UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TaperedCapsuleElem.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
8#include "TaperedCapsuleElem.generated.h"
9
12
14USTRUCT()
16{
18
19
20 UPROPERTY(Category=Capsule, EditAnywhere)
22
24 UPROPERTY(Category = Capsule, EditAnywhere, meta = (ClampMin = "-360", ClampMax = "360"))
26
28 UPROPERTY(Category= Capsule, EditAnywhere)
29 float Radius0;
30
32 UPROPERTY(Category= Capsule, EditAnywhere)
33 float Radius1;
34
36 UPROPERTY(Category= Capsule, EditAnywhere)
37 float Length;
38
40 UPROPERTY(Category = Capsule, EditAnywhere)
41 bool bOneSidedCollision = false;
42
47
48 friend bool operator==( const FKTaperedCapsuleElem& LHS, const FKTaperedCapsuleElem& RHS )
49 {
50 return ( LHS.Center == RHS.Center &&
51 LHS.Rotation == RHS.Rotation &&
52 LHS.Radius0 == RHS.Radius0 &&
53 LHS.Radius1 == RHS.Radius1 &&
54 LHS.Length == RHS.Length &&
55 LHS.bOneSidedCollision == RHS.bOneSidedCollision);
56 };
57
58 // Utility function that builds an FTransform from the current data
59 virtual FTransform GetTransform() const override final
60 {
61 return FTransform(Rotation, Center );
62 };
63
65 {
66 ensure(InTransform.IsValid());
67 Rotation = InTransform.Rotator();
68 Center = InTransform.GetLocation();
69 }
70
71 ENGINE_API void DrawElemWire(class FPrimitiveDrawInterface* PDI, const FTransform& ElemTM, float Scale, const FColor Color) const override;
72 ENGINE_API void DrawElemSolid(class FPrimitiveDrawInterface* PDI, const FTransform& ElemTM, float Scale, const FMaterialRenderProxy* MaterialRenderProxy) const override;
73
74 ENGINE_API void DrawElemWire(class FPrimitiveDrawInterface* PDI, const FTransform& ElemTM, const FVector& Scale3D, const FColor Color) const;
75 ENGINE_API void DrawElemSolid(class FPrimitiveDrawInterface* PDI, const FTransform& ElemTM, const FVector& Scale3D, const FMaterialRenderProxy* MaterialRenderProxy) const;
76
77 ENGINE_API void GetElemSolid(const FTransform& ElemTM, const FVector& Scale3D, const FMaterialRenderProxy* MaterialRenderProxy, int32 ViewIndex, FMeshElementCollector& Collector) const;
78 ENGINE_API FBox CalcAABB(const FTransform& BoneTM, float Scale) const;
79
80 ENGINE_API void ScaleElem(FVector DeltaSize, float MinSize);
81
82 ENGINE_API FKTaperedCapsuleElem GetFinalScaled(const FVector& Scale3D, const FTransform& RelativeTM) const;
83
85 ENGINE_API void GetScaledRadii(const FVector& Scale3D, float& OutRadius0, float& OutRadius1) const;
87 ENGINE_API float GetScaledCylinderLength(const FVector& Scale3D) const;
89 ENGINE_API float GetScaledHalfLength(const FVector& Scale3D) const;
90
96 ENGINE_API static void DrawTaperedCapsuleSides(FPrimitiveDrawInterface* PDI, const FTransform& ElemTM, const FVector& InCenter0, const FVector& InCenter1, float InRadius0, float InRadius1, const FColor& Color, bool bInSplitTaperedCylinder = false);
97
99};
#define ensure( InExpression)
Definition AssertionMacros.h:464
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
UE::Math::TTransform< double > FTransform
Definition MathFwd.h:53
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
Definition MaterialRenderProxy.h:102
Definition MeshElementCollector.h:26
Definition PrimitiveDrawInterface.h:19
Type
Definition ShapeElem.h:17
@ false
Definition radaudio_common.h:23
Definition Color.h:486
Definition ShapeElem.h:35
Definition TaperedCapsuleElem.h:16
void SetTransform(const FTransform &InTransform)
Definition TaperedCapsuleElem.h:64
virtual FTransform GetTransform() const override final
Definition TaperedCapsuleElem.h:59
static ENGINE_API EAggCollisionShape::Type StaticShapeType
Definition TaperedCapsuleElem.h:98