API

Function resizeMeshGeometry

  • Replace a mesh's GPU geometry IN PLACE with new (possibly larger or smaller) buffers, reusing the same Mesh object so existing references to it (scene entries, shadow-caster lists, materials) stay valid. Unlike updateMeshPositions, this REALLOCATES the GPU buffers, so it's the way to GROW a dynamically-generated mesh past its original vertex/index capacity (e.g. an ever-larger bridge whose box budget overflows). The old GPU buffers are destroyed to free device memory. Recomputes bounds.

    Parameters

    • engine: EngineContext
    • mesh: Mesh
    • positions: Float32Array
    • normals: Float32Array
    • indices: Uint32Array
    • Optionaluvs: Float32Array<ArrayBufferLike>
    • Optionaluvs2: Float32Array<ArrayBufferLike>
    • Optionaltangents: Float32Array<ArrayBufferLike>
    • Optionalcolors: Float32Array<ArrayBufferLike>

    Returns void