diff --git a/assets b/assets index 0a8ad2b..9d3f71b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 0a8ad2bc62fd926d1e26eb20094474c59fd278f7 +Subproject commit 9d3f71bee6e0a930a4bd265eca3f5fceac619709 diff --git a/src/Components/Wheel.h b/src/Components/Wheel.h index be3638b..4a6a66d 100644 --- a/src/Components/Wheel.h +++ b/src/Components/Wheel.h @@ -14,7 +14,7 @@ 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), TorqueRatio(0.25f) { } + MaxBreakingTorque(50000.f), ConnectedToHandbrake(false), SuspensionStrength(50.0f), TorqueRatio(0.25f) { } // The Hardpoint MUST be positioned INSIDE the chassis. glm::vec3 Hardpoint; diff --git a/src/GameWorld.cpp b/src/GameWorld.cpp index f0484be..86eb104 100755 --- a/src/GameWorld.cpp +++ b/src/GameWorld.cpp @@ -225,7 +225,7 @@ void GameWorld::Initialize() physics->Mass = 63000 - 16000; physics->Static = false; auto vehicle = AddComponent(tank); - vehicle->MaxTorque = 5200.f; + vehicle->MaxTorque = 8000.f; vehicle->MaxSteeringAngle = 90.f; vehicle->MaxSpeedFullSteeringAngle = 4.f; AddComponent(tank); @@ -350,7 +350,7 @@ void GameWorld::Initialize() Wheel->Radius = 0.6f; Wheel->Steering = true; Wheel->SuspensionStrength = suspensionStrength; - Wheel->Friction = 4.f; + Wheel->Friction = 3.f; Wheel->ConnectedToHandbrake = true; Wheel->TorqueRatio = 0.125f; Wheel->Width = 0.6f; @@ -380,7 +380,7 @@ void GameWorld::Initialize() Wheel->Radius = 0.6f; Wheel->Steering = false; Wheel->SuspensionStrength = suspensionStrength; - Wheel->Friction = 4.f; + Wheel->Friction = 3.f; Wheel->ConnectedToHandbrake = true; Wheel->TorqueRatio = 0.125f; Wheel->Width = 0.6f; @@ -411,7 +411,7 @@ void GameWorld::Initialize() Wheel->Radius = 0.6f; Wheel->Steering = true; Wheel->SuspensionStrength = suspensionStrength; - Wheel->Friction = 4.f; + Wheel->Friction = 3.f; Wheel->ConnectedToHandbrake = true; Wheel->TorqueRatio = 0.125f; Wheel->Width = 0.6f; @@ -441,7 +441,7 @@ void GameWorld::Initialize() Wheel->Radius = 0.6f; Wheel->Steering = true; Wheel->SuspensionStrength = suspensionStrength; - Wheel->Friction = 4.f; + Wheel->Friction = 3.f; Wheel->ConnectedToHandbrake = true; Wheel->TorqueRatio = 0.125f; Wheel->Width = 0.6f; @@ -473,7 +473,7 @@ void GameWorld::Initialize() Wheel->Radius = 0.6f; Wheel->Steering = false; Wheel->SuspensionStrength = suspensionStrength; - Wheel->Friction = 4.f; + Wheel->Friction = 3.f; Wheel->ConnectedToHandbrake = true; Wheel->TorqueRatio = 0.125f; Wheel->Width = 0.6f; @@ -502,7 +502,7 @@ void GameWorld::Initialize() Wheel->Radius = 0.6f; Wheel->Steering = false; Wheel->SuspensionStrength = suspensionStrength; - Wheel->Friction = 4.f; + Wheel->Friction = 3.f; Wheel->ConnectedToHandbrake = true; Wheel->TorqueRatio = 0.125f; Wheel->Width = 0.6f; @@ -557,7 +557,7 @@ void GameWorld::Initialize() Wheel->Radius = 0.6f; Wheel->Steering = false; Wheel->SuspensionStrength = suspensionStrength; - Wheel->Friction = 4.f; + Wheel->Friction = 3.f; Wheel->ConnectedToHandbrake = true; Wheel->TorqueRatio = 0.125f; Wheel->Width = 0.6f; @@ -586,7 +586,7 @@ void GameWorld::Initialize() Wheel->Radius = 0.6f; Wheel->Steering = false; Wheel->SuspensionStrength = suspensionStrength; - Wheel->Friction = 4.f; + Wheel->Friction = 3.f; Wheel->ConnectedToHandbrake = true; Wheel->TorqueRatio = 0.125f; Wheel->Width = 0.6f; diff --git a/src/Physics/VehicleSetup.cpp b/src/Physics/VehicleSetup.cpp index 59c3f07..e319834 100644 --- a/src/Physics/VehicleSetup.cpp +++ b/src/Physics/VehicleSetup.cpp @@ -201,7 +201,7 @@ void VehicleSetup::setupComponent(const hkpVehicleData& data, hkpVehicleDefaultT transmission.m_upshiftRPM = 7000.0f; transmission.m_clutchDelayTime = 0.0f; - transmission.m_reverseGearRatio = 1.2f; + transmission.m_reverseGearRatio = 1.0f; transmission.m_gearsRatio[0] = 3.0f; transmission.m_gearsRatio[1] = 2.25f; transmission.m_gearsRatio[2] = 1.5f; diff --git a/src/Systems/PhysicsSystem.cpp b/src/Systems/PhysicsSystem.cpp index c8a899b..c5aa34a 100644 --- a/src/Systems/PhysicsSystem.cpp +++ b/src/Systems/PhysicsSystem.cpp @@ -582,6 +582,10 @@ bool Systems::PhysicsSystem::OnTankSteer(const Events::TankSteer &event) hkpVehicleDriverInputAnalogStatus* deviceStatus = (hkpVehicleDriverInputAnalogStatus*)m_Vehicles[event.Entity]->m_deviceStatus; deviceStatus->m_positionX = event.PositionX; deviceStatus->m_positionY = event.PositionY; + if(event.PositionY > 0) + { + deviceStatus->m_reverseButtonPressed = true; + } deviceStatus->m_handbrakeButtonPressed = event.Handbrake; m_PhysicsWorld->unmarkForWrite(); } diff --git a/src/Systems/TankSteeringSystem.cpp b/src/Systems/TankSteeringSystem.cpp index 7755f1e..99cd4bd 100644 --- a/src/Systems/TankSteeringSystem.cpp +++ b/src/Systems/TankSteeringSystem.cpp @@ -94,15 +94,8 @@ void Systems::TankSteeringSystem::TowerSteeringInputController::Update( double d bool Systems::TankSteeringSystem::TankSteeringInputController::OnCommand(const Events::InputCommand &event) { - float val; - if(abs(event.Value) < 0.3f) - { - val = 0.f; - } - else - { - val = event.Value; - } + + float val = event.Value; if (event.Command == "horizontal") {