UNPKG

playcanvas

Version:

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

24 lines (23 loc) 632 B
import { Vec3 } from "../../core/math/vec3.js"; import { BoundingBox } from "../../core/shape/bounding-box.js"; import { GSplatOctree } from "./gsplat-octree.js"; class GSplatOctreeResource { aabb = new BoundingBox(); centersVersion = 0; octree; data; constructor(assetFileUrl, data, assetLoader) { 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)); this.data = data; this.data.tree = null; } destroy() { this.octree?.destroy(); this.octree = null; } } export { GSplatOctreeResource };