Navigation
API > API/Runtime > API/Runtime/Chaos > API/Runtime/Chaos/Chaos > API/Runtime/Chaos/Chaos/Collision
Inheritance Hierarchy
- FParticlePairMidPhase
- FGenericParticlePairMidPhase
- FShapePairParticlePairMidPhase
References
Module | Chaos |
Header | /Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Collision/ParticlePairMidPhase.h |
Include | #include "Chaos/Collision/ParticlePairMidPhase.h" |
Syntax
class FParticlePairMidPhase
Remarks
The lifetime of midphase objects is handled entirely by the CollisionConstraintAllocator. Nothing outside of the CollisionConstraintAllocator should hold a pointer to the detector or any constraints it creates for more than the duration of the tick.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
FRealSingle | CullDistanceScale | A number based on the size of the dynamic objects used to scale cull distance. |
![]() |
FFlags | Flags | |
![]() |
FCollisionParticlePairKey | Key | |
![]() |
int32 | LastUsedEpoch | |
![]() |
EParticlePairMidPhaseType | MidPhaseType | VTable Ptr // 8 bytes. |
![]() |
int32 | NumActiveConstraints | |
![]() |
FGeometryParticleHandle * | Particle0 | |
![]() |
FGeometryParticleHandle * | Particle1 | |
![]() |
int32 | ParticleCollisionsIndex0 | Indices into the arrays of collisions on the particles. This is a cookie for use by FParticleCollisions. |
![]() |
int32 | ParticleCollisionsIndex1 |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
|||
![]() |
FParticlePairMidPhase
(
const FParticlePairMidPhase& |
||
![]() |
FParticlePairMidPhase
(
const EParticlePairMidPhaseType InMidPhaseType |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | Build the list of potentially colliding shape pairs. This is all the shape pairs in the partilces' shapes arrays that pass the collision filter. | |
![]() |
void | Prefetch the memory in this class for later use. | |
![]() ![]() |
EParticlePairMidPhaseType | CalculateMidPhaseType
(
FGeometryParticleHandle* InParticle0, |
|
![]() |
void | DetachParticle
(
FGeometryParticleHandle* Particle |
Destroy all collisions and prevent this midphasae from being used any more. Called when one of its particles is destoyed. It will be culled at the next Prune in the CollisionConstraintAllocator. We don't delete it immediately so that we don't have to remove it from either Particle's ParticleCollisions array (which is O(N) and unnecessary when the particles are being destroyed) |
![]() ![]() |
FPBDCollisionConstraint * | FindOrCreateConstraint
(
FGeometryParticleHandle* InParticle0, |
|
![]() |
void | GenerateCollisions
(
const FReal CullDistance, |
Create collision constraints for all colliding shape pairs. |
![]() |
int32 | GenerateCollisionsImpl
(
const FReal CullDistance, |
|
![]() ![]() |
const FCollisionParticlePairKey & | GetKey () |
|
![]() ![]() |
EParticlePairMidPhaseType | ||
![]() |
FGeometryParticleHandle * | GetParticle0 () |
|
![]() |
FGeometryParticleHandle * | GetParticle1 () |
|
![]() ![]() |
int32 | GetParticleCollisionsIndex
(
FGeometryParticleHandle* InParticle |
Cookie for use by FParticleCollisions. |
![]() |
void | Init
(
FGeometryParticleHandle* InParticle0, |
Set up the midphase based on the SHapesArrays of the two particles Only intended to be called once right after constructor. We don't do this work in the constructor so that we can reduce the time that the lock is held when allocating new MidPhases. |
![]() |
void | ||
![]() |
void | InjectCollision
(
const FPBDCollisionConstraint& Constraint, |
Copy a collision and activate it This is used by the Resim system to restore saved colisions. If there is already a matching constraint it will be overwritten, otherwise a new constraint will be added. |
![]() |
void | InjectCollisionImpl
(
const FPBDCollisionConstraint& Constraint, |
|
![]() ![]() |
bool | IsCCD () |
True if CCD is supported by either particle |
![]() ![]() |
bool | IsCCDActive () |
True if CCD is active for this midphase on this frame.This can be changed by modifiers and resets to bIsCCD each frame. |
![]() ![]() |
bool | ||
![]() ![]() |
bool | IsSleeping () |
Whether the particle pair is sleeping and therefore contacts should not be culled (they will be reused on wake) |
![]() ![]() |
bool | IsUsedSince
(
const int32 Epoch |
Have we run collision detection since this Epoch (inclusive) |
![]() ![]() |
bool | IsValid () |
|
![]() ![]() |
FParticlePairMidPhase * | Make
(
FGeometryParticleHandle* InParticle0, |
|
![]() |
void | Reset () |
Delete all cached data and collisions. Should be called when a particle changes its shapes. |
![]() |
void | ResetImpl () |
|
![]() |
void | ||
![]() |
void | SetCCDIsActive
(
bool bCCDIsActive |
Override the CCD condition for this mid-phase. Used by the MidPhase modifier and gets reset every frame. |
![]() |
void | SetIsActive
(
bool bIsActive |
By default midphases are active. If IsActive is set to false, this midphase will not generate a narrow phase. |
![]() |
void | SetIsSleeping
(
const bool bInIsSleeping, |
Update the sleeping state If this switches the state to Awake, it will reactivate any collisions between the particle pair that were active when they went to sleep. |
![]() |
void | SetParticleCollisionsIndex
(
FGeometryParticleHandle* InParticle, |
Cookie for use by FParticleCollisions. |
![]() |
bool | ShouldEnableCCD
(
const FReal Dt |
Decide whether we should have CCD enabled on this constraint. |
![]() |
ECollisionVisitorResult | VisitCollisions
(
const TLambda& Visitor, |
Call a lambda on each active collision constraint This includes sleeping constraints, but skips constraints that are were not used on the last awake tick but are still kept around as an optimization. |
![]() ![]() |
ECollisionVisitorResult | VisitConstCollisions
(
const TLambda& Visitor, |
Call a lambda on each active collision constraint. |
![]() |
void | WakeCollisionsImpl
(
const int32 CurrentEpoch |
Operators
Type | Name | Description | |
---|---|---|---|
![]() |
FParticlePairMidPhase & | operator=
(
const FParticlePairMidPhase& |
|
![]() |
FParticlePairMidPhase & |
Classes
Type | Name | Description | |
---|---|---|---|
![]() |
FFlags |