Open 3D Engine NvCloth Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
NvCloth::IClothSystem Class Referenceabstract

#include <IClothSystem.h>

Inherited by NvCloth::SystemComponent [protected].

Public Member Functions

 AZ_RTTI (IClothSystem, "{83C01566-D028-4BE8-BE95-0A9DFE6137CA}")
 
virtual ISolverFindOrCreateSolver (const AZStd::string &name)=0
 
virtual void DestroySolver (ISolver *&solver)=0
 
virtual ISolverGetSolver (const AZStd::string &name)=0
 
virtual IClothCreateCloth (const AZStd::vector< SimParticleFormat > &initialParticles, const FabricCookedData &fabricCookedData)=0
 
virtual void DestroyCloth (ICloth *&cloth)=0
 
virtual IClothGetCloth (ClothId clothId)=0
 
virtual bool AddCloth (ICloth *cloth, const AZStd::string &solverName=DefaultSolverName)=0
 
virtual void RemoveCloth (ICloth *cloth)=0
 

Detailed Description

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.

Member Function Documentation

◆ 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
clothThe cloth instance to add to the solver.
solverNameName 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
initialParticlesInitial 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.
fabricCookedDataThe 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
clothThe 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
solverThe 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
nameName 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
clothIdThe 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
nameName 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
clothThe cloth instance to remove from the solver.

Implemented in NvCloth::SystemComponent.


The documentation for this class was generated from the following file: