mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-12-23 16:21:50 +01:00
fixed heli buoyancy
This commit is contained in:
parent
4a5f7464c1
commit
eadf0496bf
@ -3690,6 +3690,7 @@ CAutomobile::ProcessBuoyancy(void)
|
|||||||
CVector impulse, point;
|
CVector impulse, point;
|
||||||
|
|
||||||
if(mod_Buoyancy.ProcessBuoyancy(this, m_fBuoyancy, &point, &impulse)){
|
if(mod_Buoyancy.ProcessBuoyancy(this, m_fBuoyancy, &point, &impulse)){
|
||||||
|
bTouchingWater = true;
|
||||||
float timeStep = Max(CTimer::GetTimeStep(), 0.01f);
|
float timeStep = Max(CTimer::GetTimeStep(), 0.01f);
|
||||||
float impulseRatio = impulse.z / (GRAVITY * m_fMass * timeStep);
|
float impulseRatio = impulse.z / (GRAVITY * m_fMass * timeStep);
|
||||||
float waterResistance = Pow(1.0f - 0.05f*impulseRatio, CTimer::GetTimeStep());
|
float waterResistance = Pow(1.0f - 0.05f*impulseRatio, CTimer::GetTimeStep());
|
||||||
@ -3704,7 +3705,7 @@ CAutomobile::ProcessBuoyancy(void)
|
|||||||
heliHitWaterHard = true;
|
heliHitWaterHard = true;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
float strength = 1.0f/Max(8.0f*impulseRatio, 1.0f);
|
float strength = Max(8.0f*impulseRatio, 1.0f);
|
||||||
ApplyMoveForce(-2.0f*impulse/strength);
|
ApplyMoveForce(-2.0f*impulse/strength);
|
||||||
ApplyTurnForce(-impulse/strength, point);
|
ApplyTurnForce(-impulse/strength, point);
|
||||||
if(impulseRatio > 0.9f){
|
if(impulseRatio > 0.9f){
|
||||||
|
Loading…
Reference in New Issue
Block a user