UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ClothCollisionPrim.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
7#include "ClothCollisionPrim.generated.h"
8
12USTRUCT()
14{
16
18 : BoneIndex(InBoneIndex)
19 , Radius(InRadius)
20 , LocalPosition(InLocalPosition)
21 {}
22
24 {
25 return
26 BoneIndex == Other.BoneIndex &&
27 FMath::IsNearlyEqual(Radius, Other.Radius) &&
28 LocalPosition.Equals(Other.LocalPosition);
29 }
30
31 UPROPERTY()
32 int32 BoneIndex;
33
34 UPROPERTY()
35 float Radius;
36
37 UPROPERTY()
38 FVector LocalPosition;
39};
40
44USTRUCT()
46{
48
50 {
51 SphereIndices[0] = SphereIndex0;
52 SphereIndices[1] = SphereIndex1;
53 OneSidedPlaneNormal = InOneSidedPlaneNormal;
54 }
55
57 {
58 return
59 SphereIndices[0] == Other.SphereIndices[0] &&
60 SphereIndices[1] == Other.SphereIndices[1] &&
61 OneSidedPlaneNormal == Other.OneSidedPlaneNormal;
62 }
63
64 UPROPERTY()
65 int32 SphereIndices[2];
66
67 /* Zero vector means this is not a one-sided capsule.*/
68 UPROPERTY()
69 FVector OneSidedPlaneNormal = FVector::ZeroVector;
70};
71
73USTRUCT()
75{
77
79
81 {
82 return Plane.Equals(Other.Plane) && Indices == Other.Indices;
83 }
84
85 UPROPERTY()
87
88 UPROPERTY()
89 TArray<int32> Indices;
90};
91
97USTRUCT()
99{
101
103 : BoneIndex(INDEX_NONE)
104 {}
105
114
116 {
117 if (BoneIndex == Other.BoneIndex &&
118 Faces == Other.Faces &&
119 SurfacePoints.Num() == Other.SurfacePoints.Num())
120 {
121 for (int32 Index = 0; Index < SurfacePoints.Num(); ++Index)
122 {
123 if (!SurfacePoints[Index].Equals(Other.SurfacePoints[Index]))
124 {
125 return false;
126 }
127 }
128 return true;
129 }
130 return false;
131 }
132
133#if WITH_EDITORONLY_DATA
134 UPROPERTY()
136#endif
137
138 UPROPERTY()
140
141 UPROPERTY()
142 TArray<FVector> SurfacePoints; // Surface points, used by Chaos and also for visualization
143
144 UPROPERTY()
145 int32 BoneIndex;
146};
147
149USTRUCT()
151{
153
155 const FVector& InLocalPosition = FVector::ZeroVector,
156 const FQuat& InLocalRotation = FQuat::Identity,
157 const FVector& InHalfExtents = FVector::ZeroVector,
159 : LocalPosition(InLocalPosition)
160 , LocalRotation(InLocalRotation)
161 , HalfExtents(InHalfExtents)
162 , BoneIndex(InBoneIndex)
163 {}
164
166 {
167 return
168 BoneIndex == Other.BoneIndex &&
169 LocalPosition.Equals(Other.LocalPosition) &&
170 LocalRotation.Equals(Other.LocalRotation) &&
171 HalfExtents.Equals(Other.HalfExtents);
172 }
173
174 UPROPERTY()
175 FVector LocalPosition;
176
177 UPROPERTY()
178 FQuat LocalRotation;
179
180 UPROPERTY()
181 FVector HalfExtents;
182
183 UPROPERTY()
184 int32 BoneIndex;
185};
@ INDEX_NONE
Definition CoreMiscDefines.h:150
@ ForceInit
Definition CoreMiscDefines.h:155
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 UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define USTRUCT(...)
Definition ObjectMacros.h:746
Definition Array.h:670
U16 Index
Definition radfft.cpp:71
Definition ClothCollisionPrim.h:151
bool operator==(const FClothCollisionPrim_Box &Other) const
Definition ClothCollisionPrim.h:165
Definition ClothCollisionPrim.h:75
bool operator==(const FClothCollisionPrim_ConvexFace &Other) const
Definition ClothCollisionPrim.h:80
Definition ClothCollisionPrim.h:99
bool operator==(const FClothCollisionPrim_Convex &Other) const
Definition ClothCollisionPrim.h:115
FClothCollisionPrim_Convex(TArray< FClothCollisionPrim_ConvexFace > &&InFaces, TArray< FVector > &&InSurfacePoints, int32 InBoneIndex=INDEX_NONE)
Definition ClothCollisionPrim.h:106
Definition ClothCollisionPrim.h:46
bool operator==(const FClothCollisionPrim_SphereConnection &Other) const
Definition ClothCollisionPrim.h:56
Definition ClothCollisionPrim.h:14
bool operator==(const FClothCollisionPrim_Sphere &Other) const
Definition ClothCollisionPrim.h:23
static UE_FORCEINLINE_HINT bool IsNearlyEqual(float A, float B, float ErrorTolerance=UE_SMALL_NUMBER)
Definition UnrealMathUtility.h:388