Class WebXRNearInteraction
Hierarchy (View Summary)
- WebXRAbstractFeature
- WebXRNearInteraction
Constructors
constructor
-
new WebXRNearInteraction(
_xrSessionManager: WebXRSessionManager,
_options: IWebXRNearInteractionOptions,
): WebXRNearInteractionconstructs a new background remover module
Parameters
- _xrSessionManager: WebXRSessionManager
the session manager for this module
- _options: IWebXRNearInteractionOptions
read-only options to be used in this module
Returns WebXRNearInteraction
- _xrSessionManager: WebXRSessionManager
Properties
always Hide Selection Mesh
If set to true, the selection mesh will always be hidden. Otherwise it will be shown only when needed
Optionaldepends On
The dependencies of this feature, if any
disable Auto Attach
Should auto-attach be disabled?
is Disposed
Is this feature disposed?
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
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
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 Far Interaction Feature
-
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.
Parameters
- farInteractionFeature: Nullable<WebXRControllerPointerSelection>
the feature to disable when finger is in hover range for a mesh
Returns void
- farInteractionFeature: Nullable<WebXRControllerPointerSelection>
A module that will enable near interaction near interaction for hands and motion controllers of XR Input Sources