TL;DR: How do I create a mesh that I can (quickly) add/remove polygons from on the fly?
I want to render a lot of triangles that I might want to change depending on player input (deformable terrain). I’m experimenting with a few basic approaches using JME, and if I just instantiate a bunch of Geometry’s and add them to my rootNode, it’s pretty slow. If I call GeometryBatchFactory.optimize(rootNode), that speeds it up a bunch, but the problem is that if I call that method every time something alters terrain, it causes a noticeable hop in the framerate (which I expected). So, I’m thinking I need to dynamically generate one mesh and add/subtract from it as things (blocks) are modified. I didn’t see any methods that would do this in the Mesh class (or any of its subclasses) and I was wondering if someone could point me in the right direction. Thanks!