Navigation
API > API/Runtime > API/Runtime/ClothingSystemRuntimeInterface
Base class for clothing simulators.
The majority of the API for this class is protected. For the most part the simulation is not designed to be used outside of the FClothingSimulationInstance implementation which is used in the Skeletal Mesh Component, as its parallel simulation is tied to the Skeletal Mesh Component tick and dependents. Any method that is available in the public section below should consider that it may be called while the simulation is running.
| Name | IClothingSimulationInterface |
| Type | class |
| Header File | /Engine/Source/Runtime/ClothingSystemRuntimeInterface/Public/ClothingSimulationInterface.h |
| Include Path | #include "ClothingSimulationInterface.h" |
Syntax
class IClothingSimulationInterface
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
IClothingSimulationInterface() |
ClothingSimulationInterface.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~IClothingSimulationInterface() |
ClothingSimulationInterface.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
PRAGMA_DISABLE_DEPRECATION_WARNINGS const IClothingSimulation * DynamicCastToIClothingSimulation () |
ClothingSimulationInterface.h | ||
| ClothingSimulationInterface.h | |||
virtual int32 GetNumCloths() |
Return the number of simulated cloths. Implementation must be thread safe. | ClothingSimulationInterface.h | |
virtual int32 GetNumDynamicParticles() |
Return the number of dynamic (simulated) particles. Implementation must be thread safe. | ClothingSimulationInterface.h | |
virtual int32 GetNumIterations () |
Return the number of iterations used by the solver. | ClothingSimulationInterface.h | |
virtual int32 GetNumKinematicParticles() |
Return the number of kinematic (fixed) particles. Implementation must be thread safe. | ClothingSimulationInterface.h | |
virtual int32 GetNumSubsteps () |
Return the number of substeps used by the solver. | ClothingSimulationInterface.h | |
virtual float GetSimulationTime() |
Return the simulation time in ms. Implementation must be thread safe. | ClothingSimulationInterface.h | |
virtual bool IsTeleported() |
Return whether the simulation is teleported. Implementation must be thread safe. | ClothingSimulationInterface.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddExternalCollisions
(
const FClothCollisionData& InData |
Called by the engine when an external object wants to inject collision data into this simulation above and beyond what is specified in the asset for the internal actors Examples: Scene collision, collision for parents we are attached to | ClothingSimulationInterface.h | |
void AppendSimulationData
(
TMap< int32, FClothSimulData >& InOutData, |
Fill FClothSimulData map for the clothing simulation. | ClothingSimulationInterface.h | |
void ClearExternalCollisions () |
Called by the engine when external collisions are no longer necessary or when they need to be updated with some of the previous collisions removed. | ClothingSimulationInterface.h | |
void CreateActor
(
USkeletalMeshComponent* InOwnerComponent, |
Create an actor for this simulation from the data in InAsset Simulation data for this actor should be written back to SimDataIndex in GetSimulationData | ClothingSimulationInterface.h | |
IClothingSimulationContext * CreateContext() |
Create a new context, will not be filled, call FillContextAndPrepareTick before simulating with this context | ClothingSimulationInterface.h | |
void DestroyActors() |
Simulation should remove all of it's actors when next possible and free them | ClothingSimulationInterface.h | |
void DestroyContext
(
IClothingSimulationContext* InContext |
Destroy a context object, engine will always pass a context created using CreateContext | ClothingSimulationInterface.h | |
void EndCreateActor() |
Called once all CreateActor have been called. | ClothingSimulationInterface.h | |
void FillContextAndPrepareTick
(
const USkeletalMeshComponent* InComponent, |
Fills an existing context for a single simulation step and do any other work that needs to be called by the engine on the game thread prior to simulation. | ClothingSimulationInterface.h | |
| Called instead of Simulate when not ticking. | ClothingSimulationInterface.h | ||
FBoxSphereBounds GetBounds
(
const USkeletalMeshComponent* InOwnerComponent |
Get the bounds of the simulation mesh in local simulation space | ClothingSimulationInterface.h | |
void GetCollisions
(
FClothCollisionData& OutCollisions, |
Called by the engine to request data on all active collisions in a simulation. | ClothingSimulationInterface.h | |
void HardResetSimulation
(
const IClothingSimulationContext* InContext |
Hard reset the simulation without necessarily recreating cloth actors. | ClothingSimulationInterface.h | |
void Initialize() |
Initialize the simulation, will be called before any Simulate calls | ClothingSimulationInterface.h | |
bool ShouldSimulateLOD
(
int32 OwnerLODIndex |
Called by the engine to determine if this simulation can run this tick at this LOD. | ClothingSimulationInterface.h | |
void Shutdown() |
Shutdown the simulation, this should clear ALL resources as we no longer expect to call any other function on this simulation without first calling Initialize again. | ClothingSimulationInterface.h | |
void Simulate_AnyThread
(
const IClothingSimulationContext* InContext |
Run a single tick of the simulation. | ClothingSimulationInterface.h |