Class WebXRInputSource
Constructors
constructor
-
new WebXRInputSource(
_scene: Scene,
inputSource: XRInputSource,
_options?: IWebXRControllerOptions,
): WebXRInputSourceCreates the input source object
Parameters
- _scene: Scene
the scene which the controller should be associated to
- inputSource: XRInputSource
the underlying input source for the controller
- _options: IWebXRControllerOptions = {}
options for this controller creation
Returns WebXRInputSource
- _scene: Scene
Properties
Optionalgrip
Represents the part of the controller that is held. This may not exist if the controller is the head mounted display itself, if that's the case only the pointer from the head will be available
input Source
The underlying input source for the controller
Optionalmotion Controller
If available, this is the gamepad object related to this controller. Using this object it is possible to get click events and trackpad changes of the webxr controller that is currently being used.
on Dispose Observable
Event that fires when the controller is removed/disposed. The object provided as event data is this controller, after associated assets were disposed. uniqueId is still available.
on Mesh Loaded Observable
Will be triggered when the mesh associated with the motion controller is done loading. It is also possible that this will never trigger (!) if no mesh was loaded, or if the developer decides to load a different mesh A shortened version of controller -> motion controller -> on mesh loaded.
on Motion Controller Init Observable
Observers registered here will trigger when a motion controller profile was assigned to this xr controller
pointer
Pointer which can be used to select objects or attach a visible laser to
Methods
dispose
-
Disposes of the object
Returns void
get World Pointer Ray To Ref
-
Gets a world space ray coming from the pointer or grip
Parameters
- result: Ray
the resulting ray
- gripIfAvailable: boolean = false
use the grip mesh instead of the pointer, if available
Returns void
- result: Ray
update From XR Frame
-
updateFromXRFrame(
xrFrame: XRFrame,
referenceSpace: XRReferenceSpace,
xrCamera: WebXRCamera,
xrSessionManager: WebXRSessionManager,
): voidUpdates the controller pose based on the given XRFrame
Parameters
- xrFrame: XRFrame
xr frame to update the pose with
- referenceSpace: XRReferenceSpace
reference space to use
- xrCamera: WebXRCamera
the xr camera, used for parenting
- xrSessionManager: WebXRSessionManager
the session manager used to get the world reference system
Returns void
- xrFrame: XRFrame
Represents an XR controller