-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
area: graphicsGraphics related issueGraphics related issueenhancementRequest for a new featureRequest for a new feature
Description
When creating procedural meshes, sometimes it is beneficial to add them to a single render component. Currently, if you set a new array of mesh instances, previous ones will be destroyed - which is not always desirable. So adding mesh instances not in one go is not convenient atm.
I wrote a quick workaround for this:
// add MeshInstance to RenderComponent
const meshInstances = entity.render.meshInstances.slice(0);
entity.render._meshInstances = [];
meshInstances.push(this.meshInstance);
entity.render.meshInstances = meshInstances;
Of course this is not great, so it would be good to have a public API for it, something like:
entity.render.addMeshInstance(meshInstasnce);
entity.render.removeMeshInstance(meshInstance);
AlexAPPi
Metadata
Metadata
Assignees
Labels
area: graphicsGraphics related issueGraphics related issueenhancementRequest for a new featureRequest for a new feature