1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-20 01:11:46 +02:00
openrw/rwengine/include/objects/VehicleInfo.hpp
Daniel Evans e1a37e44c4 Cleaned up some object data
Renamed some vehicle related data objects
Changed types on some vehicle data containers
Renamed GTAObject to GameObject
2014-02-28 11:23:51 +00:00

102 lines
1.8 KiB
C++

#pragma once
#ifndef _VEHICLE_INFO_HPP_
#define _VEHICLE_INFO_HPP_
#include <string>
#include <vector>
#include <memory>
#include <glm/glm.hpp>
class VehicleData;
/**
* Vehicle handling data
*/
struct VehicleHandlingInfo
{
enum EngineType
{
Diesel = 'D',
Petrol = 'P',
Electric = 'E'
};
enum DriveType
{
Forward = 'F',
Rear = 'R',
All = '4'
};
std::string ID;
float mass;
glm::vec3 dimensions;
glm::vec3 centerOfMass;
float percentSubmerged;
float tractionMulti;
float tractionLoss;
float tractionBias;
size_t numGears;
float maxVelocity;
float acceleration;
DriveType driveType;
EngineType engineType;
float brakeDeceleration;
float brakeBias;
bool ABS;
float steeringLock;
float suspensionForce;
float suspensionDamping;
float seatOffset;
float damageMulti;
size_t value;
float suspensionUpperLimit;
float suspensionLowerLimit;
float suspensionBias;
uint32_t flags;
enum /*VehicleFlags*/ {
VF_1G_BOOST = 1 << 0,
VF_2G_BOOST = 2 << 0,
VF_REV_BONNET = 4 << 0,
VF_HANGING_BOOT = 8 << 0,
VF_NO_DOORS = 1 << 8,
VF_IS_VAN = 2 << 8,
VF_IS_BUS = 4 << 8,
VF_IS_LOW = 8 << 8,
VF_DBL_EXHAUST = 1 << 16,
VF_TAILGATE_BOOT= 2 << 16,
VF_NOSWING_BOOT = 4 << 16,
VF_NONPLAYER_STABILIZER = 8 << 16,
VF_NEUTRALHANDLING = 1 << 16,
VF_HAS_NO_ROOF = 2 << 16,
VF_IS_BIG = 4 << 16,
VF_HALOGEN_LIGHTS = 8 << 16
};
};
struct WheelInfo
{
glm::vec3 position;
};
struct SeatInfo {
glm::vec3 offset;
};
/**
* Vehicle Handling and runtime data.
*/
struct VehicleInfo {
/** Handling data */
VehicleHandlingInfo handling;
/** Value for caching wheel information */
std::vector<WheelInfo> wheels;
/** Value for caching seat information */
std::vector<SeatInfo> seats;
};
typedef std::shared_ptr<VehicleInfo> VehicleInfoHandle;
#endif