Movement/rotation queue fixed and Simon force push

This commit is contained in:
ViktorLjung
2014-05-31 03:52:39 +02:00
parent c489547294
commit a142d368a7
18 changed files with 433 additions and 202 deletions
+14
View File
@@ -68,6 +68,20 @@ void Systems::TankSteeringSystem::UpdateEntity(double dt, EntityID entity, Entit
glm::quat orientation = glm::angleAxis(barrelSteeringComponent->TurnSpeed * inputController->BarrelDirection * (float)dt, barrelSteeringComponent->Axis);
transformComponent->Orientation *= orientation;
glm::vec3 angles = glm::eulerAngles(transformComponent->Orientation);
if(angles.x > barrelSteeringComponent->UpperRotationLimit)
{
angles.x = barrelSteeringComponent->UpperRotationLimit;
transformComponent->Orientation = glm::quat(angles);
}
else if(angles.x < barrelSteeringComponent->LowerRotationLimit)
{
angles.x = barrelSteeringComponent->LowerRotationLimit;
transformComponent->Orientation = glm::quat(angles);
}
if(inputController->Shoot && m_TimeSinceLastShot[tankSteeringComponent->Barrel] > 0.5)
{
EntityID clone = m_World->CloneEntity(barrelSteeringComponent->ShotTemplate);