Navigation
API > API/Runtime > API/Runtime/Engine
A sphere generally used for simple collision. Bounds are rendered as lines in the editor.
| Name | USphereComponent |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Components/SphereComponent.h |
| Include Path | #include "Components/SphereComponent.h" |
Syntax
UCLASS (ClassGroup="Collision", EditInlineNew,
HideCategories=(Object, LOD, Lighting, TextureStreaming),
Meta=(DisplayName="Sphere Collision", BlueprintSpawnableComponent), MinimalAPI)
class USphereComponent : public UShapeComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → USceneComponent → UPrimitiveComponent → UShapeComponent → USphereComponent
Implements Interfaces
- IAsyncPhysicsStateProcessor
- IInterface_AssetUserData
- IInterface_AsyncCompilation
- INavRelevantInterface
- IPhysicsComponent
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
USphereComponent
(
const FObjectInitializer& ObjectInitializer |
Components/SphereComponent.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
float GetScaledSphereRadius() |
Components/SphereComponent.h |
|
|
float GetShapeScale () |
Get the scale used by this shape. | Components/SphereComponent.h |
|
float GetUnscaledSphereRadius() |
Components/SphereComponent.h |
|
|
void InitSphereRadius
(
float InSphereRadius |
Sets the sphere radius without triggering a render or physics update. | Components/SphereComponent.h | |
void SetSphereRadius
(
float InSphereRadius, |
Change the sphere radius. This is the unscaled radius, before component scale is applied. | Components/SphereComponent.h |
|
Overridden from UShapeComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void UpdateBodySetup() |
Update the body setup parameters based on shape information | Components/SphereComponent.h |
Overridden from UPrimitiveComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool AreSymmetricRotations
(
const FQuat& A, |
Returns true if the given transforms result in the same bounds, due to rotational symmetry. | Components/SphereComponent.h | |
virtual FPrimitiveSceneProxy * CreateSceneProxy() |
Creates a proxy to represent the primitive to the scene manager in the rendering thread. | Components/SphereComponent.h | |
virtual FCollisionShape GetCollisionShape
(
float Inflation |
Return a CollisionShape that most closely matches this primitive. | Components/SphereComponent.h | |
virtual bool IsZeroExtent () |
This isn't bound extent, but for shape component to utilize extent is 0. | Components/SphereComponent.h |
Overridden from USceneComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void CalcBoundingCylinder
(
float& CylinderRadius, |
Calculate the axis-aligned bounding cylinder of the component (radius in X-Y, half-height along Z axis). | Components/SphereComponent.h | |
virtual FBoxSphereBounds CalcBounds
(
const FTransform& LocalToWorld |
Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size. | Components/SphereComponent.h |