FPhysicsSolverBase::UniqueIdxToGTParticle_External

Used as helper for GT to go from unique idx back to gt particle If GT deletes a particle, this function will return null (that's a good thing when consuming async outputs as GT may have already deleted the particle we care about) In this case instead of getting a nullptr you will get an unrelated (wrong) GT particle Because of this we keep the index alive for as long as the async callback can lag behind.

Windows
MacOS
Linux

References

Module

Chaos

Header

/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Framework/PhysicsSolverBase.h

Include

#include "Chaos/Framework/PhysicsSolverBase.h"

Syntax

FGeometryParticle * UniqueIdxToGTParticle_External
(
    const FUniqueIdx & UniqueIdx
) const

Remarks

Used as helper for GT to go from unique idx back to gt particle If GT deletes a particle, this function will return null (that's a good thing when consuming async outputs as GT may have already deleted the particle we care about) In this case instead of getting a nullptr you will get an unrelated (wrong) GT particle Because of this we keep the index alive for as long as the async callback can lag behind. This way as long as you immediately consume the output, you will always be sure the unique index was not released. Practically the flow should always be like this: advance the solver and trigger callbacks. Callbacks write to outputs. Consume the outputs on GT and use this function before advancing solver again

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss