XRHandPrimitiveModel constructor

XRHandPrimitiveModel(
  1. XRHandModel handModel,
  2. WebXRController controller,
  3. String? path,
  4. String? handedness,
  5. Map<String, dynamic> options,
)

Constructs a new XR hand primitive model.

@param {XRHandModel} handModel - The hand model. @param {Group} controller - The WebXR controller. @param {string} path - The model path. @param {XRHandedness} handedness - The handedness of the XR input source. @param {XRHandPrimitiveModel~Options} options - The model options.

Implementation

XRHandPrimitiveModel(this.handModel, this.controller, this.path, this.handedness, this.options ):super(){
	BufferGeometry? geometry;

	if (options['primitive'] == null || options['primitive'] == 'sphere' ) {
		geometry = SphereGeometry( 1, 10, 10 );
	}
    else if( options['primitive'] == 'box' ) {
		geometry = BoxGeometry( 1, 1, 1 );
	}

	final material = MeshStandardMaterial();

	handMesh = InstancedMesh( geometry, material, 30 );
	handMesh.frustumCulled = false;
	handMesh.instanceMatrix?.setUsage( DynamicDrawUsage ); // will be updated every frame
	handMesh.castShadow = true;
	handMesh.receiveShadow = true;
	handModel.add( handMesh );
}