Navigation
API > API/Plugins > API/Plugins/ChaosVehicles
Base component to handle the vehicle simulation for an actor.
| Name | UChaosVehicleMovementComponent |
| Type | class |
| Header File | /Engine/Plugins/Experimental/ChaosVehiclesPlugin/Source/ChaosVehicles/Public/ChaosVehicleMovementComponent.h |
| Include Path | #include "ChaosVehicleMovementComponent.h" |
Syntax
UCLASS (Abstract,
HideCategories=(PlanarMovement, "Components|Movement|Planar", Activation, "Components|Activation"))
class UChaosVehicleMovementComponent : public UPawnMovementComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → UMovementComponent → UNavMovementComponent → UPawnMovementComponent → UChaosVehicleMovementComponent
Implements Interfaces
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UChaosVehicleMovementComponent
(
const FObjectInitializer& ObjectInitializer |
UChaosVehicleMovementComponent | ChaosVehicleMovementComponent.h |
Structs
| Name | Remarks |
|---|---|
| FAsyncOutputWrapper |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Aerofoils | TArray< FVehicleAerofoilConfig > | Optional aerofoil setup - can be used for car spoilers or aircraft wings/elevator/rudder | ChaosVehicleMovementComponent.h |
|
| bEnableCenterOfMassOverride | bool | Enable to override the calculated COM position with your own fixed value - this prevents the vehicle handling changing when the asset changes | ChaosVehicleMovementComponent.h |
|
| BrakeInputRate | FVehicleInputRateConfig | Rate at which input brake can rise and fall. | ChaosVehicleMovementComponent.h |
|
| bReverseAsBrake | uint8 | If true, the brake and reverse controls will behave in a more arcade fashion where holding reverse also functions as brake. | ChaosVehicleMovementComponent.h |
|
| bThrottleAsBrake | uint8 | If true, when reversing the throttle will behave like a brake while the vehicle moving in a backwards direction - requires bReverseAsBrake to be enabled for operation | ChaosVehicleMovementComponent.h |
|
| CenterOfMassOverride | FVector | The center of mass override value, this value overrides the calculated COM and the COM offset value in the mesh is also ignored. | ChaosVehicleMovementComponent.h |
|
| ChassisHeight | float | Chassis height used for drag force computation (cm) | ChaosVehicleMovementComponent.h |
|
| ChassisWidth | float | Chassis width used for drag force computation (cm) | ChaosVehicleMovementComponent.h |
|
| CurAsyncInput | FChaosVehicleAsyncInput * | ChaosVehicleMovementComponent.h | ||
| CurAsyncOutput | FChaosVehicleAsyncOutput * | ChaosVehicleMovementComponent.h | ||
| CurAsyncType | EChaosAsyncVehicleDataType | ChaosVehicleMovementComponent.h | ||
| DebugDragMagnitude | float | Debug drag magnitude last applied. | ChaosVehicleMovementComponent.h |
|
| DownforceCoefficient | float | DownforceCoefficient of the vehicle chassis - force pressing vehicle into ground at speed | ChaosVehicleMovementComponent.h |
|
| DragArea | float | Drag area in Meters^2. | ChaosVehicleMovementComponent.h |
|
| DragCoefficient | float | DragCoefficient of the vehicle chassis - force resisting forward motion at speed | ChaosVehicleMovementComponent.h |
|
| HandbrakeInputRate | FVehicleInputRateConfig | Rate at which input handbrake can rise and fall. | ChaosVehicleMovementComponent.h |
|
| InertiaTensorScale | FVector | Scales the vehicle's inertia in each direction (forward, right, up) | ChaosVehicleMovementComponent.h |
|
| Mass | float | Mass to set the vehicle chassis to. | ChaosVehicleMovementComponent.h |
|
| NextAsyncOutput | FChaosVehicleAsyncOutput * | ChaosVehicleMovementComponent.h | ||
| OutputInterpAlpha | float | ChaosVehicleMovementComponent.h | ||
| OutputsWaitingOn | TArray< FAsyncOutputWrapper > | ChaosVehicleMovementComponent.h | ||
| PitchInputRate | FVehicleInputRateConfig | Rate at which input pitch can rise and fall. | ChaosVehicleMovementComponent.h |
|
| RollInputRate | FVehicleInputRateConfig | Rate at which input roll can rise and fall. | ChaosVehicleMovementComponent.h |
|
| SleepSlopeLimit | float | Option to apply some aggressive sleep logic if slopes up Z is less than this value, i.e value = Cos(SlopeAngle) so 0.866 will sleep up to 30 degree slopes | ChaosVehicleMovementComponent.h |
|
| SleepThreshold | float | Option to apply some aggressive sleep logic, larger number is more agressive, 0 disables | ChaosVehicleMovementComponent.h |
|
| StabilizeControl | FVehicleStabilizeControlConfig | Arcade style control of vehicle | ChaosVehicleMovementComponent.h |
|
| SteeringInputRate | FVehicleInputRateConfig | Rate at which input steering can rise and fall. | ChaosVehicleMovementComponent.h |
|
| TargetRotationControl | FVehicleTargetRotationControlConfig | Arcade style direct control of vehicle rotation via torque force | ChaosVehicleMovementComponent.h |
|
| ThrottleInputRate | FVehicleInputRateConfig | Rate at which input throttle can rise and fall. | ChaosVehicleMovementComponent.h |
|
| Thrusters | TArray< FVehicleThrustConfig > | Optional thruster setup, use one or more as your main engine or as supplementary booster | ChaosVehicleMovementComponent.h |
|
| TorqueControl | FVehicleTorqueControlConfig | Arcade style direct control of vehicle rotation via torque force | ChaosVehicleMovementComponent.h |
|
| VehicleSetupTag | uint32 | Used to recreate the physics if the blueprint changes. | ChaosVehicleMovementComponent.h | |
| YawInputRate | FVehicleInputRateConfig | Rate at which input yaw can rise and fall. | ChaosVehicleMovementComponent.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool CanCreateVehicle() |
Return true if we are ready to create a vehicle, false if the setup has missing references | ChaosVehicleMovementComponent.h | |
void DecreaseThrottleInput
(
float ThrottleDelta |
Decrease the vehicle throttle position [throttle range normalized 0 to 1] | ChaosVehicleMovementComponent.h |
|
void EnableSelfRighting
(
bool InState |
ChaosVehicleMovementComponent.h |
|
|
void FinalizeSimCallbackData
(
FChaosVehicleManagerAsyncInput& Input |
ChaosVehicleMovementComponent.h | ||
void GetBaseSnapshot
(
FBaseSnapshotData& SnapshotOut |
Grab a snapshot of the vehicle instance dynamic state | ChaosVehicleMovementComponent.h | |
float GetBrakeInput() |
Get the user input for the vehicle brake - can use this to feed control to a connected trailer | ChaosVehicleMovementComponent.h |
|
int32 GetCurrentGear() |
Get current gear | ChaosVehicleMovementComponent.h |
|
float GetForwardSpeed() |
How fast the vehicle is moving forward | ChaosVehicleMovementComponent.h |
|
float GetForwardSpeedMPH() |
How fast the vehicle is moving forward | ChaosVehicleMovementComponent.h |
|
bool GetHandbrakeInput() |
Get the user input for the vehicle handbrake - can use this to feed control to a connected trailer | ChaosVehicleMovementComponent.h |
|
float GetSteeringInput() |
Get the user input for the vehicle steering - can use this to feed control to a connected trailer | ChaosVehicleMovementComponent.h |
|
virtual float GetSuspensionOffset
(
int WheelIndex |
ChaosVehicleMovementComponent.h | ||
int32 GetTargetGear() |
Get target gear | ChaosVehicleMovementComponent.h |
|
float GetThrottleInput() |
Get the user input for the vehicle throttle - can use this to feed control to a connected trailer | ChaosVehicleMovementComponent.h |
|
bool GetUseAutoGears() |
Are gears being changed automatically? | ChaosVehicleMovementComponent.h |
|
void IncreaseThrottleInput
(
float ThrottleDelta |
Increase the vehicle throttle position [throttle range normalized 0 to 1] | ChaosVehicleMovementComponent.h |
|
bool IsParked() |
Is the vehicle in park mode | ChaosVehicleMovementComponent.h |
|
FVector LocateBoneOffset
(
const FName InBoneName, |
Location local coordinates of named bone in skeleton, apply additional offset or just use offset if no bone located | ChaosVehicleMovementComponent.h | |
virtual void ParallelUpdate
(
float DeltaSeconds |
Get output data from Physics Thread. | ChaosVehicleMovementComponent.h | |
TUniquePtr< FPhysicsVehicleOutput > & PhysicsVehicleOutput() |
ChaosVehicleMovementComponent.h | ||
virtual void PreTickGT
(
float DeltaTime |
Updates the vehicle tuning and other state such as user input. | ChaosVehicleMovementComponent.h | |
void ResetVehicle() |
Reset some vehicle state - call this if you are say creating pool of vehicles that get reused and you don't want to carry over the previous state | ChaosVehicleMovementComponent.h |
|
virtual void ResetVehicleState() |
ChaosVehicleMovementComponent.h | ||
void SetBaseSnapshot
(
const FBaseSnapshotData& SnapshotIn |
Set snapshot of vehicle instance dynamic state | ChaosVehicleMovementComponent.h | |
void SetBrakeInput
(
float Brake |
Set the user input for the vehicle Brake [range 0 to 1] | ChaosVehicleMovementComponent.h |
|
void SetChangeDownInput
(
bool bNewGearDown |
Set the user input for gear down | ChaosVehicleMovementComponent.h |
|
void SetChangeUpInput
(
bool bNewGearUp |
Set the user input for gear up | ChaosVehicleMovementComponent.h |
|
TUniquePtr< FChaosVehicleAsyncInput > SetCurrentAsyncInputOutput
(
int32 InputIdx, |
ChaosVehicleMovementComponent.h | ||
void SetCurrentAsyncInputOutputInternal
(
FChaosVehicleAsyncInput* CurInput, |
ChaosVehicleMovementComponent.h | ||
void SetCurrentAsyncInputOutputInternal
(
FChaosVehicleAsyncInput* CurInput, |
ChaosVehicleMovementComponent.h | ||
void SetHandbrakeInput
(
bool bNewHandbrake |
Set the user input for handbrake | ChaosVehicleMovementComponent.h |
|
virtual void SetOverrideController
(
AController* OverrideController |
Allow the player controller of a different pawn to control this vehicle | ChaosVehicleMovementComponent.h | |
void SetParked
(
bool bParked |
Set the vehicle in park mode | ChaosVehicleMovementComponent.h |
|
void SetPitchInput
(
float Pitch |
Set the user input for the vehicle pitch [range -1 to 1] | ChaosVehicleMovementComponent.h |
|
void SetRequiresControllerForInputs
(
bool bRequiresController |
Set the flag that determines whether a controller is required to set control inputs | ChaosVehicleMovementComponent.h |
|
void SetRollInput
(
float Roll |
Set the user input for the vehicle roll [range -1 to 1] | ChaosVehicleMovementComponent.h |
|
void SetSleeping
(
bool bEnableSleep |
Set the vehicle sleeping (bEnableSleep=true) or wake it up (bEnableSleep=false) | ChaosVehicleMovementComponent.h |
|
void SetSteeringInput
(
float Steering |
Set the user input for the vehicle steering [range -1 to 1] | ChaosVehicleMovementComponent.h |
|
void SetTargetGear
(
int32 GearNum, |
Set the user input for gear (-1 reverse, 0 neutral, 1+ forward) | ChaosVehicleMovementComponent.h |
|
void SetThrottleInput
(
float Throttle |
Set the user input for the vehicle throttle [range 0 to 1] | ChaosVehicleMovementComponent.h |
|
void SetUseAutomaticGears
(
bool bUseAuto |
Set the flag that will be used to select auto-gears | ChaosVehicleMovementComponent.h |
|
void SetYawInput
(
float Yaw |
Set the user input for the vehicle yaw [range -1 to 1] | ChaosVehicleMovementComponent.h |
|
virtual void Update
(
float DeltaTime |
ChaosVehicleMovementComponent.h |
Overridden from UMovementComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void SetUpdatedComponent
(
USceneComponent* NewUpdatedComponent |
Overridden to allow registration with components NOT owned by a Pawn. | ChaosVehicleMovementComponent.h | |
virtual void StopMovementImmediately() |
Stops movement immediately (zeroes velocity, usually zeros acceleration for components with acceleration). | ChaosVehicleMovementComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool HasValidPhysicsState() |
Returns true if the physics state exists | ChaosVehicleMovementComponent.h | |
virtual void OnCreatePhysicsState() |
Used to create any physics engine information for this component | ChaosVehicleMovementComponent.h | |
virtual void OnDestroyPhysicsState() |
Used to shut down and physics engine structure for this component | ChaosVehicleMovementComponent.h | |
virtual bool ShouldCreatePhysicsState() |
Return true if it's suitable to create a physics representation of the vehicle at this time | ChaosVehicleMovementComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
End UObject interface Respond to a property change in editor | ChaosVehicleMovementComponent.h | |
virtual void Serialize
(
FArchive& Ar |
UObject interface | ChaosVehicleMovementComponent.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
float CalcHandbrakeInput() |
Compute handbrake input | ChaosVehicleMovementComponent.h | |
float CalcPitchInput() |
Compute pitch input | ChaosVehicleMovementComponent.h | |
float CalcRollInput() |
Compute roll input | ChaosVehicleMovementComponent.h | |
float CalcSteeringInput() |
Compute steering input | ChaosVehicleMovementComponent.h | |
void CalcThrottleBrakeInput
(
float& ThrottleOut, |
Compute throttle & brake input | ChaosVehicleMovementComponent.h | |
float CalcThrottleDownInput() |
ChaosVehicleMovementComponent.h | ||
float CalcThrottleUpInput() |
Compute throttle inputs | ChaosVehicleMovementComponent.h | |
float CalcYawInput() |
Compute yaw input | ChaosVehicleMovementComponent.h | |
void ClearAllInput() |
ChaosVehicleMovementComponent.h | ||
virtual void ClearInput () |
Clear all interpolated inputs to default values. | ChaosVehicleMovementComponent.h | |
virtual void ClearRawInput () |
Clear all raw inputs to default values. | ChaosVehicleMovementComponent.h | |
virtual void ComputeConstants () |
When vehicle is created we want to compute some helper data like drag area, etc.... | ChaosVehicleMovementComponent.h | |
virtual TUniquePtr< Chaos::FSimpleWheeledVehicle > CreatePhysicsVehicle() |
ChaosVehicleMovementComponent.h | ||
virtual void CreateVehicle() |
Create and setup the Chaos vehicle | ChaosVehicleMovementComponent.h | |
virtual void DrawDebug
(
UCanvas* Canvas, |
Draw debug text for the wheels and suspension | ChaosVehicleMovementComponent.h | |
| Draw 2D debug line to UI canvas | ChaosVehicleMovementComponent.h | ||
void FillAerodynamicsSetup() |
ChaosVehicleMovementComponent.h | ||
virtual void FixupSkeletalMesh() |
Skeletal mesh needs some special handling in the vehicle case | ChaosVehicleMovementComponent.h | |
const Chaos::FSimpleAerodynamicsConfig & GetAerodynamicsConfig() |
ChaosVehicleMovementComponent.h | ||
const FBodyInstance * GetBodyInstance () |
ChaosVehicleMovementComponent.h | ||
| ChaosVehicleMovementComponent.h | |||
float GetForwardAcceleration() |
ChaosVehicleMovementComponent.h | ||
UMeshComponent * GetMesh() |
Get the mesh this vehicle is tied to | ChaosVehicleMovementComponent.h | |
APlayerController * GetPlayerController() |
Retrieve the player controller of the vehicle component | ChaosVehicleMovementComponent.h | |
USkeletalMeshComponent * GetSkeletalMesh() |
Get Mesh cast as USkeletalMeshComponent, may return null if cast fails | ChaosVehicleMovementComponent.h | |
UStaticMeshComponent * GetStaticMesh() |
Get Mesh cast as UStaticMeshComponent, may return null if cast fails | ChaosVehicleMovementComponent.h | |
virtual void PostSetupVehicle() |
Do some final setup after the Chaos vehicle gets created | ChaosVehicleMovementComponent.h | |
virtual void ProcessSleeping
(
const FControlInputs& ControlInputs |
Option to aggressively sleep the vehicle | ChaosVehicleMovementComponent.h | |
void PutAllEnabledRigidBodiesToSleep() |
ChaosVehicleMovementComponent.h | ||
void ServerUpdateState
(
float InSteeringInput, |
Pass current state to server | ChaosVehicleMovementComponent.h |
|
virtual void SetupVehicle
(
TUniquePtr< Chaos::FSimpleWheeledVehicle >& PVehicle |
Allocate and setup the Chaos vehicle | ChaosVehicleMovementComponent.h | |
virtual void SetupVehicleMass() |
Adjust the Chaos Physics mass | ChaosVehicleMovementComponent.h | |
void ShowDebugInfo
(
AHUD* HUD, |
ChaosVehicleMovementComponent.h | ||
void UpdateMassProperties
(
FBodyInstance* BI |
ChaosVehicleMovementComponent.h | ||
virtual void UpdateState
(
float DeltaTime |
Read current state for simulation | ChaosVehicleMovementComponent.h | |
void WakeAllEnabledRigidBodies() |
ChaosVehicleMovementComponent.h |
Overridden from UPawnMovementComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual AController * GetController() |
Get our controller | ChaosVehicleMovementComponent.h |