UCapsuleComponent

Inheritance Hierarchy

Syntax

class UCapsuleComponent : public UShapeComponent

Remarks

A capsule generally used for simple collision. Bounds are rendered as lines in the editor.

Variables

Name Description

Protected variable

float

 

CapsuleHalfHeight

Half-height, from center of capsule to the end of top or bottom hemisphere.

Protected variable

float

 

CapsuleRadius

Radius of cap hemispheres and center cylinder. This cannot be more than CapsuleHalfHeight.

Constructors

Name Description

Public function

UCapsuleComponent

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Public function

float

 

GetScaledCapsuleHalfHeight()

Returns the capsule half-height scaled by the component scale.

Public function

float

 

GetScaledCapsuleHalfHeight_WithoutHemisphere()

Returns the capsule half-height minus radius (to exclude the hemisphere), scaled by the component scale.

Public function

float

 

GetScaledCapsuleRadius()

Returns the capsule radius scaled by the component scale.

Public function

void

 

GetScaledCapsuleSize

(
    float& OutRadius,
    float& OutHalfHeight
)

Returns the capsule radius and half-height scaled by the component scale.

Public function

void

 

GetScaledCapsuleSize_WithoutHemisphere

(
    float& OutRadius,
    float& OutHalfHeightWithoutHemisph...
)

Returns the capsule radius and half-height scaled by the component scale.

Public function

float

 

GetShapeScale()

Get the scale used by this shape.

Public function

float

 

GetUnscaledCapsuleHalfHeight()

Returns the capsule half-height, ignoring component scaling.

Public function

float

 

GetUnscaledCapsuleHalfHeight_WithoutHemisphere()

Returns the capsule half-height minus radius (to exclude the hemisphere), ignoring component scaling.

Public function

float

 

GetUnscaledCapsuleRadius()

Returns the capsule radius, ignoring component scaling.

Public function

void

 

GetUnscaledCapsuleSize

(
    float& OutRadius,
    float& OutHalfHeight
)

Returns the capsule radius and half-height scaled by the component scale.

Public function

void

 

GetUnscaledCapsuleSize_WithoutHemisphere

(
    float& OutRadius,
    float& OutHalfHeightWithoutHemisph...
)

Returns the capsule radius and half-height, ignoring component scaling.

Public function

void

 

InitCapsuleSize

(
    float InRadius,
    float InHalfHeight
)

Sets the capsule size without triggering a render or physics update. This is the preferred method when initializing a component in a class constructor.

Public function

void

 

SetCapsuleHalfHeight

(
    float HalfHeight,
    bool bUpdateOverlaps
)

Set the capsule half-height.

Public function

void

 

SetCapsuleRadius

(
    float Radius,
    bool bUpdateOverlaps
)

-------------- INLINES ------------

Public function

void

 

SetCapsuleSize

(
    float InRadius,
    float InHalfHeight,
    bool bUpdateOverlaps
)

WITH_EDITOR.

Overridden from UShapeComponent

Name Description

Public function Virtual

void

 

UpdateBodySetup()

WITH_EDITOR.

Overridden from UPrimitiveComponent

Name Description

Public function Virtual

bool

 

AreSymmetricRotations

(
    const FQuat & A,
    const FQuat & B,
    const FVector & Scale3D
)

Returns true if the given transforms result in the same bounds, due to rotational symmetry.

Public function Virtual

FPrimitiveSc ...

 

CreateSceneProxy()

Creates a proxy to represent the primitive to the scene manager in the rendering thread.

Public function Virtual

FCollisionSh ...

 

GetCollisionShape

(
    float Inflation
)

Return a CollisionShape that most closely matches this primitive.

Public function Virtual

bool

 

IsZeroExtent()

This isn't bound extent, but for shape component to utilize extent is 0.

Overridden from USceneComponent

Name Description

Public function Virtual

void

 

CalcBoundingCylinder

(
    float& CylinderRadius,
    float& CylinderHalfHeight
)

Calculate the axis-aligned bounding cylinder of the component (radius in X-Y, half-height along Z axis).

Public function Virtual

FBoxSphereBo ...

 

CalcBounds

(
    const FTransform & LocalToWorld
)

WITH_EDITOR.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent & PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostLoad()

WITH_EDITOR.

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

UObject serializer.

References

Module

Engine

Header

Runtime/Engine/Classes/Components/CapsuleComponent.h