-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Closed
Labels
Milestone
Description
Description
It's unclear how to use BatchedMesh in the case of deleting an element, and then setting it later:
// Delete a geometry, then later set the same index to any geometry.
deleteGeometry(idx)
setGeometryAt(idx, geometry);
setVisibleAt(idx, true);
The problem is that the visibility does not change due to _active[idx] being false.
Deleting sets ._active[idx] to false, and there's no public facing way to set the active status back to true.
Calls to setVisibleAt, setMatrixAt, and getMatrixAt all quietly fail, which took a moment to uncover.
Solution
Can enable the active value to be modified, or clarify if this is a limitation of BatchedMesh that geometries should not be deleted unless willing to permanently disable the index, but hopefully that's not the case.
Alternatives
Can set batchedMesh._active[idx] = true;, but not sure if this breaks anything?
Additional context
No response