UWheeledVehicleMovementComponent

Inheritance Hierarchy

Syntax

UCLASS (Abstract,
       HideCategories=(PlanarMovement, "Components|Movement|Planar", Activation, "Components|Activation"))
class UWheeledVehicleMovementComponent :
    public UPawnMovementComponent ,
    public IRVOAvoidanceInterface

Remarks

Component to handle the vehicle simulation for an actor.

Variables

Name Description

Protected variable

float

 

AngErrorAccumulator

Accumulator for RB replication errors

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

float

 

AvoidanceConsiderationRadius

Area Radius to consider for RVO avoidance

Public variable UProperty Category, EditAnywhere, AdvancedDisplay BlueprintReadOnly

FNavAvoidanceMa ...

 

AvoidanceGroup

Moving actor's group mask

Protected variable

float

 

AvoidanceLockTimer

Remaining time of avoidance velocity lock

Protected variable

FVector

 

AvoidanceLockVelocity

Forced avoidance velocity, used when AvoidanceLockTimer is > 0

Public variable UProperty Category, AdvancedDisplay BlueprintReadOnly visibleanywhere

int32

 

AvoidanceUID

No default value, for now it's assumed to be valid if GetAvoidanceManager() returns non-NULL.

Protected variable

FVector

 

AvoidanceVelocity

Calculated avoidance velocity used to adjust steering and throttle

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

float

 

AvoidanceWeight

De facto default value 0.5 (due to that being the default in the avoidance registration function), indicates RVO behavior.

Public variable UProperty Category, EditAnywhere

uint8 : 1

 

bDeprecatedSpringOffsetMode

Supports the old (before 4.14) way of applying spring forces. We used to offset from the vehicle center of mass instead of the spring location center of mass. You should only use this for existing content that hasn't been re-tuned.

Protected variable UProperty Transient

float

 

BrakeInput

Brake output to physics system. Range 0...1.

Protected variable UProperty Category, EditAnywhere, AdvancedDisplay

FVehicleInputRa ...

 

BrakeInputRate

Rate at which input brake can rise and fall.

Protected variable UProperty Transient

uint8 : 1

 

bRawGearDownInput

True if the player is holding gear down.

Protected variable UProperty Transient

uint8 : 1

 

bRawGearUpInput

True if the player is holding gear up.

Protected variable UProperty Transient

uint8 : 1

 

bRawHandbrakeInput

True if the player is holding the handbrake.

Public variable UProperty Category, EditAnywhere

uint8 : 1

 

bReverseAsBrake

If true, the brake and reverse controls will behave in a more arcade fashion where holding reverse also functions as brake.

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

uint8 : 1

 

bUseRVOAvoidance

If set, component will use RVO avoidance

Protected variable UProperty Transient

uint32 : 1

 

bWasAvoidanceUpdated

Was avoidance updated in this frame?

Public variable UProperty Category, EditAnywhere, Meta

float

 

ChassisHeight

Chassis height used for drag force computation (cm)

Public variable UProperty Category, EditAnywhere, Meta

float

 

ChassisWidth

Chassis width used for drag force computation (cm)

Public variable UProperty Transient

float

 

DebugDragMagnitude

Debug drag magnitude last applied.

Public variable UProperty Transient

float

 

DragArea

Drag area in cm^2.

Public variable UProperty Category, EditAnywhere

float

 

DragCoefficient

DragCoefficient of the vehicle chassis.

Public variable UProperty Transient

float

 

EstimatedMaxEngineSpeed

Estimated mad speed for engine.

Public variable UProperty Category, EditAnywhere, AdvancedDisplay BlueprintReadOnly

FNavAvoidanceMa ...

 

GroupsToAvoid

Will avoid other agents if they are in one of specified groups

Public variable UProperty Category, EditAnywhere, AdvancedDisplay BlueprintReadOnly

FNavAvoidanceMa ...

 

GroupsToIgnore

Will NOT avoid other agents if they are in one of specified groups, higher priority than GroupsToAvoid

Protected variable UProperty Transient

float

 

HandbrakeInput

Handbrake output to physics system. Range 0...1.

Protected variable UProperty Category, EditAnywhere, AdvancedDisplay

FVehicleInputRa ...

 

HandbrakeInputRate

Rate at which input handbrake can rise and fall.

Public variable UProperty Category, EditAnywhere, AdvancedDisplay, Meta

int32

 

HighForwardSpeedSubStepCount

The sub-step count above the threshold longitudinal speed has a default of 1.

Protected variable UProperty Category, EditAnywhere

float

 

IdleBrakeInput

How much to press the brake when the player has release throttle.

Public variable UProperty Category, EditAnywhere, AdvancedDisplay

FVector

 

InertiaTensorScale

Scales the vehicle's inertia in each direction (forward, right, up)

Public variable UProperty Category, EditAnywhere, AdvancedDisplay, Meta

int32

 

LowForwardSpeedSubStepCount

The sub-step count below the threshold longitudinal speed has a default of 3.

Public variable UProperty Category, EditAnywhere, Meta

float

 

Mass

Mass to set the vehicle chassis to.

Public variable UProperty Transient

float

 

MaxEngineRPM

Max RPM for engine.

Public variable UProperty Category, EditAnywhere, AdvancedDisplay

float

 

MaxNormalizedTireLoad

Clamp normalized tire load to this value

Public variable UProperty Category, EditAnywhere, AdvancedDisplay

float

 

MaxNormalizedTireLoadFiltered

Clamp normalized tire load to this value

Protected variable

FDelegateHandle

 

MeshOnPhysicsStateChangeHandle

Handle for delegate registered on mesh component

Public variable UProperty Category, EditAnywhere, AdvancedDisplay

float

 

MinNormalizedTireLoad

Clamp normalized tire load to this value

Public variable UProperty Category, EditAnywhere, AdvancedDisplay

float

 

MinNormalizedTireLoadFiltered

Clamp normalized tire load to this value

Public variable UProperty

FVector

 

PendingLaunchVelocity

Temporarily holds launch velocity when pawn is to be launched so it happens at end of movement.

Public variable

physx::PxVehicl...

 

PVehicle

The instanced PhysX vehicle.

Public variable

physx::PxVehicl...

 

PVehicleDrive

Protected variable UProperty Transient

float

 

RawBrakeInput

What the player has the brake set to. Range -1...1.

Protected variable UProperty Transient

float

 

RawSteeringInput

What the player has the steering set to. Range -1...1.

Protected variable UProperty Transient

float

 

RawThrottleInput

What the player has the accelerator set to. Range -1...1.

Protected variable UProperty Transient, Replicated

FReplicatedVehi ...

 

ReplicatedState

Replicated state of vehicle

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

float

 

RVOAvoidanceHeight

Vehicle Height to use for RVO avoidance (usually vehicle height)

Public variable UProperty Category, EditAnywhere BlueprintReadWrite

float

 

RVOAvoidanceRadius

Vehicle Radius to use for RVO avoidance (usually half of vehicle width)

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadWrite

float

 

RVOSteeringStep

Value by which to alter steering per frame based on calculated avoidance

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadWrite

float

 

RVOThrottleStep

Value by which to alter throttle per frame based on calculated avoidance

Protected variable UProperty Transient

float

 

SteeringInput

Steering output to physics system. Range -1...1.

Protected variable UProperty Category, EditAnywhere, AdvancedDisplay

FVehicleInputRa ...

 

SteeringInputRate

Rate at which input steering can rise and fall.

Protected variable UProperty Category, EditAnywhere

float

 

StopThreshold

Auto-brake when absolute vehicle forward speed is less than this (cm/s)

Public variable UProperty Category, EditAnywhere, AdvancedDisplay, Meta

float

 

ThresholdLongitudinalSpeed

PhysX sub-steps More sub-steps provides better stability but with greater computational cost.

Protected variable UProperty Transient

float

 

ThrottleInput

Accelerator output to physics system. Range 0...1.

Protected variable UProperty Category, EditAnywhere, AdvancedDisplay

FVehicleInputRa ...

 

ThrottleInputRate

Rate at which input throttle can rise and fall.

Public variable

uint32

 

VehicleSetupTag

The value of PhysXVehicleManager::VehicleSetupTag when this vehicle created its physics state.

Public variable UProperty Category BlueprintReadOnly Transient duplicatetransient

TArray < class U ...

 

Wheels

Our instanced wheels.

Public variable UProperty Category, EditAnywhere

TArray < FWheelS ...

 

WheelSetups

Wheels to create

Protected variable UProperty Category, EditAnywhere

float

 

WrongDirectionThreshold

Auto-brake when vehicle forward speed is opposite of player input by at least this much (cm/s)

Constructors

Name Description

Public function

UWheeledVehicleMovementComponent

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Protected function

float

 

CalcBrakeInput()

Compute brake input

Protected function

float

 

CalcHandbrakeInput()

Compute handbrake input

Protected function

float

 

CalcSteeringInput()

Compute steering input

Protected function Virtual

float

 

CalcThrottleInput()

Compute throttle input

Public function Virtual

void

 

CalculateAvoidanceVelocity

(
    float DeltaTime
)

Calculate RVO avoidance and apply it to current velocity

Public function

bool

 

CheckSlipThreshold

(
    float AbsLongSlipThreshold,
    float AbsLatSlipThreshold
)

Protected function

void

 

ClearAllInput()

Protected function Virtual

void

 

ClearInput()

Clear all interpolated inputs to default values.

Protected function Virtual

void

 

ClearRawInput()

Clear all raw inputs to default values.

Public function Virtual

void

 

ComputeConstants()

When vehicle is created we want to compute some helper data like drag area, etc....

Public function Virtual

void

 

GenerateTireForces

(
    UVehicleWheel * Wheel,
    const FTireShaderInput & Input,
    FTireShaderOutput & Output
)

Compute the forces generates from a spinning tire

Protected function

AController ...

 

GetController()

Public function UFunction BlueprintCallable, Category

int32

 

GetCurrentGear()

Get current gear

Public function UFunction BlueprintCallable, Category

float

 

GetEngineMaxRotationSpeed()

Get current engine's max rotation speed

Public function UFunction BlueprintCallable, Category

float

 

GetEngineRotationSpeed()

Get current engine's rotation speed

Public function UFunction BlueprintCallable, Category

float

 

GetForwardSpeed()

How fast the vehicle is moving forward

Public function

float

 

GetMaxSpringForce()

Public function UFunction BlueprintCallable, Category

int32

 

GetTargetGear()

Get target gear

Public function UFunction BlueprintCallable, Category

bool

 

GetUseAutoGears()

Are gears being changed automatically?

Protected function UFunction Server, Reliable withvalidation

void

 

ServerUpdateState

(
    float InSteeringInput,
    float InThrottleInput,
    float InBrakeInput,
    float InHandbrakeInput,
    int32 CurrentGear
)

Pass current state to server

Public function UFunction BlueprintCallable, Category

void

 

SetAvoidanceEnabled

(
    bool bEnable
)

Change avoidance state and register with RVO manager if necessary

Public function UFunction BlueprintCallable, Category, Meta

void

 

SetAvoidanceGroup

(
    int32 GroupFlags
)

Public function UFunction BlueprintCallable, Category

void

 

SetAvoidanceGroupMask

(
    const FNavAvoidanceMask & GroupMask
)

Protected function

void

 

SetAvoidanceVelocityLock

(
    UAvoidanceManager * Avoidance,
    float Duration
)

Lock avoidance velocity

Public function UFunction BlueprintCallable, Category

void

 

SetBrakeInput

(
    float Brake
)

Set the user input for the vehicle Brake

Public function UFunction BlueprintCallable, Category

void

 

SetGearDown

(
    bool bNewGearDown
)

Set the user input for gear down

Public function UFunction BlueprintCallable, Category

void

 

SetGearUp

(
    bool bNewGearUp
)

Set the user input for gear up

Public function UFunction BlueprintCallable, Category, Meta

void

 

SetGroupsToAvoid

(
    int32 GroupFlags
)

Public function UFunction BlueprintCallable, Category

void

 

SetGroupsToAvoidMask

(
    const FNavAvoidanceMask & GroupMask
)

Public function UFunction BlueprintCallable, Category, Meta

void

 

SetGroupsToIgnore

(
    int32 GroupFlags
)

Public function UFunction BlueprintCallable, Category

void

 

SetGroupsToIgnoreMask

(
    const FNavAvoidanceMask & GroupMask
)

Public function UFunction BlueprintCallable, Category

void

 

SetHandbrakeInput

(
    bool bNewHandbrake
)

Set the user input for handbrake

Public function UFunction BlueprintCallable, Category

void

 

SetSteeringInput

(
    float Steering
)

Set the user input for the vehicle steering

Public function UFunction BlueprintCallable, Category

void

 

SetTargetGear

(
    int32 GearNum,
    bool bImmediate
)

Set the user input for gear (-1 reverse, 0 neutral, 1+ forward)

Public function UFunction BlueprintCallable, Category

void

 

SetThrottleInput

(
    float Throttle
)

Set the user input for the vehicle throttle

Public function UFunction BlueprintCallable, Category

void

 

SetUseAutoGears

(
    bool bUseAuto
)

Set the flag that will be used to select auto-gears

Protected function

void

 

UpdateAvoidance

(
    float DeltaTime
)

Update RVO Avoidance for simulation

Protected function

void

 

UpdateDefaultAvoidance()

Called in Tick to update data in RVO avoidance manager

Protected function Virtual

void

 

UpdateState

(
    float DeltaTime
)

Updates the COMOffset on the actual body instance Read current state for simulation

Overridden from UMovementComponent

Name Description

Public function Virtual

void

 

SetUpdatedComponent

(
    USceneComponent * NewUpdatedCom...
)

Overridden to allow registration with components NOT owned by a Pawn.

Overridden from UObject

Name Description

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

UObject interface

Overridden from IRVOAvoidanceInterface

Name Description

Protected function Virtual

int32

 

GetAvoidanceGroupMask()

This actor's avoidance group mask

Protected function Virtual

int32

 

GetGroupsToAvoidMask()

Agent groups to avoid mask

Protected function Virtual

int32

 

GetGroupsToIgnoreMask()

Agent groups to ignore

Protected function Virtual

float

 

GetRVOAvoidanceConsiderationRadius()

The scaled collider radius to consider for RVO avoidance

Protected function Virtual

float

 

GetRVOAvoidanceHeight()

The scaled collider height to consider for RVO avoidance

Protected function Virtual

FVector

 

GetRVOAvoidanceOrigin()

Get the Location from where the RVO avoidance should originate

Protected function Virtual

float

 

GetRVOAvoidanceRadius()

The scaled collider radius to consider for RVO avoidance

Protected function Virtual

int32

 

GetRVOAvoidanceUID()

Return the AvoidanceUID assigned by the Avoidance Manager during registration

Protected function Virtual

float

 

GetRVOAvoidanceWeight()

Returns the AvoidanceWeight assigned by the Avoidance Manager during registration

Protected function Virtual

FVector

 

GetVelocityForRVOConsideration()

The velocity of the avoiding entity

Protected function Virtual

void

 

SetRVOAvoidanceUID

(
    int32 UID
)

BEGIN IRVOAvoidanceInterface

Protected function Virtual

void

 

SetRVOAvoidanceWeight

(
    float Weight
)

Store the AvoidanceWeight generated by the Avoidance Manager

References

Module

PhysXVehicles