Jolt Physics
A multi core friendly Game Physics Engine
|
Runtime controller class. More...
#include <WheeledVehicleController.h>
Public Types | |
using | Differentials = Array<VehicleDifferentialSettings> |
Typedefs. | |
Public Member Functions | |
JPH_OVERRIDE_NEW_DELETE | WheeledVehicleController (const WheeledVehicleControllerSettings &inSettings, VehicleConstraint &inConstraint) |
Constructor. | |
void | SetDriverInput (float inForward, float inRight, float inBrake, float inHandBrake) |
const VehicleEngine & | GetEngine () const |
Get current engine state. | |
VehicleEngine & | GetEngine () |
Get current engine state (writable interface, allows you to make changes to the configuration which will take effect the next time step) | |
const VehicleTransmission & | GetTransmission () const |
Get current transmission state. | |
VehicleTransmission & | GetTransmission () |
Get current transmission state (writable interface, allows you to make changes to the configuration which will take effect the next time step) | |
const Differentials & | GetDifferentials () const |
Get the differentials this vehicle has. | |
Differentials & | GetDifferentials () |
Get the differentials this vehicle has (writable interface, allows you to make changes to the configuration which will take effect the next time step) | |
float | GetDifferentialLimitedSlipRatio () const |
Ratio max / min average wheel speed of each differential (measured at the clutch). | |
void | SetDifferentialLimitedSlipRatio (float inV) |
void | SetRPMMeter (Vec3Arg inPosition, float inSize) |
Debug drawing of RPM meter. | |
Public Member Functions inherited from VehicleController | |
JPH_OVERRIDE_NEW_DELETE | VehicleController (VehicleConstraint &inConstraint) |
Constructor / destructor. | |
virtual | ~VehicleController ()=default |
Public Member Functions inherited from RefTarget< VehicleController > | |
RefTarget ()=default | |
Constructor. | |
RefTarget (const RefTarget &) | |
~RefTarget () | |
assert no one is referencing us | |
void | SetEmbedded () const |
RefTarget & | operator= (const RefTarget &) |
Assignment operator. | |
uint32 | GetRefCount () const |
Get current refcount of this object. | |
void | AddRef () const |
Add or release a reference to this object. | |
void | Release () const |
Protected Member Functions | |
virtual Wheel * | ConstructWheel (const WheelSettings &inWheel) const override |
virtual bool | AllowSleep () const override |
virtual void | PreCollide (float inDeltaTime, PhysicsSystem &inPhysicsSystem) override |
virtual void | PostCollide (float inDeltaTime, PhysicsSystem &inPhysicsSystem) override |
virtual bool | SolveLongitudinalAndLateralConstraints (float inDeltaTime) override |
virtual void | SaveState (StateRecorder &inStream) const override |
virtual void | RestoreState (StateRecorder &inStream) override |
virtual void | Draw (DebugRenderer *inRenderer) const override |
Protected Attributes | |
float | mForwardInput = 0.0f |
Value between -1 and 1 for auto transmission and value between 0 and 1 indicating desired driving direction and amount the gas pedal is pressed. | |
float | mRightInput = 0.0f |
Value between -1 and 1 indicating desired steering angle. | |
float | mBrakeInput = 0.0f |
Value between 0 and 1 indicating how strong the brake pedal is pressed. | |
float | mHandBrakeInput = 0.0f |
Value between 0 and 1 indicating how strong the hand brake is pulled. | |
VehicleEngine | mEngine |
Engine state of the vehicle. | |
VehicleTransmission | mTransmission |
Transmission state of the vehicle. | |
Differentials | mDifferentials |
Differential states of the vehicle. | |
float | mDifferentialLimitedSlipRatio |
Ratio max / min average wheel speed of each differential (measured at the clutch). | |
Vec3 | mRPMMeterPosition { 0, 1, 0 } |
Position (in local space of the body) of the RPM meter when drawing the constraint. | |
float | mRPMMeterSize = 0.5f |
Size of the RPM meter when drawing the constraint. | |
Protected Attributes inherited from VehicleController | |
VehicleConstraint & | mConstraint |
The vehicle constraint we belong to. | |
Protected Attributes inherited from RefTarget< VehicleController > | |
atomic< uint32 > | mRefCount |
Current reference count. | |
Additional Inherited Members | |
Static Public Member Functions inherited from RefTarget< VehicleController > | |
static int | sInternalGetRefCountOffset () |
INTERNAL HELPER FUNCTION USED BY SERIALIZATION. | |
Static Protected Attributes inherited from RefTarget< VehicleController > | |
static constexpr uint32 | cEmbedded |
A large value that gets added to the refcount to mark the object as embedded. | |
Runtime controller class.
Typedefs.
WheeledVehicleController::WheeledVehicleController | ( | const WheeledVehicleControllerSettings & | inSettings, |
VehicleConstraint & | inConstraint ) |
Constructor.
|
inlineoverrideprotectedvirtual |
Implements VehicleController.
|
inlineoverrideprotectedvirtual |
Implements VehicleController.
|
overrideprotectedvirtual |
Implements VehicleController.
Reimplemented in MotorcycleController.
|
inline |
Ratio max / min average wheel speed of each differential (measured at the clutch).
|
inline |
Get the differentials this vehicle has (writable interface, allows you to make changes to the configuration which will take effect the next time step)
|
inline |
Get the differentials this vehicle has.
|
inline |
Get current engine state (writable interface, allows you to make changes to the configuration which will take effect the next time step)
|
inline |
Get current engine state.
|
inline |
Get current transmission state (writable interface, allows you to make changes to the configuration which will take effect the next time step)
|
inline |
Get current transmission state.
|
overrideprotectedvirtual |
Implements VehicleController.
|
overrideprotectedvirtual |
Implements VehicleController.
Reimplemented in MotorcycleController.
|
overrideprotectedvirtual |
Implements VehicleController.
Reimplemented in MotorcycleController.
|
overrideprotectedvirtual |
Implements VehicleController.
Reimplemented in MotorcycleController.
|
inline |
|
inline |
Set input from driver
inForward | Value between -1 and 1 for auto transmission and value between 0 and 1 indicating desired driving direction and amount the gas pedal is pressed |
inRight | Value between -1 and 1 indicating desired steering angle (1 = right) |
inBrake | Value between 0 and 1 indicating how strong the brake pedal is pressed |
inHandBrake | Value between 0 and 1 indicating how strong the hand brake is pulled |
|
inline |
Debug drawing of RPM meter.
|
overrideprotectedvirtual |
Implements VehicleController.
Reimplemented in MotorcycleController.
|
protected |
Value between 0 and 1 indicating how strong the brake pedal is pressed.
|
protected |
Ratio max / min average wheel speed of each differential (measured at the clutch).
|
protected |
Differential states of the vehicle.
|
protected |
Engine state of the vehicle.
|
protected |
Value between -1 and 1 for auto transmission and value between 0 and 1 indicating desired driving direction and amount the gas pedal is pressed.
|
protected |
Value between 0 and 1 indicating how strong the hand brake is pulled.
|
protected |
Value between -1 and 1 indicating desired steering angle.
|
protected |
Position (in local space of the body) of the RPM meter when drawing the constraint.
|
protected |
Size of the RPM meter when drawing the constraint.
|
protected |
Transmission state of the vehicle.