![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <CollisionShape.h>
Public Member Functions | |
| FCollisionShape () | |
| bool | IsLine () const |
| bool | IsBox () const |
| bool | IsSphere () const |
| bool | IsCapsule () const |
| void | SetBox (const FVector3f &HalfExtent) |
| void | SetSphere (const float Radius) |
| void | SetCapsule (const float Radius, const float HalfHeight) |
| void | SetCapsule (const FVector3f &Extent) |
| void | SetShape (const ECollisionShape::Type InShapeType, const FVector &Extent) |
| bool | IsNearlyZero () const |
| FVector | GetExtent () const |
| float | GetCapsuleAxisHalfLength () const |
| FVector | GetBox () const |
| const float | GetSphereRadius () const |
| const float | GetCapsuleRadius () const |
| const float | GetCapsuleHalfHeight () const |
| FCollisionShape | Inflate (const float Inflation) const |
| FString | ToString () const |
Static Public Member Functions | |
| static constexpr float | MinBoxExtent () |
| static constexpr float | MinSphereRadius () |
| static constexpr float | MinCapsuleRadius () |
| static constexpr float | MinCapsuleAxisHalfHeight () |
| static FCollisionShape | MakeBox (const FVector &BoxHalfExtent) |
| static FCollisionShape | MakeBox (const FVector3f &BoxHalfExtent) |
| static FCollisionShape | MakeSphere (const float SphereRadius) |
| static FCollisionShape | MakeCapsule (const float CapsuleRadius, const float CapsuleHalfHeight) |
| static FCollisionShape | MakeCapsule (const FVector &Extent) |
Public Attributes | ||
| ECollisionShape::Type | ShapeType | |
| union { | ||
| struct { | ||
| float HalfExtentX | ||
| float HalfExtentY | ||
| float HalfExtentZ | ||
| } Box | ||
| struct { | ||
| float Radius | ||
| } Sphere | ||
| struct { | ||
| float Radius | ||
| float HalfHeight | ||
| } Capsule | ||
| }; | ||
Static Public Attributes | |
| static struct FCollisionShape | LineShape |
Collision Shapes that supports Sphere, Capsule, Box, or Line
|
inline |
|
inline |
Utility function to get Box Extention
|
inline |
Get distance from center of capsule to center of sphere ends
|
inline |
Utility function to get Capsule Half Height. Note: This is the full half height which includes the sphere radius
|
inline |
Utility function to get Capsule Radius
|
inline |
Utility function to return Extent of the shape
|
inline |
Utility function to get Sphere Radius
|
inline |
|
inline |
Is the shape currently a box?
|
inline |
Is the shape currently a capsule?
|
inline |
Is the shape currently a Line (Default)?
|
inline |
Return true if nearly zero. If so, it will back out and use line trace instead
|
inline |
Is the shape currently a sphere?
|
inlinestatic |
Static utility function to make a box
|
inlinestatic |
Static utility function to make a box
|
inlinestatic |
Static utility function to make a capsule. Note: This is the full half-height (needs to include the sphere radius)
|
inlinestatic |
Static utility function to make a capsule
|
inlinestatic |
Static utility function to make a sphere
Utility function to Set Box and dimension
Utility function to set Capsule with Radius and Half Height. Note: This is the full half-height (needs to include the sphere radius)
Utility function to set Capsule from Extent data
|
inline |
Utility function to set a shape from a type and extent
Utility function to set Sphere with Radius
|
inline |
| union { ... } FCollisionShape |
Union that supports up to 3 floats
| struct { ... } FCollisionShape::Box |
| struct { ... } FCollisionShape::Capsule |
| float FCollisionShape::HalfExtentX |
| float FCollisionShape::HalfExtentY |
| float FCollisionShape::HalfExtentZ |
| float FCollisionShape::HalfHeight |
|
static |
Used by engine in multiple places. Since LineShape doesn't need any dimension, declare once and used by all codes.
| float FCollisionShape::Radius |
| ECollisionShape::Type FCollisionShape::ShapeType |
| struct { ... } FCollisionShape::Sphere |