You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const a = [-0.0000064798259700182825, -0.0013201627880334854, 0.0000027575993044592906, 0.9999991059303284]
const t = new Ammo.btTransform();
t.setIdentity();
t.setRotation(new Ammo.btQuaternion(a[0], a[1], a[2], a[3]));
const r = t.getRotation()
// a is (very slightly) not equal to [r.x(), r.y(), r.z(), r.w()]
Any suggestions would be welcome. Thanks!
The text was updated successfully, but these errors were encountered:
const a = [-0.0000064798259700182825, -0.0013201627880334854, 0.0000027575993044592906, 0.9999991059303284]
const t = new Ammo.btTransform();
t.setIdentity();
t.setRotation(new Ammo.btQuaternion(a[0], a[1], a[2], a[3]));
const r = t.getRotation()
// a is (very slightly) not equal to [r.x(), r.y(), r.z(), r.w()]
Any suggestions would be welcome. Thanks!
const quat = new THREE.Quaternion();
quat.setFromUnitVectors(new THREE.Vector3(0, r++, 0), new THREE.Vector3( camDir.x, 0, camDir.z)); // for example
const ammoQuaternion = new Ammo.btQuaternion(quat.x, quat.y, quat.z, quat.w);
let tempTransform = ball.userData.physicsBody.getWorldTransform();
tempTransform.setRotation(ammoQuaternion);
ball.userData.physicsBody.setWorldTransform(tempTransform);
Example:
Any suggestions would be welcome. Thanks!
The text was updated successfully, but these errors were encountered: