Jump to content

GetRelativePosition

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: GetRelativePosition
Function Description: Calculates the relative position between two points by returning the distance and direction from the initial to the destination vector.
File Location: cmm.positionFunctions.lua
Syntax: CMM.GetRelativePosition( table InitialVec , table DestinationVec )
Return Value: table
Parameters: Name Description
InitialVecOrigin vector with x, y, and z components representing the starting position in world space.
DestinationVecDestination vector with x, y, and z components representing the target position in world space.
Example: CMM.GetRelativePosition({x=100, y=50, z=10}, {x=200, y=100, z=20})
Example Description: Returns a table with range 141.42 meters and direction 45 degrees, indicating the relative distance and orientation from the origin to the destination point.
Related Functions:
Notes: