Class WebXRHand
Implements
Constructors
constructor
-
new WebXRHand(
xrController: WebXRInputSource,
_jointMeshes: AbstractMesh[],
_handMesh: Nullable<AbstractMesh>,
rigMapping: Nullable<XRHandMeshRigMapping>,
_leftHandedMeshes?: boolean,
_jointsInvisible?: boolean,
_jointScaleFactor?: number,
): WebXRHandConstruct a new hand object
Parameters
- xrController: WebXRInputSource
The controller to which the hand correlates.
- _jointMeshes: AbstractMesh[]
The meshes to be used to track the hand joints.
- _handMesh: Nullable<AbstractMesh>
An optional hand mesh.
- rigMapping: Nullable<XRHandMeshRigMapping>
An optional rig mapping for the hand mesh. If not provided (but a hand mesh is provided), it will be assumed that the hand mesh's bones are named directly after the WebXR bone names.
- _leftHandedMeshes: boolean = false
Are the hand meshes left-handed-system meshes
- _jointsInvisible: boolean = false
Are the tracked joint meshes visible
- _jointScaleFactor: number = 1
Scale factor for all joint meshes
Returns WebXRHand
- xrController: WebXRInputSource
Properties
on Hand Mesh Set Observable
This observable will notify registered observers when the hand object has been set with a new mesh.
you can get the hand mesh using webxrHand.handMesh
Readonlyrig Mapping
An optional rig mapping for the hand mesh. If not provided (but a hand mesh is provided), it will be assumed that the hand mesh's bones are named directly after the WebXR bone names.
Readonlyxr Controller
The controller to which the hand correlates.
Accessors
hand Mesh
-
Get the hand mesh.
Returns Nullable<AbstractMesh>
Methods
dispose
-
Dispose this Hand object
Parameters
- disposeMeshes: boolean = false
Should the meshes be disposed as well
Returns void
- disposeMeshes: boolean = false
get Hand Part Meshes
-
Get meshes of part of the hand.
Parameters
- part: HandPart
The part of hand to get.
Returns AbstractMesh[]
An array of meshes that correlate to the hand part requested.
- part: HandPart
get Joint Mesh
-
Retrieves a mesh linked to a named joint in the hand.
Parameters
- jointName: WebXRHandJoint
The name of the joint.
Returns AbstractMesh
An AbstractMesh whose position corresponds with the joint position.
- jointName: WebXRHandJoint
set Hand Mesh
-
setHandMesh(
handMesh: AbstractMesh,
rigMapping: Nullable<XRHandMeshRigMapping>,
_xrSessionManager?: WebXRSessionManager,
): voidSets the current hand mesh to render for the WebXRHand.
Parameters
- handMesh: AbstractMesh
The rigged hand mesh that will be tracked to the user's hand.
- rigMapping: Nullable<XRHandMeshRigMapping>
The mapping from XRHandJoint to bone names to use with the mesh.
Optional_xrSessionManager: WebXRSessionManagerThe XRSessionManager used to initialize the hand mesh.
Returns void
- handMesh: AbstractMesh
update From XR Frame
-
updateFromXRFrame(
xrFrame: XRFrame,
referenceSpace: XRReferenceSpace,
xrCamera: WebXRCamera,
): voidUpdate this hand from the latest xr frame.
Parameters
- xrFrame: XRFrame
The latest frame received from WebXR.
- referenceSpace: XRReferenceSpace
The current viewer reference space.
- xrCamera: WebXRCamera
the xr camera, used for parenting
Returns void
- xrFrame: XRFrame
Representing a single hand (with its corresponding native XRHand object)