UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FKSphereElem Struct Reference

#include <SphereElem.h>

+ Inheritance diagram for FKSphereElem:

Public Member Functions

 FKSphereElem ()
 
 FKSphereElem (float r)
 
virtual ENGINE_API ~FKSphereElem ()
 
virtual FTransform GetTransform () const override final
 
void SetTransform (const FTransform &InTransform)
 
FVector::FReal GetVolume (const FVector &Scale) const
 
FVector::FReal GetScaledVolume (const FVector &Scale) const
 
ENGINE_API void DrawElemWire (class FPrimitiveDrawInterface *PDI, const FTransform &ElemTM, float Scale, const FColor Color) const override
 
ENGINE_API void DrawElemSolid (class FPrimitiveDrawInterface *PDI, const FTransform &ElemTM, float Scale, const FMaterialRenderProxy *MaterialRenderProxy) const override
 
ENGINE_API void DrawElemWire (class FPrimitiveDrawInterface *PDI, const FTransform &ElemTM, const FVector &Scale3D, const FColor Color) const
 
ENGINE_API void DrawElemSolid (class FPrimitiveDrawInterface *PDI, const FTransform &ElemTM, const FVector &Scale3D, const FMaterialRenderProxy *MaterialRenderProxy) const
 
ENGINE_API void GetElemSolid (const FTransform &ElemTM, const FVector &Scale3D, const FMaterialRenderProxy *MaterialRenderProxy, int32 ViewIndex, class FMeshElementCollector &Collector) const
 
ENGINE_API FBox CalcAABB (const FTransform &BoneTM, float Scale) const
 
ENGINE_API void ScaleElem (FVector DeltaSize, float MinSize)
 
ENGINE_API FKSphereElem GetFinalScaled (const FVector &Scale3D, const FTransform &RelativeTM) const
 
ENGINE_API float GetShortestDistanceToPoint (const FVector &WorldPosition, const FTransform &BodyToWorldTM) const
 
ENGINE_API float GetClosestPointAndNormal (const FVector &WorldPosition, const FTransform &BodyToWorldTM, FVector &ClosestWorldPosition, FVector &Normal) const
 
- Public Member Functions inherited from FKShapeElem
 FKShapeElem ()
 
 FKShapeElem (EAggCollisionShape::Type InShapeType)
 
 FKShapeElem (const FKShapeElem &Copy)
 
virtual ENGINE_API ~FKShapeElem ()
 
const FKShapeElemoperator= (const FKShapeElem &Other)
 
template<typename T >
T * GetShapeCheck ()
 
const FUserDataGetUserData () const
 
const FNameGetName () const
 
void SetName (const FName &InName)
 
EAggCollisionShape::Type GetShapeType () const
 
bool GetContributeToMass () const
 
void SetContributeToMass (bool bInContributeToMass)
 
void SetCollisionEnabled (ECollisionEnabled::Type InCollisionEnabled)
 
ECollisionEnabled::Type GetCollisionEnabled () const
 
virtual void DrawElemSolid (class FPrimitiveDrawInterface *PDI, const FTransform &ElemTM, const float Scale, const class FMaterialRenderProxy *MaterialRenderProxy) const
 

Public Attributes

FVector Center
 
float Radius
 
- Public Attributes inherited from FKShapeElem
float RestOffset
 

Static Public Attributes

static ENGINE_API EAggCollisionShape::Type StaticShapeType = EAggCollisionShape::Sphere
 
- Static Public Attributes inherited from FKShapeElem
static ENGINE_API EAggCollisionShape::Type StaticShapeType = EAggCollisionShape::Unknown
 

Friends

bool operator== (const FKSphereElem &LHS, const FKSphereElem &RHS)
 

Additional Inherited Members

- Protected Member Functions inherited from FKShapeElem
void CloneElem (const FKShapeElem &Other)
 

Detailed Description

Sphere shape used for collision

Constructor & Destructor Documentation

◆ FKSphereElem() [1/2]

FKSphereElem::FKSphereElem ( )
inline

◆ FKSphereElem() [2/2]

FKSphereElem::FKSphereElem ( float  r)
inline

◆ ~FKSphereElem()

FKSphereElem::~FKSphereElem ( )
virtualdefault

Member Function Documentation

◆ CalcAABB()

FBox FKSphereElem::CalcAABB ( const FTransform BoneTM,
float  Scale 
) const

◆ DrawElemSolid() [1/2]

void FKSphereElem::DrawElemSolid ( class FPrimitiveDrawInterface PDI,
const FTransform ElemTM,
const FVector Scale3D,
const FMaterialRenderProxy MaterialRenderProxy 
) const

◆ DrawElemSolid() [2/2]

void FKSphereElem::DrawElemSolid ( class FPrimitiveDrawInterface PDI,
const FTransform ElemTM,
float  Scale,
const FMaterialRenderProxy MaterialRenderProxy 
) const
override

◆ DrawElemWire() [1/2]

void FKSphereElem::DrawElemWire ( class FPrimitiveDrawInterface PDI,
const FTransform ElemTM,
const FVector Scale3D,
const FColor  Color 
) const

◆ DrawElemWire() [2/2]

void FKSphereElem::DrawElemWire ( class FPrimitiveDrawInterface PDI,
const FTransform ElemTM,
float  Scale,
const FColor  Color 
) const
overridevirtual

Reimplemented from FKShapeElem.

◆ GetClosestPointAndNormal()

float FKSphereElem::GetClosestPointAndNormal ( const FVector WorldPosition,
const FTransform BodyToWorldTM,
FVector ClosestWorldPosition,
FVector Normal 
) const

Finds the closest point on the shape given a world position. Input and output are given in world space

Parameters
WorldPositionThe point we are trying to get close to
BodyToWorldTMThe transform to convert BodySetup into world space
ClosestWorldPositionThe closest point on the shape in world space
NormalThe normal of the feature associated with ClosestWorldPosition.
Returns
The distance between WorldPosition and the shape. 0 indicates WorldPosition is inside the shape.

◆ GetElemSolid()

void FKSphereElem::GetElemSolid ( const FTransform ElemTM,
const FVector Scale3D,
const FMaterialRenderProxy MaterialRenderProxy,
int32  ViewIndex,
class FMeshElementCollector Collector 
) const

◆ GetFinalScaled()

FKSphereElem FKSphereElem::GetFinalScaled ( const FVector Scale3D,
const FTransform RelativeTM 
) const

◆ GetScaledVolume()

FVector::FReal FKSphereElem::GetScaledVolume ( const FVector Scale) const
inline

◆ GetShortestDistanceToPoint()

float FKSphereElem::GetShortestDistanceToPoint ( const FVector WorldPosition,
const FTransform BodyToWorldTM 
) const

Finds the shortest distance between the element and a world position. Input and output are given in world space

Parameters
WorldPositionThe point we are trying to get close to
BodyToWorldTMThe transform to convert BodySetup into world space
Returns
The distance between WorldPosition and the shape. 0 indicates WorldPosition is inside the shape.

◆ GetTransform()

virtual FTransform FKSphereElem::GetTransform ( ) const
inlinefinaloverridevirtual

Reimplemented from FKShapeElem.

◆ GetVolume()

FVector::FReal FKSphereElem::GetVolume ( const FVector Scale) const
inline

◆ ScaleElem()

void FKSphereElem::ScaleElem ( FVector  DeltaSize,
float  MinSize 
)

◆ SetTransform()

void FKSphereElem::SetTransform ( const FTransform InTransform)
inline

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const FKSphereElem LHS,
const FKSphereElem RHS 
)
friend

Member Data Documentation

◆ Center

FVector FKSphereElem::Center

Position of the sphere's origin

◆ Radius

float FKSphereElem::Radius

Radius of the sphere

◆ StaticShapeType

EAggCollisionShape::Type FKSphereElem::StaticShapeType = EAggCollisionShape::Sphere
static

The documentation for this struct was generated from the following files: