Bridges scene/view state changes into GPU-ready render state for the renderer.

  • MeshManager is owned by a ViewManager, which manages all Views for a single Viewer (not one ViewManager per View).
  • It acts as the central bridge between the scene graph (models, objects, meshes) and the renderer's GPU memory and batching subsystems.
  • Owns the renderer-side representation of:
  • Coordinates with GPUMemoryManager to allocate, update, and release GPU memory for mesh, geometry, and attribute data.
  • Maintains mesh batches for efficient rendering, minimizing draw calls and optimizing memory usage.
  • Handles registration and lifecycle of models, objects, and meshes in response to scene/view events.
  • Forwards per-frame and per-event updates (matrix, color, opacity, visibility, etc.) to the relevant renderer objects/meshes and/or GPUMemoryManager.
  • Used internally by the renderer; not accessed directly by application code.
  • The WebGLRenderer owns a single ViewManager for each renderer instance.
  • The ViewManager manages all Views for the Viewer.
  • The MeshManager is owned by the ViewManager and manages all renderer objects and meshes for all views.
  • MeshManager ensures that changes in the scene or any view are efficiently reflected in GPU state, supporting high-performance, multi-view rendering.

Constructors

Accessors

Methods

  • Retrieves a mesh batch by index.

    Parameters

    • batchIndex: number

      Batch index.

    Returns MeshBatch

    The batch if found, otherwise null.

    The current implementation indexes into _sortedBatches (a record keyed by internal ids), so this method may not behave as expected unless _sortedBatches is keyed by numeric indices. Consider switching to sortedBatches[batchIndex] if you want a stable positional lookup.

  • Returns the parameters required for a WebGL drawArrays call for a mesh within a batch.

    Parameters

    • batchIndex: number

      GPU memory batch index.

    • meshIndex: number

      Mesh index within the batch.

    Returns { count: number; first: number }

    {first, count} if available, otherwise null.