27 float mLongitudinalFriction = 4.0f;
28 float mLateralFriction = 2.0f;
50 float mCombinedLongitudinalFriction = 0.0f;
51 float mCombinedLateralFriction = 0.0f;
52 float mBrakeImpulse = 0.0f;
91 void SetDriverInput(
float inForward,
float inLeftRatio,
float inRightRatio,
float inBrake) {
JPH_ASSERT(inLeftRatio != 0.0f && inRightRatio != 0.0f); mForwardInput = inForward; mLeftRatio = inLeftRatio; mRightRatio = inRightRatio; mBrakeInput = inBrake; }
127#ifdef JPH_DEBUG_RENDERER
129 void SetRPMMeter(
Vec3Arg inPosition,
float inSize) { mRPMMeterPosition = inPosition; mRPMMeterSize = inSize; }
134 void SyncLeftRightTracks();
138 virtual bool AllowSleep()
const override;
139 virtual void PreCollide(
float inDeltaTime,
PhysicsSystem &inPhysicsSystem)
override;
140 virtual void PostCollide(
float inDeltaTime,
PhysicsSystem &inPhysicsSystem)
override;
141 virtual bool SolveLongitudinalAndLateralConstraints(
float inDeltaTime)
override;
142 virtual void SaveState(
StateRecorder &inStream)
const override;
144#ifdef JPH_DEBUG_RENDERER
149 float mForwardInput = 0.0f;
150 float mLeftRatio = 1.0f;
151 float mRightRatio = 1.0f;
152 float mBrakeInput = 0.0f;
159#ifdef JPH_DEBUG_RENDERER
161 Vec3 mRPMMeterPosition { 0, 1, 0 };
162 float mRPMMeterSize = 0.5f;
#define JPH_EXPORT
Definition: Core.h:236
unsigned int uint
Definition: Core.h:452
#define JPH_NAMESPACE_END
Definition: Core.h:378
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:372
#define JPH_ASSERT(...)
Definition: IssueReporting.h:33
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition: Memory.h:31
bool IsKindOf(const Type *inObject, const RTTI *inRTTI)
Check if inObject is or is derived from DstType.
Definition: RTTI.h:369
#define JPH_RTTI(class_name)
Definition: RTTI.h:319
#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(linkage, class_name)
Definition: SerializableObject.h:109
VehicleTrack[(int) ETrackSide::Num] VehicleTracks
Definition: VehicleTrack.h:54
Definition: DebugRenderer.h:47
Definition: PhysicsSystem.h:29
Definition: StateRecorder.h:48
Simple binary input stream.
Definition: StreamIn.h:13
Simple binary output stream.
Definition: StreamOut.h:13
Runtime controller class for vehicle with tank tracks.
Definition: TrackedVehicleController.h:79
VehicleEngine mEngine
Engine state of the vehicle.
Definition: TrackedVehicleController.h:155
VehicleTracks mTracks
Tracks of the vehicle.
Definition: TrackedVehicleController.h:157
const VehicleTransmission & GetTransmission() const
Get current transmission state.
Definition: TrackedVehicleController.h:116
const VehicleTracks & GetTracks() const
Get the tracks this vehicle has.
Definition: TrackedVehicleController.h:122
float GetLeftRatio() const
Definition: TrackedVehicleController.h:99
void SetRightRatio(float inRightRatio)
Value between -1 and 1 indicating an extra multiplier to the rotation rate of the right track (used f...
Definition: TrackedVehicleController.h:102
float GetBrakeInput() const
Definition: TrackedVehicleController.h:107
float GetRightRatio() const
Definition: TrackedVehicleController.h:103
VehicleTransmission mTransmission
Transmission state of the vehicle.
Definition: TrackedVehicleController.h:156
virtual Wheel * ConstructWheel(const WheelSettings &inWheel) const override
Definition: TrackedVehicleController.h:137
void SetRPMMeter(Vec3Arg inPosition, float inSize)
Debug drawing of RPM meter.
Definition: TrackedVehicleController.h:129
VehicleTracks & GetTracks()
Get the tracks this vehicle has (writable interface, allows you to make changes to the configuration ...
Definition: TrackedVehicleController.h:125
void SetLeftRatio(float inLeftRatio)
Value between -1 and 1 indicating an extra multiplier to the rotation rate of the left track (used fo...
Definition: TrackedVehicleController.h:98
const VehicleEngine & GetEngine() const
Get current engine state.
Definition: TrackedVehicleController.h:110
float GetForwardInput() const
Definition: TrackedVehicleController.h:95
VehicleEngine & GetEngine()
Get current engine state (writable interface, allows you to make changes to the configuration which w...
Definition: TrackedVehicleController.h:113
void SetBrakeInput(float inBrake)
Value between 0 and 1 indicating how strong the brake pedal is pressed.
Definition: TrackedVehicleController.h:106
void SetDriverInput(float inForward, float inLeftRatio, float inRightRatio, float inBrake)
Definition: TrackedVehicleController.h:91
void SetForwardInput(float inForward)
Value between -1 and 1 for auto transmission and value between 0 and 1 indicating desired driving dir...
Definition: TrackedVehicleController.h:94
VehicleTransmission & GetTransmission()
Get current transmission state (writable interface, allows you to make changes to the configuration w...
Definition: TrackedVehicleController.h:119
Definition: TrackedVehicleController.h:60
VehicleEngineSettings mEngine
The properties of the engine.
Definition: TrackedVehicleController.h:72
VehicleTransmissionSettings mTransmission
The properties of the transmission (aka gear box)
Definition: TrackedVehicleController.h:73
Definition: VehicleConstraint.h:66
Runtime data for interface that controls acceleration / deceleration of the vehicle.
Definition: VehicleController.h:41
Basic settings object for interface that controls acceleration / deceleration of the vehicle.
Definition: VehicleController.h:25
Runtime data for engine.
Definition: VehicleEngine.h:44
Generic properties for a vehicle engine.
Definition: VehicleEngine.h:21
Generic properties for tank tracks.
Definition: VehicleTrack.h:25
Runtime data for transmission.
Definition: VehicleTransmission.h:46
Configuration for the transmission of a vehicle (gear box)
Definition: VehicleTransmission.h:23
Base class for runtime data for a wheel, each VehicleController can implement a derived class of this...
Definition: Wheel.h:46
Base class for wheel settings, each VehicleController can implement a derived class of this.
Definition: Wheel.h:19
virtual void SaveBinaryState(StreamOut &inStream) const
Saves the contents in binary form to inStream.
Definition: Wheel.cpp:32
virtual void RestoreBinaryState(StreamIn &inStream)
Restores the contents in binary form to inStream.
Definition: Wheel.cpp:49
WheelSettings object specifically for TrackedVehicleController.
Definition: TrackedVehicleController.h:19
Wheel object specifically for TrackedVehicleController.
Definition: TrackedVehicleController.h:33
const WheelSettingsTV * GetSettings() const
Override GetSettings and cast to the correct class.
Definition: TrackedVehicleController.h:41