UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ChaosVDOptionalDataChannel.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#if WITH_CHAOS_VISUAL_DEBUGGER
6
9
10class FText;
11class FName;
12
15{
17 StartEnabled = 1 << 0,
20};
22
24{
26 struct FChaosVDOptionalDataChannel : TSharedFromThis<FChaosVDOptionalDataChannel>
27 {
30 {
31 bIsEnabled = EnumHasAnyFlags(InitializationFlags, EChaosVDDataChannelInitializationFlags::StartEnabled);
32 bCanChangeEnabledState = EnumHasAnyFlags(InitializationFlags, EChaosVDDataChannelInitializationFlags::CanChangeEnabledState);
33 }
34
36 void Initialize();
37
39 CHAOS_API const FText& GetDisplayName() const;
40
42 FName GetId() const
43 {
44 return *ChannelId;
45 }
46
48 FORCEINLINE bool IsChannelEnabled() const
49 {
50 return bIsEnabled;
51 }
52
55
57 bool CanChangeEnabledState() const
58 {
60 }
61
62 private:
65 std::atomic<bool> bIsEnabled = true;
66 bool bCanChangeEnabledState = false;
67 };
68
71 {
72 public:
73
75
79 template<typename TCallback>
80 void EnumerateChannels(TCallback Callback)
81 {
83 {
84 if (!Callback(ChannelWithName.Value.ToSharedRef()))
85 {
86 return;
87 }
88 }
89 }
90
93 {
95 {
96 return *ChannelFound;
97 }
98
99 return nullptr;
100 }
101
102 private:
103
106
107 public:
109 {
111 }
112 private:
113
116 {
118 }
119
121
123 };
124
126
129}
130
131#endif //WITH_CHAOS_VISUAL_DEBUGGER
132
133#ifndef CVD_CONCAT_NX
134 #define CVD_CONCAT_NX(A, B) A ## B
135#endif
136
137#ifndef CVD_CONCAT
138 #define CVD_CONCAT(A, B) CVD_CONCAT_NX(A,B)
139#endif
140
141#ifndef CVD_STRINGIZE_NX
142 #define CVD_STRINGIZE_NX(A) #A
143#endif
144
145#ifndef CVD_STRINGIZE
146 #define CVD_STRINGIZE(A) CVD_STRINGIZE_NX(A)
147#endif
148
149#if WITH_CHAOS_VISUAL_DEBUGGER
150
152#ifndef CVD_DECLARE_OPTIONAL_DATA_CHANNEL
153 #define CVD_DECLARE_OPTIONAL_DATA_CHANNEL(DataChannelName) \
154 extern CHAOS_API TSharedRef<Chaos::VisualDebugger::FChaosVDOptionalDataChannel> CVDDC_##DataChannelName;
155#endif
156
158#ifndef CVD_DECLARE_OPTIONAL_DATA_CHANNEL_EXTERN
159 #define CVD_DECLARE_OPTIONAL_DATA_CHANNEL_EXTERN(DataChannelName, ModuleAPI) \
160 extern ModuleAPI TSharedRef<Chaos::VisualDebugger::FChaosVDOptionalDataChannel> CVDDC_##DataChannelName;
161#endif
162
164#ifndef CVD_DEFINE_OPTIONAL_DATA_CHANNEL
165 #define CVD_DEFINE_OPTIONAL_DATA_CHANNEL(DataChannelName, InitializationFlags) \
166 TSharedRef<Chaos::VisualDebugger::FChaosVDOptionalDataChannel> CVDDC_##DataChannelName = Chaos::VisualDebugger::CreateDataChannel(#DataChannelName, MakeShared<FText>(NSLOCTEXT(CVD_STRINGIZE(ChaosVisualDebugger), CVD_STRINGIZE(CVD_CONCAT(DataChannelName,_ChannelName)), #DataChannelName)), InitializationFlags);
167#endif
168
169
170// Declare CVD's Default set of channels
172CVD_DECLARE_OPTIONAL_DATA_CHANNEL(EvolutionStart); // Initial particle positions for this tick. Same as end of previous EvolutionEnd but with any external changes applied (set position, velocity, etc).
173CVD_DECLARE_OPTIONAL_DATA_CHANNEL(PostIntegrate); // Predicted particle positions before user callbacks and constraint solver. Includes this tick's movement from external forces, velocity, kinematic targets, etc.
174CVD_DECLARE_OPTIONAL_DATA_CHANNEL(PreConstraintSolve); // Predicted particle positions as used by the constraint solver. After user callbacks, collision modifiers, etc., but before collisions and joints are resolved.
178CVD_DECLARE_OPTIONAL_DATA_CHANNEL(PostConstraintSolve); // Particle positions corrected by the constraint solver (collisions, joints, etc.), but before user callbacks or destruction handling.
179CVD_DECLARE_OPTIONAL_DATA_CHANNEL(EvolutionEnd); // Final particle positions, including destruction and user callbacks.
183CVD_DECLARE_OPTIONAL_DATA_CHANNEL(CharacterGroundConstraints);
184CVD_DECLARE_OPTIONAL_DATA_CHANNEL(AccelerationStructures);
185
186// When a particle is added to a cluster will get disabled and therefore not updated by CVD's delta frames implementation.
187// If this channel is enabled, we will record all child particles of any active dirty cluster particle
189
190#else //WITH_CHAOS_VISUAL_DEBUGGER
191
193#ifndef CVD_DECLARE_OPTIONAL_DATA_CHANNEL
194 #define CVD_DECLARE_OPTIONAL_DATA_CHANNEL(DataChannelName)
195#endif
196
198#ifndef CVD_DECLARE_OPTIONAL_DATA_CHANNEL_EXTERN
199 #define CVD_DECLARE_OPTIONAL_DATA_CHANNEL_EXTERN(DataChannelName, ModuleAPI)
200#endif
201
203#ifndef CVD_DEFINE_OPTIONAL_DATA_CHANNEL
204 #define CVD_DEFINE_OPTIONAL_DATA_CHANNEL(DataChannelName, InitializationFlags)
205#endif
206
207#endif //WITH_CHAOS_VISUAL_DEBUGGER
#define FORCEINLINE
Definition AndroidPlatform.h:140
#define CVD_DECLARE_OPTIONAL_DATA_CHANNEL(DataChannelName)
Definition ChaosVDOptionalDataChannel.h:194
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:49
constexpr bool EnumHasAnyFlags(Enum Flags, Enum Contains)
Definition EnumClassFlags.h:35
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition NameTypes.h:617
Definition Text.h:385
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition SharedPointer.h:1640
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition SharedPointer.h:1295
Definition ChaosVDDataWrapperUtils.cpp:19
FORCEINLINE T * Get(const FObjectPtr &ObjectPtr)
Definition ObjectPtr.h:426
UE_TRACE_API void EnumerateChannels(ChannelIterFunc IterFunc, void *User) UE_TRACE_IMPL()
Definition Tuple.h:652