mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 04:34:48 +00:00
adds minimum displacement check prior to convexSweepTest to avoid NaNs
This commit is contained in:
parent
c2e5dc3345
commit
edce2cc566
|
|
@ -290,8 +290,9 @@ bool BtPlayer::_sweep( btVector3 *inOutCurrPos, const btVector3 &disp, Collision
|
|||
BtPlayerSweepCallback callback( mGhostObject, disp.normalized() );
|
||||
callback.m_collisionFilterGroup = mGhostObject->getBroadphaseHandle()->m_collisionFilterGroup;
|
||||
callback.m_collisionFilterMask = mGhostObject->getBroadphaseHandle()->m_collisionFilterMask;
|
||||
|
||||
mGhostObject->convexSweepTest( mColShape, start, end, callback, 0.0f );
|
||||
|
||||
if (disp.length()>0.0001)
|
||||
mGhostObject->convexSweepTest( mColShape, start, end, callback, 0.0f );
|
||||
|
||||
inOutCurrPos->setInterpolate3( start.getOrigin(), end.getOrigin(), callback.m_closestHitFraction );
|
||||
if ( callback.hasHit() )
|
||||
|
|
|
|||
Loading…
Reference in a new issue