Create CollisonShape does not work!

The new PhysicEngine give me some headaches.



*) physic.setGravity(Vector3f.ZERO);

does not work! I can’t disable gravity.



*) CollisionShapeFactory.createMeshShape(physic_mesh);

can’t create CollisionShape!

“new PhysicsRigidBodyControl(1);” is useless, when the Ogre mesh has no CollsionShape.

Therefore each of my models has no collisions and is just affected by gravity.



*) Why can the hovertank use a premade CollisionShape? How can I create such a shape? Where is it stored?

This shape seems to be able to work 100% dynamic! Can this shapes collide with each other?



I think the new system is great. Its just I don’t know how to use it!

  1. You have to either set the gravity to the physicsspace first and then add the object or add the object and then set the gravity to the object. The current gravity of the space is set to the object when its added. This has not changed btw.
  2. Define “cant create”. A Mesh accurate shape cannot be moved, you have to use Hull or GImpact shapes when you use dynamic meshes, GImpact is very resource hungry so Hull is the default “dynamic” shape.

    new PhysicsRigidBodyControl(1); creates a HullCollisionShape or a CompoundCollisionShape with HullCollisionShapes as children for each of the Geometries of the Node its attached to. So you need some Geometries as this Spatials children or the Spatial has to be a Geometry, otherwise no CollisionShape can be created. You can also supply a manually made CollisionShape to the constructor if you want. Again, nothing has changed here except the automatic generation when you dont supply a CollisionShape
  3. Its just a HullCollisionShape, I think the tests uses the CollisionShapeFactory directly, just look at the code.

Mhh, strange…

Seems no HullCollisionShape can be created with my models.

You use the Blender exporter, right? Seems Maya Exporter isn’t a good choice

Use the blender exporter for what?

To get a working ogre xml

Did you update to the latest nightly, Momoko fixed a bug he added in HullCollisionShape. I am using blender 2.49 and the OgreXML exporters supplied by jMP.