I’m making my own terrain system and have got the mesh creation done, now I’m trying to get collision working.
I created a MeshCollisionShape using this code here:
MeshCollisionShape terrainCollisionShape = new MeshCollisionShape(terrainTile.getMesh());
And it’s throwing this error:
java.lang.IndexOutOfBoundsException: 600 at java.base/java.nio.DirectIntBufferU.get(DirectIntBufferU.java:332) at com.jme3.scene.mesh.IndexIntBuffer.get(IndexIntBuffer.java:59) at com.jme3.bullet.util.Converter.convert(Converter.java:248) at com.jme3.bullet.collision.shapes.MeshCollisionShape.createCollisionMesh(MeshCollisionShape.java:82) at com.jme3.bullet.collision.shapes.MeshCollisionShape.<init>(MeshCollisionShape.java:77) at com.jme3.bullet.collision.shapes.MeshCollisionShape.<init>(MeshCollisionShape.java:67) at com.bootlegfireworks.terrain.Terrain.generate(Terrain.java:68) at com.bootlegfireworks.Main.generateTerrain(Main.java:82) at com.bootlegfireworks.Main.simpleInitApp(Main.java:75) at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:240) at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:139) at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:221) at java.base/java.lang.Thread.run(Thread.java:833)
Anyone have any ideas for what is causing the error?