RelativePositionVec2
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | RelativePositionVec2 | |
| Function Description: | Computes a new position vector by offsetting a given vector by a specified distance and bearing in degrees. | |
| File Location: | cmm.positionFunctions.lua | |
| Syntax: | CMM.RelativePositionVec2( table vec2 , number bearing , number distance ) | |
| Return Value: | table | |
| Parameters: | Name | Description |
| vec2 | A vec3 table containing x, y, and z components representing the base position to offset. | |
| bearing | Direction in degrees from north, used to determine the angle of offset (0° is north, 90° is east, etc.). | |
| distance | Distance in meters to move from the base position along the specified bearing. | |
| Example: | CMM.RelativePositionVec2({x=100, y=50, z=10}, 45, 100) | |
| Example Description: | Returns a new position at 141.42 meters in a 45-degree bearing from the origin, with coordinates adjusted accordingly. | |
| Related Functions: | ||
| Notes: | ||