Skip to main content

Posts

Showing posts from February, 2016

jMonkeyEngine Terrain Collision

Hi there,this time I'll write in English, because this will be interesting for people world wide. As it took my a very long time to find out and understand how to use Terrain created with the Terrain Editor in JME3 and especially how to add a collider to it, I'll share my knowledge with you. The biggest problem in here is, that it is very hard to debug, as the terrain collider is not drawn by the Debug Renderer since it's a heightmap. First of all, don't try scaling in programmatically, it didn't work for me. Instead I used the properties view and changed the parent nodes scale property in there. NOT the child nodes properties! But wait, I'll give you a code snippet and some screenshots. Code Example: 1: 2: bulletAppState = new BulletAppState(); // For Collision Handling 3: stateManager.attach(bulletAppState); 4: 5: // Terrain 6: Spatial gameLevel = assetManager.loadModel("Scenes/myTerrain.j3o"); 7: