#pragma once
#include <stdint.h>
typedef int32_t r3e_int32;
typedef float r3e_float32;
typedef double r3e_float64;
typedef uint8_t r3e_u8char;
#define R3E_SHARED_MEMORY_NAME "$R3E"
enum
{
R3E_VERSION_MAJOR = 2
};
enum
{
R3E_VERSION_MINOR = 14
};
enum
{
R3E_NUM_DRIVERS_MAX = 128
};
typedef enum
{
R3E_SESSION_UNAVAILABLE = -1,
R3E_SESSION_PRACTICE = 0,
R3E_SESSION_QUALIFY = 1,
R3E_SESSION_RACE = 2,
R3E_SESSION_WARMUP = 3,
} r3e_session;
typedef enum
{
R3E_SESSION_PHASE_UNAVAILABLE = -1,
R3E_SESSION_PHASE_GARAGE = 1,
R3E_SESSION_PHASE_GRIDWALK = 2,
R3E_SESSION_PHASE_FORMATION = 3,
R3E_SESSION_PHASE_COUNTDOWN = 4,
R3E_SESSION_PHASE_GREEN = 5,
R3E_SESSION_PHASE_CHECKERED = 6,
} r3e_session_phase;
typedef enum
{
R3E_CONTROL_UNAVAILABLE = -1,
R3E_CONTROL_PLAYER = 0,
R3E_CONTROL_AI = 1,
R3E_CONTROL_REMOTE = 2,
R3E_CONTROL_REPLAY = 3,
} r3e_control;
typedef enum
{
R3E_PIT_WINDOW_UNAVAILABLE = -1,
R3E_PIT_WINDOW_DISABLED = 0,
R3E_PIT_WINDOW_CLOSED = 1,
R3E_PIT_WINDOW_OPEN = 2,
R3E_PIT_WINDOW_STOPPED = 3,
R3E_PIT_WINDOW_COMPLETED = 4,
} r3e_pit_window;
typedef enum
{
R3E_PIT_MENU_UNAVAILABLE = -1,
R3E_PIT_MENU_PRESET = 0,
R3E_PIT_MENU_PENALTY = 1,
R3E_PIT_MENU_DRIVERCHANGE = 2,
R3E_PIT_MENU_FUEL = 3,
R3E_PIT_MENU_FRONTTIRES = 4,
R3E_PIT_MENU_REARTIRES = 5,
R3E_PIT_MENU_FRONTWING = 6,
R3E_PIT_MENU_REARWING = 7,
R3E_PIT_MENU_SUSPENSION = 8,
R3E_PIT_MENU_BUTTON_TOP = 9,
R3E_PIT_MENU_BUTTON_BOTTOM = 10,
R3E_PIT_MENU_MAX = 11,
} r3e_pit_menu_selection;
typedef enum
{
R3E_TIRE_TYPE_UNAVAILABLE = -1,
R3E_TIRE_TYPE_OPTION = 0,
R3E_TIRE_TYPE_PRIME = 1,
} r3e_tire_type;
typedef enum
{
R3E_TIRE_SUBTYPE_UNAVAILABLE = -1,
R3E_TIRE_SUBTYPE_PRIMARY = 0,
R3E_TIRE_SUBTYPE_ALTERNATE = 1,
R3E_TIRE_SUBTYPE_SOFT = 2,
R3E_TIRE_SUBTYPE_MEDIUM = 3,
R3E_TIRE_SUBTYPE_HARD = 4,
} r3e_tire_subtype;
typedef enum
{
R3E_MTRL_TYPE_UNAVAILABLE = -1,
R3E_MTRL_TYPE_NONE = 0,
R3E_MTRL_TYPE_TARMAC = 1,
R3E_MTRL_TYPE_GRASS = 2,
R3E_MTRL_TYPE_DIRT = 3,
R3E_MTRL_TYPE_GRAVEL = 4,
R3E_MTRL_TYPE_RUMBLE = 5,
} r3e_mtrl_type;
typedef enum
{
R3E_PITSTOP_STATUS_UNAVAILABLE = -1,
R3E_PITSTOP_STATUS_TWO_TYRES_UNSERVED = 0,
R3E_PITSTOP_STATUS_FOUR_TYRES_UNSERVED = 1,
R3E_PITSTOP_STATUS_SERVED = 2,
} r3e_pitstop_status;
typedef enum
{
R3E_TIRE_FRONT_LEFT = 0,
R3E_TIRE_FRONT_RIGHT = 1,
R3E_TIRE_REAR_LEFT = 2,
R3E_TIRE_REAR_RIGHT = 3,
R3E_TIRE_INDEX_MAX = 4,
} r3e_tire_index_enum;
typedef enum
{
R3E_TIRE_TEMP_LEFT = 0,
R3E_TIRE_TEMP_CENTER = 1,
R3E_TIRE_TEMP_RIGHT = 2,
R3E_TIRE_TEMP_INDEX_MAX = 3,
} r3e_tire_temp_enum;
typedef enum
{
R3E_ENGINE_TYPE_COMBUSTION = 0,
R3E_ENGINE_TYPE_ELECTRIC = 1,
R3E_ENGINE_TYPE_HYBRID = 2,
R3E_ENGINE_TYPE_INDEX_MAX = 3,
} r3e_engine_type_enum;
typedef enum
{
R3E_FINISH_STATUS_UNAVAILABLE = -1,
R3E_FINISH_STATUS_NONE = 0,
R3E_FINISH_STATUS_FINISHED = 1,
R3E_FINISH_STATUS_DNF = 2,
R3E_FINISH_STATUS_DNQ = 3,
R3E_FINISH_STATUS_DNS = 4,
R3E_FINISH_STATUS_DQ = 5,
} r3e_finish_status;
typedef enum
{
R3E_SESSION_LENGTH_UNAVAILABLE = -1,
R3E_SESSION_LENGTH_TIME_BASED = 0,
R3E_SESSION_LENGTH_LAP_BASED = 1,
R3E_SESSION_LENGTH_TIME_AND_LAP_BASED = 2,
} r3e_session_length_format;
#pragma pack(push, 1)
typedef struct
{
r3e_float32 x;
r3e_float32 y;
r3e_float32 z;
} r3e_vec3_f32;
typedef struct
{
r3e_float64 x;
r3e_float64 y;
r3e_float64 z;
} r3e_vec3_f64;
typedef struct
{
r3e_float32 pitch;
r3e_float32 yaw;
r3e_float32 roll;
} r3e_ori_f32;
typedef struct
{
r3e_float32 sector1;
r3e_float32 sector2;
r3e_float32 sector3;
} r3e_sectorStarts;
typedef struct
{
r3e_int32 game_simulation_ticks;
r3e_float64 game_simulation_time;
r3e_vec3_f64 position;
r3e_vec3_f64 velocity;
r3e_vec3_f64 local_velocity;
r3e_vec3_f64 acceleration;
r3e_vec3_f64 local_acceleration;
r3e_vec3_f64 orientation;
r3e_vec3_f64 rotation;
r3e_vec3_f64 angular_acceleration;
r3e_vec3_f64 angular_velocity;
r3e_vec3_f64 local_angular_velocity;
r3e_vec3_f64 local_g_force;
r3e_float64 steering_force;
r3e_float64 steering_force_percentage;
r3e_float64 engine_torque;
r3e_float64 current_downforce;
r3e_float64 voltage;
r3e_float64 ers_level;
r3e_float64 power_mgu_h;
r3e_float64 power_mgu_k;
r3e_float64 torque_mgu_k;
r3e_float64 suspension_deflection[R3E_TIRE_INDEX_MAX];
r3e_float64 suspension_velocity[R3E_TIRE_INDEX_MAX];
r3e_float64 camber[R3E_TIRE_INDEX_MAX];
r3e_float64 ride_height[R3E_TIRE_INDEX_MAX];
r3e_float64 front_wing_height;
r3e_float64 front_roll_angle;
r3e_float64 rear_roll_angle;
r3e_float64 third_spring_suspension_deflection_front;
r3e_float64 third_spring_suspension_velocity_front;
r3e_float64 third_spring_suspension_deflection_rear;
r3e_float64 third_spring_suspension_velocity_rear;
r3e_float64 unused1;
} r3e_playerdata;
typedef struct
{
r3e_int32 yellow;
r3e_int32 yellowCausedIt;
r3e_int32 yellowOvertake;
r3e_int32 yellowPositionsGained;
r3e_int32 sector_yellow[3];
r3e_float32 closest_yellow_distance_into_track;
r3e_int32 blue;
r3e_int32 black;
r3e_int32 green;
r3e_int32 checkered;
r3e_int32 white;
r3e_int32 black_and_white;
} r3e_flags;
typedef struct
{
r3e_float32 engine;
r3e_float32 transmission;
r3e_float32 aerodynamics;
r3e_float32 suspension;
r3e_float32 unused1;
r3e_float32 unused2;
} r3e_car_damage;
typedef struct
{
r3e_int32 drive_through;
r3e_int32 stop_and_go;
r3e_int32 pit_stop;
r3e_int32 time_deduction;
r3e_int32 slow_down;
} r3e_cut_track_penalties;
typedef struct
{
r3e_int32 equipped;
r3e_int32 available;
r3e_int32 numActivationsLeft;
r3e_int32 engaged;
} r3e_drs;
typedef struct
{
r3e_int32 available;
r3e_int32 engaged;
r3e_int32 amount_left;
r3e_float32 engaged_time_left;
r3e_float32 wait_time_left;
} r3e_push_to_pass;
typedef struct
{
r3e_float32 current_temp[R3E_TIRE_TEMP_INDEX_MAX];
r3e_float32 optimal_temp;
r3e_float32 cold_temp;
r3e_float32 hot_temp;
} r3e_tire_temp;
typedef struct
{
r3e_float32 current_temp;
r3e_float32 optimal_temp;
r3e_float32 cold_temp;
r3e_float32 hot_temp;
} r3e_brake_temp;
typedef struct
{
r3e_int32 abs;
r3e_int32 tc;
r3e_int32 esp;
r3e_int32 countersteer;
r3e_int32 cornering;
} r3e_aid_settings;
typedef struct
{
r3e_u8char name[64];
r3e_int32 car_number;
r3e_int32 class_id;
r3e_int32 model_id;
r3e_int32 team_id;
r3e_int32 livery_id;
r3e_int32 manufacturer_id;
r3e_int32 user_id;
r3e_int32 slot_id;
r3e_int32 class_performance_index;
r3e_int32 engine_type;
r3e_float32 car_width;
r3e_float32 car_length;
} r3e_driver_info;
typedef struct
{
r3e_driver_info driver_info;
r3e_finish_status finish_status;
r3e_int32 place;
r3e_int32 place_class;
r3e_float32 lap_distance;
r3e_vec3_f32 position;
r3e_int32 track_sector;
r3e_int32 completed_laps;
r3e_int32 current_lap_valid;
r3e_float32 lap_time_current_self;
r3e_float32 sector_time_current_self[3];
r3e_float32 sector_time_previous_self[3];
r3e_float32 sector_time_best_self[3];
r3e_float32 time_delta_front;
r3e_float32 time_delta_behind;
r3e_pitstop_status pitstop_status;
r3e_int32 in_pitlane;
r3e_int32 num_pitstops;
r3e_cut_track_penalties penalties;
r3e_float32 car_speed;
r3e_int32 tire_type_front;
r3e_int32 tire_type_rear;
r3e_int32 tire_subtype_front;
r3e_int32 tire_subtype_rear;
r3e_float32 base_penalty_weight;
r3e_float32 aid_penalty_weight;
r3e_int32 drs_state;
r3e_int32 ptp_state;
r3e_int32 penaltyType;
r3e_int32 penaltyReason;
r3e_int32 engineState;
r3e_vec3_f32 orientation;
} r3e_driver_data;
typedef struct
{
r3e_int32 version_major;
r3e_int32 version_minor;
r3e_int32 all_drivers_offset; r3e_int32 driver_data_size;
r3e_int32 game_paused;
r3e_int32 game_in_menus;
r3e_int32 game_in_replay;
r3e_int32 game_using_vr;
r3e_int32 game_unused1;
r3e_playerdata player;
r3e_u8char track_name[64];
r3e_u8char layout_name[64];
r3e_int32 track_id;
r3e_int32 layout_id;
r3e_float32 layout_length;
r3e_sectorStarts sector_start_factors;
r3e_int32 race_session_laps[3];
r3e_int32 race_session_minutes[3];
r3e_int32 event_index;
r3e_int32 session_type;
r3e_int32 session_iteration;
r3e_session_length_format session_length_format;
r3e_float32 session_pit_speed_limit;
r3e_int32 session_phase;
r3e_int32 start_lights;
r3e_int32 tire_wear_active;
r3e_int32 fuel_use_active;
r3e_int32 number_of_laps;
r3e_float32 session_time_duration;
r3e_float32 session_time_remaining;
r3e_int32 max_incident_points;
r3e_float32 event_unused2;
r3e_int32 pit_window_status;
r3e_int32 pit_window_start;
r3e_int32 pit_window_end;
r3e_int32 in_pitlane;
r3e_pit_menu_selection pit_menu_selection;
r3e_int32 pit_menu_state[R3E_PIT_MENU_MAX];
r3e_int32 pit_state;
r3e_float32 pit_total_duration;
r3e_float32 pit_elapsed_time;
r3e_int32 pit_action;
r3e_int32 num_pitstops;
r3e_float32 pit_min_duration_total;
r3e_float32 pit_min_duration_left;
r3e_flags flags;
r3e_int32 position;
r3e_int32 position_class;
r3e_finish_status finish_status;
r3e_int32 cut_track_warnings;
r3e_cut_track_penalties penalties;
r3e_int32 num_penalties;
r3e_int32 completed_laps;
r3e_int32 current_lap_valid;
r3e_int32 track_sector;
r3e_float32 lap_distance;
r3e_float32 lap_distance_fraction;
r3e_float32 lap_time_best_leader;
r3e_float32 lap_time_best_leader_class;
r3e_float32 session_best_lap_sector_times[3];
r3e_float32 lap_time_best_self;
r3e_float32 sector_time_best_self[3];
r3e_float32 lap_time_previous_self;
r3e_float32 sector_time_previous_self[3];
r3e_float32 lap_time_current_self;
r3e_float32 sector_time_current_self[3];
r3e_float32 lap_time_delta_leader;
r3e_float32 lap_time_delta_leader_class;
r3e_float32 time_delta_front;
r3e_float32 time_delta_behind;
r3e_float32 time_delta_best_self;
r3e_float32 best_individual_sector_time_self[3];
r3e_float32 best_individual_sector_time_leader[3];
r3e_float32 best_individual_sector_time_leader_class[3];
r3e_int32 incident_points;
r3e_int32 lap_valid_state;
r3e_float32 score_unused1;
r3e_float32 score_unused2;
r3e_driver_info vehicle_info;
r3e_u8char player_name[64];
r3e_int32 control_type;
r3e_float32 car_speed;
r3e_float32 engine_rps;
r3e_float32 max_engine_rps;
r3e_float32 upshift_rps;
r3e_int32 gear;
r3e_int32 num_gears;
r3e_vec3_f32 car_cg_location;
r3e_ori_f32 car_orientation;
r3e_vec3_f32 local_acceleration;
r3e_float32 total_mass;
r3e_float32 fuel_left;
r3e_float32 fuel_capacity;
r3e_float32 fuel_per_lap;
r3e_float32 engine_water_temp;
r3e_float32 engine_oil_temp;
r3e_float32 fuel_pressure;
r3e_float32 engine_oil_pressure;
r3e_float32 turbo_pressure;
r3e_float32 throttle;
r3e_float32 throttle_raw;
r3e_float32 brake;
r3e_float32 brake_raw;
r3e_float32 clutch;
r3e_float32 clutch_raw;
r3e_float32 steer_input_raw;
r3e_int32 steer_lock_degrees;
r3e_int32 steer_wheel_range_degrees;
r3e_aid_settings aid_settings;
r3e_drs drs;
r3e_int32 pit_limiter;
r3e_push_to_pass push_to_pass;
r3e_float32 brake_bias;
r3e_int32 drs_numActivationsTotal;
r3e_int32 ptp_numActivationsTotal;
r3e_float32 battery_soc;
r3e_float32 water_left;
r3e_ori_f32 vehicle_unused1;
r3e_int32 tire_type;
r3e_float32 tire_rps[R3E_TIRE_INDEX_MAX];
r3e_float32 tire_speed[R3E_TIRE_INDEX_MAX];
r3e_float32 tire_grip[R3E_TIRE_INDEX_MAX];
r3e_float32 tire_wear[R3E_TIRE_INDEX_MAX];
r3e_int32 tire_flatspot[R3E_TIRE_INDEX_MAX];
r3e_float32 tire_pressure[R3E_TIRE_INDEX_MAX];
r3e_float32 tire_dirt[R3E_TIRE_INDEX_MAX];
r3e_tire_temp tire_temp[R3E_TIRE_INDEX_MAX];
r3e_int32 tire_type_front;
r3e_int32 tire_type_rear;
r3e_int32 tire_subtype_front;
r3e_int32 tire_subtype_rear;
r3e_brake_temp brake_temp[R3E_TIRE_INDEX_MAX];
r3e_float32 brake_pressure[R3E_TIRE_INDEX_MAX];
r3e_int32 traction_control_setting;
r3e_int32 engine_map_setting;
r3e_int32 engine_brake_setting;
r3e_float32 traction_control_percent;
r3e_int32 tire_on_mtrl[R3E_TIRE_INDEX_MAX];
r3e_float32 tire_load[R3E_TIRE_INDEX_MAX];
r3e_car_damage car_damage;
r3e_int32 num_cars;
r3e_driver_data all_drivers_data_1[R3E_NUM_DRIVERS_MAX];
} r3e_shared;
#pragma pack(pop)