Class WebXRControllerPointerSelection
Hierarchy (View Summary)
- WebXRAbstractFeature
- WebXRControllerPointerSelection
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new WebXRControllerPointerSelection(
_xrSessionManager: WebXRSessionManager,
_options: IWebXRControllerPointerSelectionOptions,
): WebXRControllerPointerSelectionconstructs a new background remover module
Parameters
- _xrSessionManager: WebXRSessionManager
the session manager for this module
- _options: IWebXRControllerPointerSelectionOptions
read-only options to be used in this module
Returns WebXRControllerPointerSelection
- _xrSessionManager: WebXRSessionManager
Properties
Optionaldepends On
The dependencies of this feature, if any
disable Auto Attach
Should auto-attach be disabled?
disable Pointer Lighting
Disable lighting on the laser pointer (so it will always be visible)
disable Selection Mesh Lighting
Disable lighting on the selection mesh (so it will always be visible)
display Laser Pointer
Should the laser pointer be displayed
display Selection Mesh
Should the selection mesh be displayed (The ring at the end of the laser pointer)
is Disposed
Is this feature disposed?
laser Pointer Default Color
Default color of the laser pointer
laser Pointer Picked Color
This color will be set to the laser pointer when selection is triggered
on Feature Attach Observable
Observers registered here will be executed when the feature is attached
on Feature Detach Observable
Observers registered here will be executed when the feature is detached
ray Selection Predicate
Optional filter to be used for ray selection. This predicate shares behavior with scene.pointerMovePredicate which takes priority if it is also assigned.
selection Mesh Default Color
default color of the selection ring
selection Mesh Picked Color
This color will be applied to the selection ring when selection is triggered
Static ReadonlyName
The module's name
Static ReadonlyVersion
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
Is this feature attached
Returns boolean
attached Controller Id
-
get attachedControllerId(): string
Get the unique id of the currently attached (active) controller for pointer selection. When
enablePointerSelectionOnAllControllersis true, this value is not meaningful because all controllers are active simultaneously.Returns string
the unique id of the attached controller, or an empty string if none is attached
xr Native Feature Name
-
get xrNativeFeatureName(): string
The name of the native xr feature name (like anchor, hit-test, or hand-tracking)
Returns string
-
set xrNativeFeatureName(name: string): void
The name of the native xr feature name, if applicable (like anchor, hit-test, or hand-tracking)
Parameters
- name: string
Returns void
Methods
attach
-
attach this feature Will usually be called by the features manager
Returns boolean
true if successful.
detach
-
detach this feature. Will usually be called by the features manager
Returns boolean
true if successful.
dispose
-
Dispose this feature and all of the resources attached
Returns void
get Mesh Under Pointer
-
Will get the mesh under a specific pointer.
scene.meshUnderPointerwill 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
- controllerId: string
get XR Controller By Pointer Id
-
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
- id: number
is Compatible
-
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
set Attached Controller
-
Set the active controller for pointer selection during an XR session. Accepts either an
XRHandednessvalue ("left","right","none") to select the first matching controller, or a controller unique id string for precise control.When a matching controller is found, any in-progress pointer-down state on the previously active controller is properly resolved (pointer-up is simulated).
This also updates the
preferredHandednessoption so that if controllers are re-initialized (e.g. on disconnect/reconnect), the new preference persists.This method is a no-op when
enablePointerSelectionOnAllControllersis true, since all controllers are active simultaneously in that mode.Parameters
- controllerId: any
the XRHandedness (
"left","right","none") or the unique id of the controller to attach
Returns boolean
true if the active controller was changed, false otherwise
- controllerId: any
A module that will enable pointer selection for motion controllers of XR Input Sources