openspace.navigation
Functions overview
Name |
Documentation |
---|---|
Directly adds to the global roll of the camera |
|
Directly adds to the global rotation of the camera |
|
Directly adds to the local roll of the camera |
|
Directly adds to the local rotation of the camera |
|
Directly adds to the truck movement of the camera |
|
Returns the deadzone for the desired axis of the provided joystick |
|
Finds the input joystick with the given ‘name’ and binds the axis identified by the second argument to be used as the type identified by the third argument |
|
Finds the input joystick with the given ‘name’ and binds the axis identified by the second argument to be bound to the property identified by the third argument |
|
Finds the input joystick with the given ‘name’ and binds a Lua script given by the third argument to be executed when the joystick button identified by the second argument is triggered |
|
Finds the input joystick with the given ‘name’ and removes all commands that are currently bound to the button identified by the second argument |
|
Returns the distance in meters to the current focus node |
|
Returns the distance in meters to the current focus node’s bounding sphere |
|
Returns the distance in meters to the current focus node’s interaction sphere |
|
Return the current navigation state as a Lua table |
|
Finds the input joystick with the given ‘name’ and returns the joystick axis information for the passed axis |
|
Finds the input joystick with the given ‘name’ and returns the script that is currently bound to be executed when the provided button is pressed |
|
Return the complete list of connected joysticks |
|
Load a navigation state from file |
|
Reset the camera direction to point at the aim node |
|
Reset the camera direction to point at the anchor node |
|
Save the current navigation state to a file with the path given by the first argument |
|
Finds the input joystick with the given ‘name’ and sets the deadzone for a particular joystick axis, which means that any input less than this value is completely ignored |
|
Set the navigation state |
|
Picks the next node from the interesting nodes out of the profile and selects that |
|
Picks the previous node from the interesting nodes out of the profile and selects that |
|
Immediately start applying the chosen IdleBehavior |
Functions
addGlobalRoll
Directly adds to the global roll of the camera.
v1
Number
v2
Number
Return type: void
openspace.navigation.addGlobalRoll(v1, v2)
addGlobalRotation
Directly adds to the global rotation of the camera.
v1
Number
v2
Number
Return type: void
openspace.navigation.addGlobalRotation(v1, v2)
addLocalRoll
Directly adds to the local roll of the camera.
v1
Number
v2
Number
Return type: void
openspace.navigation.addLocalRoll(v1, v2)
addLocalRotation
Directly adds to the local rotation of the camera.
v1
Number
v2
Number
Return type: void
openspace.navigation.addLocalRotation(v1, v2)
addTruckMovement
Directly adds to the truck movement of the camera.
v1
Number
v2
Number
Return type: void
openspace.navigation.addTruckMovement(v1, v2)
axisDeadzone
Returns the deadzone for the desired axis of the provided joystick.
joystickName
String
axis
Integer
Return type: Number
openspace.navigation.axisDeadzone(joystickName, axis)
bindJoystickAxis
Finds the input joystick with the given ‘name’ and binds the axis identified by the second argument to be used as the type identified by the third argument. If ‘isInverted’ is ‘true’, the axis value is inverted. ‘joystickType’ is if the joystick behaves more like a joystick or a trigger, where the first is the default. If ‘isSticky’ is ‘true’, the value is calculated relative to the previous value. If ‘shouldFlip’ is true, then the camera movement for the axis is reversed. If ‘sensitivity’ is given then that value will affect the sensitivity of the axis together with the global sensitivity.
joystickName
String
the name for the joystick or game controller that should be bound
axis
Integer
the axis of the joystick that should be bound
axisType
String
the type of movement that the axis should be mapped to
shouldInvert
Boolean?
- Default value:false
if the joystick movement should be inverted or not
joystickType
String?
- Default value:"JoystickLike"
what type of joystick or axis this is. Either
”JoystickLike”
or”TriggerLike”
.
isSticky
Boolean?
- Default value:false
if true, the value is calculated relative to the previous value, if false the the value is used as is.
shouldFlip
Boolean?
- Default value:false
reverses the movement of the camera that the joystick produces
sensitivity
Number?
- Default value:0.0
sensitivity for this axis
Return type: void
openspace.navigation.bindJoystickAxis(joystickName, axis, axisType, shouldInvert, joystickType, isSticky, shouldFlip, sensitivity)
bindJoystickAxisProperty
Finds the input joystick with the given ‘name’ and binds the axis identified by the second argument to be bound to the property identified by the third argument. ‘min’ and ‘max’ is the minimum and the maximum allowed value for the given property and the axis value is rescaled from [-1, 1] to [min, max], default is [0, 1]. If ‘isInverted’ is ‘true’, the axis value is inverted. The last argument determines whether the property change is going to be executed locally or remotely, where the latter is the default.
joystickName
String
the name for the joystick or game controller that should be bound
axis
Integer
the axis of the joystick that should be bound
propertyUri
String
the property that this joystick axis should modify
min
Number?
- Default value:0.f
the minimum value that this axis can set for the property
max
Number?
- Default value:1.f
the maximum value that this axis can set for the property
shouldInvert
Boolean?
- Default value:false
if the joystick movement should be inverted or not
isRemote
Boolean?
- Default value:true
if true, the property change will also be executed on connected nodes if false, the property change will only affect the master node
Return type: void
openspace.navigation.bindJoystickAxisProperty(joystickName, axis, propertyUri, min, max, shouldInvert, isRemote)
bindJoystickButton
Finds the input joystick with the given ‘name’ and binds a Lua script given by the third argument to be executed when the joystick button identified by the second argument is triggered. The fifth argument determines when the script should be executed, this defaults to ‘Press’, which means that the script is run when the user presses the button. The fourth arguemnt is the documentation of the script in the third argument. The sixth argument determines whether the command is going to be executable locally or remotely, where the latter is the default.
joystickName
String
button
Integer
command
String
documentation
String
action
String?
- Default value:"Press"
isRemote
Boolean?
- Default value:true
Return type: void
openspace.navigation.bindJoystickButton(joystickName, button, command, documentation, action, isRemote)
clearJoystickButton
Finds the input joystick with the given ‘name’ and removes all commands that are currently bound to the button identified by the second argument.
joystickName
String
button
Integer
Return type: void
openspace.navigation.clearJoystickButton(joystickName, button)
distanceToFocus
Returns the distance in meters to the current focus node
Return type: Number
openspace.navigation.distanceToFocus()
distanceToFocusBoundingSphere
Returns the distance in meters to the current focus node’s bounding sphere
Return type: Number
openspace.navigation.distanceToFocusBoundingSphere()
distanceToFocusInteractionSphere
Returns the distance in meters to the current focus node’s interaction sphere
Return type: Number
openspace.navigation.distanceToFocusInteractionSphere()
getNavigationState
Return the current navigation state as a Lua table. The optional argument is the scene graph node to use as reference frame. By default, the reference frame will picked based on whether the orbital navigator is currently following the anchor node rotation. If it is, the anchor will be chosen as reference frame. If not, the reference frame will be set to the scene graph root.
frame
String?
Return type: Table
openspace.navigation.getNavigationState(frame)
joystickAxis
Finds the input joystick with the given ‘name’ and returns the joystick axis information for the passed axis. The information that is returned is the current axis binding as a string, whether the values are inverted as bool, the joystick type as a string, whether the axis is sticky as bool, the sensitivity as number, the property uri bound to the axis as string (empty is type is not Property), the min and max values for the property as numbers and whether the property change will be executed remotly as bool.
joystickName
String
axis
Integer
Return type: (String, Boolean, String, Boolean, Boolean, Number, String, Number, Number, Boolean)
openspace.navigation.joystickAxis(joystickName, axis)
joystickButton
Finds the input joystick with the given ‘name’ and returns the script that is currently bound to be executed when the provided button is pressed.
joystickName
String
button
Integer
Return type: String
openspace.navigation.joystickButton(joystickName, button)
listAllJoysticks
Return the complete list of connected joysticks
Return type: String[]
openspace.navigation.listAllJoysticks()
loadNavigationState
Load a navigation state from file. The file should be a lua file returning the navigation state as a table formatted as a Navigation State, such as the output files of saveNavigationState. If usetimeStamp is set to true and the provided navigation state has a timestamp, time will be set as well.
cameraStateFilePath
String
useTimeStamp
Boolean?
- Default value:false
Return type: void
openspace.navigation.loadNavigationState(cameraStateFilePath, useTimeStamp)
retargetAim
Reset the camera direction to point at the aim node.
Return type: void
openspace.navigation.retargetAim()
retargetAnchor
Reset the camera direction to point at the anchor node.
Return type: void
openspace.navigation.retargetAnchor()
saveNavigationState
Save the current navigation state to a file with the path given by the first argument. The optional second argument is the scene graph node to use as reference frame. By default, the reference frame will picked based on whether the orbital navigator is currently following the anchor node rotation. If it is, the anchor will be chosen as reference frame. If not, the reference frame will be set to the scene graph root.
path
String
frame
String?
- Default value:""
Return type: void
openspace.navigation.saveNavigationState(path, frame)
setAxisDeadZone
Finds the input joystick with the given ‘name’ and sets the deadzone for a particular joystick axis, which means that any input less than this value is completely ignored.
joystickName
String
axis
Integer
deadzone
Number
Return type: void
openspace.navigation.setAxisDeadZone(joystickName, axis, deadzone)
setNavigationState
Set the navigation state. The first argument must be a valid Navigation State. If useTimeStamp is set to true and the provided navigation state has a timestamp, time will be set as well.
navigationState
Table
useTimeStamp
Boolean?
- Default value:false
Return type: void
openspace.navigation.setNavigationState(navigationState, useTimeStamp)
targetNextInterestingAnchor
Picks the next node from the interesting nodes out of the profile and selects that. If the current anchor is not an interesting node, the first will be selected
Return type: void
openspace.navigation.targetNextInterestingAnchor()
targetPreviousInterestingAnchor
Picks the previous node from the interesting nodes out of the profile and selects that. If the current anchor is not an interesting node, the first will be selected
Return type: void
openspace.navigation.targetPreviousInterestingAnchor()
triggerIdleBehavior
Immediately start applying the chosen IdleBehavior. If none is specified, use the one set to default in the OrbitalNavigator.
choice
String?
- Default value:""
Return type: void
openspace.navigation.triggerIdleBehavior(choice)