#include <SystemComponent.h>
Inherits AZ::Component, NvCloth::IClothSystem, and AZ::TickBus::Handler.
|
static void | Reflect (AZ::ReflectContext *context) |
|
static void | GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided) |
|
static void | GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible) |
|
static void | GetRequiredServices (AZ::ComponentDescriptor::DependencyArrayType &required) |
|
static void | InitializeNvClothLibrary () |
|
static void | TearDownNvClothLibrary () |
|
static bool | CheckLastClothError () |
| Returns true when there is no error reported.
|
|
static void | ResetLastClothError () |
| Resets the last error reported by NvCloth.
|
|
Implementation of the IClothSystem interface.
This class has the responsibility to initialize and tear down NvCloth library. It owns all Solvers, Cloths and Fabrics, and it manages their creation and destruction. It's also the responsible for updating (on Physics Tick) all the solvers that are not flagged as "user simulated".
◆ AddCloth()
bool NvCloth::SystemComponent::AddCloth |
( |
ICloth * |
cloth, |
|
|
const AZStd::string & |
solverName = DefaultSolverName |
|
) |
| |
|
overrideprotectedvirtual |
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.
Implements NvCloth::IClothSystem.
◆ CreateCloth()
ICloth* NvCloth::SystemComponent::CreateCloth |
( |
const AZStd::vector< SimParticleFormat > & |
initialParticles, |
|
|
const FabricCookedData & |
fabricCookedData |
|
) |
| |
|
overrideprotectedvirtual |
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.
Implements NvCloth::IClothSystem.
◆ DestroyCloth()
void NvCloth::SystemComponent::DestroyCloth |
( |
ICloth *& |
cloth | ) |
|
|
overrideprotectedvirtual |
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. |
Implements NvCloth::IClothSystem.
◆ DestroySolver()
void NvCloth::SystemComponent::DestroySolver |
( |
ISolver *& |
solver | ) |
|
|
overrideprotectedvirtual |
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. |
Implements NvCloth::IClothSystem.
◆ FindOrCreateSolver()
ISolver* NvCloth::SystemComponent::FindOrCreateSolver |
( |
const AZStd::string & |
name | ) |
|
|
overrideprotectedvirtual |
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.
Implements NvCloth::IClothSystem.
◆ GetCloth()
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.
Implements NvCloth::IClothSystem.
◆ GetSolver()
ISolver* NvCloth::SystemComponent::GetSolver |
( |
const AZStd::string & |
name | ) |
|
|
overrideprotectedvirtual |
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.
Implements NvCloth::IClothSystem.
◆ RemoveCloth()
void NvCloth::SystemComponent::RemoveCloth |
( |
ICloth * |
cloth | ) |
|
|
overrideprotectedvirtual |
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. |
Implements NvCloth::IClothSystem.
The documentation for this class was generated from the following file:
- Gems/NvCloth/Code/Source/System/SystemComponent.h