Custom mesh flipping out


My project is reaching it’s final development stages… but I ran into a quite big problem at the end of the road.

At the above image you can see a sample of my multiplayer game. Everything mostly works fine but sometimes when i’m removing blocks from my terrain I get these kind of malformed meshes. My terrain is split up into 16x16x16 parts so only the part that I have updated will have the weird effect on it. I have no idea where it can possibly come from.

Is this maybe a known bug or anything that I might have forgotten to take into account?

I can provide the code if needed, although it’s quite a lot…

Edit: This event doesn’t generate any errors or anything else. When I update the mesh again (through placing a block or removing one) the mesh shape is fine again.

Try to set face cull to off and see if it helps. If yes, then you are doing some of the triangles wrong way (clockwise versus counterclockwise). Probably your update routine is slightly different in this aspect from your creation routine, thus the error appearing only after the update.

It looks like your indices are messed up or some vertices are missing.

Finally managed to get some errors out of it… can’t really make much out of it though. Maybe you guys see it…

Seems to be happening when i’m removing my meshcollisionshape on the old mesh and creating a new meshcollisionshape on the new one?

23-mei-2011 18:36:12 com.jme3.bullet.BulletAppState postRender

SEVERE: null

java.util.concurrent.ExecutionException: java.lang.NullPointerException

at java.util.concurrent.FutureTask$Sync.innerGet(

at java.util.concurrent.FutureTask.get(

at com.jme3.bullet.BulletAppState.postRender(



at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(



Caused by: java.lang.NullPointerException

at com.bulletphysics.collision.dispatch.SimulationIslandManager.buildIslands(

at com.bulletphysics.collision.dispatch.SimulationIslandManager.buildAndProcessIslands(

at com.bulletphysics.dynamics.DiscreteDynamicsWorld.solveConstraints(

at com.bulletphysics.dynamics.DiscreteDynamicsWorld.internalSingleStepSimulation(

at com.bulletphysics.dynamics.DiscreteDynamicsWorld.stepSimulation(

at com.jme3.bullet.PhysicsSpace.update(

at com.jme3.bullet.PhysicsSpace.update(

at com.jme3.bullet.BulletAppState$

at com.jme3.bullet.BulletAppState$

at java.util.concurrent.FutureTask$Sync.innerRun(


at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(

at java.util.concurrent.ScheduledThreadPoolExecutor$

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(

at java.util.concurrent.ThreadPoolExecutor$

… 1 more

Does the visual artifact or exception still happen when you disable physics?

I think that error is a result of some problem before. The MeshCollisionShape expects a properly set up mesh made from triangles. So this is actually another hint that your index/vertex data is messed up.

Disabled the physics and I didn’t get any of these malformed meshes.

Guessing I have to look into the lines where I add my mesh to the physics space.

No you have to look at the lines where the mesh is assembled. It has nothing to do with physics, thats just when you recognize it for the first time because the malformed mesh is causing an exception in the physics collision detection.

take a look at your private inbox diet666 :wink:

check the inbox again :slight_smile: