@pixi/3d
    Preparing search index...

    Interface QuaternionData

    Minimal { x, y, z, w } shape of a quaternion, accepted across the math API

    Quaternion and ObservableQuaternion implement it, and so does any plain object with these four numbers. For a turn of angle radians around the unit vector axis, (x, y, z) is axis * sin(angle / 2) and w is cos(angle / 2).

    const quarterTurnAroundY: QuaternionData = { x: 0, y: Math.SQRT1_2, z: 0, w: Math.SQRT1_2 };

    door.quaternion.copyFrom(quarterTurnAroundY);
    interface QuaternionData {
        w: number;
        x: number;
        y: number;
        z: number;
    }

    Implemented by

    Index
    w x y z
    w: number

    The w component

    const angle = 2 * Math.acos(rotation.w);
    
    x: number

    The x component

    const axisX = rotation.x / Math.sqrt(1 - rotation.w * rotation.w);
    
    y: number

    The y component

    const axisY = rotation.y / Math.sqrt(1 - rotation.w * rotation.w);
    
    z: number

    The z component

    const axisZ = rotation.z / Math.sqrt(1 - rotation.w * rotation.w);