Skip to content
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.15)
project(simapi VERSION 1.0.1 DESCRIPTION "Telemetry Mapping Library for Racing Sims")
include(GNUInstallDirs)
add_library(simapi SHARED simapi/simmapper.c simapi/getpid.c simapi/mapping/acmapper.c simapi/mapping/pcars2mapper.c simapi/mapping/rf2mapper.c simapi/mapping/scs2mapper.c simapi/mapping/outgaugemapper.c simapi/mapping/dirt2mapper.c simapi/mapping/f12018mapper.c)
add_library(simapi SHARED simapi/simmapper.c simapi/getpid.c simapi/mapping/acmapper.c simapi/mapping/pcars2mapper.c simapi/mapping/rf2mapper.c simapi/mapping/scs2mapper.c simapi/mapping/outgaugemapper.c simapi/mapping/dirt2mapper.c simapi/mapping/f12018mapper.c simapi/mapping/wreckfest2mapper.c simapi/mapping/rbrmapper.c)

set(SIMAPI_PUBLIC_HEADERS
"simapi/simmapper.h"
Expand Down
42 changes: 33 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,39 @@ sudo cmake --install build
```

## [Supported Sims](https://spacefreak18.github.io/simapi/supportedsims)
the closest to documentation found for each sim (not exhaustive)
### Assetto Corsa / Assetto Corsa Competizione
[acsharedmemorydocumentation](https://www.overtake.gg/attachments/acsharedmemorydocumentation-pdf.667802)
### RFactor2
[modding resources](https://www.studio-397.com/modding-resources/)
[internals plugin](https://github.com/TheIronWolfModding/rF2SharedMemoryMapPlugin/blob/master/Include/InternalsPlugin.hpp)
[linux plugin download](https://github.com/schlegp/rF2SharedMemoryMapPlugin_Wine)
### Projects Cars 2 (Automobilista 2)
[sharedmemory.h](https://github.com/viper4gh/CREST2-AMS2/blob/master/SharedMemory.h)

### Platinum Support (All features)
- Assetto Corsa
- Assetto Corsa Competizione
- Automobilista 2
- RFactor 2
- LeMans Ultimate

### Gold Support (Most features)
- Project Cars 2

### Silver Support (Minimal features)
- Assetto Corsa Evo
- Assetto Corsa Rally
- American Truck Simulator
- Euro Truck Simulator 2

### Bronze Support (Very minimal features)
- Live For Speed
- BeamNG
- Dirt Rally 2

### Additional Support
- Richard Burns Rally RSF Edition
- Wreckfest 2
- F1 2018/2022

See the full [compatibility matrix](https://spacefreak18.github.io/simapi/supportedsims) for details on protocols and plugins required for each sim.

### Developer Documentation
- Assetto Corsa: [acsharedmemorydocumentation](https://www.overtake.gg/attachments/acsharedmemorydocumentation-pdf.667802)
- RFactor2: [modding resources](https://www.studio-397.com/modding-resources/) | [internals plugin](https://github.com/TheIronWolfModding/rF2SharedMemoryMapPlugin/blob/master/Include/InternalsPlugin.hpp) | [linux plugin](https://github.com/schlegp/rF2SharedMemoryMapPlugin_Wine)
- Project Cars 2 / AMS2: [sharedmemory.h](https://github.com/viper4gh/CREST2-AMS2/blob/master/SharedMemory.h)

## Contributing
Feel free to make pull requests by adding mappings to simmapper.c for any simulator!
8 changes: 4 additions & 4 deletions include/acdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ typedef int ACC_RAIN_INTENSITY;

typedef struct //acsVec3
{
float x;
float y;
float z;
float x;
float y;
float z;
} acsVec3;

typedef struct //accVehicleInfo
Expand Down Expand Up @@ -321,7 +321,7 @@ struct SPageFileStatic
// car static info
float maxTorque;
float maxPower;
int maxRpm;
int maxRpm;
float maxFuel;
float suspensionMaxTravel[4];
float tyreRadius[4];
Expand Down
150 changes: 150 additions & 0 deletions include/rbrdata.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
// vim: set ts=4 :
///////////////////////////////////////////////////////////
// rbr.telemetry.data.TelemetryData.h
// Implementation of the Class TireSegment
// Created on: 28-Dez-2019 07:49:08
// Original author: Guenter Schlupf
///////////////////////////////////////////////////////////
#ifndef _RBRDATA_H
#define _RBRDATA_H

#include <stdint.h>

#pragma pack(push, 1)

typedef struct
{
float temperature_;
float wear_;
} RBR_TireSegment;

typedef struct
{
float pressure_;
float temperature_;
float carcassTemperature_;
float treadTemperature_;
unsigned int currentSegment_;
RBR_TireSegment segment1_;
RBR_TireSegment segment2_;
RBR_TireSegment segment3_;
RBR_TireSegment segment4_;
RBR_TireSegment segment5_;
RBR_TireSegment segment6_;
RBR_TireSegment segment7_;
RBR_TireSegment segment8_;
} RBR_Tire;

typedef struct
{
float layerTemperature_;
float temperature_;
float wear_;
} RBR_BrakeDisk;

typedef struct
{
RBR_BrakeDisk brakeDisk_;
RBR_Tire tire_;
} RBR_Wheel;

typedef struct
{
float damage_;
float pistonVelocity_;
} RBR_Damper;

typedef struct
{
float springDeflection_;
float rollbarForce_;
float springForce_;
float damperForce_;
float strutForce_;
int helperSpringIsActive_;
RBR_Damper damper_;
RBR_Wheel wheel_;
} RBR_Suspension;

typedef struct
{
float rpm_;
float radiatorCoolantTemperature_;
float engineCoolantTemperature_;
float engineTemperature_;
} RBR_Engine;

typedef struct
{
/// Forward/backward.
float surge_;
/// Left/right.
float sway_;
/// Up/down.
float heave_;
/// Rotation about longitudinal axis.
float roll_;
/// Rotation about transverse axis.
float pitch_;
/// Rotation about normal axis.
float yaw_;
} RBR_Motion;

typedef struct
{
int index_;
/// Speed of the car in kph or mph.
float speed_;
float positionX_;
float positionY_;
float positionZ_;
float roll_;
float pitch_;
float yaw_;
RBR_Motion velocities_;
RBR_Motion accelerations_;
RBR_Engine engine_;
/// Suspension data: LF, RF, LB, RB.
RBR_Suspension suspensionLF_;
/// Suspension data: LF, RF, LB, RB.
RBR_Suspension suspensionRF_;
/// Suspension data: LF, RF, LB, RB.
RBR_Suspension suspensionLB_;
/// Suspension data: LF, RF, LB, RB.
RBR_Suspension suspensionRB_;
} RBR_Car;

typedef struct
{
float steering_;
float throttle_;
float brake_;
float handbrake_;
float clutch_;
int gear_;
float footbrakePressure_;
float handbrakePressure_;
} RBR_Control;

typedef struct
{
int index_;
/// The position on the driveline.
float progress_;
/// The total race time.
float raceTime_;
float driveLineLocation_;
float distanceToEnd_;
} RBR_Stage;

typedef struct
{
unsigned int totalSteps_;
RBR_Stage stage_;
RBR_Control control_;
RBR_Car car_;
} RBR_TelemetryData;

#pragma pack(pop)

#endif // _RBRDATA_H
Loading