Tank tuning

This commit is contained in:
ViktorLjung
2014-06-03 18:54:08 +02:00
parent a00c145616
commit 486922a7c5
3 changed files with 20 additions and 6 deletions
+16 -2
View File
@@ -237,6 +237,19 @@ void Systems::PhysicsSystem::UpdateEntity(double dt, EntityID entity, EntityID p
if(m_Vehicles.find(car) != m_Vehicles.end())
{
m_PhysicsWorld->markForWrite();
/*auto player = m_World->GetComponent<Components::Player>(car);
if(player)
{
if(player->ID == 1)
{
LOG_INFO("Speed: %f, Gear: %i, RPM: %f", m_Vehicles[car]->calcKMPH(), m_Vehicles[car]->m_currentGear, m_Vehicles[car]->m_rpm);
}
}*/
m_Vehicles[car]->getChassis()->activate();
hkVector4 hardPoint = m_Vehicles[car]->m_suspension->m_wheelParams[wheelComponent->ID].m_hardpointChassisSpace;
@@ -409,7 +422,6 @@ void Systems::PhysicsSystem::OnEntityCommit( EntityID entity )
}
}
VehicleSetup vehicleSetup;
// Create the basic vehicle.
m_Vehicles[entity] = new hkpVehicleInstance(m_RigidBodies[entity]);
@@ -638,6 +650,8 @@ void Systems::PhysicsSystem::OnEntityCommit( EntityID entity )
std::vector<hkReal>* vertices = new std::vector<hkReal>;
std::vector<hkUint16>* vertexIndices = new std::vector<hkUint16>;
auto meshShape = ResourceManager->Load<OBJ>("OBJ", meshShapeComponent->ResourceName);
if(!meshShape)
return;
for (auto &vertex : meshShape->Vertices)
{
@@ -749,7 +763,7 @@ bool Systems::PhysicsSystem::OnTankSteer(const Events::TankSteer &event)
}
else
{
deviceStatus->m_positionX = steeringX;
deviceStatus->m_positionX = event.PositionX;
deviceStatus->m_positionY = event.PositionY;
}