Velocity limit, to prevent NaNs
This commit is contained in:
parent
2e6b4242d6
commit
20cbcf8ad9
@ -130,6 +130,7 @@
|
||||
#define CELL 4
|
||||
#define ISTP (CELL/2)
|
||||
#define CFDS (4.0f/CELL)
|
||||
#define SIM_MAXVELOCITY 1e4f
|
||||
|
||||
//Air constants
|
||||
#define AIR_TSTEPP 0.3f
|
||||
|
@ -4199,6 +4199,12 @@ killed:
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mv > SIM_MAXVELOCITY)
|
||||
{
|
||||
parts[i].vx *= SIM_MAXVELOCITY/mv;
|
||||
parts[i].vy *= SIM_MAXVELOCITY/mv;
|
||||
mv = SIM_MAXVELOCITY;
|
||||
}
|
||||
// interpolate to see if there is anything in the way
|
||||
dx = parts[i].vx*ISTP/mv;
|
||||
dy = parts[i].vy*ISTP/mv;
|
||||
|
Reference in New Issue
Block a user