From a672860c401aa1ca179fce42e439c59f8d07f6d8 Mon Sep 17 00:00:00 2001 From: aap Date: Sat, 16 Jan 2021 19:38:05 +0100 Subject: initial work on vehicles --- src/vehicles/Bike.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vehicles/Bike.cpp') diff --git a/src/vehicles/Bike.cpp b/src/vehicles/Bike.cpp index 72188a17..cc57f1b4 100644 --- a/src/vehicles/Bike.cpp +++ b/src/vehicles/Bike.cpp @@ -111,7 +111,7 @@ CBike::CBike(int32 id, uint8 CreatedBy) m_fTurnMass = pHandling->fTurnMass; m_vecCentreOfMass = pHandling->CentreOfMass; m_vecCentreOfMass.z = 0.1f; - m_fAirResistance = pHandling->Dimension.x*pHandling->Dimension.z/m_fMass; + m_fAirResistance = pHandling->fDragMult > 0.01f ? pHandling->fDragMult*0.0005f : pHandling->fDragMult; m_fElasticity = 0.05f; m_fBuoyancy = pHandling->fBuoyancy; -- cgit v1.2.3 From b5c09965a97574adbac6ef6f07ec382ef8d5c6c8 Mon Sep 17 00:00:00 2001 From: withmorten Date: Mon, 18 Jan 2021 17:25:31 +0100 Subject: some free cam fixes for controller --- src/vehicles/Bike.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/vehicles/Bike.cpp') diff --git a/src/vehicles/Bike.cpp b/src/vehicles/Bike.cpp index 6d70c22a..2c2b9468 100644 --- a/src/vehicles/Bike.cpp +++ b/src/vehicles/Bike.cpp @@ -1844,7 +1844,12 @@ CBike::ProcessControlInputs(uint8 pad) m_fSteerInput = clamp(m_fSteerInput, -1.0f, 1.0f); // Lean forward/backward - float updown = -CPad::GetPad(pad)->GetSteeringUpDown()/128.0f + CPad::GetPad(pad)->GetCarGunUpDown()/128.0f; + float updown; +#ifdef FREE_CAM + if (CCamera::bFreeCam) updown = CPad::IsAffectedByController ? -CPad::GetPad(pad)->GetSteeringUpDown()/128.0f : CPad::GetPad(pad)->GetCarGunUpDown()/128.0f; + else +#endif + updown = -CPad::GetPad(pad)->GetSteeringUpDown()/128.0f + CPad::GetPad(pad)->GetCarGunUpDown()/128.0f; m_fLeanInput += (updown - m_fLeanInput)*0.2f*CTimer::GetTimeStep(); m_fLeanInput = clamp(m_fLeanInput, -1.0f, 1.0f); -- cgit v1.2.3