Problem with physics geometry from TriMesh


I'm playing arround with the TestVehicle. Instead of the box floor, I use an imported .obj which presents a race track.

Now, the first .obj I've imported happend to be a Node.

By attaching this node to my StaticPhysicsNode and staticNode.generatePhysicsGeometry(true) everything works fine.

But another .obj that i have imported happend to be a TriMesh or Spatial. With the following code my car falls through the floor:

       URL url = RRImportTest.class.getClassLoader().getResource(OBJFileName);
       FormatConverter converter = new ObjToJme();
       ByteArrayOutputStream BO = new ByteArrayOutputStream();
       try {
          converter.convert(url.openStream(), BO);
           model = (TriMesh)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
           model.setModelBound(new BoundingBox());
           Matrix3f matrix = new Matrix3f();
           matrix.fromAngleAxis(-1.5707f, new Vector3f(1f,0f,0f));
           model.setLocalTranslation(new Vector3f(0f,-15f,10f));
           staticNode.setMaterial(Material.CONCRETE );
       } catch(IOException e) {

I also tried PhysicsMesh, but it did not help.

Any ideas?

Console output is: Object:Plane_Plane btw. Don't really know what that means. With the other .obj files output is curved_mesh when i remember correct.


It should not matter wether you have a node with trimeshes or a single trimesh attached. What's different with your second model? Does it have normals?

Ok, you're right, the normals were the reason. They were pointing to the wrong direction. Wups. :frowning: