Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
VehicleTrack.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
10#include <Jolt/Core/StreamOut.h>
12
14
16enum class ETrackSide : uint
17{
18 Left = 0,
19 Right = 1,
20 Num = 2
21};
22
25{
27
28public:
30 void SaveBinaryState(StreamOut &inStream) const;
31
33 void RestoreBinaryState(StreamIn &inStream);
34
37 float mInertia = 10.0f;
38 float mAngularDamping = 0.5f;
39 float mMaxBrakeTorque = 15000.0f;
40 float mDifferentialRatio = 6.0f;
41};
42
45{
46public:
48 void SaveState(StateRecorder &inStream) const;
49 void RestoreState(StateRecorder &inStream);
50
51 float mAngularVelocity = 0.0f;
52};
53
55
#define JPH_EXPORT
Definition Core.h:236
unsigned int uint
Definition Core.h:453
#define JPH_NAMESPACE_END
Definition Core.h:379
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
#define JPH_DECLARE_SERIALIZABLE_NON_VIRTUAL(linkage, class_name)
Definition SerializableObject.h:80
ETrackSide
On which side of the vehicle the track is located (for steering)
Definition VehicleTrack.h:17
VehicleTrack[(int) ETrackSide::Num] VehicleTracks
Definition VehicleTrack.h:54
Definition Array.h:36
Definition StateRecorder.h:105
Simple binary input stream.
Definition StreamIn.h:13
Simple binary output stream.
Definition StreamOut.h:13
Runtime data for tank tracks.
Definition VehicleTrack.h:45
Generic properties for tank tracks.
Definition VehicleTrack.h:25
Array< uint > mWheels
Indices of wheels that are inside this track, should include the driven wheel too.
Definition VehicleTrack.h:36
uint mDrivenWheel
Which wheel on the track is connected to the engine.
Definition VehicleTrack.h:35