UClothingSimulationInteractor

If a clothing simulation is able to be interacted with at runtime then a derived interactor should be created, and at least the basic API implemented for that simulation.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

ClothingSystemRuntimeInterface

Header

/Engine/Source/Runtime/ClothingSystemRuntimeInterface/Public/ClothingSimulationInteractor.h

Include

#include "ClothingSimulationInteractor.h"

Syntax

class UClothingSimulationInteractor : public UObject

Remarks

If a clothing simulation is able to be interacted with at runtime then a derived interactor should be created, and at least the basic API implemented for that simulation. Only write to the simulation and context during the call to Sync, as that is guaranteed to be a safe place to access this data.

Variables

Name Description

Public variable

TMap< FName, TO...

 

ClothingInteractors

Cloth interactors currently created.

Functions

Name Description

Public function Virtual

void

 

ClothConfigUpdated()

Called to update the cloth config without restarting the simulation.

Protected function Virtual

UClothingInt...

 

CreateClothingInteractor()

Public function

void

 

CreateClothingInteractor

(
    const UClothingAssetBase* Clot...,
    int32 ClothingId
)

Create a cloth specific interactor.

Public function

void

 

DestroyClothingInteractors()

Destroy all interactors.

Public function Virtual

void

 

DisableGravityOverride()

Disable any currently set gravity override.

Public function Virtual

void

 

EnableGravityOverride

(
    const FVector& InVector
)

Set a new gravity override and enable the override.

Public function Const

UClothingInt...

 

GetClothingInteractor

(
    const FString& ClothingAssetName
)

Return a cloth interactor for this simulation.

Public function Const

int32

 

GetNumCloths()

Return the number of cloths run by the simulation.

Public function Const

int32

 

GetNumDynamicParticles()

Return the number of dynamic (simulated) particles.

Public function Const

int32

 

GetNumIterations()

Return the solver number of iterations.

Public function Const

int32

 

GetNumKinematicParticles()

Return the number of kinematic (animated) particles.

Public function Const

int32

 

GetNumSubsteps()

Return the solver number of subdivisions./ This could be different from the number set if the simulation hasn't updated yet.

Public function Const

float

 

GetSimulationTime()

Return the instant average simulation time in ms.

Public function Virtual

void

 

PhysicsAssetUpdated()

Called to update collision status without restarting the simulation.

Public function Virtual

void

 

SetAnimDriveSpringStiffness

(
    float InStiffness
)

Set the stiffness of the spring force for the animation drive.

Public function Virtual

void

 

SetNumIterations

(
    int32 NumIterations
)

Set the number of solver iterations.

Public function Virtual

void

 

SetNumSubsteps

(
    int32 NumSubsteps
)

Set the number of substeps or subdivisions.

Public function Virtual

void

 

Sync

(
    IClothingSimulation* Simulatio...,
    IClothingSimulationContext* Co...
)

Sync the interactor to the provided context for the clothing simulation to use on its next update.