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::ISolver Class Referenceabstract

#include <ISolver.h>

Inherited by NvCloth::Solver.

Public Types

using PreSimulationEvent = AZ::Event< const AZStd::string &, float >
 
using PostSimulationEvent = AZ::Event< const AZStd::string &, float >
 

Public Member Functions

 AZ_RTTI (ISolver, "{4077FEB2-78E3-4A8F-AA33-67446E6ECD1F}")
 
virtual const AZStd::string & GetName () const =0
 Returns name of the solver.
 
virtual void Enable (bool value)=0
 
virtual bool IsEnabled () const =0
 Returns whether the solver is enabled or not.
 
virtual void SetUserSimulated (bool value)=0
 
virtual bool IsUserSimulated () const =0
 Returns whether the solver StartSimulation and FinishSimulation functions will be called by the user or the cloth system.
 
virtual void StartSimulation (float deltaTime)=0
 
virtual void FinishSimulation ()=0
 
virtual void SetInterCollisionDistance (float distance)=0
 
virtual void SetInterCollisionStiffness (float stiffness)=0
 
virtual void SetInterCollisionIterations (AZ::u32 iterations)=0
 
void ConnectPreSimulationEventHandler (PreSimulationEvent::Handler &handler)
 Connects a handler to the PreSimulationEvent.
 
void ConnectPostSimulationEventHandler (PostSimulationEvent::Handler &handler)
 Connects a handler to the PostSimulationEvent.
 

Protected Attributes

PreSimulationEvent m_preSimulationEvent
 
PostSimulationEvent m_postSimulationEvent
 

Detailed Description

Interface to a solver in the system. A solver contains cloth instances and they run simulation to all of them.

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

Member Typedef Documentation

◆ PostSimulationEvent

using NvCloth::ISolver::PostSimulationEvent = AZ::Event<const AZStd::string&, float>

Event signaled after running simulation in the solver.

Parameters
(Unnamed)Name of the solver.
(Unnamed)Delta time.

◆ PreSimulationEvent

using NvCloth::ISolver::PreSimulationEvent = AZ::Event<const AZStd::string&, float>

Event signaled before running simulation in the solver.

Parameters
(Unnamed)Name of the solver.
(Unnamed)Delta time

Member Function Documentation

◆ Enable()

virtual void NvCloth::ISolver::Enable ( bool  value)
pure virtual

Enable or disable running simulation on the solver. When the solver is disabled it won't run simulation and its events will not be signaled.

Implemented in NvCloth::Solver.

◆ FinishSimulation()

virtual void NvCloth::ISolver::FinishSimulation ( )
pure virtual

Complete the simulation process. If the solver is in user-simulated mode the user is responsible for calling this function. Note: This is a blocking call that will wait for the simulation jobs to complete.

Implemented in NvCloth::Solver.

◆ SetInterCollisionDistance()

virtual void NvCloth::ISolver::SetInterCollisionDistance ( float  distance)
pure virtual

Specifies the distance (meters) that cloths' particles need to be separated from each other. Inter-collision refers to collisions between different cloth instances in the solver, do not confuse with self-collision, which is available per cloth through IClothConfigurator. When distance is 0 inter-collision is disabled (default).

Note
Using inter-collision with more than 32 cloths added to the solver will cause undefined behavior.

Implemented in NvCloth::Solver.

◆ SetInterCollisionIterations()

virtual void NvCloth::ISolver::SetInterCollisionIterations ( AZ::u32  iterations)
pure virtual

Sets the number of iterations the solver will do during inter-collision. Default value is 1.

Implemented in NvCloth::Solver.

◆ SetInterCollisionStiffness()

virtual void NvCloth::ISolver::SetInterCollisionStiffness ( float  stiffness)
pure virtual

Sets the stiffness for inter-collision constraints. Stiffness range is [0.0, 1.0]. Default value is 1.0.

Implemented in NvCloth::Solver.

◆ SetUserSimulated()

virtual void NvCloth::ISolver::SetUserSimulated ( bool  value)
pure virtual

Set the solver into user-simulated mode. When the solver is user-simulated the user will be responsible to call StartSimulation and FinishSimulation functions, otherwise they will be called by the cloth system.

Implemented in NvCloth::Solver.

◆ StartSimulation()

virtual void NvCloth::ISolver::StartSimulation ( float  deltaTime)
pure virtual

Start simulation of all the cloths that are part of this solver. This will setup and start cloth simulation jobs. If the solver is in user-simulated mode the user is responsible for calling this function. Note: This is a non-blocking call.

Implemented in NvCloth::Solver.


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