| UObjectBase
|
Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/GameFramework/ProjectileMovementComponent.h |
Include |
#include "GameFramework/ProjectileMovementComponent.h" |
class UProjectileMovementComponent : public UMovementComponent
ProjectileMovementComponent updates the position of another component during its tick.
Behavior such as bouncing after impacts and homing toward a target are supported.
Normally the root component of the owning actor is moved, however another component may be selected (see SetUpdatedComponent()). If the updated component is simulating physics, only the initial launch parameters (when initial velocity is non-zero) will affect the projectile, and the physics sim will take over from there.
Name | Description | ||
---|---|---|---|
|
uint8: 1 |
bBounceAngleAffectsFriction |
Controls the effects of friction on velocity parallel to the impact surface when bouncing. |
|
uint8: 1 |
bForceSubStepping |
If true, forces sub-stepping to break up movement into discrete smaller steps to improve accuracy of the trajectory. |
|
uint8: 1 |
bInitialVelocityInLocalSpace |
If true, the initial Velocity is interpreted as being in local space upon startup. |
|
uint8: 1 |
bInterpMovement |
If true and there is an interpolated component set, location (and optionally rotation) interpolation is enabled which allows the interpolated object to smooth uneven updates of the UpdatedComponent's location (usually to smooth network updates). |
|
uint8: 1 |
bInterpolationComplete |
|
|
uint8: 1 |
bInterpRotation |
If true and there is an interpolated component set, rotation interpolation is enabled which allows the interpolated object to smooth uneven updates of the UpdatedComponent's rotation (usually to smooth network updates). |
|
uint8: 1 |
bIsHomingProjectile |
If true, we will accelerate toward our homing target. |
|
uint8: 1 |
bIsSliding |
If true, projectile is sliding / rolling along a surface. |
|
BounceAdditionalIterations |
On the first few bounces (up to this amount), allow extra iterations over MaxSimulationIterations if necessary. |
|
|
float |
BounceVelocityStopSimulatingThreshold |
If velocity is below this threshold after a bounce, stops simulating and triggers the OnProjectileStop event. |
|
float |
Bounciness |
Percentage of velocity maintained after the bounce in the direction of the normal of impact (coefficient of restitution). |
|
uint8: 1 |
bRotationFollowsVelocity |
If true, this projectile will have its rotation updated each frame to match the direction of its velocity. |
|
uint8: 1 |
bRotationRemainsVertical |
If true, this projectile will have its rotation updated each frame to maintain the rotations Yaw only. |
|
uint8: 1 |
bShouldBounce |
If true, simple bounces will be simulated. Set this to false to stop simulating on contact. |
|
uint8: 1 |
bSimulationEnabled |
If true, does normal simulation ticking and update. |
|
uint8: 1 |
bSweepCollision |
If true, movement uses swept collision checks. |
|
float |
Buoyancy |
Buoyancy of UpdatedComponent in fluid. 0.0=sinks as fast as in air, 1.0=neutral buoyancy |
|
float |
Friction |
Coefficient of friction, affecting the resistance to sliding along a surface. |
|
float |
HomingAccelerationMagnitude |
The magnitude of our acceleration towards the homing target. |
|
TWeakObjectPtr<... |
HomingTargetComponent |
The current target we are homing towards. |
|
float |
InitialSpeed |
Initial speed of projectile. |
|
InterpInitialLocationOffset |
||
|
InterpInitialRotationOffset |
||
|
float |
InterpLocationMaxLagDistance |
Max distance behind UpdatedComponent which the interpolated component is allowed to lag. |
|
InterpLocationOffset |
||
|
float |
InterpLocationSnapToTargetDistance |
Max distance behind UpdatedComponent beyond which the interpolated component is snapped to the target location instead. |
|
float |
InterpLocationTime |
"Time" over which most of the location interpolation occurs, when the UpdatedComponent (target) moves ahead of the interpolated component. |
|
TWeakObjectPtr<... |
InterpolatedComponentPtr |
|
|
InterpRotationOffset |
||
|
float |
InterpRotationTime |
"Time" over which most of the rotation interpolation occurs, when the UpdatedComponent (target) moves ahead of the interpolated component. |
|
MaxSimulationIterations |
Max number of iterations used for each discrete simulation step. |
|
|
float |
MaxSimulationTimeStep |
Max time delta for each discrete simulation step. |
|
float |
MaxSpeed |
Limit on speed of projectile (0 means no limit). |
|
float |
MinFrictionFraction |
When bounce angle affects friction, apply at least this fraction of normal friction. |
|
OnProjectileBounce |
Called when projectile impacts something and bounces are enabled. |
|
|
OnProjectileStop |
Called when projectile has come to a stop (velocity is below simulation threshold, bounces are disabled, or it is forcibly stopped). |
|
|
PendingForceThisUpdate |
Double-buffer of pending force so that updates can use the accumulated value and reset the data so other AddForce() calls work correctly. |
|
|
PreviousHitNormal |
Saved HitResult Normal from previous simulation step that resulted in an impact. |
|
|
float |
PreviousHitTime |
Saved HitResult Time (0 to 1) from previous simulation step. Equal to 1.0 when there was no impact. |
|
float |
ProjectileGravityScale |
Custom gravity scale for this projectile. Set to 0 for no gravity. |
Name | Description | |
---|---|---|
|
UProjectileMovementComponent ( |
Name | Description | ||
---|---|---|---|
|
AddForce ( |
Adds a force which is accumulated until next tick, used by ComputeAcceleration() to affect Velocity. |
|
|
CheckStillInWorld() |
This will check to see if the projectile is still in the world. |
|
|
ClearPendingForce ( |
Clears any pending forces from AddForce(). |
|
|
ComputeAcceleration ( |
Compute the acceleration that will be applied |
|
|
ComputeBounceResult ( |
Computes result of a bounce and returns the new velocity. |
|
|
ComputeHomingAcceleration ( |
Allow the projectile to track towards its homing target. |
|
|
ComputeMoveDelta ( |
Compute the distance we should move in the given time, at a given a velocity. |
|
|
ComputeVelocity ( |
Given an initial velocity and a time step, compute a new velocity. |
|
|
float |
GetBuoyancy() |
|
|
USceneCompon... |
GetInterpolatedComponent() |
Returns the component used for network interpolation. |
|
GetPendingForce() |
Returns the sum of pending forces from AddForce(). |
|
|
float |
GetSimulationTimeStep ( |
Compute remaining time step given remaining time and current iterations. |
|
EHandleBlock... |
HandleBlockingHit ( |
Handle blocking hit during simulation update. |
|
HandleDeflection ( |
Handle a blocking hit after HandleBlockingHit() returns a result indicating that deflection occured. |
|
|
HandleSliding ( |
Handle case where projectile is sliding along a surface. |
|
|
HasStoppedSimulation() |
||
|
IsInterpolationComplete() |
Returns whether interpolation is complete because the target has been reached. |
|
|
IsVelocityUnderSimulationThreshold() |
Returns true if velocity magnitude is less than BounceVelocityStopSimulatingThreshold. |
|
|
LimitVelocity ( |
Don't allow velocity magnitude to exceed MaxSpeed, if MaxSpeed is non-zero. |
|
|
MoveInterpolationTarget |
Moves the UpdatedComponent, which is also the interpolation target for the interpolated component. |
|
|
ResetInterpolation() |
Resets interpolation so that interpolated component snaps back to the initial location/rotation without any additional offsets. |
|
|
SetInterpolatedComponent ( |
Assigns the component that will be used for network interpolation/smoothing. |
|
|
SetVelocityInLocalSpace ( |
Sets the velocity to the new value, rotated into Actor space. |
|
|
ShouldApplyGravity() |
||
|
ShouldUseSubStepping() |
Determine whether or not to use substepping in the projectile motion update. |
|
|
StopSimulating ( |
Clears the reference to UpdatedComponent, fires stop event (OnProjectileStop), and stops ticking (if bAutoUpdateTickRegistration is true). |
|
|
TickInterpolation ( |
Name | Description | ||
---|---|---|---|
|
float |
GetGravityZ() |
Compute gravity effect given current physics volume, projectile gravity scale, etc. |
|
float |
GetMaxSpeed() |
Returns maximum speed of component in current movement mode. |
|
HandleImpact ( |
Applies bounce logic if enabled to affect velocity upon impact (using ComputeBounceResult()), or stops the projectile if bounces are not enabled or velocity is below BounceVelocityStopSimulatingThreshold. |
|
|
UpdateTickRegistration() |
Update tick registration state, determined by bAutoUpdateTickRegistration. |
Name | Description | ||
---|---|---|---|
|
InitializeComponent() |
Overridden to auto-register the updated component if it starts NULL, and we can find a root component on our owner. |
|
|
TickComponent ( |
Function called every frame on this ActorComponent. |
Name | Description | ||
---|---|---|---|
|
PostLoad() |
Do any object-specific cleanup required immediately after loading an object. |
Name |
Description |
|
---|---|---|
|
FOnProjectileBounceDelegate |
|
|
FOnProjectileStopDelegate |
Name |
Description |
|
---|---|---|
|
EHandleBlockingHitResult |
Enum indicating how simulation should proceed after HandleBlockingHit() is called. |
Name |
Description |
---|---|
MIN_TICK_TIME |
Minimum delta time considered when ticking. |