TriangleBatch

Whats the substitute of TriangleBatch for jME 2.0

AFAIK There is no direct substitute, so it now depends what functionality in trianglebatch you are looking to substitute?



If its the "batching" part, then that was moved up into the geometry class, so geometry is the batch now.

Dont remember what else trianglebatch had now - memory not so good these days :slight_smile:

well other than the stupidly old code i’m attempting to port yo jME 2.0 from when i first started i’m also trying to use the Fractal classes made by Pirix in which the call TriangleBatch batch = getBatch(0); is called throughout the code their doesn’t seem to be a method called getBatch however so i wasn’t exactly sure how to remedy it.

You should be alright to replace TriangleBatch batch = getBatch(0); with TriMesh mesh = this; - I believe that should give you exactly the same result. At least, it's worked for me where I've used it XD

or just remove it altogether :slight_smile:

Apart from the texturing, you can just search and replace all occurences of "batch."  with nothing

thx for the help but



batch.getTextureBuffers().set(0, BufferUtils.createVector2Buffer(batch.getVertexCount()));

batch.getTextureBuffer(0).put(newTex);

batch.getTextureBuffer(0).put(tex);

batch.getTextureBuffers().set(0, BufferUtils.createVector2Buffer(batch.getVertexCount()));

batch.getTextureBuffer(0).put(tex);





should i just comment it out since its not compiling or would that cause adverse effects



JOC i could comment out everything that says batch and it would work the same??

As I said previously - removing "batch." will work for everything except the texture related ones. This is because the geometry class now handles all the batch stuff - hence it should just work :slight_smile:



The texture stuff is a little different tho - Off the top of my head, not sure what they are replaced with exactly… a quick look suggests getTextureCoords … .

Just commenting them out means you won't have any texture coordinates, so applied textures will probably not look right, but apart from that it will work.


It helps to actually attach the object to the rootnode :stuck_out_tongue:

JOC said:

It helps to actually attach the object to the rootnode :p


yeah thx i actually forgot to to that lol thx for the help though i actually got it working

Thanks. ported an engine wrapper to jme 2, not too much code to change.



This worked just fine with jme1 -> jme2.



Still quite a few issues, but it runs (kinda!!) and doesn't crash.