MCPcopy
hub / github.com/spritejs/spritejs / setAxisAngle

Function setAxisAngle

docs/demo/spritejs.worker.js:3971–3979  ·  view source on GitHub ↗

* Sets a quat from the given angle and rotation axis, * then returns it. * * @param {quat} out the receiving quaternion * @param {ReadonlyVec3} axis the axis around which to rotate * @param {Number} rad the angle in radians * @returns {quat} out

(out, axis, rad)

Source from the content-addressed store, hash-verified

3969 **/
3970
3971function setAxisAngle(out, axis, rad) {
3972 rad = rad * 0.5;
3973 var s = Math.sin(rad);
3974 out[0] = s * axis[0];
3975 out[1] = s * axis[1];
3976 out[2] = s * axis[2];
3977 out[3] = Math.cos(rad);
3978 return out;
3979}
3980/**
3981 * Gets the rotation axis and angle for a given
3982 * quaternion. If a quaternion is created with

Callers 1

spritejs.worker.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected