NavigationState
A NavigationState is an object describing an exact camera position and rotation, in a certain reference frame (per default, the one of the specified Anchor node). It can be used to set the same camera position at a later point in time, or navigating to a specific camera position using the pathnavigation system.
The camera rotation is specified using Euler angles, in radians. It is also possible to specify a node to be used as Aim, but note that this will not affect the actual camera position or view direction.
To get the current navigation state of the camera, use the openspace.navigation.getNavigationState()
function in the Scripting API.
Note that when loading a NavigationState, the visuals may be different depending on what the simulation timestamp is, as the relative positions of objects in the scene may have changed. The get the exact same visuals as when the NavigationState was saved you need to also set the simulation time to correpsond to the timestamp.
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The identifier of the anchor node |
|
Value of type ‘String’ |
No |
|
The position of the camera relative to the anchor node, expressed in meters in the specified reference frame |
|
Value of type ‘Vector3 |
No |
|
The identifier of the aim node, if used |
|
Value of type ‘String’ |
Yes |
|
The pitch angle in radians. Positive angle means pitching camera upwards |
|
Value of type ‘Double’ |
Yes |
|
The identifier of the scene graph node to use as reference frame. If not specified, this will be the same as the anchor |
|
Value of type ‘String’ |
Yes |
|
The timestamp for when the navigation state was captured or is valid. Specified either as seconds past the J2000 epoch, or as a date string in ISO 8601 format: ‘YYYY MM DD HH:mm:ss.xxx’ |
|
Value of type ‘Double’, or Value of type ‘String’ |
Yes |
|
The up vector expressed in the coordinate system of the reference frame |
|
Value of type ‘Vector3 |
Yes |
|
The yaw angle in radians. Positive angle means yawing camera to the right |
|
Value of type ‘Double’ |
Yes |