Function EnableSwizzlesF64

  • Enables Swizzle operations on Vec2 / Vec3 / Vec4 types from gl-matrix/f64 (64-bit).

    Swizzle operations are performed by using the . operator in conjunction with any combination of between two and four component names, either from the set xyzw or rgbw (though not intermixed). They return a new vector with the same number of components as specified in the swizzle attribute.

    Returns void

    import { Vec3 } from 'gl-matrix/f64';
    import { EnableSwizzlesF64 } from 'gl-matrix/swizzle/f64';

    EnableSwizzlesF64();

    let v = new Vec3(0, 1, 2);

    v.yx; // returns new Vec2(1, 0)
    v.xzy; // returns new Vec3(0, 2, 1)
    v.zyxz; // returns new Vec4(2, 1, 0, 2)

    v.rgb; // returns new Vec3(0, 1, 2)
    v.rbg; // returns new Vec3(0, 2, 1)
    v.gg; // returns new Vec2(1, 1)