mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
adds minimum displacement check prior to convexSweepTest to avoid NaNs
This commit is contained in:
parent
c2e5dc3345
commit
edce2cc566
1 changed files with 3 additions and 2 deletions
|
|
@ -290,8 +290,9 @@ bool BtPlayer::_sweep( btVector3 *inOutCurrPos, const btVector3 &disp, Collision
|
||||||
BtPlayerSweepCallback callback( mGhostObject, disp.normalized() );
|
BtPlayerSweepCallback callback( mGhostObject, disp.normalized() );
|
||||||
callback.m_collisionFilterGroup = mGhostObject->getBroadphaseHandle()->m_collisionFilterGroup;
|
callback.m_collisionFilterGroup = mGhostObject->getBroadphaseHandle()->m_collisionFilterGroup;
|
||||||
callback.m_collisionFilterMask = mGhostObject->getBroadphaseHandle()->m_collisionFilterMask;
|
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 );
|
inOutCurrPos->setInterpolate3( start.getOrigin(), end.getOrigin(), callback.m_closestHitFraction );
|
||||||
if ( callback.hasHit() )
|
if ( callback.hasHit() )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue