Brakes working
This commit is contained in:
+1
-1
Submodule assets updated: 0a8ad2bc62...9d3f71bee6
@@ -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;
|
||||
|
||||
+9
-9
@@ -225,7 +225,7 @@ void GameWorld::Initialize()
|
||||
physics->Mass = 63000 - 16000;
|
||||
physics->Static = false;
|
||||
auto vehicle = AddComponent<Components::Vehicle>(tank);
|
||||
vehicle->MaxTorque = 5200.f;
|
||||
vehicle->MaxTorque = 8000.f;
|
||||
vehicle->MaxSteeringAngle = 90.f;
|
||||
vehicle->MaxSpeedFullSteeringAngle = 4.f;
|
||||
AddComponent<Components::TankSteering>(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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user