Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
MotorcycleControllerSettings Class Reference

#include <MotorcycleController.h>

Inheritance diagram for MotorcycleControllerSettings:
WheeledVehicleControllerSettings VehicleControllerSettings SerializableObject RefTarget< VehicleControllerSettings > NonCopyable

Public Member Functions

virtual VehicleControllerConstructController (VehicleConstraint &inConstraint) const override
 Create an instance of the vehicle controller class. More...
 
virtual void SaveBinaryState (StreamOut &inStream) const override
 Saves the contents of the controller settings in binary form to inStream. More...
 
virtual void RestoreBinaryState (StreamIn &inStream) override
 Restore the contents of the controller settings in binary form from inStream. More...
 
virtual VehicleControllerConstructController (VehicleConstraint &inConstraint) const override
 Create an instance of the vehicle controller class. More...
 
virtual void SaveBinaryState (StreamOut &inStream) const override
 Saves the contents of the controller settings in binary form to inStream. More...
 
virtual void RestoreBinaryState (StreamIn &inStream) override
 Restore the contents of the controller settings in binary form from inStream. More...
 
virtual void SaveBinaryState (StreamOut &inStream) const =0
 Saves the contents of the controller settings in binary form to inStream. More...
 
virtual void RestoreBinaryState (StreamIn &inStream)=0
 Restore the contents of the controller settings in binary form from inStream. More...
 
virtual VehicleControllerConstructController (VehicleConstraint &inConstraint) const =0
 Create an instance of the vehicle controller class. More...
 
- Public Member Functions inherited from SerializableObject
virtual ~SerializableObject ()=default
 Constructor. More...
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 
- Public Member Functions inherited from RefTarget< VehicleControllerSettings >
 RefTarget ()=default
 Constructor. More...
 
 RefTarget (const RefTarget &)
 
 ~RefTarget ()
 assert no one is referencing us More...
 
void SetEmbedded () const
 
RefTargetoperator= (const RefTarget &)
 Assignment operator. More...
 
uint32 GetRefCount () const
 Get current refcount of this object. More...
 
void AddRef () const
 Add or release a reference to this object. More...
 
void Release () const
 

Public Attributes

float mMaxLeanAngle = DegreesToRadians(45.0f)
 How far we're willing to make the bike lean over in turns (in radians) More...
 
float mLeanSpringConstant = 5000.0f
 Spring constant for the lean spring. More...
 
float mLeanSpringDamping = 1000.0f
 Spring damping constant for the lean spring. More...
 
float mLeanSpringIntegrationCoefficient = 0.0f
 The lean spring applies an additional force equal to this coefficient * Integral(delta angle, 0, t), this effectively makes the lean spring a PID controller. More...
 
float mLeanSpringIntegrationCoefficientDecay = 4.0f
 How much to decay the angle integral when the wheels are not touching the floor: new_value = e^(-decay * t) * initial_value. More...
 
float mLeanSmoothingFactor = 0.8f
 
- Public Attributes inherited from WheeledVehicleControllerSettings
VehicleEngineSettings mEngine
 The properties of the engine. More...
 
VehicleTransmissionSettings mTransmission
 The properties of the transmission (aka gear box) More...
 
Array< VehicleDifferentialSettingsmDifferentials
 List of differentials and their properties. More...
 
float mDifferentialLimitedSlipRatio = 1.4f
 Ratio max / min average wheel speed of each differential (measured at the clutch). When the ratio is exceeded all torque gets distributed to the differential with the minimal average velocity. This allows implementing a limited slip differential between differentials. Set to FLT_MAX for an open differential. Value should be > 1. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from RefTarget< VehicleControllerSettings >
static int sInternalGetRefCountOffset ()
 INTERNAL HELPER FUNCTION USED BY SERIALIZATION. More...
 
- Protected Attributes inherited from RefTarget< VehicleControllerSettings >
atomic< uint32mRefCount
 Current reference count. More...
 
- Static Protected Attributes inherited from RefTarget< VehicleControllerSettings >
static constexpr uint32 cEmbedded
 A large value that gets added to the refcount to mark the object as embedded. More...
 

Detailed Description

Settings of a two wheeled motorcycle (adds a spring to balance the motorcycle) Note: The motor cycle controller is still in development and may need a lot of tweaks/hacks to work properly!

Member Function Documentation

◆ ConstructController()

VehicleController * MotorcycleControllerSettings::ConstructController ( VehicleConstraint inConstraint) const
overridevirtual

Create an instance of the vehicle controller class.

Reimplemented from WheeledVehicleControllerSettings.

◆ RestoreBinaryState()

void MotorcycleControllerSettings::RestoreBinaryState ( StreamIn inStream)
overridevirtual

Restore the contents of the controller settings in binary form from inStream.

Reimplemented from WheeledVehicleControllerSettings.

◆ SaveBinaryState()

void MotorcycleControllerSettings::SaveBinaryState ( StreamOut inStream) const
overridevirtual

Saves the contents of the controller settings in binary form to inStream.

Reimplemented from WheeledVehicleControllerSettings.

Member Data Documentation

◆ mLeanSmoothingFactor

float MotorcycleControllerSettings::mLeanSmoothingFactor = 0.8f

How much to smooth the lean angle (0 = no smoothing, 1 = lean angle never changes) Note that this is frame rate dependent because the formula is: smoothing_factor * previous + (1 - smoothing_factor) * current

◆ mLeanSpringConstant

float MotorcycleControllerSettings::mLeanSpringConstant = 5000.0f

Spring constant for the lean spring.

◆ mLeanSpringDamping

float MotorcycleControllerSettings::mLeanSpringDamping = 1000.0f

Spring damping constant for the lean spring.

◆ mLeanSpringIntegrationCoefficient

float MotorcycleControllerSettings::mLeanSpringIntegrationCoefficient = 0.0f

The lean spring applies an additional force equal to this coefficient * Integral(delta angle, 0, t), this effectively makes the lean spring a PID controller.

◆ mLeanSpringIntegrationCoefficientDecay

float MotorcycleControllerSettings::mLeanSpringIntegrationCoefficientDecay = 4.0f

How much to decay the angle integral when the wheels are not touching the floor: new_value = e^(-decay * t) * initial_value.

◆ mMaxLeanAngle

float MotorcycleControllerSettings::mMaxLeanAngle = DegreesToRadians(45.0f)

How far we're willing to make the bike lean over in turns (in radians)


The documentation for this class was generated from the following files: