UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ChaosVDJointDataWrappers.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
6#include "UObject/Class.h"
8
9#include "ChaosVDJointDataWrappers.generated.h"
10
11UENUM()
19
20UENUM()
28
29UENUM()
31{
32 None = 0,
33 Disabled = 1 << 0,
34 Broken = 1 << 1,
35 Breaking = 1 << 2,
36 DriveTargetChanged = 1 << 3,
37 EnabledDuringResim = 1 << 4,
38};
40
41UENUM()
43{
44 None = 0,
45 IsBreaking = 1 << 0,
46 IsBroken = 1 << 1,
47 DriveTargetChanged = 1 << 2,
48 IsViolating = 1 << 3,
49};
51
52USTRUCT()
54{
56public:
57
59
60 //TODO: Make the island data visible when we add support to record that data
61
62 int32 Island = INDEX_NONE;
65 int32 IslandSize = INDEX_NONE;
66
67 UPROPERTY(VisibleAnywhere, Category=JointState)
68 uint8 bDisabled : 1 = false;
69 UPROPERTY(VisibleAnywhere, Category=JointState)
70 uint8 bBroken : 1 = false;
71 UPROPERTY(VisibleAnywhere, Category=JointState)
72 uint8 bBreaking : 1 = false;
73 UPROPERTY(VisibleAnywhere, Category=JointState)
74 uint8 bDriveTargetChanged : 1 = false;
75 UPROPERTY(VisibleAnywhere, Category=JointState)
76 uint8 bEnabledDuringResim : 1 = true;
77
78 UPROPERTY(VisibleAnywhere, Category=JointState)
79 FVector LinearImpulse = FVector::ZeroVector;
80 UPROPERTY(VisibleAnywhere, Category=JointState)
81 FVector AngularImpulse = FVector::ZeroVector;
82 UPROPERTY(VisibleAnywhere, Category=JointState)
84 UPROPERTY(VisibleAnywhere, Category=JointState)
86
87};
89
90USTRUCT()
92{
94public:
95
97
98 UPROPERTY(VisibleAnywhere, Category=JointState)
99 uint8 bIsBreaking : 1 = false;
100 UPROPERTY(VisibleAnywhere, Category=JointState)
101 uint8 bIsBroken : 1 = false;
102 UPROPERTY(VisibleAnywhere, Category=JointState)
103 uint8 bDriveTargetChanged : 1 = false;
104 UPROPERTY(VisibleAnywhere, Category=JointState)
105 uint8 bIsViolating : 1 = false;
106 UPROPERTY(VisibleAnywhere, Category=JointState)
107 FVector Force = FVector::ZeroVector;
108 UPROPERTY(VisibleAnywhere, Category=JointState)
109 FVector Torque = FVector::ZeroVector;
110 UPROPERTY(VisibleAnywhere, Category=JointState)
111 float LinearViolation = 0.f;
112 UPROPERTY(VisibleAnywhere, Category=JointState)
113 float AngularViolation = 0.f;
114};
116
117UENUM()
119{
120 None = 0,
121
122 UseLinearSolver = 1 << 0,
123 SortEnabled = 1 << 1,
124 SolvePositionLast = 1 << 2,
125 UsePositionBasedDrives = 1 << 3,
126 EnableTwistLimits = 1 << 4,
127 EnableSwingLimits = 1 << 5,
128 EnableDrives = 1 << 6,
129};
130
132
133USTRUCT()
135{
137public:
139
140 UPROPERTY(VisibleAnywhere, Category=Tolerances)
141 double SwingTwistAngleTolerance = 0.0;
142 UPROPERTY(VisibleAnywhere, Category=Tolerances)
143 double PositionTolerance = 0.0;
144 UPROPERTY(VisibleAnywhere, Category=Tolerances)
145 double AngleTolerance = 0.0;
146
147 UPROPERTY(VisibleAnywhere, Category="Stability Control")
148 double MinParentMassRatio = 0.0;
149 UPROPERTY(VisibleAnywhere, Category="Stability Control")
150 double MaxInertiaRatio = 0.0;
151
152 UPROPERTY(VisibleAnywhere, Category="Solver Stiffness")
153 double MinSolverStiffness = 0.0;
154 UPROPERTY(VisibleAnywhere, Category="Solver Stiffness")
155 double MaxSolverStiffness = 0.0;
156 UPROPERTY(VisibleAnywhere, Category="Solver Stiffness")
157 int32 NumIterationsAtMaxSolverStiffness = INDEX_NONE;
158 UPROPERTY(VisibleAnywhere, Category="Solver Stiffness")
159 int32 NumShockPropagationIterations = INDEX_NONE;
160
161 UPROPERTY(VisibleAnywhere, Category="General")
162 uint16 bUseLinearSolver : 1 = false;
163 UPROPERTY(VisibleAnywhere, Category="General")
164 uint16 bSortEnabled : 1 = false;
165 UPROPERTY(VisibleAnywhere, Category="General")
166 uint16 bSolvePositionLast : 1 = false;
167 UPROPERTY(VisibleAnywhere, Category="General")
168 uint16 bUsePositionBasedDrives : 1 = false;
169 UPROPERTY(VisibleAnywhere, Category="General")
170 uint16 bEnableTwistLimits : 1 = false;
171 UPROPERTY(VisibleAnywhere, Category="General")
172 uint16 bEnableSwingLimits : 1 = false;
173 UPROPERTY(VisibleAnywhere, Category="General")
174 uint16 bEnableDrives : 1 = false;
175
176 UPROPERTY(VisibleAnywhere, Category="General")
177 double LinearStiffnessOverride = 0.0;
178 UPROPERTY(VisibleAnywhere, Category="General")
179 double TwistStiffnessOverride = 0.0;
180 UPROPERTY(VisibleAnywhere, Category="General")
181 double SwingStiffnessOverride = 0.0;
182 UPROPERTY(VisibleAnywhere, Category="General")
183 double LinearProjectionOverride = 0.0;
184 UPROPERTY(VisibleAnywhere, Category="General")
185 double AngularProjectionOverride = 0.0;
186 UPROPERTY(VisibleAnywhere, Category="General")
187 double ShockPropagationOverride = 0.0;
188 UPROPERTY(VisibleAnywhere, Category="General")
189 double LinearDriveStiffnessOverride = 0.0;
190 UPROPERTY(VisibleAnywhere, Category="General")
191 double LinearDriveDampingOverride = 0.0;
192 UPROPERTY(VisibleAnywhere, Category="General")
193 double AngularDriveStiffnessOverride = 0.0;
194 UPROPERTY(VisibleAnywhere, Category="General")
195 double AngularDriveDampingOverride = 0.0;
196 UPROPERTY(VisibleAnywhere, Category="General")
197 double SoftLinearStiffnessOverride = 0.0;
198 UPROPERTY(VisibleAnywhere, Category="General")
199 double SoftLinearDampingOverride = 0.0;
200 UPROPERTY(VisibleAnywhere, Category="General")
201 double SoftTwistStiffnessOverride = 0.0;
202 UPROPERTY(VisibleAnywhere, Category="General")
203 double SoftTwistDampingOverride = 0.0;
204 UPROPERTY(VisibleAnywhere, Category="General")
205 double SoftSwingStiffnessOverride = 0.0;
206 UPROPERTY(VisibleAnywhere, Category="General")
207 double SoftSwingDampingOverride = 0.0;
208};
210
211UENUM()
213{
214 Free,
215 Limited,
216 Locked,
217};
218
219UENUM()
225
226UENUM()
228{
229 Free,
230 Shrink,
231 Grow,
232};
233
234UENUM()
257
258USTRUCT()
260{
262public:
263
265
266 UPROPERTY(VisibleAnywhere, Category="General")
267 FTransform ConnectorTransforms[2];
268 UPROPERTY(VisibleAnywhere, Category="General")
269 double Stiffness = 0.0;
270 UPROPERTY(VisibleAnywhere, Category="General")
271 double LinearProjection = 0.0;
272 UPROPERTY(VisibleAnywhere, Category="General")
273 double AngularProjection = 0.0;
274 UPROPERTY(VisibleAnywhere, Category="General")
275 double ShockPropagation = 0.0;
276 UPROPERTY(VisibleAnywhere, Category="General")
277 double TeleportDistance = 0.0;
278 UPROPERTY(VisibleAnywhere, Category="General")
279 double TeleportAngle = 0.0;
280 UPROPERTY(VisibleAnywhere, Category="General")
281 double ParentInvMassScale = 0.0;
282
283 UPROPERTY(VisibleAnywhere, Category="General")
284 uint16 bCollisionEnabled : 1 = false;
285 UPROPERTY(VisibleAnywhere, Category="General")
286 uint16 bMassConditioningEnabled : 1 = false;
287 UPROPERTY(VisibleAnywhere, Category="General")
288 uint16 bUseLinearSolver : 1 = false;
289 UPROPERTY(VisibleAnywhere, Category="General")
290 uint16 bSoftLinearLimitsEnabled : 1 = false;
291 UPROPERTY(VisibleAnywhere, Category="General")
292 uint16 bSoftTwistLimitsEnabled : 1 = false;
293 UPROPERTY(VisibleAnywhere, Category="General")
294 uint16 bSoftSwingLimitsEnabled : 1 = false;
295 UPROPERTY(VisibleAnywhere, Category="General")
296 uint16 bAngularSLerpPositionDriveEnabled : 1 = false;
297 UPROPERTY(VisibleAnywhere, Category="General")
298 uint16 bAngularSLerpVelocityDriveEnabled : 1 = false;
299 UPROPERTY(VisibleAnywhere, Category="General")
300 uint16 bAngularTwistPositionDriveEnabled : 1 = false;
301 UPROPERTY(VisibleAnywhere, Category="General")
302 uint16 bAngularTwistVelocityDriveEnabled : 1 = false;
303 UPROPERTY(VisibleAnywhere, Category="General")
304 uint16 bAngularSwingPositionDriveEnabled : 1 = false;
305 UPROPERTY(VisibleAnywhere, Category="General")
306 uint16 bAngularSwingVelocityDriveEnabled : 1 = false;
307
308 UPROPERTY(VisibleAnywhere, Category="General")
310 UPROPERTY(VisibleAnywhere, Category="General")
311 double LinearLimit = 0.0;
312 UPROPERTY(VisibleAnywhere, Category="General")
314 UPROPERTY(VisibleAnywhere, Category="General")
315 FVector AngularLimits = FVector::ZeroVector;
316
317 UPROPERTY(VisibleAnywhere, Category="General")
319 UPROPERTY(VisibleAnywhere, Category="General")
321 UPROPERTY(VisibleAnywhere, Category="General")
322 double SoftLinearStiffness = 0.0;
323 UPROPERTY(VisibleAnywhere, Category="General")
324 double SoftLinearDamping = 0.0;
325 UPROPERTY(VisibleAnywhere, Category="General")
326 double SoftTwistStiffness = 0.0;
327 UPROPERTY(VisibleAnywhere, Category="General")
328 double SoftTwistDamping = 0.0;
329 UPROPERTY(VisibleAnywhere, Category="General")
330 double SoftSwingStiffness = 0.0;
331 UPROPERTY(VisibleAnywhere, Category="General")
332 double SoftSwingDamping = 0.0;
333 UPROPERTY(VisibleAnywhere, Category="General")
334 double LinearRestitution = 0.0;
335 UPROPERTY(VisibleAnywhere, Category="General")
336 double TwistRestitution = 0.0;
337 UPROPERTY(VisibleAnywhere, Category="General")
338 double SwingRestitution = 0.0;
339
340 UPROPERTY(VisibleAnywhere, Category="General")
341 double LinearContactDistance = 0.0;
342 UPROPERTY(VisibleAnywhere, Category="General")
343 double TwistContactDistance = 0.0;
344 UPROPERTY(VisibleAnywhere, Category="General")
345 double SwingContactDistance = 0.0;
346
347 UPROPERTY(VisibleAnywhere, Category="General")
348 FVector LinearDrivePositionTarget = FVector::ZeroVector;
349 UPROPERTY(VisibleAnywhere, Category="General")
350 FVector LinearDriveVelocityTarget = FVector::ZeroVector;
351
352 UPROPERTY(VisibleAnywhere, Category="General")
353 uint8 bLinearPositionDriveEnabled0 : 1 = false;
354 UPROPERTY(VisibleAnywhere, Category="General")
355 uint8 bLinearPositionDriveEnabled1 : 1 = false;
356 UPROPERTY(VisibleAnywhere, Category="General")
357 uint8 bLinearPositionDriveEnabled2 : 1 = false;
358 UPROPERTY(VisibleAnywhere, Category="General")
359 uint8 bLinearVelocityDriveEnabled0 : 1 = false;
360 UPROPERTY(VisibleAnywhere, Category="General")
361 uint8 bLinearVelocityDriveEnabled1 : 1 = false;
362 UPROPERTY(VisibleAnywhere, Category="General")
363 uint8 bLinearVelocityDriveEnabled2 : 1 = false;
364
365 UPROPERTY(VisibleAnywhere, Category="General")
367 UPROPERTY(VisibleAnywhere, Category="General")
368 FVector LinearDriveStiffness = FVector::ZeroVector;
369 UPROPERTY(VisibleAnywhere, Category="General")
370 FVector LinearDriveDamping = FVector::ZeroVector;
371 UPROPERTY(VisibleAnywhere, Category="General")
372 FVector LinearDriveMaxForce = FVector::ZeroVector;
373 UPROPERTY(VisibleAnywhere, Category="General")
374 FQuat AngularDrivePositionTarget = FQuat::Identity;
375 UPROPERTY(VisibleAnywhere, Category="General")
376 FVector AngularDriveVelocityTarget = FVector::ZeroVector;
377 UPROPERTY(VisibleAnywhere, Category="General")
379 UPROPERTY(VisibleAnywhere, Category="General")
380 FVector AngularDriveStiffness = FVector::ZeroVector;
381 UPROPERTY(VisibleAnywhere, Category="General")
382 FVector AngularDriveDamping = FVector::ZeroVector;
383 UPROPERTY(VisibleAnywhere, Category="General")
384 FVector AngularDriveMaxTorque = FVector::ZeroVector;
385 UPROPERTY(VisibleAnywhere, Category="General")
386 double LinearBreakForce = 0.0;
387 UPROPERTY(VisibleAnywhere, Category="General")
388 double LinearPlasticityLimit = 0.0;
389 UPROPERTY(VisibleAnywhere, Category="General")
391 UPROPERTY(VisibleAnywhere, Category="General")
392 double LinearPlasticityInitialDistanceSquared = 0.0;
393 UPROPERTY(VisibleAnywhere, Category="General")
394 double AngularBreakTorque = 0.0;
395 UPROPERTY(VisibleAnywhere, Category="General")
396 double AngularPlasticityLimit = 0.0;
397 UPROPERTY(VisibleAnywhere, Category="General")
398 double ContactTransferScale = 0.0;
399};
400
402
403USTRUCT()
405{
407
409
411
412 int32 SolverID = INDEX_NONE;
413
414 UPROPERTY(VisibleAnywhere, Category="General")
415 int32 ConstraintIndex = INDEX_NONE;
416
417 int32 ParticleParIndexes[2] = { INDEX_NONE, INDEX_NONE };
418
419 UPROPERTY(VisibleAnywhere, Category=JointState)
420 FChaosVDJointStateDataWrapper PhysicsThreadJointState;
421
422 UPROPERTY()
424
425 UPROPERTY(VisibleAnywhere, Category=JointSettings)
427
428 virtual int32 GetSolverID() const override { return SolverID; }
429 virtual int32 GetParticleIDAtSlot(EChaosVDParticlePairIndex IndexSlot) const override { return ParticleParIndexes[static_cast<int32>(IndexSlot)]; }
430 virtual int32 GetConstraintIndex () const override {return ConstraintIndex; }
431};
432
434
435
436
#define CVD_IMPLEMENT_SERIALIZER(Type)
Definition ChaosVDDataSerializationMacros.h:30
EChaosVDGTJointStateFlags
Definition ChaosVDJointDataWrappers.h:43
EChaosVDJointSolverSettingsFlags
Definition ChaosVDJointDataWrappers.h:119
EChaosVDJointSyncType
Definition ChaosVDJointDataWrappers.h:22
EChaosVDJointSettingsFlags
Definition ChaosVDJointDataWrappers.h:236
EChaosVDPlasticityType
Definition ChaosVDJointDataWrappers.h:228
EChaosVDJointStateFlags
Definition ChaosVDJointDataWrappers.h:31
EChaosVDJointForceMode
Definition ChaosVDJointDataWrappers.h:221
EChaosVDJointMotionType
Definition ChaosVDJointDataWrappers.h:213
EChaosVDJointReSimType
Definition ChaosVDJointDataWrappers.h:13
EChaosVDParticlePairIndex
Definition ChaosVDParticleDataWrapper.h:90
@ INDEX_NONE
Definition CoreMiscDefines.h:150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
return true
Definition ExternalRpcRegistry.cpp:601
@ General
Definition MaterialExpressionFunctionInput.h:41
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
@ false
Definition radaudio_common.h:23
Definition ChaosVDParticleDataWrapper.h:98
Definition ChaosVDJointDataWrappers.h:92
Definition ChaosVDJointDataWrappers.h:405
virtual int32 GetParticleIDAtSlot(EChaosVDParticlePairIndex IndexSlot) const override
Definition ChaosVDJointDataWrappers.h:429
virtual int32 GetConstraintIndex() const override
Definition ChaosVDJointDataWrappers.h:430
Definition ChaosVDJointDataWrappers.h:260
Definition ChaosVDJointDataWrappers.h:135
Definition ChaosVDJointDataWrappers.h:54
Definition ChaosVDParticleDataWrapper.h:76