mirror of
https://github.com/mrxenginner/reVC.git
synced 2026-10-11 17:58:17 +08:00
Physical: division by zero fix
This commit is contained in:
1 parent
61c2398b67
commit
9f0a96ac89
1 file changed
+4
@@ -521,6 +521,10 @@ CPhysical::ApplySpringDampening(float damping, CVector &springDir, CVector &poin
|
||||
{
|
||||
float speedA = DotProduct(speed, 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 impulse = -damping * (speedA + speedB)/2.0f * m_fMass * step * 0.53f;
|
||||
if(bIsHeavy)
|
||||
|
||||
Reference in new issue
Block a user