rhodonite
    Preparing search index...

    Interface IVector4

    Interface for immutable 4D vectors. Provides operations specific to 4-component vectors (homogeneous coordinates).

    interface IVector4 {
        _v: TypedArray;
        bytesPerComponent: number;
        className: string;
        glslStrAsFloat: string;
        glslStrAsInt: string;
        glslStrAsUint: string;
        w: number;
        wgslStrAsFloat: string;
        wgslStrAsInt: string;
        wgslStrAsUint: string;
        x: number;
        y: number;
        z: number;
        at(i: number): number;
        clone(): IVector4;
        dot(vec: IVector4): number;
        flattenAsArray(): number[];
        isDummy(): boolean;
        isEqual(vec: IVector4, delta?: number): boolean;
        isStrictEqual(vec: IVector4): boolean;
        isTheSourceSame(arrayBuffer: ArrayBuffer): boolean;
        length(): number;
        lengthSquared(): number;
        lengthTo(vec: IVector4): number;
        toString(): string;
        toStringApproximately(): string;
        v(i: number): number;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    The underlying typed array containing vector components

    bytesPerComponent: number

    Number of bytes per component in the underlying array

    className: string

    The class name identifier

    glslStrAsFloat: string

    GLSL string representation for float type

    glslStrAsInt: string

    GLSL string representation for integer type

    glslStrAsUint: string

    GLSL string representation for unsigned integer type

    w: number

    The w component

    wgslStrAsFloat: string

    WGSL string representation for float type

    wgslStrAsInt: string

    WGSL string representation for integer type

    wgslStrAsUint: string

    WGSL string representation for unsigned integer type

    x: number

    The x component

    y: number

    The y component

    z: number

    The z component

    • Gets component at index.

      Parameters

      • i: number

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

      Returns number

      Component value

    • Creates a copy of this vector.

      Returns IVector4

      New Vector4 instance

    • Calculates dot product with another Vector4.

      Parameters

      Returns number

      Dot product

    • Converts the vector to a flat array.

      Returns number[]

      Array containing [x, y, z, w]

    • Checks if this is a dummy vector.

      Returns boolean

      True if dummy

    • Checks equality with another Vector4 within tolerance.

      Parameters

      • vec: IVector4

        Vector to compare with

      • Optionaldelta: number

        Optional tolerance

      Returns boolean

      True if approximately equal

    • Checks strict equality with another Vector4.

      Parameters

      Returns boolean

      True if exactly equal

    • Checks if this vector shares the same source array buffer.

      Parameters

      • arrayBuffer: ArrayBuffer

        The array buffer to check

      Returns boolean

      True if using the same source buffer

    • Calculates vector length.

      Returns number

      Vector magnitude

    • Calculates squared length.

      Returns number

      Squared magnitude

    • Calculates distance to another Vector4.

      Parameters

      Returns number

      Distance

    • Returns a string representation of the vector.

      Returns string

      String representation

    • Returns an approximate string representation with rounded values.

      Returns string

      Approximate string representation

    • Gets the component value at the specified index (alias for at).

      Parameters

      • i: number

        The component index

      Returns number

      The component value