# NavCube

class `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 view is created. For additional information on overlays please refer to the [[OverlayManager]].

  More information can be found here.

  ## Index

  Methods

  - `disable`
  - `enable`
  - `getAnchor`
  - `getEnabled`
  - `getOverlayId`
  - `getPreserveModelUp`
  - `insideOverlay`
  - `onClickSelection`
  - `onMoveSelection`
  - `setAnchor`
  - `setPreserveModelUp`

## Methods

`NavCube.``disable`()
  disable(): Promise

  Disables the NavCube.

  Returns: Promise

`NavCube.``enable`()
  enable(): Promise

  Enables the NavCube.

  Returns: Promise

`NavCube.``getAnchor`()
  getAnchor(): `OverlayAnchor`

  Gets the anchor position for the NavCube. Default position is in the UpperRightCorner, see [[OverlayAnchor]] for more details.

  Returns: `OverlayAnchor`

`NavCube.``getEnabled`()
  getEnabled(): boolean

  Gets whether the NavCube is currently enabled.

  Returns: boolean

`NavCube.``getOverlayId`()
  getOverlayId(): number

  Gets the associated overlay id.

  Returns: number

`NavCube.``getPreserveModelUp`()
  getPreserveModelUp(): boolean

  Gets the NavCube preserveModelUp state.

  Returns: boolean

  > true if model up is preserved, false if camera up is preserved.

`NavCube.``insideOverlay`()
  insideOverlay(mousePos: `Point2`): boolean

  Determines whether or not a point is inside the NavCube overlay.

  Parameters

  > mousePos: `Point2`

  Returns: boolean

  > Boolean indicating whether the provided point is inside the NavCube overlay

`NavCube.``onClickSelection`()
  onClickSelection(selection: (None | `SelectionItem`)): Promise

  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.

  Parameters

  > selection: (None | `SelectionItem`)

  Returns: Promise

`NavCube.``onMoveSelection`()
  onMoveSelection(selection: (None | `SelectionItem`)): void

  Called when the NavCube is “moused over”. Displays face/edge/corner that will be selected.

  Parameters

  > selection: (None | `SelectionItem`)

  Returns: void

`NavCube.``setAnchor`()
  setAnchor(anchor: `OverlayAnchor`): Promise

  Sets the anchor position for the NavCube.

  Parameters

  > anchor: `OverlayAnchor`

  > > the anchor position.

  Returns: Promise

`NavCube.``setPreserveModelUp`()
  setPreserveModelUp(preserve: boolean): void

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

  Parameters

  > preserve: boolean

  > > If true, model up is preserved. Otherwise, camera up is preserved.

  Returns: void

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Visualize Web or choose a sample question below to start a conversation:

What is HOOPS Visualize Web?
What are the latest release notes for HOOPS Visualize Web?
How do I start evaluating HOOPS Visualize Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...