Vehicle kind of working.

This commit is contained in:
ViktorLjung
2014-04-11 23:54:00 +02:00
parent f2259f712d
commit d7e65ff118
8 changed files with 153 additions and 7 deletions
+18
View File
@@ -12,9 +12,12 @@
#include "Components/BallSocketConstraint.h"
#include "Components/HingeConstraint.h"
#include "Components/SliderConstraint.h"
#include "Components/Vehicle.h"
#include "Components/Wheel.h"
#include "btBulletDynamicsCommon.h"
#include "LinearMath/btMatrix3x3.h"
#include <unordered_set>
namespace Systems
{
@@ -35,6 +38,10 @@ private:
btSequentialImpulseConstraintSolver* m_Solver;
btDiscreteDynamicsWorld* m_DynamicsWorld;
//m_DynamicsWorld = new btDiscreteDynamicsWorld(m_Dispatcher, m_Broadphase, m_Solver, m_CollisionConfiguration);
struct PhysicsData
{ btRigidBody* RigidBody;
btMotionState* MotionState;
@@ -43,6 +50,17 @@ private:
std::map<EntityID, PhysicsData> m_PhysicsData;
std::map<std::pair<EntityID, EntityID>, btTypedConstraint*> m_Constraints;
struct Vehicle
{
btVehicleRaycaster* VehicleRaycaster;
btRaycastVehicle* RaycastVehicle;
btRaycastVehicle::btVehicleTuning Tuning;
std::unordered_set<EntityID> Wheels;
};
std::map<EntityID, Vehicle> m_Vehicles;
void SetUpPhysicsState(EntityID entity, EntityID parent);
void TearDownPhysicsState(EntityID entity, EntityID parent);
};