UBoxComponent

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

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Components/BoxComponent.h

Include

#include "Components/BoxComponent.h"

Syntax

class UBoxComponent : public UShapeComponent

Remarks

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

Variables

Name Description

Protected variable

FVector

 

BoxExtent

The extents (radii dimensions) of the box

Protected variable

float

 

LineThickness

Used to control the line thickness when rendering

Constructors

Name Description

Public function

UBoxComponent

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Const

FVector

 

GetScaledBoxExtent()

Public function Const

FVector

 

GetUnscaledBoxExtent()

Public function

void

 

InitBoxExtent

(
    const FVector& InBoxExtent
)

Sets the box extents without triggering a render or physics update.

Public function

void

 

SetBoxExtent

(
    FVector InBoxExtent,
    bool bUpdateOverlaps
)

Change the box extent size. This is the unscaled size, before component scale is applied.

Overridden from UShapeComponent

Name Description

Public function Virtual

void

 

UpdateBodySetup()

Update the body setup parameters based on shape information

Overridden from UPrimitiveComponent

Name Description

Public function Virtual

FPrimitiveSc...

 

CreateSceneProxy()

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

Public function Virtual Const

FCollisionSh...

 

GetCollisionShape

(
    float Inflation
)

Return a CollisionShape that most closely matches this primitive.

Public function Virtual Const

bool

 

IsZeroExtent()

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

Overridden from USceneComponent

Name Description

Public function Virtual Const

FBoxSphereBo...

 

CalcBounds

(
    const FTransform& LocalToWorld
)

Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback