mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-23 10:00:01 +00:00
renamed a vehicle thing
This commit is contained in:
parent
c00f7a8d22
commit
575c5466df
|
@ -2241,22 +2241,22 @@ CAutomobile::ProcessControlInputs(uint8 pad)
|
||||||
// Steer left/right
|
// Steer left/right
|
||||||
if(CCamera::m_bUseMouse3rdPerson && !CVehicle::m_bDisableMouseSteering){
|
if(CCamera::m_bUseMouse3rdPerson && !CVehicle::m_bDisableMouseSteering){
|
||||||
if(CPad::GetPad(pad)->GetMouseX() != 0.0f){
|
if(CPad::GetPad(pad)->GetMouseX() != 0.0f){
|
||||||
m_fSteerRatio += fMouseSteerSens*CPad::GetPad(pad)->GetMouseX();
|
m_fSteerInput += fMouseSteerSens*CPad::GetPad(pad)->GetMouseX();
|
||||||
nLastControlInput = 2;
|
nLastControlInput = 2;
|
||||||
if(Abs(m_fSteerRatio) < fMouseCentreRange)
|
if(Abs(m_fSteerInput) < fMouseCentreRange)
|
||||||
m_fSteerRatio *= Pow(fMouseCentreMult, CTimer::GetTimeStep());
|
m_fSteerInput *= Pow(fMouseCentreMult, CTimer::GetTimeStep());
|
||||||
}else if(CPad::GetPad(pad)->GetSteeringLeftRight() || nLastControlInput != 2){
|
}else if(CPad::GetPad(pad)->GetSteeringLeftRight() || nLastControlInput != 2){
|
||||||
// mouse hasn't move, steer with pad like below
|
// mouse hasn't move, steer with pad like below
|
||||||
m_fSteerRatio += (-CPad::GetPad(pad)->GetSteeringLeftRight()/128.0f - m_fSteerRatio)*
|
m_fSteerInput += (-CPad::GetPad(pad)->GetSteeringLeftRight()/128.0f - m_fSteerInput)*
|
||||||
0.2f*CTimer::GetTimeStep();
|
0.2f*CTimer::GetTimeStep();
|
||||||
nLastControlInput = 0;
|
nLastControlInput = 0;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
m_fSteerRatio += (-CPad::GetPad(pad)->GetSteeringLeftRight()/128.0f - m_fSteerRatio)*
|
m_fSteerInput += (-CPad::GetPad(pad)->GetSteeringLeftRight()/128.0f - m_fSteerInput)*
|
||||||
0.2f*CTimer::GetTimeStep();
|
0.2f*CTimer::GetTimeStep();
|
||||||
nLastControlInput = 0;
|
nLastControlInput = 0;
|
||||||
}
|
}
|
||||||
m_fSteerRatio = clamp(m_fSteerRatio, -1.0f, 1.0f);
|
m_fSteerInput = clamp(m_fSteerInput, -1.0f, 1.0f);
|
||||||
|
|
||||||
// Accelerate/Brake
|
// Accelerate/Brake
|
||||||
float acceleration = (CPad::GetPad(pad)->GetAccelerate() - CPad::GetPad(pad)->GetBrake())/255.0f;
|
float acceleration = (CPad::GetPad(pad)->GetAccelerate() - CPad::GetPad(pad)->GetBrake())/255.0f;
|
||||||
|
@ -2307,10 +2307,10 @@ CAutomobile::ProcessControlInputs(uint8 pad)
|
||||||
|
|
||||||
// Actually turn wheels
|
// Actually turn wheels
|
||||||
static float fValue; // why static?
|
static float fValue; // why static?
|
||||||
if(m_fSteerRatio < 0.0f)
|
if(m_fSteerInput < 0.0f)
|
||||||
fValue = -sq(m_fSteerRatio);
|
fValue = -sq(m_fSteerInput);
|
||||||
else
|
else
|
||||||
fValue = sq(m_fSteerRatio);
|
fValue = sq(m_fSteerInput);
|
||||||
m_fSteerAngle = DEGTORAD(pHandling->fSteeringLock) * fValue;
|
m_fSteerAngle = DEGTORAD(pHandling->fSteeringLock) * fValue;
|
||||||
|
|
||||||
if(bComedyControls){
|
if(bComedyControls){
|
||||||
|
|
|
@ -52,7 +52,7 @@ CVehicle::CVehicle(uint8 CreatedBy)
|
||||||
|
|
||||||
m_nCurrentGear = 1;
|
m_nCurrentGear = 1;
|
||||||
m_fChangeGearTime = 0.0f;
|
m_fChangeGearTime = 0.0f;
|
||||||
m_fSteerRatio = 0.0f;
|
m_fSteerInput = 0.0f;
|
||||||
m_type = ENTITY_TYPE_VEHICLE;
|
m_type = ENTITY_TYPE_VEHICLE;
|
||||||
VehicleCreatedBy = CreatedBy;
|
VehicleCreatedBy = CreatedBy;
|
||||||
bIsLocked = false;
|
bIsLocked = false;
|
||||||
|
|
|
@ -194,7 +194,7 @@ public:
|
||||||
bool m_bSirenOrAlarm;
|
bool m_bSirenOrAlarm;
|
||||||
int8 m_comedyControlState;
|
int8 m_comedyControlState;
|
||||||
CStoredCollPoly m_aCollPolys[2]; // poly which is under front/rear part of car
|
CStoredCollPoly m_aCollPolys[2]; // poly which is under front/rear part of car
|
||||||
float m_fSteerRatio;
|
float m_fSteerInput;
|
||||||
eVehicleType m_vehType;
|
eVehicleType m_vehType;
|
||||||
|
|
||||||
static void *operator new(size_t);
|
static void *operator new(size_t);
|
||||||
|
|
Loading…
Reference in a new issue