I wrote this a while ago and I was rather proud, despite its simplicity. Now it doesn't compile at all so I'll have to spend some time fixing it! Bugger! :x
http://www.jmonkeyengine.com/wiki/doku.php?id=geometrybatch
/home/mike/Development/Java/Terrain1/src/GeometryBatch.java:45: getVertexBuffer(int) in com.jme.scene.Geometry cannot be applied to ()
FloatBuffer vertices = BufferUtils.clone(mesh.getVertexBuffer());
int total = this.getIndexBuffer().capacity() + mesh.getIndexBuffer().capacity();
/home/mike/Development/Java/Terrain1/src/GeometryBatch.java:96: incompatible types
found : java.lang.String
required: int
int total = this.getIndexBuffer().capacity() + mesh.getIndexBuffer().capacity();
/home/mike/Development/Java/Terrain1/src/GeometryBatch.java:98: getIndexBuffer(int) in com.jme.scene.TriMesh cannot be applied to ()
Hopefully it won't be too painful. I don't think anyone else has used my class so there's no rush…
You have to specify the batch (jME style batch) get*Buffer. If there's only 1 it's always 0. so getIndexBuffer(0)/
And you have to rename your class. Really it's too confusing.
Is the name confusing because of the GeomBatch class in JME?
I personally think so, yes. As you know I helped you a bit with this class but when I saw the topic I had to squint my eyes a bit before I remembered that this isn't about batches (ok, it was early too).
What about GeometryMerger or something? I acually think it's a more accurate description.
Ok, I personally think it's ok, but to help clear things up for others I'll try to find something more appropriate.
Thanks!