fast-mesh-wasm
    Preparing search index...

    Interface MeshViews

    Zero-copy views of one mesh's render buffers, slot-aligned.

    Each getter builds a fresh view over the current wasm memory. A view is only valid until the next scene call that may allocate or move buffers (any edit, add, undo, query, ...): the buffer may have moved, so a kept view may read other data, or be empty once the memory grew. Re-acquire views after every scene call and do not keep them. With new Scene({ debug: true }) reading a kept view warns.

    interface MeshViews {
        colors(): Uint8Array<ArrayBufferLike> | null;
        indices(): Uint32Array;
        normals(): Float32Array<ArrayBufferLike> | null;
        positions(): Float32Array;
        uvs?(): Float32Array<ArrayBufferLike> | null;
        values?(): Float32Array<ArrayBufferLike> | null;
    }

    Hierarchy (View Summary)

    Index
    • RGBA8 colours, 4 bytes per vertex slot, or null without colouring.

      Returns Uint8Array<ArrayBufferLike> | null

    • Vertex normals, 3 floats per vertex slot, or null when normals are off. For a "lazy" or "manual" mesh it can be shorter than 3 · vertex slots after a growth, until the mesh is updated (Scene.update).

      Returns Float32Array<ArrayBufferLike> | null

    • Texture coordinates, 2 floats per vertex slot, or null for a mesh without them (never given, or dropped by an operation: see docs/uv-channel.md). Optional for other SceneLike hosts; Scene and WorkerScene provide it (SceneMeshViews).

      Returns Float32Array<ArrayBufferLike> | null

    • The values the colours are made from (the colouring field's values), 1 float per vertex slot, or null without colouring. They change only at the colours' dirty slots, so they follow the colors change ranges. Optional for other SceneLike hosts; Scene and WorkerScene provide it.

      Returns Float32Array<ArrayBufferLike> | null