UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

33 lines (32 loc) 1.42 kB
/** * * returns the Euler-angles of the rotation matrix \c *this using the convention defined by the triplet (`a0`,`a1`,`a2`) * * Each of the three parameters `a0`, `a1`, `a2` represents the respective rotation axis as an integer in {0,1,2}. * For instance, in: * ``` * Vector3f ea = mat.eulerAngles(2, 0, 2); * ``` * "2" represents the z axis and "0" the x axis, etc. The returned angles are such that * we have the following equality: * ``` * mat == AngleAxisf(ea[0], Vector3f::UnitZ()) * * AngleAxisf(ea[1], Vector3f::UnitX()) * * AngleAxisf(ea[2], Vector3f::UnitZ()); * ``` * This corresponds to the right-multiply conventions (with right hand side frames). * * The returned angles are in the ranges [0:pi]x[-pi:pi]x[-pi:pi]. * NOTE: ported from Eigen C++ library * * @see https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/src/Geometry/EulerAngles.h * @see https://stackoverflow.com/questions/11514063/extract-yaw-pitch-and-roll-from-a-rotationmatrix * * @param {number[]} output * @param {number[]|Float32Array|mat4} m4 source matrix to extract rotation from * @param {number} a0 axis index (0 = X, 1 = Y, 2 = Z) * @param {number} a1 axis index * @param {number} a2 axis index */ export function eulerAnglesFromMatrix(output: number[], m4: number[] | Float32Array | mat4, a0: number, a1: number, a2: number): void; //# sourceMappingURL=eulerAnglesFromMatrix.d.ts.map