engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | 友元 | 所有成员列表
IClothingSimulation类 参考abstract

Base class for clothing simulators. 更多...

#include <ClothingSimulationInterface.h>

被 FClothingSimulationCommon 继承.

Public 成员函数

virtual void GatherStats () const
 Called by the engine once per physics tick to gather non-cycle stats (num sim verts etc.) Will not be called if STATS is not defined, not required to be implemented if no need for stats. 更多...
 
virtual int32 GetNumCloths () const
 Return the number of simulated cloths. 更多...
 
virtual int32 GetNumDynamicParticles () const
 Return the number of dynamic (simulated) particles. 更多...
 
virtual int32 GetNumIterations () const
 Return the number of iterations used by the solver. 更多...
 
virtual int32 GetNumKinematicParticles () const
 Return the number of kinematic (fixed) particles. 更多...
 
virtual int32 GetNumSubsteps () const
 Return the number of substeps used by the solver. 更多...
 
virtual float GetSimulationTime () const
 Return the simulation time in ms. 更多...
 
virtual bool IsTeleported () const
 Return whether the simulation is teleported. 更多...
 

Protected 成员函数

virtual void AddExternalCollisions (const FClothCollisionData &InData)=0
 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 更多...
 
virtual void ClearExternalCollisions ()=0
 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. 更多...
 
virtual void CreateActor (USkeletalMeshComponent *InOwnerComponent, UClothingAssetBase *InAsset, int32 SimDataIndex)=0
 Create an actor for this simulation from the data in InAsset Simulation data for this actor should be written back to SimDataIndex in GetSimulationData 更多...
 
virtual IClothingSimulationContext * CreateContext ()=0
 Create a new context, will not be filled, call FillContext before simulating with this context
 
virtual void DestroyActors ()=0
 Simulation should remove all of it's actors when next possible and free them
 
virtual void DestroyContext (IClothingSimulationContext *InContext)=0
 Destroy a context object, engine will always pass a context created using CreateContext 更多...
 
virtual void FillContext (USkeletalMeshComponent *InComponent, float InDeltaTime, IClothingSimulationContext *InOutContext)=0
 Fills an existing context for a single simulation step, called by the engine on the game thread prior to simulation 更多...
 
virtual FBoxSphereBounds GetBounds (const USkeletalMeshComponent *InOwnerComponent) const =0
 Get the bounds of the simulation mesh in local simulation space
 
virtual void GetCollisions (FClothCollisionData &OutCollisions, bool bIncludeExternal=true) const =0
 Called by the engine to request data on all active collisions in a simulation. 更多...
 
virtual void GetSimulationData (TMap< int32, FClothSimulData > &OutData, USkeletalMeshComponent *InOwnerComponent, USkinnedMeshComponent *InOverrideComponent) const =0
 Fill FClothSimulData map for the clothing simulation. 更多...
 
virtual void Initialize ()=0
 Initialize the simulation, will be called before any Simulate calls
 
virtual void PostActorCreationInitialize ()
 Do any required initialization after all the actors have been loaded
 
virtual bool ShouldSimulate () const =0
 Called by the engine to detect whether or not the simulation should run, essentially are there any actors that need to simulate in this simulation
 
virtual void Shutdown ()=0
 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.
 
virtual void Simulate (IClothingSimulationContext *InContext)=0
 Run a single tick of the simulation. 更多...
 

友元

class USkeletalMeshComponent
 

详细描述

Base class for clothing simulators.

成员函数说明

◆ AddExternalCollisions()

virtual void IClothingSimulation::AddExternalCollisions ( const FClothCollisionData &  InData)
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

◆ ClearExternalCollisions()

virtual void IClothingSimulation::ClearExternalCollisions ( )
protectedpure virtual

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

◆ CreateActor()

virtual void IClothingSimulation::CreateActor ( USkeletalMeshComponent *  InOwnerComponent,
UClothingAssetBase *  InAsset,
int32  SimDataIndex 
)
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 GetSimulationData

◆ DestroyContext()

virtual void IClothingSimulation::DestroyContext ( IClothingSimulationContext *  InContext)
protectedpure virtual

Destroy a context object, engine will always pass a context created using CreateContext

参数
InContext- The context to destroy

◆ FillContext()

virtual void IClothingSimulation::FillContext ( USkeletalMeshComponent *  InComponent,
float  InDeltaTime,
IClothingSimulationContext *  InOutContext 
)
protectedpure virtual

Fills an existing context for a single simulation step, called by the engine on the game thread prior to simulation

参数
InComponent- The component to fill the context for
InOutContext- The context to fill

◆ GatherStats()

virtual void IClothingSimulation::GatherStats ( ) const
inlinevirtual

Called by the engine once per physics tick to gather non-cycle stats (num sim verts etc.) Will not be called if STATS is not defined, not required to be implemented if no need for stats.

STAT_NumCloths and STAT_NumClothVerts are already defined and can be incremented, more can be added per simulation. This can be called on any thread, so derived implementations should make sure the gather is safe

◆ GetCollisions()

virtual void IClothingSimulation::GetCollisions ( FClothCollisionData &  OutCollisions,
bool  bIncludeExternal = true 
) const
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

◆ GetNumCloths()

virtual int32 IClothingSimulation::GetNumCloths ( ) const
inlinevirtual

Return the number of simulated cloths.

Implementation must be thread safe.

◆ GetNumDynamicParticles()

virtual int32 IClothingSimulation::GetNumDynamicParticles ( ) const
inlinevirtual

Return the number of dynamic (simulated) particles.

Implementation must be thread safe.

◆ GetNumIterations()

virtual int32 IClothingSimulation::GetNumIterations ( ) const
inlinevirtual

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.

◆ GetNumKinematicParticles()

virtual int32 IClothingSimulation::GetNumKinematicParticles ( ) const
inlinevirtual

Return the number of kinematic (fixed) particles.

Implementation must be thread safe.

◆ GetNumSubsteps()

virtual int32 IClothingSimulation::GetNumSubsteps ( ) const
inlinevirtual

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.

◆ GetSimulationData()

virtual void IClothingSimulation::GetSimulationData ( TMap< int32, FClothSimulData > &  OutData,
USkeletalMeshComponent *  InOwnerComponent,
USkinnedMeshComponent *  InOverrideComponent 
) const
protectedpure virtual

Fill FClothSimulData map for the clothing simulation.

Should fill a map pair per-actor

参数
OutData- The simulation data to write to
InOwnerComponent- the component that owns the simulation
InOverrideComponent- An override component if bound to a master pose component

◆ GetSimulationTime()

virtual float IClothingSimulation::GetSimulationTime ( ) const
inlinevirtual

Return the simulation time in ms.

Implementation must be thread safe.

◆ IsTeleported()

virtual bool IClothingSimulation::IsTeleported ( ) const
inlinevirtual

Return whether the simulation is teleported.

Implementation must be thread safe.

◆ Simulate()

virtual void IClothingSimulation::Simulate ( IClothingSimulationContext *  InContext)
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 make care to make sure only the correct context is ever passed through

参数
InContext- The context to use during simulation, will have been filled in FillContext

该类的文档由以下文件生成: