@twinfinity/core
    Preparing search index...

    Class GeometryBuffer

    Represents a block of reusable geometry memory. It is expensive to allocate memory for geometry arrays (vertices, normals, indices) for each mesh. By using this class we can allocate a large block of memory and then allocate smaller slices from this block to write geometry data to. For example during mesh merging.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get byteLength(): number

      Total size in bytes of geometry memory.

      Returns number

    Methods

    • Frees the memory used by the geometry buffer.

      Returns void

    • Allocate a block of geometry arrays (GeometryArrays). Only one allocation at a time may exist Therefore next call to this method will invalidate contents of previous GeometryArrays instances.

      Parameters

      • primitiveCount: number

        Number of primitives to allocate.

      • indiceCount: number

        Number of indices to allocate.

      Returns GeometryArrays

    • Updates the maximum length of the geometry buffer to accommodate the given primitive count and indice count. If the given counts are greater than the current maximum lengths, then the maximum size will be updated.

      Parameters

      • primitiveCount: number

        The desired primitive count.

      • indiceCount: number

        The desired indice count.

      Returns GeometryBuffer

      This GeometryBuffer instance.