Interface IWebXRHandTrackingOptions
handMeshes?: {
customColors?: {
base?: Color3;
fingerColor?: Color3;
fresnel?: Color3;
tipFresnel?: Color3;
};
customMeshes?: { left: AbstractMesh; right: AbstractMesh };
customRigMappings?: {
left: XRHandMeshRigMapping;
right: XRHandMeshRigMapping;
};
disableDefaultMeshes?: boolean;
disableHandShader?: boolean;
disposeOnSessionEnd?: boolean;
meshesUseLeftHandedCoordinates?: boolean;
};
jointMeshes?: {
enablePhysics?: boolean;
invisible?: boolean;
keepOriginalVisible?: boolean;
onHandJointMeshGenerated?: (
meshInstance: InstancedMesh,
jointId: number,
hand: XRHandedness,
) => AbstractMesh | undefined;
physicsProps?: {
friction?: number;
impostorType?: number;
restitution?: number;
};
scaleFactor?: number;
sourceMesh?: Mesh;
};
xrInput: WebXRInput;
}
Properties
Optionalhand Meshes
customColors?: {
base?: Color3;
fingerColor?: Color3;
fresnel?: Color3;
tipFresnel?: Color3;
};
customMeshes?: { left: AbstractMesh; right: AbstractMesh };
customRigMappings?: {
left: XRHandMeshRigMapping;
right: XRHandMeshRigMapping;
};
disableDefaultMeshes?: boolean;
disableHandShader?: boolean;
disposeOnSessionEnd?: boolean;
meshesUseLeftHandedCoordinates?: boolean;
}
Configuration object for the hand meshes.
Type Declaration
-
OptionalcustomColors?: { base?: Color3; fingerColor?: Color3; fresnel?: Color3; tipFresnel?: Color3 }Override the colors of the hand meshes.
-
OptionalcustomMeshes?: { left: AbstractMesh; right: AbstractMesh }Rigged hand meshes that will be tracked to the user's hands. This will override the default hand mesh.
-
OptionalcustomRigMappings?: { left: XRHandMeshRigMapping; right: XRHandMeshRigMapping }If a hand mesh was provided, this array will define what axis will update which node. This will override the default hand mesh
-
OptionaldisableDefaultMeshes?: booleanShould the default hand mesh be disabled. In this case, the spheres will be visible (unless set invisible).
-
OptionaldisableHandShader?: booleanSetting this will allow the developer to avoid loading the NME material and use the standard material instead.
-
OptionaldisposeOnSessionEnd?: booleanDefine whether or not the hand meshes should be disposed on just invisible when the session ends. Not setting, or setting to false, will maintain the hand meshes in the scene after the session ends, which will allow q quicker re-entry into XR.
-
OptionalmeshesUseLeftHandedCoordinates?: booleanAre the meshes prepared for a left-handed system. Default hand meshes are right-handed.
Optionaljoint Meshes
enablePhysics?: boolean;
invisible?: boolean;
keepOriginalVisible?: boolean;
onHandJointMeshGenerated?: (
meshInstance: InstancedMesh,
jointId: number,
hand: XRHandedness,
) => AbstractMesh | undefined;
physicsProps?: {
friction?: number;
impostorType?: number;
restitution?: number;
};
scaleFactor?: number;
sourceMesh?: Mesh;
}
Configuration object for the joint meshes.
Type Declaration
-
OptionalenablePhysics?: booleanShould each instance have its own physics impostor
-
Optionalinvisible?: booleanShould the meshes created be invisible (defaults to false).
-
OptionalkeepOriginalVisible?: booleanShould the source mesh stay visible (defaults to false).
-
OptionalonHandJointMeshGenerated?: (
meshInstance: InstancedMesh,
jointId: number,
hand: XRHandedness,
) => AbstractMesh | undefinedThis function will be called after a mesh was created for a specific joint. Using this function you can either manipulate the instance or return a new mesh. When returning a new mesh the instance created before will be disposed.
-
OptionalphysicsProps?: { friction?: number; impostorType?: number; restitution?: number }If enabled, override default physics properties
-
OptionalscaleFactor?: numberScale factor for all joint meshes (defaults to 1)
-
OptionalsourceMesh?: MeshA source mesh to be used to create instances. Defaults to an icosphere with two subdivisions and smooth lighting. This mesh will be the source for all other (25) meshes. It should have the general size of a single unit, as the instances will be scaled according to the provided radius.
xr Input
The xrInput that will be used as source for new hands
Configuration interface for the hand tracking feature