I am trying to align a bone with a specific Vector3 (directionToTarget) by rotating it. Here is the code snippet:
const directionToTarget = new THREE.Vector3(random, random, random); //random pseudocode values
directionToTarget.normalize();
var Hand2worldQ = new THREE.Quaternion();
this._anchor['LeftHandIndex1'].getWorldQuaternion(Hand2worldQ); // retrieves quaternion for LeftHand bone
this._mesh.skeleton.bones[ 0 ].quaternion.set( SomeFunctionThatMakesVecintoQuarternion(directionToTarget );
// applies rotation of LeftHand to _mesh skeleton bones
Currently, I am in search of a function called SomeFunctionThatMakesVec3intoQuarternion(directionToTarget )