TerrainTestTile implementation

Hello, i’m trying to implement my tiledterrain with a 3x3 grid of terrains, instead of 2x2 like the demo. I created the 9 terrains, set the neighbor finder for them, created a MultiTerrainLodControl and added all of the terrains and then edited all of the neighbor finding methods like getRightQuad() to find the correct neighbors, exactly like the demo, and im getting errors

Dec 14, 2019 6:38:13 PM com.jme3.terrain.geomipmap.TerrainLodControl updateQuadLODs
SEVERE: null
java.util.concurrent.ExecutionException: java.lang.ClassCastException: java.nio.DirectByteBuffer cannot be cast to java.nio.ShortBuffer
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at com.jme3.terrain.geomipmap.TerrainLodControl.updateQuadLODs(TerrainLodControl.java:362)
at com.jme3.terrain.geomipmap.TerrainLodControl.updateLOD(TerrainLodControl.java:281)
at com.jme3.terrain.geomipmap.TerrainLodControl.controlUpdate(TerrainLodControl.java:221)
at com.jme3.scene.control.AbstractControl.update(AbstractControl.java:111)
at com.jme3.scene.Spatial.runControlUpdate(Spatial.java:737)
at com.jme3.scene.Spatial.updateLogicalState(Spatial.java:880)
at com.jme3.scene.Node.updateLogicalState(Node.java:231)
at com.jme3.scene.Node.updateLogicalState(Node.java:242)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:261)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:197)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: java.nio.DirectByteBuffer cannot be cast to java.nio.ShortBuffer
at com.jme3.terrain.geomipmap.TerrainPatch.reIndexGeometry(TerrainPatch.java:260)
at com.jme3.terrain.geomipmap.TerrainQuad.reIndexPages(TerrainQuad.java:535)
at com.jme3.terrain.geomipmap.TerrainQuad.reIndexPages(TerrainQuad.java:533)
at com.jme3.terrain.geomipmap.MultiTerrainLodControl$UpdateMultiLOD.call(MultiTerrainLodControl.java:169)
at com.jme3.terrain.geomipmap.MultiTerrainLodControl$UpdateMultiLOD.call(MultiTerrainLodControl.java:141)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
… 1 more

My terrains look like:
1-4-7
2-5-8
3-6-9

Is there anything I can do to fix this? :woozy_face:

This looks like another instance of issue 1197.

I expect the fix will be in JME 3.3.0-beta. For now, you can use JME 3.2.4 which shouldn’t have that issue.

Oh okay, I see. thanks a lot for the help!

1 Like