Best Way to Use Changing Meshes
Posted: Wed Feb 18, 2015 12:55 am
Hello,
In my game I have a lot of procedurally generated obstacles that are composed of a mesh and a material but remain static in the environment so I assume StaticMesh collidables are best for them. However, because of the huge number of obstacles I can't retain a collidable for each obstacle. I am able to quickly determine which obstacles are near a player so I only need to check for collisions with them. I would assume that creating and destroying new StaticMesh objects as the player moves would create a lot of garbage. Is there an efficient way to change the shape of a StaticMesh object?
The closest other topic about this that I found is:
viewtopic.php?f=4&t=1402
Which describes what I had been looking into myself, changing the Vertices and Indices of the shape then using Reconstruct but it sounds like it may be inefficient.
The obstacles are small, relatively simple unique meshes of about 50 triangles each and the player may be touching multiple obstacles at once, up to 10 or so. Is there a better way to manage this than using Reconstruct? Is there maybe a different collidable that would work better?
Thank you.
In my game I have a lot of procedurally generated obstacles that are composed of a mesh and a material but remain static in the environment so I assume StaticMesh collidables are best for them. However, because of the huge number of obstacles I can't retain a collidable for each obstacle. I am able to quickly determine which obstacles are near a player so I only need to check for collisions with them. I would assume that creating and destroying new StaticMesh objects as the player moves would create a lot of garbage. Is there an efficient way to change the shape of a StaticMesh object?
The closest other topic about this that I found is:
viewtopic.php?f=4&t=1402
Which describes what I had been looking into myself, changing the Vertices and Indices of the shape then using Reconstruct but it sounds like it may be inefficient.
The obstacles are small, relatively simple unique meshes of about 50 triangles each and the player may be touching multiple obstacles at once, up to 10 or so. Is there a better way to manage this than using Reconstruct? Is there maybe a different collidable that would work better?
Thank you.