Capítulo 582 de 859

Chapter 582: OculusHandModel

Core Idea

Represents an Oculus hand model.

Key Concepts

  • controller : Group: The hand controller.
  • envMap : Texture: The model's environment map.
  • loader : Loader: A loader that is used to load hand models.
  • mesh : Mesh: The model mesh.
  • motionController : MotionController: The motion controller.
  • onLoad : function: A callback that is executed when a hand model has been loaded.
  • path : string: The path to the model repository.

Code Examples

import { OculusHandModel } from 'three/addons/webxr/OculusHandModel.js';
  • What it demonstrates: Typical usage of OculusHandModel.

Reference Tables

Constructor

Signature
new OculusHandModel( controller : Group, loader : Loader, onLoad : function )

Properties

PropertyDescription
.controller : GroupThe hand controller.
.envMap : TextureThe model's environment map.
.loader : LoaderA loader that is used to load hand models.
.mesh : MeshThe model mesh.
.motionController : MotionControllerThe motion controller.
.onLoad : functionA callback that is executed when a hand model has been loaded.
.path : stringThe path to the model repository.

Methods

MethodDescription
.checkButton( button : Object )Executed actions depending on the interaction state with the given button.
.getPointerPosition() : Vector3Returns the pointer position which is the position of the index finger tip.
.intersectBoxObject( boxObject : Mesh ) : booleanReturns true if the current pointer position (the index finger tip) intersections with the given box object.
.updateMatrixWorld( force : boolean )Overwritten with a custom implementation. Makes sure the motion controller updates the mesh.

Key Takeaways

  1. OculusHandModel extends: EventDispatcher → Object3D
  2. Most relevant properties: controller, envMap, loader, mesh.
  3. Key methods: checkButton, getPointerPosition, intersectBoxObject, updateMatrixWorld.

Connects To