UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

20 lines (17 loc) 601 B
import { Vec3 } from '../../core/math/vec3.js'; import { BoundingBox } from '../../core/shape/bounding-box.js'; import { GSplatOctree } from './gsplat-octree.js'; class GSplatOctreeResource { destroy() { this.octree?.destroy(); this.octree = null; } constructor(assetFileUrl, data, assetLoader){ this.aabb = new BoundingBox(); this.centersVersion = 0; this.octree = new GSplatOctree(assetFileUrl, data); this.octree.assetLoader = assetLoader; this.aabb.setMinMax(new Vec3(data.tree.bound.min), new Vec3(data.tree.bound.max)); } } export { GSplatOctreeResource };