UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
CollisionContext.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
5#include "Chaos/Core.h"
6
7namespace Chaos
8{
9 namespace Private
10 {
11 class FCollisionContextAllocator;
12 }
13
14 class FParticlePairMidPhase;
15
17 {
18 public:
34
35 // Shape bounds are expanded by this in all 3 directions. This is also used as the CullDistance for collision response.
37
38 // Shape bounds in the broadphase are expanded by this multiple of velocity (normal collision mode)
40
41 // We only allow the bounds to grow from velocity by this much (normal collision mode)
43
44 // Shape bounds in the broadphase are expanded by this multiple of velocity (movement-aware collision mode)
46
47 // We only allow the bounds to grow from velocity by this much (movement-aware collision mode)
49
50 // Whether to check the shape query flags in the narrow phase (e.g., Rigid Body nodes have already performed filtering prior to collision detection)
52
53 // Whether to defer the narrow phase to the constraint-solve phase. This is only enabled by RBAN. It is not useful for the main solver because
54 // we would not know the contact details when we call the collision modifier callbacks. It is used by RBAN to allow us to run 1 joint iteration
55 // prior to collision detection which gives better results.
57
58 // Whether to use one-shot manifolds where supported
60
61 // Whether we can reuse manifolds between frames if contacts have not moved far
63
64 // Whether CCD is allowed (disabled for RBAN)
66
67 // Whether MACD is allowed (disabled for RBAN)
69
70 // Useful for debugging (esp. PIE client/server)
72
73 const FString& GetName() const
74 {
75 return EvolutionName.Value();
76 }
77 };
78
83 {
84 public:
86 : Settings(nullptr)
87 , Allocator(nullptr)
88 , MidPhase(nullptr)
89 {
90 }
91
92 void Reset()
93 {
94 Settings = nullptr;
95 Allocator = nullptr;
96 MidPhase = nullptr;
97 }
98
101
104
106
108
109 // This is used in the older collision detection path which is still used for particles that do not flatten their implicit hierrarchies
110 // into the Particle's ShapesArray. Currently this is only Clusters.
111 // @todo(chaos): remove thsi from here and make it a parameter on ConstructCollisions and all inner functions.
113 };
114}
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
Definition CollisionContext.h:83
void SetSettings(const FCollisionDetectorSettings &InSettings)
Definition CollisionContext.h:100
const FCollisionDetectorSettings & GetSettings() const
Definition CollisionContext.h:99
FParticlePairMidPhase * MidPhase
Definition CollisionContext.h:112
Private::FCollisionContextAllocator * Allocator
Definition CollisionContext.h:107
const FCollisionDetectorSettings * Settings
Definition CollisionContext.h:105
void SetAllocator(Private::FCollisionContextAllocator *InAllocator)
Definition CollisionContext.h:103
void Reset()
Definition CollisionContext.h:92
Private::FCollisionContextAllocator * GetAllocator() const
Definition CollisionContext.h:102
FCollisionContext()
Definition CollisionContext.h:85
Definition CollisionContext.h:17
bool bAllowCCD
Definition CollisionContext.h:65
bool bAllowManifolds
Definition CollisionContext.h:59
bool bFilteringEnabled
Definition CollisionContext.h:51
bool bAllowManifoldReuse
Definition CollisionContext.h:62
const FString & GetName() const
Definition CollisionContext.h:73
bool bDeferNarrowPhase
Definition CollisionContext.h:56
bool bAllowMACD
Definition CollisionContext.h:68
FCollisionDetectorSettings()
Definition CollisionContext.h:19
FSharedDebugName EvolutionName
Definition CollisionContext.h:71
FReal BoundsExpansion
Definition CollisionContext.h:36
FReal BoundsVelocityInflation
Definition CollisionContext.h:39
FReal MaxVelocityBoundsExpansionMACD
Definition CollisionContext.h:48
FReal BoundsVelocityInflationMACD
Definition CollisionContext.h:45
FReal MaxVelocityBoundsExpansion
Definition CollisionContext.h:42
Produce collisions for a particle pair A FParticlePairMidPhase object is created for every particle p...
Definition ParticlePairMidPhase.h:192
Definition ChaosDebugName.h:17
const FString & Value() const
Definition ChaosDebugName.h:42
Definition CollisionConstraintAllocator.h:28
Definition SkeletalMeshComponent.h:307
FRealDouble FReal
Definition Real.h:22
Definition OverriddenPropertySet.cpp:45
@ false
Definition radaudio_common.h:23