Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebXRControllerPointerSelection

A module that will enable pointer selection for motion controllers of XR Input Sources

Hierarchy

Implements

Index

Constructors

constructor

Properties

disableAutoAttachSearch playground for disableAutoAttach

disableAutoAttach: boolean

Should auto-attach be disabled?

disablePointerLightingSearch playground for disablePointerLighting

disablePointerLighting: boolean

Disable lighting on the laser pointer (so it will always be visible)

disableSelectionMeshLightingSearch playground for disableSelectionMeshLighting

disableSelectionMeshLighting: boolean

Disable lighting on the selection mesh (so it will always be visible)

displayLaserPointerSearch playground for displayLaserPointer

displayLaserPointer: boolean

Should the laser pointer be displayed

displaySelectionMeshSearch playground for displaySelectionMesh

displaySelectionMesh: boolean

Should the selection mesh be displayed (The ring at the end of the laser pointer)

isDisposedSearch playground for isDisposed

isDisposed: boolean

Is this feature disposed?

laserPointerDefaultColorSearch playground for laserPointerDefaultColor

laserPointerDefaultColor: Color3

Default color of the laser pointer

laserPointerPickedColorSearch playground for laserPointerPickedColor

laserPointerPickedColor: Color3

This color will be set to the laser pointer when selection is triggered

raySelectionPredicateSearch playground for raySelectionPredicate

raySelectionPredicate: (mesh: AbstractMesh) => boolean

Optional filter to be used for ray selection. This predicate shares behavior with scene.pointerMovePredicate which takes priority if it is also assigned.

Type declaration

selectionMeshDefaultColorSearch playground for selectionMeshDefaultColor

selectionMeshDefaultColor: Color3

default color of the selection ring

selectionMeshPickedColorSearch playground for selectionMeshPickedColor

selectionMeshPickedColor: Color3

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

xrNativeFeatureNameSearch playground for xrNativeFeatureName

xrNativeFeatureName: string

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

Static Readonly NameSearch playground for Name

Name: "xr-controller-pointer-selection" = "xr-controller-pointer-selection"

The module's name

Static Readonly VersionSearch playground for Version

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

Accessors

attached

  • get attached(): boolean

Methods

attachSearch playground for attach

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

    Returns boolean

    true if successful.

detachSearch playground for detach

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

    Returns boolean

    true if successful.

disposeSearch playground for dispose

  • dispose(): void

getMeshUnderPointerSearch playground for getMeshUnderPointer

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

    Parameters

    • controllerId: string

      the controllerId to check

    Returns Nullable<AbstractMesh>

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

getXRControllerByPointerIdSearch playground for getXRControllerByPointerId

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

    Parameters

    • id: number

      the pointer id to search for

    Returns Nullable<WebXRInputSource>

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

isCompatibleSearch playground for isCompatible

  • 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

Legend

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