17#include "AggregateGeom.generated.h"
27 UPROPERTY(EditAnywhere,
editfixedsize, Category =
"Aggregate Geometry", meta = (DisplayName =
"Spheres", TitleProperty =
"Name"))
55 : RenderInfoPtr(
nullptr)
60 : RenderInfoPtr(nullptr)
81 template <
typename Callable>
109 if constexpr(!std::is_same_v<RetType, void>)
115 template <
typename Callable>
143 if constexpr(!std::is_same_v<RetType, void>)
150 template <
typename T>
166 return &SphereElems[
Index];
172 return &BoxElems[
Index];
178 return &SphylElems[
Index];
184 return &ConvexElems[
Index];
188 if (
ensure(TaperedCapsuleElems.IsValidIndex(
Index)))
190 return &TaperedCapsuleElems[
Index];
196 return &LevelSetElems[
Index];
230 return &SphereElems[
Index];
236 return &BoxElems[
Index];
242 return &SphylElems[
Index];
248 return &ConvexElems[
Index];
252 if (
ensure(TaperedCapsuleElems.IsValidIndex(
Index)))
254 return &TaperedCapsuleElems[
Index];
260 return &LevelSetElems[
Index];
290 if (SphereElems.IsValidIndex(
Index))
292 return &SphereElems[
Index];
294 Index -= SphereElems.Num();
295 if (BoxElems.IsValidIndex(
Index))
297 return &BoxElems[
Index];
299 Index -= BoxElems.Num();
300 if (SphylElems.IsValidIndex(
Index))
302 return &SphylElems[
Index];
304 Index -= SphylElems.Num();
305 if (ConvexElems.IsValidIndex(
Index))
307 return &ConvexElems[
Index];
309 Index -= ConvexElems.Num();
310 if (TaperedCapsuleElems.IsValidIndex(
Index))
312 return &TaperedCapsuleElems[
Index];
314 Index -= TaperedCapsuleElems.Num();
315 if (LevelSetElems.IsValidIndex(
Index))
317 return &LevelSetElems[
Index];
319 Index -= LevelSetElems.Num();
341 if (SphereElems.IsValidIndex(
Index))
343 return &SphereElems[
Index];
345 Index -= SphereElems.Num();
346 if (BoxElems.IsValidIndex(
Index))
348 return &BoxElems[
Index];
350 Index -= BoxElems.Num();
351 if (SphylElems.IsValidIndex(
Index))
353 return &SphylElems[
Index];
355 Index -= SphylElems.Num();
356 if (ConvexElems.IsValidIndex(
Index))
358 return &ConvexElems[
Index];
360 Index -= ConvexElems.Num();
361 if (TaperedCapsuleElems.IsValidIndex(
Index))
363 return &TaperedCapsuleElems[
Index];
365 Index -= TaperedCapsuleElems.Num();
366 if (LevelSetElems.IsValidIndex(
Index))
368 return &LevelSetElems[
Index];
370 Index -= LevelSetElems.Num();
434 int32 StartIndex = 0;
437 return FoundIndex + StartIndex;
439 StartIndex += SphereElems.Num();
444 return FoundIndex + StartIndex;
446 StartIndex += BoxElems.Num();
451 return FoundIndex + StartIndex;
453 StartIndex += SphylElems.Num();
458 return FoundIndex + StartIndex;
460 StartIndex += ConvexElems.Num();
465 return FoundIndex + StartIndex;
467 StartIndex += TaperedCapsuleElems.Num();
472 return FoundIndex + StartIndex;
474 StartIndex += LevelSetElems.Num();
479 return FoundIndex + StartIndex;
485 return FoundIndex + StartIndex;
491 return FoundIndex + StartIndex;
497#if WITH_EDITORONLY_DATA
500 auto CleanUp = [](
auto& Elems)
504 return Elem.bIsGenerated ==
false;
527 TaperedCapsuleElems.Empty();
528 LevelSetElems.Empty();
535#if WITH_EDITORONLY_DATA
556 UE_DEPRECATED(5.1,
"Changed to GetScaledVolume. Note that Volume calculation now includes non-uniform scale so values may have changed")
569 SphereElems =
Other.SphereElems;
570 BoxElems =
Other.BoxElems;
571 SphylElems =
Other.SphylElems;
572 ConvexElems =
Other.ConvexElems;
573 TaperedCapsuleElems =
Other.TaperedCapsuleElems;
574 LevelSetElems =
Other.LevelSetElems;
584 [InName](
const T&
Elem)
586 return InName ==
Elem.GetName();
595 [InName](
const T&
Elem)
597 return InName ==
Elem.GetName();
603 mutable std::atomic<class FKConvexGeomRenderInfo*> RenderInfoPtr;
constexpr auto MakeArrayView(OtherRangeType &&Other)
Definition ArrayView.h:873
#define check(expr)
Definition AssertionMacros.h:314
#define ensure( InExpression)
Definition AssertionMacros.h:464
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
typename TInvokeResult< FuncType, ArgTypes... >::Type TInvokeResult_T
Definition Invoke.h:135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ Meshes
Definition HairStrandsInterface.h:193
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
Definition Archive.h:1208
Definition MaterialRenderProxy.h:102
Definition MeshElementCollector.h:26
Definition NameTypes.h:617
Definition ArrayView.h:139
constexpr SizeType IndexOfByPredicate(Predicate Pred) const
Definition ArrayView.h:644
constexpr ElementType * FindByPredicate(Predicate Pred) const
Definition ArrayView.h:688
Type
Definition ShapeElem.h:17
@ Box
Definition ShapeElem.h:19
@ LevelSet
Definition ShapeElem.h:23
@ SkinnedTriangleMesh
Definition ShapeElem.h:26
@ SkinnedLevelSet
Definition ShapeElem.h:24
@ Convex
Definition ShapeElem.h:21
@ Sphyl
Definition ShapeElem.h:20
@ TaperedCapsule
Definition ShapeElem.h:22
@ MLLevelSet
Definition ShapeElem.h:25
@ Sphere
Definition ShapeElem.h:18
Definition RobinHoodHashTable.h:18
U16 Index
Definition radfft.cpp:71
Definition AggregateGeom.h:24
auto VisitShapeAndContainer(const FKShapeElem &InElement, Callable &&InCallable)
Definition AggregateGeom.h:116
const FKShapeElem * GetElement(const int32 InIndex) const
Definition AggregateGeom.h:338
int32 GetElementCount() const
Definition AggregateGeom.h:72
void AddElement(const T &Elem)
Definition AggregateGeom.h:151
const FKShapeElem * GetElement(const EAggCollisionShape::Type Type, const int32 Index) const
Definition AggregateGeom.h:223
FKShapeElem * GetElement(const int32 InIndex)
Definition AggregateGeom.h:287
int32 GetElementIndexByName(const FName InName) const
Definition AggregateGeom.h:431
auto VisitShapeAndContainer(FKShapeElem &InElement, Callable &&InCallable)
Definition AggregateGeom.h:82
const FKShapeElem * GetElementByName(const FName InName) const
Definition AggregateGeom.h:389
void EmptyElements()
Definition AggregateGeom.h:521
const FKAggregateGeom & operator=(const FKAggregateGeom &Other)
Definition AggregateGeom.h:65
FKShapeElem * GetElement(const EAggCollisionShape::Type Type, const int32 Index)
Definition AggregateGeom.h:159
SIZE_T GetAllocatedSize() const
Definition AggregateGeom.h:79
FKAggregateGeom(const FKAggregateGeom &Other)
Definition AggregateGeom.h:59
Definition ConvexElem.h:32
Definition LevelSetElem.h:17
Definition MLLevelSetElem.h:17
Definition ShapeElem.h:35
Definition SkinnedLevelSetElem.h:13
Definition SkinnedTriangleMeshElem.h:12
Definition SphereElem.h:15
Definition SphylElem.h:16
Definition TaperedCapsuleElem.h:16
Definition UnrealTypeTraits.h:40
Definition BoxSphereBounds.h:25