mirror of
https://github.com/halpz/re3.git
synced 2024-12-22 17:35:29 +00:00
Physical: division by zero fix
This commit is contained in:
parent
d82dbf91ef
commit
e9baf31ad8
|
@ -480,6 +480,10 @@ CPhysical::ApplySpringDampening(float damping, CVector &springDir, CVector &poin
|
||||||
{
|
{
|
||||||
float speedA = DotProduct(speed, springDir);
|
float speedA = DotProduct(speed, springDir);
|
||||||
float speedB = DotProduct(GetSpeed(point), springDir);
|
float speedB = DotProduct(GetSpeed(point), springDir);
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (speedB == 0.0f)
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
float step = Min(CTimer::GetTimeStep(), 3.0f);
|
float step = Min(CTimer::GetTimeStep(), 3.0f);
|
||||||
float impulse = -damping * (speedA + speedB)/2.0f * m_fMass * step * 0.53f;
|
float impulse = -damping * (speedA + speedB)/2.0f * m_fMass * step * 0.53f;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue