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.
NvCloth::ICloth Class Referenceabstract

#include <ICloth.h>

Inherited by NvCloth::Cloth.

Public Types

using PreSimulationEvent = AZ::Event< ClothId, float >
 
using PostSimulationEvent = AZ::Event< ClothId, float, const AZStd::vector< SimParticleFormat > & >
 

Public Member Functions

 AZ_RTTI (ICloth, "{78817F38-E4A5-4B94-BCD8-3E3B73F66B5A}")
 
virtual ClothId GetId () const =0
 Returns the cloth identifier.
 
virtual const AZStd::vector< SimParticleFormat > & GetInitialParticles () const =0
 Returns the list of particles (positions and inverse mass) used when the cloth was created.
 
virtual const AZStd::vector< SimIndexType > & GetInitialIndices () const =0
 Returns the list of triangles' indices used when the cloth's fabric was created.
 
virtual const AZStd::vector< SimParticleFormat > & GetParticles () const =0
 Returns the current list of particles (positions and inverse mass) of cloth.
 
virtual void SetParticles (const AZStd::vector< SimParticleFormat > &particles)=0
 
virtual void SetParticles (AZStd::vector< SimParticleFormat > &&particles)=0
 
virtual void DiscardParticleDelta ()=0
 
virtual const FabricCookedDataGetFabricCookedData () const =0
 Returns the FabricCookedData used when the cloth was created.
 
virtual IClothConfiguratorGetClothConfigurator ()=0
 
void ConnectPreSimulationEventHandler (PreSimulationEvent::Handler &handler)
 
void ConnectPostSimulationEventHandler (PostSimulationEvent::Handler &handler)
 

Protected Attributes

PreSimulationEvent m_preSimulationEvent
 
PostSimulationEvent m_postSimulationEvent
 

Detailed Description

Interface to a cloth in the system. A cloth is formed of particles that are simulated with a series of constraints specified by a fabric. A cloth must be added to a solver to be simulated.

Note
Use IClothSystem interface to obtain a cloth from the system.

Member Typedef Documentation

◆ PostSimulationEvent

using NvCloth::ICloth::PostSimulationEvent = AZ::Event<ClothId, float, const AZStd::vector<SimParticleFormat>&>

Event signaled after running simulation.

Parameters
(Unnamed)The cloth identifier.
(Unnamed)Delta time.
(Unnamed)New particles (positions and inverse masses) result of running the simulation.

◆ PreSimulationEvent

using NvCloth::ICloth::PreSimulationEvent = AZ::Event<ClothId, float>

Event signaled before running simulation.

Parameters
(Unnamed)The cloth identifier.
(Unnamed)Delta time

Member Function Documentation

◆ ConnectPostSimulationEventHandler()

void NvCloth::ICloth::ConnectPostSimulationEventHandler ( PostSimulationEvent::Handler &  handler)
inline

Connects a handler to the PostSimulationEvent. Note that the events can be triggered from multiple threads at the same time. Please make sure the handler is reentrant and thread-safe.

◆ ConnectPreSimulationEventHandler()

void NvCloth::ICloth::ConnectPreSimulationEventHandler ( PreSimulationEvent::Handler &  handler)
inline

Connects a handler to the PreSimulationEvent. Note that the events can be triggered from multiple threads at the same time. Please make sure the handler is reentrant and thread-safe.

◆ DiscardParticleDelta()

virtual void NvCloth::ICloth::DiscardParticleDelta ( )
pure virtual

Makes current and previous particles the same, the next simulation will not have any effect since delta positions will be zero.

Implemented in NvCloth::Cloth.

◆ GetClothConfigurator()

virtual IClothConfigurator* NvCloth::ICloth::GetClothConfigurator ( )
pure virtual

Returns the interface to IClothConfigurator to set all cloth parameters that define its behavior during simulation.

Implemented in NvCloth::Cloth.

◆ SetParticles() [1/2]

virtual void NvCloth::ICloth::SetParticles ( AZStd::vector< SimParticleFormat > &&  particles)
pure virtual

Sets the current particles (positions and inverse mass) for cloth.

Parameters
particlesList of particles to set (rvalue overload).
Note
This function results in a copy of all particle data to NvCloth and therefore it's not a fast operation.

Implemented in NvCloth::Cloth.

◆ SetParticles() [2/2]

virtual void NvCloth::ICloth::SetParticles ( const AZStd::vector< SimParticleFormat > &  particles)
pure virtual

Sets the current particles (positions and inverse mass) for cloth.

Parameters
particlesList of particles to set.
Note
This function results in a copy of all particle data to NvCloth and therefore it's not a fast operation.

Implemented in NvCloth::Cloth.


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