VehicleSetup componentbased.

This commit is contained in:
ViktorLjung
2014-04-22 17:14:29 +02:00
parent d2f3adb07e
commit 4481c95681
8 changed files with 209 additions and 136 deletions
+9 -1
View File
@@ -8,7 +8,15 @@ namespace Components
struct Vehicle : Component
{
Vehicle()
: MaxTorque(500.0f), MinRPM(1000.0f), OptimalRPM(5500.0f), MaxRPM(7500.0f), MaxSteeringAngle(35), TopSpeed(50.0f) { }
float MaxTorque;
float MinRPM;
float OptimalRPM;
float MaxRPM;
// Degrees
float MaxSteeringAngle;
float TopSpeed;
};
}
+32
View File
@@ -0,0 +1,32 @@
#ifndef Components_Wheel_h__
#define Components_Wheel_h__
#include "Component.h"
namespace Components
{
struct Wheel : Component
{
Wheel()
: AxleID(0), Radius(0), Width(0), Mass(0), Steering(false), DownDirection(glm::vec3(0, -1, 0)), Friction(1.5f), SlipAngle(0.0f),
MaxBreakingTorque(1500.0f), ConnectedToHandbrake(false), SuspensionStrength(50.0f) { }
// The Hardpoint MUST be positioned INSIDE the chassis.
glm::vec3 Hardpoint;
unsigned int AxleID;
float Radius;
float Width;
float Mass;
bool Steering;
glm::vec3 DownDirection;
float SuspensionStrength;
float Friction;
float SlipAngle;
float MaxBreakingTorque;
bool ConnectedToHandbrake;
};
}
#endif // Components_Wheel_h__