allow separation of 3d file into individual meshes

This commit is contained in:
2026-04-08 11:16:24 +03:00
parent 4aa9bcdbd6
commit 8d9c7216c3
5 changed files with 14 additions and 4 deletions
@@ -8,6 +8,15 @@ class GenericObject extends EventManager{
this.source = await engine.load(data.$go.asset.name);
this.object = engine.meshUtils.bottomOrigin(this.source.scene)
if (data.asIndividuals){
this.object.hasIndividualChildren = true;
this.source.scene.traverse(o=>{
if (o.isMesh){
o.isIndividual = true;
}
})
}
if (!data.exclude){
engine.clickable.add(this.object, async e=>{
this.object.__onhud = !this.object.__onhud;