rhodonite
    Preparing search index...

    Interface IScalar

    Interface for scalar values (1-component vectors).

    interface IScalar {
        _v: TypedArray;
        bytesPerComponent: number;
        className: string;
        glslStrAsFloat: string;
        glslStrAsInt: string;
        glslStrAsUint: string;
        wgslStrAsFloat: string;
        wgslStrAsInt: string;
        wgslStrAsUint: string;
        x: number;
        at(i: number): number;
        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;
        toString(): string;
        toStringApproximately(): string;
        v(i: number): number;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    The underlying typed array

    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 scalar value (x component)

    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