NavCube
- class Communicator.NavCube()
This class provides an interface to the navigational cube which is enabled by default. The default functionality changes the camera’s view orientation based on the location the user clicks on the cube. This cube is initialized and associated with an overlay when the viewer is created. For additional information on overlays please refer to the
Communicator.OverlayManager
More information can be found here.
Methods
Methods
disable
- NavCube.disable()
Disables the NavCube.
- Return type
enable
- NavCube.enable()
Enables the NavCube.
- Return type
getAnchor
- NavCube.getAnchor()
Gets the anchor position for the NavCube. Default position is in the UpperRightCorner, see
Communicator.OverlayAnchor
for more details.- Return type
getEnabled
- NavCube.getEnabled()
Gets whether the NavCube is currently enabled.
- Return type
boolean
getOverlayId
- NavCube.getOverlayId()
Gets the associated overlay id.
- Return type
getPreserveModelUp
- NavCube.getPreserveModelUp()
Gets the NavCube preserveModelUp state.
- Return type
boolean
- Returns
true if model up is preserved, false if camera up is preserved.
insideOverlay
onClickSelection
- NavCube.onClickSelection(selection)
Called when the NavCube is clicked. Realigns the view to the side/edge/corner selected by
selection
, or rotates the view 90 degrees if the selection matches the current view orientation, or does nothing if no side is selected.- Arguments
selection (
SelectionItem()
| null) –
- Return type
Promise <void>
onMoveSelection
- NavCube.onMoveSelection(selection)
Called when the NavCube is “moused over”. Displays face/edge/corner that will be selected.
- Arguments
selection (
SelectionItem()
| null) –
- Return type
void
setAnchor
- NavCube.setAnchor(anchor)
Sets the anchor position for the NavCube.
- Arguments
anchor (OverlayAnchor) – the anchor position.
- Return type
Promise <void>
setPreserveModelUp
- NavCube.setPreserveModelUp(preserve)
Determines if model up or camera up will the preserved when navigating with the NavCube. If model up is preserved, navigation with the NavCube will keep the model upright all the time. If camera up is preserved, navigation with the NavCube will attempt to preserve the current up direction of the camera as much as possible. Defaults to
true
.- Arguments
preserve (
boolean()
) – If true, model up is preserved. Otherwise, camera up is preserved.
- Return type
void