Entity position and rotation

Position
Position is encoded as a table with  entries. Such a table can be created with the  function. The X and Z axes point along the map plane and the Y axis is the up direction.


 * Use  to get the position of an entity. The returned object has   fields.
 * Use  to set the position of an entity. The entity will not snap to the position immediately but will interpolate to it smoothly during the frame.

Example

 * -|Lua=


 * -|TypeScript=

Rotation
Rotation is encoded as a heading vector (ie. the forward direction vector). The vector uses the same type as positions and can also be created with.


 * Use  to get the heading of an entity. The returned object has   fields.
 * Use  to set the heading of an entity. The entity will rotate immediately or interpolate smoothly depending on whether bInterpolate is   or.

Example

 * -|Lua=


 * -|TypeScript=

Misc

 * Functions for manipulating position and heading also exist for other types of objects (eg.  for Squad)
 * As rotation is encoded as a heading vector we can not have roll angle (ie. a rotation around the forward direction)