XRControllerModelFactory class

Allows to create controller models for WebXR controllers that can be added as a visual representation to your scene. XRControllerModelFactory will automatically fetch controller models that match what the user is holding as closely as possible. The models should be attached to the object returned from getControllerGrip in order to match the orientation of the held device.

This module depends on the motion-controllers{@link https://github.com/immersive-web/webxr-input-profiles/blob/main/packages/motion-controllers/README.md} third-part library.

const controllerModelFactory = new XRControllerModelFactory();

const controllerGrip = renderer.xr.getControllerGrip( 0 );
controllerGrip.add( controllerModelFactory.createControllerModel( controllerGrip ) );
scene.add( controllerGrip );

@three_import import { XRControllerModelFactory } from 'three/addons/webxr/XRControllerModelFactory.js';

Constructors

XRControllerModelFactory.new([GLTFLoader? gltfLoader, Function? onLoad])
Constructs a new XR controller model factory.

Properties

gltfLoader ↔ GLTFLoader?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
onLoad Function?
getter/setter pair
path String
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createControllerModel(WebXRController controller) XRControllerModel
Creates a controller model for the given WebXR controller.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setPath(dynamic path) XRControllerModelFactory
Sets the path to the model repository.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited