Plush

GarmentSimulation#

PlushEngine · Type index

Namespace: PlushEngine.Animation (using PlushEngine.Animation;)

Realtime cloth for the garments of one animated object: the parts of its skinned mesh that carry Character Studio's garment data (see SkeletalAnimation.HasGarmentData). Each garment vertex is a particle that follows its skinned place: _PLUSH_HOLD 1 pins it there (collars, waistbands), lower values let it lag, swing and sag, and _PLUSH_MAXDEV bounds how far it may stray. Stretch and bend constraints take their rest lengths from the skinned shape every step, so the cloth never fights the animation; it only adds motion. Each garment's particles are kept outside capsules fitted just inside that garment's rest shape, so an outer garment (a shirt) also stays outside an inner one (trunks). The step runs once per simulation step, after animation, so it sees that step's final pose (IK, pelvis offsets, ragdoll). Change the settings from a script during Play: Entity.Animation.Garments!.Gravity = .5f.

public sealed class GarmentSimulation

Members: Backstop · BendCompliance · Colliders · Damping · Enabled · FollowHalfLife · Gravity · Particles · Reset · StepMilliseconds · StretchCompliance · Substeps · Thickness

Backstop#

public float Backstop { get; set; }

Initial value: .002f

How far (metres) cloth may sink inwards past its skinned place, along the skinned surface normal. Cloth then never shows more of the body underneath than skinning does.

BendCompliance#

public float BendCompliance { get; set; }

Initial value: 2e-4f

Bend compliance (XPBD). Higher folds more easily; 0 is as stiff in bending as in stretch.

Colliders#

public int Colliders { get; }

Number of body capsules the cloth collides with.

Damping#

public float Damping { get; set; }

Initial value: 2.5f

How quickly the cloth's own motion dies away, per second. Higher is heavier, wetter cloth.

Enabled#

public bool Enabled { get; set; }

When false, garments draw exactly where skinning puts them.

FollowHalfLife#

public float FollowHalfLife { get; set; }

Initial value: .35f

Seconds for free cloth to close half the gap back to its skinned place. Lower is snappier.

Gravity#

public float Gravity { get; set; }

Initial value: 1

Multiplies gravity (9.81 m/s² down). 0 makes the cloth weightless; it still swings with motion.

Particles#

public int Particles { get; }

Number of simulated garment vertices.

Reset#

public void Reset();

Puts every garment vertex back on its skinned place on the next step, at rest.

StepMilliseconds#

public float StepMilliseconds { get; }

Milliseconds the last step took (0 while disabled or hidden).

StretchCompliance#

public float StretchCompliance { get; set; }

Initial value: 1e-7f

Stretch compliance (metres per newton, XPBD). 0 is inextensible; around 1e-5 is stretchy jersey.

Substeps#

public int Substeps { get; set; }

Solver substeps per simulation step (1 to 16). More is stiffer and steadier, and costs more.

Thickness#

public float Thickness { get; set; }

Initial value: .004f

Gap kept between the cloth and the body capsules, in metres.

Source#