Problem with physics geometry from TriMesh

Hi,



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();
       converter.setProperty("mtllib",url);
       try {
          converter.convert(url.openStream(), BO);
           model = (TriMesh)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
           model.setModelBound(new BoundingBox());
           model.updateModelBound();
           Matrix3f matrix = new Matrix3f();
           matrix.fromAngleAxis(-1.5707f, new Vector3f(1f,0f,0f));
           model.setLocalRotation(matrix);
           model.setLocalTranslation(new Vector3f(0f,-15f,10f));
           model.setLocalScale(5f);
          
           staticNode.attachChild(model);
           staticNode.setMaterial(Material.CONCRETE );
           rootNode.attachChild(staticNode);
           staticNode.generatePhysicsGeometry(true);
       } catch(IOException e) {
          e.printStackTrace();
       }



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.

Thx.

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: