MCPcopy Create free account
hub / github.com/esengine/esengine / eulerToQuaternion

Function eulerToQuaternion

scripts/verify-anim-t0.mjs:243–253  ·  view source on GitHub ↗
(x, y, z)

Source from the content-addressed store, hash-verified

241console.log(`=== SAMPLING ANIMATION AT t=0 ===\n`);
242
243function eulerToQuaternion(x, y, z) {
244 const cx = Math.cos(x / 2), sx = Math.sin(x / 2);
245 const cy = Math.cos(y / 2), sy = Math.sin(y / 2);
246 const cz = Math.cos(z / 2), sz = Math.sin(z / 2);
247 return [
248 sx * cy * cz - cx * sy * sz,
249 cx * sy * cz + sx * cy * sz,
250 cx * cy * sz - sx * sy * cz,
251 cx * cy * cz + sx * sy * sz
252 ];
253}
254
255function multiplyQuaternion(a, b) {
256 const [ax, ay, az, aw] = a;

Callers 1

verify-anim-t0.mjsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected