Editor: Object Transforms
Description
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 Actor
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 Editor: Universe Actor.
Transforms
When spawning a universe actor (all physical components, spacecraft and ground objects are universe actors), the Spawn Transform
pin is an Unreal default pin. These coordinates are in Unreal’s coordinates and are not representative of the simulation position. The location and rotation parameters are incorrect. Except adding a component as a child to another actor, these should be kept as zero. Instead, the transform functions should be called.
Note
The Spawn Transform Scale
part of the spawning of an actor is correct and valid. As this is only a visualization feature, this can be modified without the worry that it will affect the back end of the simulation.
To set the position and rotation, use the Set Universe Position
and Set Universe Rotation
functions respectively. Each of these functions comes with a Local
and World
variant. The local variants will set the transform relative to the parent object (or if there is no parent, relative to the origin). The world variants will set the transform relative to the origin of the simulation.
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 Editor: The Solar System guide.
The position is defined in meters, using the right-handed coordinate system. The rotation in this function is defined in degrees, using a Euler rotation. Alternatively, for more accurate rotations, the Set Universe DCM
functions can be called, which take in a 3x3 matrix for the rotation. The DCM is a rotation matrix relative to the origin frame.
There are several rotation systems available in Nominal Editor. These systems can be converted between each other, including Euler angles, Modified Rodriguez Parameters (MRPs) and quaternions. More information can be found in 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 Universe Position
and Get Universe 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.