-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathForzaSledDataStruct.cs
118 lines (96 loc) · 3.54 KB
/
ForzaSledDataStruct.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
using System.Runtime.InteropServices;
namespace ForzaData.Core;
/// <summary>
/// "Sled" data structure
/// </summary>
[StructLayout(LayoutKind.Auto)]
public struct ForzaSledDataStruct
{
// = 1 when race is on. = 0 when in menus/race stopped …
public int IsRaceOn;
//Can overflow to 0 eventually
public uint TimestampMS;
public float EngineMaxRpm;
public float EngineIdleRpm;
public float CurrentEngineRpm;
//In the car's local space; X = right, Y = up, Z = forward
public float AccelerationX;
public float AccelerationY;
public float AccelerationZ;
//In the car's local space; X = right, Y = up, Z = forward
public float VelocityX;
public float VelocityY;
public float VelocityZ;
//In the car's local space; X = pitch, Y = yaw, Z = roll
public float AngularVelocityX;
public float AngularVelocityY;
public float AngularVelocityZ;
public float Yaw;
public float Pitch;
public float Roll;
// Suspension travel normalized: 0.0f = max stretch; 1.0 = max compression
public float NormalizedSuspensionTravelFrontLeft;
public float NormalizedSuspensionTravelFrontRight;
public float NormalizedSuspensionTravelRearLeft;
public float NormalizedSuspensionTravelRearRight;
// Tire normalized slip ratio, = 0 means 100% grip and |ratio| > 1.0 means loss of grip.
public float TireSlipRatioFrontLeft;
public float TireSlipRatioFrontRight;
public float TireSlipRatioRearLeft;
public float TireSlipRatioRearRight;
// Wheel rotation speed radians/sec.
public float WheelRotationSpeedFrontLeft;
public float WheelRotationSpeedFrontRight;
public float WheelRotationSpeedRearLeft;
public float WheelRotationSpeedRearRight;
// = 1 when wheel is on rumble strip, = 0 when off.
public int WheelOnRumbleStripFrontLeft;
public int WheelOnRumbleStripFrontRight;
public int WheelOnRumbleStripRearLeft;
public int WheelOnRumbleStripRearRight;
// = from 0 to 1, where 1 is the deepest puddle
public float WheelInPuddleDepthFrontLeft;
public float WheelInPuddleDepthFrontRight;
public float WheelInPuddleDepthRearLeft;
public float WheelInPuddleDepthRearRight;
// Non-dimensional surface rumble values passed to controller force feedback
public float SurfaceRumbleFrontLeft;
public float SurfaceRumbleFrontRight;
public float SurfaceRumbleRearLeft;
public float SurfaceRumbleRearRight;
// Tire normalized slip angle, = 0 means 100% grip and |angle| > 1.0 means loss of grip.
public float TireSlipAngleFrontLeft;
public float TireSlipAngleFrontRight;
public float TireSlipAngleRearLeft;
public float TireSlipAngleRearRight;
// Tire normalized combined slip, = 0 means 100% grip and |slip| > 1.0 means loss of grip.
public float TireCombinedSlipFrontLeft;
public float TireCombinedSlipFrontRight;
public float TireCombinedSlipRearLeft;
public float TireCombinedSlipRearRight;
// Actual suspension travel in meters
public float SuspensionTravelMetersFrontLeft;
public float SuspensionTravelMetersFrontRight;
public float SuspensionTravelMetersRearLeft;
public float SuspensionTravelMetersRearRight;
/// <summary>
/// Unique ID of the car make/model
/// </summary>
public int CarOrdinal;
/// <summary>
/// Between 0 (D -- worst cars) and 7 (X class -- best cars) inclusive
/// </summary>
public int CarClass;
/// <summary>
/// Between 100 (slowest car) and 999 (fastest car) inclusive
/// </summary>
public int CarPerformanceIndex;
/// <summary>
/// Corresponds to EDrivetrainType; 0 = FWD, 1 = RWD, 2 = AWD
/// </summary>
public int DrivetrainType;
/// <summary>
/// Number of cylinders in the engine
/// </summary>
public int NumCylinders;
}