- Cylinder aren´t possible (yet) in PhysX 3.x - in the 2.x versions there was a method for it.
Hard way and “exactly” shapes:
You can create an convex mesh - you need to cook the mesh from the infos you got.
Or a static mesh of course. Depended what you want to archiev.
[In your case, you need to pass the triangle data and stuff from the Ogre mesh to your convex cooker]
Easy way using simple shapes:
(The collision meshs are not accurate, thus its not recommended if you need “exact” results)
-> Build your cylinder with some PxShapes which uses PxBoxGeometry, and PxSphereGeometry, or PxCapsuleGeometry -
or use 2 PxShapes [PxSpehere] wich is at the bottom and the top of the barrel.
Simple, but inaccurate.
You need adjust your materials of your PxActors for getting these effects.
Just imagine a 1000kg rock and a 0.01kg feather falls from 100 meter high.
Which one will be the first hitting the ground?
- Answer. They hits the ground almost at the same time.
Thats the behaviour of gravity. If you want to have “more realistic” physics, like
the feather would take much longer than the rock to fall down on the ground, you need
to add forces to simulate “air friction” (dont know if this is the english word for it.)
I dont know if you can scale the gravity for each PxActor, if so, this is an alternative.
(Not needed for my projects yet)
There is also another setting for PxRigidDynamics:
which might be worth to mention if you testing the behaviour of PxActors.