Collision terrain.raw Vs character.ms3d

hi everybody.

i need to make a collision between  a .raw terrain and a physic  node. i try to put the raw in static node and calculate the collision but that dont work, i think because the raw dont have bounding  volume. this is the code to calculate collision, it  is from 8th tutorial.

    public void performAction( InputActionEvent evt ) {
                ContactInfo contactInfo = (ContactInfo) evt.getTriggerData();
                if ( contactInfo.getNode1() == bases || contactInfo.getNode2() == bases ) {
                     inUpdate=false;
            GameStateManager.getInstance().deactivateChildNamed("landing");
            GameStateManager.getInstance().activateChildNamed("stage2");
                }
            }



can help me  please
thank you

When are are using one of the physics engines, then it doesn't care about the bounding volumes in jME so I don't believe that would be your problem. Can you post a little more code maybe showing how you've added your terrain and character to the physics space?

actually, I believe the Physics engines are entirely dependent on the bounding volumes (except of course trimesh accurate collisions…); the one exception though is generating terrain there I'm not so sure…



Check out the GenerateTerrain physics test (which is a LOT of fun to 'throw' the ball 300 yards w/ a simple mouse gesture  }:-@), I think thats what you are looking for.

The physics engine itself has it's own method of optimizing collisions. Internally it could be octtrees, grid-based, even BSP. jME bounding volumes are used mostly for jME-side collision detection & frustum culling.

if ( contactInfo.getNode1() == bases || contactInfo.getNode2() == bases ) {


Are you sure you're checking the right node here? Try to print out all nodes that you see collision with, and check which one shows up when the physics node hits the ground.
I believe the Physics engines are entirely dependent on the bounding volumes

What I meant by this is that the jME-Physics uses bounding volumes to build the physics engine 'objects', not that the actual bounding volumes are used in calculations...

thanks a lot, mens you rules :slight_smile:

i use the "generate terrain  physics" and i find 1 error in my code



thanks