mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
avoid divide by zero when counteracting bouyancy bounce for players
reported by sir_skurpsalot: https://discord.com/channels/358091480004558848/783127087820439582/1518054290524995644
This commit is contained in:
parent
280866724d
commit
f912bc172d
1 changed files with 4 additions and 1 deletions
|
|
@ -2864,7 +2864,10 @@ void Player::updateMove(const Move* move)
|
||||||
speed_bias = speed_bias + (speed_bias_goal - speed_bias)*0.1f;
|
speed_bias = speed_bias + (speed_bias_goal - speed_bias)*0.1f;
|
||||||
moveSpeed *= speed_bias;
|
moveSpeed *= speed_bias;
|
||||||
// Acceleration due to gravity
|
// Acceleration due to gravity
|
||||||
VectorF acc(0.0f, 0.0f, mNetGravity/(1.0 - mBuoyancy) * TickSec);
|
F32 invBuoyancy = (1.0 - mBuoyancy);
|
||||||
|
if (mFabs(invBuoyancy) < POINT_EPSILON)
|
||||||
|
invBuoyancy = POINT_EPSILON;
|
||||||
|
VectorF acc(0.0f, 0.0f, mNetGravity / invBuoyancy * TickSec);
|
||||||
if (getParent() !=NULL)
|
if (getParent() !=NULL)
|
||||||
acc = VectorF::Zero;
|
acc = VectorF::Zero;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue