| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#pragma once |
| 6 |
|
| 7 |
#include <Jolt/ObjectStream/SerializableObject.h> |
| 8 |
#include <Jolt/Core/LinearCurve.h> |
| 9 |
#include <Jolt/Core/StreamIn.h> |
| 10 |
#include <Jolt/Core/StreamOut.h> |
| 11 |
#include <Jolt/Physics/StateRecorder.h> |
| 12 |
|
| 13 |
JPH_NAMESPACE_BEGIN |
| 14 |
|
| 15 |
|
| 16 |
enum class ETrackSide : uint |
| 17 |
{ |
| 18 |
Left = 0, |
| 19 |
Right = 1, |
| 20 |
Num = 2 |
| 21 |
}; |
| 22 |
|
| 23 |
|
| 24 |
class JPH_EXPORT VehicleTrackSettings |
| 25 |
{ |
| 26 |
JPH_DECLARE_SERIALIZABLE_NON_VIRTUAL(JPH_EXPORT, VehicleTrackSettings) |
| 27 |
|
| 28 |
public: |
| 29 |
|
| 30 |
void SaveBinaryState(StreamOut &inStream) const; |
| 31 |
|
| 32 |
|
| 33 |
void RestoreBinaryState(StreamIn &inStream); |
| 34 |
|
| 35 |
uint mDrivenWheel; |
| 36 |
Array<uint> mWheels; |
| 37 |
float mInertia = 10.0f; |
| 38 |
float mAngularDamping = 0.5f; |
| 39 |
float mMaxBrakeTorque = 15000.0f; |
| 40 |
float mDifferentialRatio = 6.0f; |
| 41 |
}; |
| 42 |
|
| 43 |
|
| 44 |
class JPH_EXPORT VehicleTrack : public VehicleTrackSettings |
| 45 |
{ |
| 46 |
public: |
| 47 |
|
| 48 |
void SaveState(StateRecorder &inStream) const; |
| 49 |
void RestoreState(StateRecorder &inStream); |
| 50 |
|
| 51 |
float mAngularVelocity = 0.0f; |
| 52 |
}; |
| 53 |
|
| 54 |
using VehicleTracks = VehicleTrack[(int)ETrackSide::Num]; |
| 55 |
|
| 56 |
JPH_NAMESPACE_END |