Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/Components
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- UPrimitiveComponent
- UShapeComponent
- UCapsuleComponent
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/Components/CapsuleComponent.h |
| Include | #include "Components/CapsuleComponent.h" |
Syntax
class UCapsuleComponent : public UShapeComponent
Remarks
A capsule generally used for simple collision. Bounds are rendered as lines in the editor.
Variables
| Type | Name | Description | |
|---|---|---|---|
| float | CapsuleHalfHeight | Half-height, from center of capsule to the end of top or bottom hemisphere. | |
| float | CapsuleRadius | Radius of cap hemispheres and center cylinder. This cannot be more than CapsuleHalfHeight. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UCapsuleComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| float | Returns the capsule half-height scaled by the component scale. | ||
| float | Returns the capsule half-height minus radius (to exclude the hemisphere), scaled by the component scale. | ||
| float | Returns the capsule radius scaled by the component scale. | ||
| void | GetScaledCapsuleSize
(
float& OutRadius, |
Returns the capsule radius and half-height scaled by the component scale. | |
| void | GetScaledCapsuleSize_WithoutHemisphere
(
float& OutRadius, |
Returns the capsule radius and half-height scaled by the component scale. | |
| float | Get the scale used by this shape. | ||
| float | Returns the capsule half-height, ignoring component scaling. This includes the hemisphere end cap. | ||
| float | Returns the capsule half-height minus radius (to exclude the hemisphere), ignoring component scaling. | ||
| float | Returns the capsule radius, ignoring component scaling. | ||
| void | GetUnscaledCapsuleSize
(
float& OutRadius, |
Returns the capsule radius and half-height scaled by the component scale. | |
| void | GetUnscaledCapsuleSize_WithoutHemisphere
(
float& OutRadius, |
Returns the capsule radius and half-height, ignoring component scaling. | |
| void | InitCapsuleSize
(
float InRadius, |
Sets the capsule size without triggering a render or physics update. This is the preferred method when initializing a component in a class constructor. | |
| void | SetCapsuleHalfHeight
(
float HalfHeight, |
Set the capsule half-height. | |
| void | SetCapsuleRadius
(
float Radius, |
Set the capsule radius. | |
| void | SetCapsuleSize
(
float InRadius, |
Change the capsule size. This is the unscaled size, before component scale is applied. |
Overridden from UShapeComponent
| Type | Name | Description | |
|---|---|---|---|
| void | Update the body setup parameters based on shape information |
Overridden from UPrimitiveComponent
| Type | Name | Description | |
|---|---|---|---|
| bool | AreSymmetricRotations
(
const FQuat& A, |
Returns true if the given transforms result in the same bounds, due to rotational symmetry. | |
| FPrimitiveSceneProxy * | Creates a proxy to represent the primitive to the scene manager in the rendering thread. | ||
| FCollisionShape | GetCollisionShape
(
float Inflation |
Return a CollisionShape that most closely matches this primitive. | |
| bool | IsZeroExtent () |
This isn't bound extent, but for shape component to utilize extent is 0. |
Overridden from USceneComponent
| Type | Name | Description | |
|---|---|---|---|
| void | CalcBoundingCylinder
(
float& CylinderRadius, |
Calculate the axis-aligned bounding cylinder of the component (radius in X-Y, half-height along Z axis). | |
| FBoxSphereBounds | CalcBounds
(
const FTransform& LocalToWorld |
Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Called when a property on this object has been modified externally | |
| void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | |
| void | Handles reading, writing, and reference collecting using FArchive. |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| float | CapsuleHeight_DEPRECATED |