The simulation coordinates use the Right-handed coordinate system, which can be represented using three axes. The X, Y and Z axes correspond to the right, forward and up axes respectively. However, this is not the same as the Unreal system. The Unreal coordinates have the X and Y axis flipped. This causes inconsistencies between the real simulation coordinates (for rotations and locations) and visualizations done in the Unreal Engine.
To fix this, the Universe Object
system has been created to have representations of the simulation coordinates in Unreal. It handles the conversions between rotations and locations correctly and ensures that the values are accurate. More information on how these actors work can be found in Universe Object.
Transforms
When creating a universe object (all physical components, spacecraft and ground objects are universe objects), the coordinates are in the simulation coordinates, and not Unreal’s coordinate system. By default, any universe object will have an Owner, Local Position, and Local Rotation. The owner is the object to attach the new object to. If there is no owner, it will just exist in the simulation as a root object. The position and rotations are relative to the owner (or the inertial frame if no owner is specified).
WARNING
Using Unreal’s default
Spawn Actor from Class
node will result in incorrect coordinates being used, as Unreal’s coordinate system is left-handed and is not compatible with the simulation axes.
To set the position and rotation, use the Set Position
and Set Rotation
functions. Each will have a Local
and World
variation, which defines whether the transform is relative to the parent or relative to the inertial origin. In the case of root objects, these will be the same regardless of which function is used. To configure the DCM for the rotation, use a conversion function, such as an Euler one.
NOTE
The origin of the simulation is defined by the zero-base of the simulation. This is typically the centre of Earth unless it is not changed. It can be changed as per the OG - Editor: The Solar System guide.
There are several rotation systems available in Zendir Editor. These systems can be converted between each other, including Euler angles, Modified Rodriguez Parameters (MRPs) and quaternions. More information can be found in OG - Editor: Kinematic Rotation Conversions.
Similar to the setting of the transforms, the positions and rotations relative to the parent and the origin can be fetched from the objects. These are done with the Get Position
and Get Rotation
functions. Alternatively, the transform itself can be fetched and this can be broken into each component.
WARNING
When fetching or setting positions or rotations of Universe actors in Unreal, never use the
Get Actor Location
functions unless dealing with the observer or visualization artefacts. These will provide incorrect simulation coordinates as the systems are incorrect.