UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

17 lines (14 loc) 414 B
/** * * @param {AABB3} result * @param {TopoMesh} mesh */ export function computeTopoMeshBoundiningBox(result, mesh) { result.setNegativelyInfiniteBounds(); const vertices = mesh.vertices; const vertex_count = vertices.length; for (let i = 0; i < vertex_count; i++) { const vertex = vertices[i]; result._expandToFitPoint(vertex.x, vertex.y, vertex.z); } }