og/segment/SegmentHelper

Source: segmentHelper.ts:5


Instance Methods

createIndexesArray(length, vertexCount)

Index array of the GPU buffer: 16 bit when the indexes fit, 32 bit otherwise. Index 0xFFFF restarts a primitive in WebGL2, so the 16 bit indexes stay below it.

Parameters

  • length — Index count.
  • vertexCount — Vertex count, the indexes are less than it.

createCellTriangles(strip, size)

Lists the triangles of a triangle strip over a grid of (size + 1) x (size + 1) vertices per cell they cover. A triangle is listed in every cell of its bounding box.

Parameters

  • strip — Vertex indexes of the triangle strip.
  • size — Grid size, cells per side.

createCellTrianglesTable()

One slot per grid size and neighbour sizes, filled on first use by getCellTriangles.