rhodonite
    Preparing search index...

    Interface IMutableVector

    Base interface for mutable vector types. Extends IVector with mutation operations that modify the vector in-place.

    interface IMutableVector {
        _v: TypedArray;
        bytesPerComponent: number;
        className: string;
        glslStrAsFloat: string;
        glslStrAsInt: string;
        glslStrAsUint: string;
        wgslStrAsFloat: string;
        wgslStrAsInt: string;
        wgslStrAsUint: string;
        x: number;
        add(vec: any): IMutableVector;
        at(i: number): number;
        copyComponents(vec: any): IMutableVector;
        divide(value: number): IMutableVector;
        divideVector(vec: any): IMutableVector;
        dot(vec: IVector): number;
        flattenAsArray(): number[];
        isDummy(): boolean;
        isEqual(vec: IVector, delta?: number): boolean;
        isStrictEqual(vec: IVector): boolean;
        isTheSourceSame(arrayBuffer: ArrayBuffer): boolean;
        length(): number;
        lengthSquared(): number;
        lengthTo(vec: IVector): number;
        multiply(value: number): IMutableVector;
        multiplyVector(vec: any): IMutableVector;
        normalize(): IMutableVector;
        one(): IMutableVector;
        raw(): TypedArray;
        setAt(i: number, value: number): IMutableVector;
        setComponents(...num: number[]): IMutableVector;
        subtract(vec: any): IMutableVector;
        toString(): string;
        toStringApproximately(): string;
        v(i: number): number;
        zero(): IMutableVector;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    The underlying typed array containing vector components (mutable)

    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

    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 of the vector

    Methods

    • Gets the component value at the specified index.

      Parameters

      • i: number

        The component index

      Returns number

      The component value

    • Checks if this vector is equal to another vector within a tolerance.

      Parameters

      • vec: IVector

        The vector to compare with

      • Optionaldelta: number

        Optional tolerance value (default: small epsilon)

      Returns boolean

      True if vectors are approximately 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

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

      Parameters

      • i: number

        The component index

      Returns number

      The component value