@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
16 lines (13 loc) • 366 B
JavaScript
/**
*
* @param {BufferGeometry|Geometry} geometry
* @returns {Box3}
*/
export function ensureGeometryBoundingBox(geometry) {
let boundingBox = geometry.boundingBox;
if (boundingBox === null || boundingBox === undefined) {
geometry.computeBoundingBox();
boundingBox = geometry.boundingBox;
}
return boundingBox;
}