updateMesh method

  1. @override
void updateMesh()
override

Updates the mesh based on the tracked XR joints data.

Implementation

@override
void updateMesh() {
	final xrJoints = controller.children;//.userData['joints'];

	for (int i = 0; i < (bones?.length ?? 0); i ++ ) {
		final bone = bones?[i];

		if ( bone != null) {
			final xrJoint = xrJoints[i];//bone.userData['jointName'] ];

			if ( xrJoint.visible == true) {
				final position = xrJoint.position;

				bone.position.setFrom( position );
				bone.quaternion.setFrom( xrJoint.quaternion );
				// bone.scale.setScalar( XRJoint.jointRadius || defaultRadius );
			}
		}
	}
}