#include <IClothSystem.h>
Inherited by NvCloth::SystemComponent [protected]
.
Interface to the cloth system that allows to create/destroy cloths and solvers.
A default solver is always present in the system.
- Note
- Use AZ::Interface<IClothSystem>::Get() to call the interface.
◆ AddCloth()
virtual bool NvCloth::IClothSystem::AddCloth |
( |
ICloth * |
cloth, |
|
|
const AZStd::string & |
solverName = DefaultSolverName |
|
) |
| |
|
pure virtual |
Adds a cloth instance to a solver. Once a cloth is part of a solver it will be simulated and its events will be signaled. A cloth can only be added to one solver at a time, if the cloth was previously added to another solver it will be removed from it first.
- Parameters
-
cloth | The cloth instance to add to the solver. |
solverName | Name of the solver to add the cloth into. By default the cloth will be added to the default solver. Empty string is an invalid solver name. |
- Returns
- Whether it successfully added cloth to the solver or not.
Implemented in NvCloth::SystemComponent.
◆ CreateCloth()
virtual ICloth* NvCloth::IClothSystem::CreateCloth |
( |
const AZStd::vector< SimParticleFormat > & |
initialParticles, |
|
|
const FabricCookedData & |
fabricCookedData |
|
) |
| |
|
pure virtual |
Creates a cloth instance from a fabric.
- Parameters
-
initialParticles | Initial simulation positions and inverse masses for the cloth to start the simulation. They do not have to be the same positions and inverse masses used to cook the fabric. |
fabricCookedData | The fabric data used to create the cloth. |
- Returns
- The cloth instance or nullptr if unable to create it.
Implemented in NvCloth::SystemComponent.
◆ DestroyCloth()
virtual void NvCloth::IClothSystem::DestroyCloth |
( |
ICloth *& |
cloth | ) |
|
|
pure virtual |
Destroys the cloth instance passed as parameter. Any reference kept to the cloth will be invalid. The cloth be automatically removed from a solver, in case it's still added to one.
- Parameters
-
cloth | The cloth to be destroyed. Variable will be set to nullptr. |
Implemented in NvCloth::SystemComponent.
◆ DestroySolver()
virtual void NvCloth::IClothSystem::DestroySolver |
( |
ISolver *& |
solver | ) |
|
|
pure virtual |
Destroys the solver passed as parameter. Any reference kept to the solver will be invalid. Any cloth the solver still has will be automatically removed.
- Parameters
-
solver | The solver to be destroyed. Variable will be set to nullptr. |
Implemented in NvCloth::SystemComponent.
◆ FindOrCreateSolver()
virtual ISolver* NvCloth::IClothSystem::FindOrCreateSolver |
( |
const AZStd::string & |
name | ) |
|
|
pure virtual |
Looks for a solver and if it cannot find it then it creates it.
- Parameters
-
name | Name the solver. Empty string is an invalid solver name. |
- Returns
- The solver created/found or nullptr if unable to create it.
Implemented in NvCloth::SystemComponent.
◆ GetCloth()
virtual ICloth* NvCloth::IClothSystem::GetCloth |
( |
ClothId |
clothId | ) |
|
|
pure virtual |
Returns a cloth from the system, identified by its id.
- Parameters
-
clothId | The cloth identifier. |
- Returns
- The cloth found or nullptr if it doesn't exist.
Implemented in NvCloth::SystemComponent.
◆ GetSolver()
virtual ISolver* NvCloth::IClothSystem::GetSolver |
( |
const AZStd::string & |
name | ) |
|
|
pure virtual |
Returns a solver from the system, identified by its name.
- Parameters
-
name | Name the solver. Empty string is an invalid name. |
- Returns
- The solver found or nullptr if it doesn't exists.
Implemented in NvCloth::SystemComponent.
◆ RemoveCloth()
virtual void NvCloth::IClothSystem::RemoveCloth |
( |
ICloth * |
cloth | ) |
|
|
pure virtual |
Removes a cloth instance from its solver. Once a cloth is not part of a solver it will not be simulated and its events will not be signaled. If the cloth was not previously part of any solver this function doesn't have any effect.
- Parameters
-
cloth | The cloth instance to remove from the solver. |
Implemented in NvCloth::SystemComponent.
The documentation for this class was generated from the following file:
- Gems/NvCloth/Code/Include/NvCloth/IClothSystem.h