Skip to content

Instantly share code, notes, and snippets.

@stevedekorte
Created November 8, 2022 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevedekorte/b5da27201df066b37586a4bced2d4fc9 to your computer and use it in GitHub Desktop.
Save stevedekorte/b5da27201df066b37586a4bced2d4fc9 to your computer and use it in GitHub Desktop.
Rapier rotations not getting what was set
CODE:
const a = [-0.0000064798259700182825, -0.0013201627880334854, 0.0000027575993044592906, 0.9999991059303284]
rigidBody.setRotation(new RAPIER.Quaternion(a[0], a[1], a[2], a[3]))
const r = rigidBody.rotation()
console.log("before:", a)
console.log(" after:", [r.x, r.y, r.z, r.w])
OUTPUT:
before: (4) [-0.0000064798259700182825, -0.0013201627880334854, 0.0000027575993044592906, 0.9999991059303284]
after: (4) [-0.000006479826424765633, -0.0013201627880334854, 0.0000027575993044592906, 0.9999991059303284]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment