rhodonite
    Preparing search index...

    Interface IMutableQuaternion

    Mutable quaternion interface that extends IQuaternion with modification capabilities. Provides methods to modify quaternion components and perform in-place operations.

    interface IMutableQuaternion {
        _v: TypedArray;
        className: string;
        w: number;
        x: number;
        y: number;
        z: number;
        add(quat: IQuaternion): IMutableQuaternion;
        at(i: number): number;
        axisAngle(vec: IVector3, radian: number): IMutableQuaternion;
        clone(): IMutableQuaternion;
        clone(): IMutableQuaternion;
        copyComponents(quat: IQuaternion): IMutableQuaternion;
        divideNumber(value: number): IMutableQuaternion;
        dot(vec: IQuaternion): number;
        flattenAsArray(): number[];
        fromMatrix(mat: IMatrix44): IMutableQuaternion;
        identity(): IMutableQuaternion;
        isDummy(): boolean;
        isEqual(vec: IQuaternion, delta?: number): boolean;
        isStrictEqual(vec: IQuaternion): boolean;
        length(): number;
        lengthSquared(): number;
        multiply(quat: IQuaternion): IMutableQuaternion;
        multiplyNumber(value: number): IMutableQuaternion;
        normalize(): IMutableQuaternion;
        raw(): TypedArray;
        setAt(i: number, value: number): IMutableQuaternion;
        setComponents(
            x: number,
            y: number,
            z: number,
            w: number,
        ): IMutableQuaternion;
        subtract(quat: IQuaternion): IMutableQuaternion;
        toEulerAngles(): IVector3;
        toEulerAnglesTo(out: IMutableVector3): IMutableVector3;
        toString(): string;
        toStringApproximately(): string;
        transformVector3(vec: IVector3): IVector3;
        transformVector3Inverse(vec: IVector3): IVector3;
        transformVector3To(vec: IVector3, out: IMutableVector3): Vector3;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Internal typed array storage for quaternion components (Float32Array or Float64Array)

    className: string

    The class name identifier

    w: number

    The w component (real quaternion basis) - mutable

    x: number

    The x component (i quaternion basis) - mutable

    y: number

    The y component (j quaternion basis) - mutable

    z: number

    The z component (k quaternion basis) - mutable

    • Gets the component value at the specified index.

      Parameters

      • i: number

        Index (0=x, 1=y, 2=z, 3=w)

      Returns number

      The component value at the given index

    • Sets this quaternion to represent a rotation around an axis by a given angle.

      Parameters

      • vec: IVector3

        The axis of rotation (should be normalized)

      • radian: number

        The angle of rotation in radians

      Returns IMutableQuaternion

      This quaternion for method chaining

    • Divides this quaternion by a scalar value in place.

      Parameters

      • value: number

        The scalar value to divide by

      Returns IMutableQuaternion

      This quaternion for method chaining

    • Calculates the dot product between this quaternion and another.

      Parameters

      Returns number

      The dot product result

    • Converts the quaternion to a flat array of numbers.

      Returns number[]

      Array containing [x, y, z, w] components

    • Sets this quaternion to the identity quaternion (0, 0, 0, 1).

      Returns IMutableQuaternion

      This quaternion for method chaining

    • Checks if this quaternion is a dummy/invalid quaternion.

      Returns boolean

      True if the quaternion is dummy, false otherwise

    • Compares this quaternion with another quaternion for equality within a tolerance.

      Parameters

      • vec: IQuaternion

        The quaternion to compare with

      • Optionaldelta: number

        Optional tolerance value for comparison (default uses system epsilon)

      Returns boolean

      True if quaternions are equal within tolerance, false otherwise

    • Compares this quaternion with another quaternion for strict equality.

      Parameters

      Returns boolean

      True if quaternions are exactly equal, false otherwise

    • Calculates the magnitude (length) of the quaternion.

      Returns number

      The magnitude of the quaternion

    • Calculates the squared magnitude of the quaternion. More efficient than length() when only comparison is needed.

      Returns number

      The squared magnitude of the quaternion

    • Multiplies this quaternion by another quaternion in place (quaternion composition).

      Parameters

      Returns IMutableQuaternion

      This quaternion for method chaining

    • Multiplies this quaternion by a scalar value in place.

      Parameters

      • value: number

        The scalar value to multiply by

      Returns IMutableQuaternion

      This quaternion for method chaining

    • Normalizes this quaternion to unit length in place.

      Returns IMutableQuaternion

      This quaternion for method chaining

    • Gets the raw typed array backing this quaternion.

      Returns TypedArray

      The underlying TypedArray storage

    • Sets the component value at the specified index.

      Parameters

      • i: number

        Index (0=x, 1=y, 2=z, 3=w)

      • value: number

        The value to set

      Returns IMutableQuaternion

      This quaternion for method chaining

    • Sets all four components of the quaternion.

      Parameters

      • x: number

        The x component value

      • y: number

        The y component value

      • z: number

        The z component value

      • w: number

        The w component value

      Returns IMutableQuaternion

      This quaternion for method chaining

    • Converts the quaternion to Euler angles.

      Returns IVector3

      A new vector containing Euler angles (x=pitch, y=yaw, z=roll)

    • Returns a string representation of the quaternion.

      Returns string

      String representation of the quaternion

    • Returns an approximate string representation of the quaternion with limited precision.

      Returns string

      Approximate string representation