![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <ClothingSimulationInterface.h>
Public Member Functions | |
| UE_API | IClothingSimulationInterface () |
| virtual UE_API | ~IClothingSimulationInterface () |
| PRAGMA_DISABLE_DEPRECATION_WARNINGS const IClothingSimulation * | DynamicCastToIClothingSimulation () const |
| IClothingSimulation * | DynamicCastToIClothingSimulation () |
| virtual PRAGMA_ENABLE_DEPRECATION_WARNINGS int32 | GetNumCloths () const |
| virtual int32 | GetNumKinematicParticles () const |
| virtual int32 | GetNumDynamicParticles () const |
| virtual int32 | GetNumIterations () const |
| virtual int32 | GetNumSubsteps () const |
| virtual float | GetSimulationTime () const |
| virtual bool | IsTeleported () const |
Friends | |
| struct | FClothingSimulationInstance |
| class | IClothingSimulation |
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.
|
default |
|
virtualdefault |
|
protectedpure virtual |
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
| InData | - Collisions to add to this simulation |
|
protectedpure virtual |
Fill FClothSimulData map for the clothing simulation. Should fill a map pair per-actor. Do not remove InOutData elements which you are not responsible for: they may have been written by a different instance.
| InOutData | - The simulation data to write to |
| OwnerComponent | - the component that owns the simulation |
| OverrideComponent | - An override component if bound to a leader pose component |
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. It is recommended in derived simulations to avoid freeing any allocations regarding external collisions as it is likely more will be added soon after this call
|
protectedpure virtual |
Create an actor for this simulation from the data in InAsset Simulation data for this actor should be written back to SimDataIndex in GetSimulationData
| InOwnerComponent | - The component requesting this actor |
| InAsset | - The asset to create an actor from |
| SimDataIndex | - the sim data index to use when doing the writeback in AppendSimulationData |
|
protectedpure virtual |
Create a new context, will not be filled, call FillContextAndPrepareTick before simulating with this context
Simulation should remove all of it's actors when next possible and free them
|
protectedpure virtual |
Destroy a context object, engine will always pass a context created using CreateContext
| InContext | - The context to destroy |
|
inline |
|
inline |
Called once all CreateActor have been called.
|
protectedpure virtual |
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.
| InComponent | - The component to fill the context for |
| InOutContext | - The context to fill |
| bIsInitialization | - Whether this fill is occurring as part of the actor creation stage |
| bForceTeleportResetOnly | - Whether ForceClothNextUpdateTeleportAndReset instead of Simulate and AppendSimulationData will be called. |
|
protectedpure virtual |
Called instead of Simulate when not ticking.
|
protectedpure virtual |
Get the bounds of the simulation mesh in local simulation space
|
protectedpure virtual |
Called by the engine to request data on all active collisions in a simulation. if bIncludeExternal is true, derived implementations should add the asset collisions and any collisions added at runtime, if false only the collisions from the asset should be considered
| OutCollisions | - Array to write collisions to |
| bIncludeExternal | - Whether or not external collisions should be retrieved, or just asset collisions |
|
inlinevirtual |
Return the number of simulated cloths. Implementation must be thread safe.
Return the number of dynamic (simulated) particles. Implementation must be thread safe.
Return the number of iterations used by the solver. This is the maximum used as an indicative value only, as this could vary between cloths. Implementation must be thread safe.
Return the number of kinematic (fixed) particles. Implementation must be thread safe.
Return the number of substeps used by the solver. This is the maximum used as an indicative value only, as this could vary between cloths. Implementation must be thread safe.
Return the simulation time in ms. Implementation must be thread safe.
|
protectedpure virtual |
Hard reset the simulation without necessarily recreating cloth actors.
Initialize the simulation, will be called before any Simulate calls
Return whether the simulation is teleported. Implementation must be thread safe.
|
protectedpure virtual |
Called by the engine to determine if this simulation can run this tick at this LOD. ForceClothNextUpdateTeleportAndReset rather than Simulate and AppendSimulationData will be called this tick.
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.
|
protectedpure virtual |
Run a single tick of the simulation. The pointer InContext is guaranteed (when called by the engine) to be the context allocated in CreateContext and can be assumed to be safely castable to any derived type allocated there. New callers should take care to make sure only the correct context is ever passed through.
| InContext | - The context to use during simulation, will have been filled in FillContextAndPrepareTick |
|
friend |