Open 3D Engine NvCloth Gem API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
Implementation of the ICloth and IClothConfigurator interfaces. More...
#include <Cloth.h>
Inherits NvCloth::ICloth, and NvCloth::IClothConfigurator.
Public Member Functions | |
AZ_RTTI (Cloth, "{D9DEED18-FEF2-440B-8639-A080F8C1F6DB}", ICloth) | |
Cloth (ClothId id, const AZStd::vector< SimParticleFormat > &initialParticles, Fabric *fabric, NvClothUniquePtr nvCloth) | |
Fabric * | GetFabric () |
Returns the fabric used to create this cloth. | |
Solver * | GetSolver () |
Returns the solver this cloth is added to or nullptr if it's not part of any solver. | |
void | Update () |
Retrieves the latest simulation data from NvCloth and updates the particles. | |
ClothId | GetId () const override |
Returns the cloth identifier. | |
const AZStd::vector< SimParticleFormat > & | GetInitialParticles () const override |
Returns the list of particles (positions and inverse mass) used when the cloth was created. | |
const AZStd::vector< SimIndexType > & | GetInitialIndices () const override |
Returns the list of triangles' indices used when the cloth's fabric was created. | |
const AZStd::vector< SimParticleFormat > & | GetParticles () const override |
Returns the current list of particles (positions and inverse mass) of cloth. | |
void | SetParticles (const AZStd::vector< SimParticleFormat > &particles) override |
void | SetParticles (AZStd::vector< SimParticleFormat > &&particles) override |
void | DiscardParticleDelta () override |
const FabricCookedData & | GetFabricCookedData () const override |
Returns the FabricCookedData used when the cloth was created. | |
IClothConfigurator * | GetClothConfigurator () override |
void | SetTransform (const AZ::Transform &transformWorld) override |
Sets world transform to cloth. | |
void | ClearInertia () override |
Clears inertia derived from SetTransform to zero. | |
void | SetMass (float mass) override |
void | SetGravity (const AZ::Vector3 &gravity) override |
Gravity applied to cloth during simulation. | |
void | SetStiffnessFrequency (float frequency) override |
void | SetDamping (const AZ::Vector3 &damping) override |
void | SetDampingLinearDrag (const AZ::Vector3 &linearDrag) override |
void | SetDampingAngularDrag (const AZ::Vector3 &angularDrag) override |
void | SetLinearInertia (const AZ::Vector3 &linearInertia) override |
void | SetAngularInertia (const AZ::Vector3 &angularInertia) override |
void | SetCentrifugalInertia (const AZ::Vector3 ¢rifugalInertia) override |
void | SetWindVelocity (const AZ::Vector3 &velocity) override |
void | SetWindDragCoefficient (float drag) override |
void | SetWindLiftCoefficient (float lift) override |
void | SetWindFluidDensity (float density) override |
void | SetCollisionFriction (float friction) override |
void | SetCollisionMassScale (float scale) override |
void | EnableContinuousCollision (bool value) override |
void | SetCollisionAffectsStaticParticles (bool value) override |
Enables/Disables colliders affecting static particles (inverse mass 0.0). | |
void | SetSelfCollisionDistance (float distance) override |
void | SetSelfCollisionStiffness (float stiffness) override |
void | SetVerticalPhaseConfig (float stiffness, float stiffnessMultiplier, float compressionLimit, float stretchLimit) override |
void | SetHorizontalPhaseConfig (float stiffness, float stiffnessMultiplier, float compressionLimit, float stretchLimit) override |
void | SetBendingPhaseConfig (float stiffness, float stiffnessMultiplier, float compressionLimit, float stretchLimit) override |
void | SetShearingPhaseConfig (float stiffness, float stiffnessMultiplier, float compressionLimit, float stretchLimit) override |
void | SetTetherConstraintStiffness (float stiffness) override |
void | SetTetherConstraintScale (float scale) override |
void | SetSolverFrequency (float frequency) override |
void | SetAcceleationFilterWidth (AZ::u32 width) override |
void | SetSphereColliders (const AZStd::vector< AZ::Vector4 > &spheres) override |
void | SetSphereColliders (AZStd::vector< AZ::Vector4 > &&spheres) override |
void | SetCapsuleColliders (const AZStd::vector< AZ::u32 > &capsuleIndices) override |
void | SetCapsuleColliders (AZStd::vector< AZ::u32 > &&capsuleIndices) override |
void | SetMotionConstraints (const AZStd::vector< AZ::Vector4 > &constraints) override |
void | SetMotionConstraints (AZStd::vector< AZ::Vector4 > &&constraints) override |
void | ClearMotionConstraints () override |
Clear the list of motion constraints. | |
void | SetMotionConstraintsScale (float scale) override |
void | SetMotionConstraintsBias (float bias) override |
void | SetMotionConstraintsStiffness (float stiffness) override |
void | SetSeparationConstraints (const AZStd::vector< AZ::Vector4 > &constraints) override |
void | SetSeparationConstraints (AZStd::vector< AZ::Vector4 > &&constraints) override |
void | ClearSeparationConstraints () override |
Clear the list of separation constraints. | |
Public Member Functions inherited from NvCloth::ICloth | |
AZ_RTTI (ICloth, "{78817F38-E4A5-4B94-BCD8-3E3B73F66B5A}") | |
void | ConnectPreSimulationEventHandler (PreSimulationEvent::Handler &handler) |
void | ConnectPostSimulationEventHandler (PostSimulationEvent::Handler &handler) |
Friends | |
class | Solver |
Additional Inherited Members | |
Public Types inherited from NvCloth::ICloth | |
using | PreSimulationEvent = AZ::Event< ClothId, float > |
using | PostSimulationEvent = AZ::Event< ClothId, float, const AZStd::vector< SimParticleFormat > & > |
Protected Attributes inherited from NvCloth::ICloth | |
PreSimulationEvent | m_preSimulationEvent |
PostSimulationEvent | m_postSimulationEvent |
Implementation of the ICloth and IClothConfigurator interfaces.
|
overridevirtual |
Makes current and previous particles the same, the next simulation will not have any effect since delta positions will be zero.
Implements NvCloth::ICloth.
|
overridevirtual |
Enables/Disables continuous collision detection. Enabling it improves collision by computing time of impact between cloth particles and colliders.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Returns the interface to IClothConfigurator to set all cloth parameters that define its behavior during simulation.
Implements NvCloth::ICloth.
|
overridevirtual |
Number of iterations to average delta time factor used for gravity and external acceleration. Width valid values are > 0.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Portion of angular acceleration applied to turning particles. 0.0: Particles are unaffected. 1.0: Physically correct.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Configures bending constraints parameters.
stiffness | Stiffness value of bending constraints. 0.0: no bending constraints. |
stiffnessMultiplier | Scale value for compression and stretch limits. 0.0: No horizontal compression and stretch limits applied. 1.0: Fully apply compression and stretch limits. |
compressionLimit | Compression limit for bending constraints. 0.0: No compression. |
stretchLimit | Stretch limit for bending constraints. Reduce stiffness of tether constraints (or increase its scale beyond 1.0) to allow cloth to stretch. 0.0: No stretching. |
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Set a list of capsules to collide with cloth's particles (rvalue overload). Each capsule is formed by 2 indices to sphere colliders.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Set a list of capsules to collide with cloth's particles. Each capsule is formed by 2 indices to sphere colliders.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Portion of angular velocity applied to turning particles. 0.0: Particles are unaffected. 1.0: Physically correct.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Amount of friction with colliders. 0.0: No friction. Friction valid values are >= 0.0.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Controls how quickly mass is increased during collisions. 0.0: No mass scaling. Scale valid values are >= 0.0.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Damping of particles' velocity. 0.0: Velocity is unaffected. 1.0: Velocity is zeroed.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Portion of angular velocity applied to turning particles. 0.0: Particles is unaffected. 1.0: Damped global particle angular velocity.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Portion of velocity applied to particles. 0.0: Particles is unaffected. 1.0: Damped global particle velocity.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Configures horizontal constraints parameters.
stiffness | Stiffness value of horizontal constraints. 0.0: no horizontal constraints. |
stiffnessMultiplier | Scale value for compression and stretch limits. 0.0: No horizontal compression and stretch limits applied. 1.0: Fully apply compression and stretch limits. |
compressionLimit | Compression limit for horizontal constraints. 0.0: No compression. |
stretchLimit | Stretch limit for horizontal constraints. Reduce stiffness of tether constraints (or increase its scale beyond 1.0) to allow cloth to stretch. 0.0: No stretching. |
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Portion of acceleration applied to particles. 0.0: Particles are unaffected. 1.0: Physically correct.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Mass scale applied to all particles, zero makes all particles static.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Sets the motion constraints (positions and radius) for cloth. Each particle's movement during simulation will be limited to the volume of a sphere.
constraints | List of constraints (positions and radius) to set (rvalue overload). |
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Sets the motion constraints (positions and radius) for cloth. Each particle's movement during simulation will be limited to the volume of a sphere.
constraints | List of constraints (positions and radius) to set. |
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Sets the bias to be applied to all motion constraints. The bias value will be added to the radius of all motion constraints.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Sets the scale to be applied to all motion constraints. The radius of all motion constraints will be multiplied by the scale.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Stiffness for motion constraints. Stiffness range is [0.0, 1.0].
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Sets the current particles (positions and inverse mass) for cloth.
particles | List of particles to set (rvalue overload). |
Implements NvCloth::ICloth.
|
overridevirtual |
Sets the current particles (positions and inverse mass) for cloth.
particles | List of particles to set. |
Implements NvCloth::ICloth.
|
overridevirtual |
Meters that particles need to be separated from each other. 0.0: No self collision. Distance valid values are > 0.0.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Stiffness for the self collision constraints. 0.0: No self collision. Stiffness range is [0.0, 1.0].
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Sets the separation constraints (positions and radius) for cloth. Each particle's movement during simulation will be kept outside the volume of a sphere.
constraints | List of constraints (positions and radius) to set (rvalue overload). |
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Sets the separation constraints (positions and radius) for cloth. Each particle's movement during simulation will be kept outside the volume of a sphere.
constraints | List of constraints (positions and radius) to set. |
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Configures shearing constraints parameters.
stiffness | Stiffness value of shearing constraints. 0.0: no shearing constraints. |
stiffnessMultiplier | Scale value for compression and stretch limits. 0.0: No horizontal compression and stretch limits applied. 1.0: Fully apply compression and stretch limits. |
compressionLimit | Compression limit for shearing constraints. 0.0: No compression. |
stretchLimit | Stretch limit for shearing constraints. Reduce stiffness of tether constraints (or increase its scale beyond 1.0) to allow cloth to stretch. 0.0: No stretching. |
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Target solver iterations per second. At least 1 iteration per frame will be solved regardless of the value set. Frequency valid values are >= 0.0.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Set a list of spheres to collide with cloth's particles (rvalue overload). x,y,z represents the position and w the radius of the sphere.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Set a list of spheres to collide with cloth's particles. x,y,z represents the position and w the radius of the sphere.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Stiffness exponent per second applied to damping, damping dragging, wind dragging, wind lifting, self collision stiffness, fabric stiffness, fabric compression, fabric stretch, tether constraint stiffness and motion constraints stiffness. Stiffness frequency valid values are > 0.0.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Tether constraints scale. Scale valid values are >= 0.0.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Stiffness for tether constraints. 0.0: No tether constraints applied. 1.0: Makes the constraints behave springy. Stiffness range is [0.0, 1.0].
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Configures vertical constraints parameters.
stiffness | Stiffness value of vertical constraints. 0.0: no vertical constraints. |
stiffnessMultiplier | Scale value for compression and stretch limits. 0.0: No horizontal compression and stretch limits applied. 1.0: Fully apply compression and stretch limits. |
compressionLimit | Compression limit for vertical constraints. 0.0: No compression. |
stretchLimit | Stretch limit for vertical constraints. Reduce stiffness of tether constraints (or increase its scale beyond 1.0) to allow cloth to stretch. 0.0: No stretching. |
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Amount of air drag. Wind drag range is [0.0, 1.0].
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Density of air used for air drag and lift calculations. Fluid density valid values are > 0.0.
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Amount of air lift. Wind lift range is [0.0, 1.0].
Implements NvCloth::IClothConfigurator.
|
overridevirtual |
Wind in global coordinates acting on cloth's triangles. Disabled when both wind air coefficients are zero. Wind velocity range is [-50.0, 50.0].
Implements NvCloth::IClothConfigurator.