jME3 Hello Collision - Error

HI al,

If I try to run the jme3 hello collision tutorial I get following error:

[java]ava.lang.ClassCastException: com.jme3.scene.Geometry

at hellojme3.Main.simpleInitApp(



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



And I get the error in this part:

[java] assetManager.registerLocator(“Model/”, FileLocator.class.getName());

scene = assetManager.loadModel(“X.obj”);

scene.scale(0.1f, 0.1f, 0.1f);


DirectionalLight light = new DirectionalLight();

light.setDirection(new Vector3f(1, -1, -1));



bulletAppState = new BulletAppState();


CompoundCollisionShape sceneShape = CollisionShapeFactory.createMeshCompoundShape((Node) scene);

PhysicsNode landscape = new PhysicsNode(scene, sceneShape, 0);


I don’t understand what’s the error?

you try to put something that is a Geometry into something that is not, at line 56 of your class.

what is line 56?

line 56:

CompoundCollisionShape sceneShape = CollisionShapeFactory.createMeshCompoundShape((Node) scene);

And the scene Object is a Geometry?

If so…you try to cast a geometry into a node…thus the error.

try to create a node object, attach the scene object to it , then attach the node to the rootNode and use it for your compound shape.

Why make it a node in the first place? A Geometry is fine…