Torque 3D - Script Manual: PxCloth Class Reference

TorqueScript

Main   Class List   Namespace List   Online

PxCloth Class Reference
[Physics]

Rectangular patch of cloth simulated by PhysX. More...

Inheritance diagram for PxCloth:

List of all members.

Public Attributes

PxClothAttachment attachments
 Optional way to specify cloth verts that will be attached to the world position it is created at.
bool bending
 Enables or disables bending resistance.
float bendingStiffness
 Bending stiffness of the cloth in the range 0 to 1.
bool damping
 Enable/disable damping of internal velocities.
float dampingCoefficient
 Spring damping of the cloth in the range 0 to 1.
float density
 Density of the cloth (Mass per Area).
float friction
 Friction coefficient in the range 0 to 1.
string Material
 Name of the material to render.
Point2I samples
 The number of cloth vertices in width and length.
bool selfCollision
 Enables or disables self-collision handling within a single piece of cloth.
Point2F size
 The width and height of the cloth.
float thickness
 Value representing how thick the cloth is.
bool triangleCollision
 Not supported in current release (according to PhysX docs).

Static Public Attributes

static bool isRenderable
 Disables rendering of all instances of this type.
static bool isSelectable
 Disables selection of all instances of this type.

Detailed Description

Rectangular patch of cloth simulated by PhysX.

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.


Member Data Documentation

PxClothAttachment PxCloth::attachments

Optional way to specify cloth verts that will be attached to the world position it is created at.

Enables or disables bending resistance.

Set the bending resistance through PxCloth::bendingStiffness.

Bending stiffness of the cloth in the range 0 to 1.

Enable/disable damping of internal velocities.

Spring damping of the cloth in the range 0 to 1.

Density of the cloth (Mass per Area).

Friction coefficient in the range 0 to 1.

Defines the damping of the velocities of cloth particles that are in contact.

Name of the material to render.

The number of cloth vertices in width and length.

At least two verts should be defined.

Enables or disables self-collision handling within a single piece of cloth.

Point2F PxCloth::size

The width and height of the cloth.

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.

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.



Copyright © GarageGames, LLC. All Rights Reserved.