Skip to content

Commit

Permalink
Store a list of all current object meshes with instances in the scene
Browse files Browse the repository at this point in the history
  • Loading branch information
fenomas committed Apr 21, 2023
1 parent fb4887e commit a8540e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/objectMesher.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ function ObjectMesher(noa) {
// mock object to pass to customMesh handler, to get transforms
var transformObj = new TransformNode('')

// list of known base meshes
this.allBaseMeshes = []

// internal storage of instance managers, keyed by ID
// has check to dedupe by mesh, since babylon chokes on
// separate sets of instances for the same mesh/clone/geometry
Expand All @@ -53,6 +56,7 @@ function ObjectMesher(noa) {
return managers[id] = managers[id2]
}
}
this.allBaseMeshes.push(mesh)
return managers[id] = new InstanceManager(noa, mesh)
}

Expand Down

0 comments on commit a8540e5

Please sign in to comment.