127#ifdef JPH_DEBUG_RENDERER
137 void SyncLeftRightTracks();
141 virtual bool AllowSleep()
const override;
142 virtual void PreCollide(
float inDeltaTime,
PhysicsSystem &inPhysicsSystem)
override;
143 virtual void PostCollide(
float inDeltaTime,
PhysicsSystem &inPhysicsSystem)
override;
144 virtual bool SolveLongitudinalAndLateralConstraints(
float inDeltaTime)
override;
145 virtual void SaveState(
StateRecorder &inStream)
const override;
147#ifdef JPH_DEBUG_RENDERER
162#ifdef JPH_DEBUG_RENDERER
#define JPH_EXPORT
Definition Core.h:275
unsigned int uint
Definition Core.h:500
#define JPH_NAMESPACE_END
Definition Core.h:425
#define JPH_NAMESPACE_BEGIN
Definition Core.h:419
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
const Vec3 Vec3Arg
Definition MathTypes.h:19
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:50
const DstType * StaticCast(const SrcType *inObject)
Cast inObject to DstType, asserts on failure.
Definition RTTI.h:388
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
@ Num
Definition VehicleTrack.h:20
VehicleTrack[(int) ETrackSide::Num] VehicleTracks
Definition VehicleTrack.h:54
Definition DebugRenderer.h:47
Definition PhysicsSystem.h:30
Definition Reference.h:107
Definition StateRecorder.h:110
Simple binary input stream.
Definition StreamIn.h:13
Simple binary output stream.
Definition StreamOut.h:13
VehicleEngine mEngine
Engine state of the vehicle.
Definition TrackedVehicleController.h:158
float mLeftRatio
Value between -1 and 1 indicating an extra multiplier to the rotation rate of the left track (used fo...
Definition TrackedVehicleController.h:153
VehicleTracks mTracks
Tracks of the vehicle.
Definition TrackedVehicleController.h:160
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
Vec3 mRPMMeterPosition
Position (in local space of the body) of the RPM meter when drawing the constraint.
Definition TrackedVehicleController.h:164
float GetLeftRatio() const
Definition TrackedVehicleController.h:99
float mRPMMeterSize
Size of the RPM meter when drawing the constraint.
Definition TrackedVehicleController.h:165
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:159
virtual Wheel * ConstructWheel(const WheelSettings &inWheel) const override
Definition TrackedVehicleController.h:140
void SetRPMMeter(Vec3Arg inPosition, float inSize)
Debug drawing of RPM meter.
Definition TrackedVehicleController.h:129
JPH_OVERRIDE_NEW_DELETE TrackedVehicleController(const TrackedVehicleControllerSettings &inSettings, VehicleConstraint &inConstraint)
Constructor.
Definition TrackedVehicleController.cpp:130
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
float mForwardInput
Value between -1 and 1 for auto transmission and value between 0 and 1 indicating desired driving dir...
Definition TrackedVehicleController.h:152
float mRightRatio
Value between -1 and 1 indicating an extra multiplier to the rotation rate of the right track (used f...
Definition TrackedVehicleController.h:154
float mBrakeInput
Value between 0 and 1 indicating how strong the brake pedal is pressed.
Definition TrackedVehicleController.h:155
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
TrackedVehicleControllerSettings()
Definition TrackedVehicleController.cpp:97
virtual VehicleController * ConstructController(VehicleConstraint &inConstraint) const override
Create an instance of the vehicle controller class.
Definition TrackedVehicleController.cpp:92
VehicleTrackSettings mTracks[(int) ETrackSide::Num]
List of tracks and their properties.
Definition TrackedVehicleController.h:74
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
friend class VehicleConstraint
Definition VehicleController.h:58
JPH_OVERRIDE_NEW_DELETE VehicleController(VehicleConstraint &inConstraint)
Constructor / destructor.
Definition VehicleController.h:46
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
RefConst< WheelSettings > mSettings
Configuration settings for this wheel.
Definition Wheel.h:123
JPH_OVERRIDE_NEW_DELETE Wheel(const WheelSettings &inSettings)
Constructor / destructor.
Definition Wheel.cpp:66
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
float mLateralFriction
Friction in sideways direction of tire.
Definition TrackedVehicleController.h:28
float mLongitudinalFriction
Friction in forward direction of tire.
Definition TrackedVehicleController.h:27
Wheel object specifically for TrackedVehicleController.
Definition TrackedVehicleController.h:33
float mBrakeImpulse
Amount of impulse that the brakes can apply to the floor (excluding friction), spread out from brake ...
Definition TrackedVehicleController.h:52
float mCombinedLongitudinalFriction
Combined friction coefficient in longitudinal direction (combines terrain and track).
Definition TrackedVehicleController.h:50
float mCombinedLateralFriction
Combined friction coefficient in lateral direction (combines terrain and track).
Definition TrackedVehicleController.h:51
const WheelSettingsTV * GetSettings() const
Override GetSettings and cast to the correct class.
Definition TrackedVehicleController.h:41
int mTrackIndex
Index in mTracks to which this wheel is attached (calculated on initialization).
Definition TrackedVehicleController.h:49
JPH_OVERRIDE_NEW_DELETE WheelTV(const WheelSettingsTV &inWheel)
Constructor.
Definition TrackedVehicleController.cpp:51