• Public
  • Public/Protected
  • All

A module that will enable near interaction near interaction for hands and motion controllers of XR Input Sources





disableAutoAttach: boolean

Should auto-attach be disabled?

isDisposed: boolean

Is this feature disposed?

selectionMeshDefaultColor: Color3

default color of the selection ring

selectionMeshPickedColor: Color3

This color will be applied to the selection ring when selection is triggered

xrNativeFeatureName: string

The name of the native xr feature name (like anchor, hit-test, or hand-tracking)

Name: "xr-near-interaction" = "xr-near-interaction"

The module's name

Version: 1 = 1

The (Babylon) version of this module. This is an integer representing the implementation version. This number does not correspond to the WebXR specs version


  • get attached(): boolean
  • Is this feature attached

    Returns boolean


  • attach(): boolean
  • Attach this feature Will usually be called by the features manager

    Returns boolean

    true if successful.

  • detach(): boolean
  • Detach this feature. Will usually be called by the features manager

    Returns boolean

    true if successful.

  • dispose(): void
  • Dispose this feature and all of the resources attached

    Returns void

  • Will get the mesh under a specific pointer. scene.meshUnderPointer will only return one mesh - either left or right.


    • controllerId: string

      the controllerId to check

    Returns Nullable<AbstractMesh>

    The mesh under pointer or null if no mesh is under the pointer

  • Get the xr controller that correlates to the pointer id in the pointer event


    • id: number

      the pointer id to search for

    Returns Nullable<WebXRInputSource>

    the controller that correlates to this id or null if not found

  • isCompatible(): boolean
  • This function will be executed during before enabling the feature and can be used to not-allow enabling it. Note that at this point the session has NOT started, so this is purely checking if the browser supports it

    Returns boolean

    whether or not the feature is compatible in this environment

  • This function sets webXRControllerPointerSelection feature that will be disabled when the hover range is reached for a mesh and will be reattached when not in hover range. This is used to remove the selection rays when moving.


    Returns void

  • Picks a mesh with a sphere


    • mesh: AbstractMesh

      the mesh to pick

    • sphere: BoundingSphere

      picking sphere in world coordinates

    • Optional skipBoundingInfo: boolean

      a boolean indicating if we should skip the bounding info check

    Returns PickingInfo

    the picking info


  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static property
  • Static method