In PhysX, a material is the property of a physical object that defines the friction and restitution property of an actor, and is used to resolve the collision with other objects. To create a material, call PxPhysics::createMaterial()
, which requires three arguments of type PxReal
; these represent static friction, dynamic friction and restitution, respectively.
A typical example for creating a PhysX material is as follows:
PxMaterial* mMaterial = gPhysicsSDK->createMaterial(0.5,0.5,0.5);
Tip
Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Static friction represents the friction exerted on a rigid body when it is in a rest position, and its value can vary from 0 to infinity. On the other hand, dynamic friction is applicable to a rigid body...