Error when create CollisionShape for terrain

Hi all, I create a terrain using terrain editor in JME, I want to have a CollisionShape for that terrain but I got this error. Can anyone help me solve this problem?



Thanks in advance…



This is the error :



May 23, 2012 8:13:21 PM com.jme3.system.JmeSystem initialize

INFO: Running on jMonkey Engine 3 Alpha 0.6

May 23, 2012 8:13:21 PM com.jme3.system.Natives extractNativeLibs

INFO: Extraction Directory #1: file:/C:/Program%20Files/jmonkeyplatformAlpha4/jmonkeyplatform/libs/

May 23, 2012 8:13:21 PM com.jme3.system.Natives extractNativeLibs

INFO: Extraction Directory #2: C:UsersKenjiDesktopPraktikum GDPTopFinal1

May 23, 2012 8:13:21 PM com.jme3.system.Natives extractNativeLibs

INFO: Extraction Directory #3: C:UsersKenjiDesktopPraktikum GDPTopFinal1

May 23, 2012 8:13:21 PM com.jme3.system.lwjgl.LwjglAbstractDisplay run

INFO: Using LWJGL 2.7.1

May 23, 2012 8:13:21 PM com.jme3.system.lwjgl.LwjglDisplay createContext

INFO: Selected display mode: 800 x 600 x 0 @0Hz

May 23, 2012 8:13:21 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: Display created.

May 23, 2012 8:13:21 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: Adapter: igdumdx32

May 23, 2012 8:13:21 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: Driver Version: 8.15.10.1872

May 23, 2012 8:13:21 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: Vendor: Intel

May 23, 2012 8:13:21 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: OpenGL Version: 2.1.0 - Build 8.15.10.1872

May 23, 2012 8:13:21 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: Renderer: Mobile Intel® 4 Series Express Chipset Family

May 23, 2012 8:13:21 PM com.jme3.system.lwjgl.LwjglAbstractDisplay initInThread

INFO: GLSL Ver: 1.20 - Intel Build 8.15.10.1872

May 23, 2012 8:13:21 PM com.jme3.system.lwjgl.LwjglTimer

INFO: Timer resolution: 1000 ticks per second

May 23, 2012 8:13:21 PM com.jme3.renderer.lwjgl.LwjglRenderer initialize

INFO: Caps: [FrameBuffer, FrameBufferMRT, OpenGL20, OpenGL21, ARBprogram, GLSL100, GLSL110, GLSL120, VertexTextureFetch, FloatTexture, FloatColorBuffer]

May 23, 2012 8:13:21 PM com.jme3.asset.DesktopAssetManager

INFO: DesktopAssetManager created.

May 23, 2012 8:13:21 PM com.jme3.renderer.Camera

INFO: Camera created (W: 800, H: 600)

May 23, 2012 8:13:21 PM com.jme3.renderer.Camera

INFO: Camera created (W: 800, H: 600)

May 23, 2012 8:13:21 PM com.jme3.input.lwjgl.LwjglMouseInput initialize

INFO: Mouse created.

May 23, 2012 8:13:21 PM com.jme3.input.lwjgl.LwjglKeyInput initialize

INFO: Keyboard created.

May 23, 2012 8:13:22 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread

INFO: AudioRenderer supports 64 channels

May 23, 2012 8:13:22 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread

INFO: Audio effect extension version: 1.0

May 23, 2012 8:13:22 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread

INFO: Audio max auxilary sends: 1

May 23, 2012 8:13:22 PM com.jme3.material.MaterialDef

INFO: Loaded material definition: Unshaded

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Gui Node)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (BitmapFont) attached to this node (null)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (null) attached to this node (Statistics View)

May 23, 2012 8:13:22 PM com.jme3.scene.Node attachChild

INFO: Child (Statistics View) attached to this node (Gui Node)

May 23, 2012 8:13:22 PM com.jme3.material.MaterialDef

INFO: Loaded material definition: Default GUI

May 23, 2012 8:13:22 PM com.jme3.asset.DesktopAssetManager

INFO: DesktopAssetManager created.

May 23, 2012 8:13:22 PM com.jme3.material.MaterialDef

INFO: Loaded material definition: Default GUI

May 23, 2012 8:13:22 PM com.jme3.asset.DesktopAssetManager

INFO: DesktopAssetManager created.

May 23, 2012 8:13:22 PM com.jme3.material.MaterialDef

INFO: Loaded material definition: Default GUI

May 23, 2012 8:13:22 PM com.jme3.asset.DesktopAssetManager

INFO: DesktopAssetManager created.

May 23, 2012 8:13:23 PM com.jme3.material.MaterialDef

INFO: Loaded material definition: Default GUI

May 23, 2012 8:13:23 PM com.jme3.scene.Node attachChild

INFO: Child (HUD Picture) attached to this node (Gui Node)

May 23, 2012 8:13:23 PM com.jme3.scene.Node attachChild

INFO: Child (HUD Picture) attached to this node (Gui Node)

May 23, 2012 8:13:23 PM com.jme3.scene.Node attachChild

INFO: Child (HUD Picture) attached to this node (Gui Node)

May 23, 2012 8:13:23 PM com.jme3.scene.Node attachChild

INFO: Child (HUD Picture) attached to this node (Gui Node)

May 23, 2012 8:13:23 PM com.jme3.scene.Node attachChild

INFO: Child (HUD Picture) attached to this node (Gui Node)

May 23, 2012 8:13:23 PM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation

INFO: Uniform m_VertexColor is not declared in shader.

May 23, 2012 8:13:24 PM com.jme3.scene.Node detachChildAt

INFO: Child removed.

May 23, 2012 8:13:24 PM com.jme3.scene.Node detachChildAt

INFO: Child removed.

May 23, 2012 8:13:24 PM com.jme3.scene.Node detachChildAt

INFO: Child removed.

May 23, 2012 8:13:24 PM com.jme3.scene.Node detachChildAt

INFO: Child removed.

May 23, 2012 8:13:24 PM com.jme3.scene.Node detachChildAt

INFO: Child removed.

May 23, 2012 8:13:24 PM com.jme3.scene.Node detachChildAt

INFO: Child removed.

May 23, 2012 8:13:24 PM com.jme3.scene.Node detachChildAt

INFO: Child removed.

May 23, 2012 8:13:24 PM com.jme3.scene.Node detachAllChildren

INFO: All children removed.

May 23, 2012 8:13:24 PM com.jme3.material.MaterialDef

INFO: Loaded material definition: Terrain Lighting

May 23, 2012 8:13:24 PM com.jme3.app.Application handleError

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.IndexOutOfBoundsException: 2193

at java.nio.DirectIntBufferU.get(DirectIntBufferU.java:239)

at com.jme3.scene.mesh.IndexIntBuffer.get(IndexIntBuffer.java:52)

at com.jme3.bullet.util.Converter.convert(Converter.java:248)

at com.jme3.bullet.collision.shapes.MeshCollisionShape.createCollisionMesh(MeshCollisionShape.java:70)

at com.jme3.bullet.collision.shapes.MeshCollisionShape.(MeshCollisionShape.java:65)

at com.jme3.bullet.util.CollisionShapeFactory.createSingleMeshShape(CollisionShapeFactory.java:174)

at com.jme3.bullet.util.CollisionShapeFactory.createCompoundShape(CollisionShapeFactory.java:65)

at com.jme3.bullet.util.CollisionShapeFactory.createCompoundShape(CollisionShapeFactory.java:62)

at com.jme3.bullet.util.CollisionShapeFactory.createCompoundShape(CollisionShapeFactory.java:85)

at com.jme3.bullet.util.CollisionShapeFactory.createMeshCompoundShape(CollisionShapeFactory.java:94)

at com.jme3.bullet.util.CollisionShapeFactory.createMeshShape(CollisionShapeFactory.java:134)

at mygame.Main.initGames(Main.java:266)

at mygame.Main.simpleUpdate(Main.java:227)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:241)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:158)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:203)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:221)

at java.lang.Thread.run(Thread.java:722)

Pass the actual TerrainQuad to the CollisionShape.createMeshShape()

I don’t use terrainQuad, but spatial, because I load it from assetManager…This is my code, any mistake?



Spatial terrain = assetManager.loadModel(“Scenes/MyTerrain.j3o”);

terrain.setLocalScale(10f);

terrain.setLocalTranslation(10, -5, 50);

terrain.rotate(0, 1, 0);

cam.setLocation(new Vector3f(-10, 3, -40));

cam.setDirection(new Vector3f(0, 0.3f, 1));



CollisionShape sceneShape = CollisionShapeFactory.createMeshShape(terrain);

landscape = new RigidBodyControl(sceneShape, 0) ;

terrain.addControl(landscape);

Do you use vanilla beta 3.0? Update the SDK to the latest stable version.

No, I use JME Alpha 4…My graphic card only can process openGL ver 2.1.0, so in the latest version I can’t use the terrain editor.

Then you’re out of luck. The mesh isn’t a proper triangle mesh and cannot be used. The newer versions of jme produce a proper mesh in this case.

Oh, ok thank for the solution…



btw, I want to ask, what is the minimum requirement graphic card spec to run the latest version of JME?

Its always OpenGL2, also terrain should work if your card properly supports OpenGL2.

The terrain material doesn’t do anything different than the lighting material in terms of opengl functionality. What gfx card do you have, and do you have the most up-to-date drivers?

Check your imports, it’s possible that you imported something wrong so it fails?

Happened to me yesterday, same problem

Actually the minimum requirement for jME3 is OpenGL1 (assuming you choose that the OpenGL1 renderer or turn on automatic selection). However for the terrain shader to work correctly, OpenGL2 is required.