updateMesh method

  1. @override
void updateMesh()
override

Updates the mesh based on the tracked XR joints data.

Implementation

@override
void updateMesh() {
	final defaultRadius = 0.008;
	final joints = controller.children;//.joints as Map<String,Object3D>;

	int count = 0;

	for (int i = 0; i < this.joints.length; i ++ ) {
		final joint = joints[i];//[ this.joints[ i ] ];

		if ( joint.visible == true) {
			_vector.setScalar( joint.userData['jointRadius'] ?? defaultRadius );
			_matrix.compose( joint.position, joint.quaternion, _vector );
			handMesh.setMatrixAt( i, _matrix );

			count ++;
		}
	}

	handMesh.count = count;
	handMesh.instanceMatrix?.needsUpdate = true;
}