openspace.navigation

Functions overview

Name

Documentation

addGlobalRoll

Directly adds to the global roll of the camera

addGlobalRotation

Directly adds to the global rotation of the camera

addLocalRoll

Directly adds to the local roll of the camera

addLocalRotation

Directly adds to the local rotation of the camera

addTruckMovement

Directly adds to the truck movement of the camera

axisDeadzone

Returns the deadzone for the desired axis of the provided joystick

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

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

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

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

distanceToFocus

Returns the distance in meters to the current focus node

distanceToFocusBoundingSphere

Returns the distance in meters to the current focus node’s bounding sphere

distanceToFocusInteractionSphere

Returns the distance in meters to the current focus node’s interaction sphere

getNavigationState

Return the current navigation state as a Lua table

joystickAxis

Finds the input joystick with the given ‘name’ and returns the joystick axis information for the passed 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

listAllJoysticks

Return the complete list of connected joysticks

loadNavigationState

Load a navigation state from file

retargetAim

Reset the camera direction to point at the aim node

retargetAnchor

Reset the camera direction to point at the anchor node

saveNavigationState

Save the current navigation state to a file with the path given by the first argument

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

setNavigationState

Set the navigation state

targetNextInterestingAnchor

Picks the next node from the interesting nodes out of the profile and selects that

targetPreviousInterestingAnchor

Picks the previous node from the interesting nodes out of the profile and selects that

triggerIdleBehavior

Immediately start applying the chosen IdleBehavior

Functions

addGlobalRoll

Directly adds to the global roll of the camera.

Parameters
  • v1 Number

  • v2 Number

Return type: void

Signature
openspace.navigation.addGlobalRoll(v1, v2)

addGlobalRotation

Directly adds to the global rotation of the camera.

Parameters
  • v1 Number

  • v2 Number

Return type: void

Signature
openspace.navigation.addGlobalRotation(v1, v2)

addLocalRoll

Directly adds to the local roll of the camera.

Parameters
  • v1 Number

  • v2 Number

Return type: void

Signature
openspace.navigation.addLocalRoll(v1, v2)

addLocalRotation

Directly adds to the local rotation of the camera.

Parameters
  • v1 Number

  • v2 Number

Return type: void

Signature
openspace.navigation.addLocalRotation(v1, v2)

addTruckMovement

Directly adds to the truck movement of the camera.

Parameters
  • v1 Number

  • v2 Number

Return type: void

Signature
openspace.navigation.addTruckMovement(v1, v2)

axisDeadzone

Returns the deadzone for the desired axis of the provided joystick.

Parameters
  • joystickName String

  • axis Integer

Return type: Number

Signature
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.

Parameters
  • 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

Signature
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.

Parameters
  • 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

Signature
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.

Parameters
  • joystickName String

  • button Integer

  • command String

  • documentation String

  • action String? - Default value: "Press"

  • isRemote Boolean? - Default value: true

Return type: void

Signature
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.

Parameters
  • joystickName String

  • button Integer

Return type: void

Signature
openspace.navigation.clearJoystickButton(joystickName, button)

distanceToFocus

Returns the distance in meters to the current focus node

Return type: Number

Signature
openspace.navigation.distanceToFocus()

distanceToFocusBoundingSphere

Returns the distance in meters to the current focus node’s bounding sphere

Return type: Number

Signature
openspace.navigation.distanceToFocusBoundingSphere()

distanceToFocusInteractionSphere

Returns the distance in meters to the current focus node’s interaction sphere

Return type: Number

Signature
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.

Parameters
  • frame String?

Return type: Table

Signature
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.

Parameters
  • joystickName String

  • axis Integer

Return type: (String, Boolean, String, Boolean, Boolean, Number, String, Number, Number, Boolean)

Signature
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.

Parameters
  • joystickName String

  • button Integer

Return type: String

Signature
openspace.navigation.joystickButton(joystickName, button)

listAllJoysticks

Return the complete list of connected joysticks

Return type: String[]

Signature
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.

Parameters
  • cameraStateFilePath String

  • useTimeStamp Boolean? - Default value: false

Return type: void

Signature
openspace.navigation.loadNavigationState(cameraStateFilePath, useTimeStamp)

retargetAim

Reset the camera direction to point at the aim node.

Return type: void

Signature
openspace.navigation.retargetAim()

retargetAnchor

Reset the camera direction to point at the anchor node.

Return type: void

Signature
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.

Parameters
  • path String

  • frame String? - Default value: ""

Return type: void

Signature
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.

Parameters
  • joystickName String

  • axis Integer

  • deadzone Number

Return type: void

Signature
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.

Parameters
  • navigationState Table

  • useTimeStamp Boolean? - Default value: false

Return type: void

Signature
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

Signature
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

Signature
openspace.navigation.targetPreviousInterestingAnchor()

triggerIdleBehavior

Immediately start applying the chosen IdleBehavior. If none is specified, use the one set to default in the OrbitalNavigator.

Parameters
  • choice String? - Default value: ""

Return type: void

Signature
openspace.navigation.triggerIdleBehavior(choice)