PxCloth¶
Rectangular patch of cloth simulated by PhysX.
- Inherit:
- GameBase
Description¶
PxCloth is affected by other objects in the simulation but does not itself affect others, it is essentially a visual effect. Eg, shooting at cloth will disturb it but will not explode the projectile.
Be careful with the cloth size and resolution because it can easily become performance intensive to simulate. A single piece of cloth that is very large or high resolution is also much more expensive than multiple pieces that add up to the same number of verts.
Note that most field docs have been copied from their PhysX counterpart.
Fields¶
-
PxClothAttachment
PxCloth
::
attachments
¶ Optional way to specify cloth verts that will be attached to the world position it is created at.
-
bool
PxCloth
::
bending
¶ Enables or disables bending resistance. Set the bending resistance through PxCloth::bendingStiffness .
-
float
PxCloth
::
bendingStiffness
¶ Bending stiffness of the cloth in the range 0 to 1.
-
bool
PxCloth
::
damping
¶ Enable/disable damping of internal velocities.
-
float
PxCloth
::
dampingCoefficient
¶ Spring damping of the cloth in the range 0 to 1.
-
float
PxCloth
::
density
¶ Density of the cloth (Mass per Area).
-
float
PxCloth
::
friction
¶ Friction coefficient in the range 0 to 1. Defines the damping of the velocities of cloth particles that are in contact.
-
string
PxCloth
::
Material
¶ Name of the material to render.
-
Point2I
PxCloth
::
samples
¶ The number of cloth vertices in width and length. At least two verts should be defined.
-
bool
PxCloth
::
selfCollision
¶ Enables or disables self-collision handling within a single piece of cloth.
-
Point2F
PxCloth
::
size
¶ The width and height of the cloth.
-
float
PxCloth
::
thickness
¶ Value representing how thick the cloth is. The thickness is usually a fraction of the overall extent of the cloth and should not be set to a value greater than that. A good value is the maximal distance between two adjacent cloth particles in their rest pose. Visual artifacts or collision problems may appear if the thickness is too small.
-
bool
PxCloth
::
triangleCollision
¶ Not supported in current release (according to PhysX docs). Enables or disables collision detection of cloth triangles against the scene. If not set, only collisions of cloth particles are detected. If set, collisions of cloth triangles are detected as well.