Node as DynamicPhysicsObject

I'm importing a model and I woulk like to set as a DynamicPhysicsObject.

Running my application, it reports


java.lang.NoSuchMethodError: com.jme.scene.Geometry.getModelBound()Lcom/jme/bounding/BoundingVolume;
   at com.jmex.physics.PhysicsWorld.stripNode(PhysicsWorld.java:520)
   at com.jmex.physics.PhysicsWorld.createNode(PhysicsWorld.java:461)
   at com.jmex.physics.PhysicsWorld.createPhysicalEntity(PhysicsWorld.java:366)
   at com.jmex.physics.DynamicPhysicsObject.<init>(DynamicPhysicsObject.java:86)
   at it.local.main.Main.initGame(Main.java:175)
   at com.jme.app.BaseGame.start(Unknown Source)



Seems it's not possibile since it's a Node and not a Geometry, isn't it ?

If it was not possible, tell me how I can I relate my player to the physic world.

It is possible. The error you are getting results from using incompatible jars together.



If you have the source of jME and jME Physics 2 simply rebuild (clean) your workspace/projects. When you are using precompiled jars make sure to get new compatible versions (the jME Physics 2 releases come with matching jME snapshots; the jME Nightly works with current jME Physics 2 snapshots).

I try, thanks by now.

I have a question regarding that topic.

If I add a imported Model to a node make it a child of a staticphysicsNode and the Shape is concav.

When there is a collision it is calculated with the Bounding box or the Model inside the physicsnode itself?


Collisions are only calculated between physics geometries. Those can be created manually, or with the generate method. They can be primitives (sphere, box, capsule, cylinder…) or trimeshes. You can view the physics geometries in a SimplePhysicsGame by pressing [v] - physics trimeshes are not additionally visualized, though.