How make correct collisions with the imported model[Spatial]?


As in the subject.

How can i do it? I have this code:

       Spatial trackModel = ModelLoader.load3ds("data/tracks/rallycross/track.3ds");

        StaticPhysicsNode track = getPhysicsSpace().createStaticNode();
        track.attachChild( trackModel );

        track.setMaterial( Material.CONCRETE);
        track.setLocalScale(new Vector3f( 10f, 10f, 10f ));
        rootNode.attachChild( track );

but after compiling the car is moving on top of bounding box.
I'd like to make it moving on track.
And screen:

Sorry for my English ;/

erm… I can assume your attaching the car to a DynamicPhysicsNode all generated in the same physicsSpace and the PhysicsSpace is being updated correct?


And if i set generatePhysicsGeometry() to true, the car hangs on the point and falls away.

The car is probably moving on top of the bounding box, i'm pretty sure you need to use generatePhysicsGeometry(true);

Do you models have BoundingBoxes at all ?

Yes, all models have BoduningBoxes.

Ok, i was found the problem:

My track was an "open" model.

But thanks for help ;-]

glad you found the issue, what do you mean with a 'open' model ?

ah ok :slight_smile: