Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/GameFramework/MovementComponent.h |
Include |
#include "GameFramework/MovementComponent.h" |
class UMovementComponent : public UActorComponent
MovementComponent is an abstract component class that defines functionality for moving a PrimitiveComponent (our UpdatedComponent) each tick. Base functionality includes:
Restricting movement to a plane or axis.
Utility functions for special handling of collision results (SlideAlongSurface(), ComputeSlideVector(), TwoWallAdjust()).
Utility functions for moving when there may be initial penetration (SafeMoveUpdatedComponent(), ResolvePenetration()).
Automatically registering the component tick and finding a component to move on the owning Actor. Normally the root component of the owning actor is moved, however another component may be selected (see SetUpdatedComponent()). During swept (non-teleporting) movement only collision of UpdatedComponent is considered, attached components will teleport to the end location ignoring collision.
Name | Description | ||
---|---|---|---|
|
uint8: 1 |
bAutoRegisterPhysicsVolumeUpdates |
If true, then applies the value of bComponentShouldUpdatePhysicsVolume to the UpdatedComponent. |
|
uint8: 1 |
bAutoRegisterUpdatedComponent |
If true, registers the owner's Root component as the UpdatedComponent if there is not one currently assigned. |
|
uint8: 1 |
bAutoUpdateTickRegistration |
If true, whenever the updated component is changed, this component will enable or disable its tick dependent on whether it has something to update. |
|
uint8: 1 |
bComponentShouldUpdatePhysicsVolume |
If true, enables bShouldUpdatePhysicsVolume on the UpdatedComponent during initialization from SetUpdatedComponent(), otherwise disables such updates. |
|
uint8: 1 |
bConstrainToPlane |
If true, movement will be constrained to a plane. |
|
uint8: 1 |
bSnapToPlaneAtStart |
If true and plane constraints are enabled, then the updated component will be snapped to the plane when first attached. |
|
uint8: 1 |
bTickBeforeOwner |
If true, after registration we will add a tick dependency to tick before our owner (if we can both tick). |
|
uint8: 1 |
bUpdateOnlyIfRendered |
If true, skips TickComponent() if UpdatedComponent was not recently rendered. |
|
MoveComponentFlags |
Flags that control the behavior of calls to MoveComponent() on our UpdatedComponent. |
|
|
PlaneConstraintNormal |
The normal or axis of the plane that constrains movement, if bConstrainToPlane is enabled. |
|
|
PlaneConstraintOrigin |
The origin of the plane that constrains movement, if plane constraint is enabled. |
|
|
TObjectPtr< USc... |
UpdatedComponent |
The component we move and update. |
|
TObjectPtr< UPr... |
UpdatedPrimitive |
UpdatedComponent, cast as a UPrimitiveComponent. |
|
Velocity |
Current velocity of updated component. |
Name | Description | |
---|---|---|
|
UMovementComponent ( |
Name | Description | ||
---|---|---|---|
|
AddRadialForce ( |
Adds force from radial force components. |
|
|
AddRadialImpulse ( |
Adds impulse from radial force components. |
|
|
ComputeSlideVector ( |
Compute a vector to slide along a surface, given an attempted move, time, and normal. |
|
|
ConstrainDirectionToPlane ( |
Constrain a direction vector to the plane constraint, if enabled. |
|
|
ConstrainLocationToPlane ( |
Constrain a position vector to the plane constraint, if enabled. |
|
|
ConstrainNormalToPlane ( |
Constrain a normal vector (of unit length) to the plane constraint, if enabled. |
|
|
float |
GetGravityZ() |
Returns gravity that affects this component |
|
float |
GetMaxSpeed() |
Returns maximum speed of component in current movement mode. |
|
GetPenetrationAdjustment ( |
Calculate a movement adjustment to try to move out of a penetration from a failed move. |
|
|
APhysicsVolu... |
GetPhysicsVolume() |
Returns the PhysicsVolume this MovementComponent is using, or the world's default physics volume if none. |
|
EPlaneConstr... |
GetPlaneConstraintAxisSetting() |
Get the plane constraint axis setting. |
|
const FVecto... |
GetPlaneConstraintNormal() |
Returns the normal of the plane that constrains movement, enforced if the plane constraint is enabled. |
|
GetPlaneConstraintNormalFromAxisSetting ( |
Helper to compute the plane constraint axis from the current setting. |
|
|
const FVecto... |
GetPlaneConstraintOrigin() |
Get the plane constraint origin. |
|
HandleImpact ( |
Called for Blocking impact |
|
|
InitCollisionParams ( |
Initialize collision params appropriately based on our collision settings. |
|
|
IsExceedingMaxSpeed ( |
Returns true if the current velocity is exceeding the given max speed (usually the result of GetMaxSpeed()), within a small error tolerance. |
|
|
IsInWater() |
Returns true if it's in PhysicsVolume with water flag |
|
|
K2_MoveUpdatedComponent ( |
Moves our UpdatedComponent by the given Delta, and sets rotation to NewRotation. |
|
|
MoveUpdatedComponent ( |
Moves our UpdatedComponent by the given Delta, and sets rotation to NewRotation. |
|
|
MoveUpdatedComponent ( |
Moves our UpdatedComponent by the given Delta, and sets rotation to NewRotation. |
|
|
MoveUpdatedComponentImpl ( |
||
|
OnTeleported() |
Called by owning Actor upon successful teleport from AActor::TeleportTo(). |
|
|
OverlapTest ( |
Return true if the given collision shape overlaps other geometry at the given location and rotation. |
|
|
PhysicsLockedAxisSettingChanged() |
||
|
PhysicsVolumeChanged ( |
Delegate when PhysicsVolume of UpdatedComponent has been changed |
|
|
ResolvePenetration ( |
||
|
ResolvePenetration ( |
Try to move out of penetration in an object after a failed move. |
|
|
ResolvePenetrationImpl ( |
||
|
SafeMoveUpdatedComponent ( |
Calls MoveUpdatedComponent(), handling initial penetrations by calling ResolvePenetration(). |
|
|
SafeMoveUpdatedComponent ( |
Calls MoveUpdatedComponent(), handling initial penetrations by calling ResolvePenetration(). |
|
|
SetPlaneConstraintAxisSetting ( |
Set the plane constraint axis setting. |
|
|
SetPlaneConstraintEnabled ( |
Sets whether or not the plane constraint is enabled. |
|
|
SetPlaneConstraintFromVectors |
Uses the Forward and Up vectors to compute the plane that constrains movement, enforced if the plane constraint is enabled. |
|
|
SetPlaneConstraintNormal ( |
Sets the normal of the plane that constrains movement, enforced if the plane constraint is enabled. |
|
|
SetPlaneConstraintOrigin ( |
Sets the origin of the plane that constrains movement, enforced if the plane constraint is enabled. |
|
|
SetUpdatedComponent ( |
Assign the component we move and update. |
|
|
ShouldSkipUpdate ( |
Possibly skip update if moved component is not rendered or can't move. |
|
|
float |
SlideAlongSurface ( |
Slide smoothly along a surface, and slide away from multiple impacts using TwoWallAdjust if necessary. |
|
SnapUpdatedComponentToPlane() |
Snap the updated component to the plane constraint, if enabled. |
|
|
StopMovementImmediately() |
Stops movement immediately (zeroes velocity, usually zeros acceleration for components with acceleration). |
|
|
TwoWallAdjust ( |
Compute a movement direction when contacting two surfaces. |
|
|
UpdateComponentVelocity() |
Update ComponentVelocity of UpdatedComponent. |
|
|
UpdateTickRegistration() |
Update tick registration state, determined by bAutoUpdateTickRegistration. |
Name | Description | ||
---|---|---|---|
|
Deactivate() |
Deactivates the SceneComponent. |
|
|
InitializeComponent() |
Overridden to auto-register the updated component if it starts NULL, and we can find a root component on our owner. |
|
|
OnRegister() |
Overridden to update component properties that should be updated while being edited. |
|
|
RegisterComponentTickFunctions ( |
Virtual call chain to register all tick functions |
|
|
TickComponent ( |
Function called every frame on this ActorComponent. |
Name | Description | ||
---|---|---|---|
|
PostEditChangeProperty ( |
Called when a property on this object has been modified externally |
|
|
PostLoad() |
Do any object-specific cleanup required immediately after loading an object. |
|
|
Serialize ( |
Handles reading, writing, and reference collecting using FArchive. |