eulerAngles

Undocumented in source. Be warned that the author may not have intended to support it.
  1. Mat3!T eulerAngles(T a, T b, T c)
  2. auto eulerAngles(V angles)
    pure @safe @nogc nothrow
    eulerAngles
    (
    V
    )
    (
    in V angles
    )
    if (
    isVec!(3, V) &&
    isFloatingPoint!(V.Component)
    )

Examples

ditto

import gfx.math.approx : approxUlpAndAbs;
import std.math : PI;

const v = fvec(0, 0, 1);
// rotate PI/2 around X, then no rotation around Z, then again PI/2 around X
const m = eulerAngles(float(PI / 2), 0f, float(PI / 2));
const result = m * v;
const expected = fvec(0, 0, -1);

assert(approxUlpAndAbs(result, expected));

Meta