Merge pull request #1409 from Azaezel/alpha41/soImpulsive

skip out on impulses that have no chance of moving the object
This commit is contained in:
Brian Roberts 2025-03-14 13:59:44 -05:00 committed by GitHub
commit bab30568eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View file

@ -1118,7 +1118,7 @@ void RigidShape::updatePos(F32 dt)
{
F32 k = mRigid.getKineticEnergy();
F32 G = mNetGravity* dt * TickMs / mDataBlock->integration;
F32 Kg = 0.5 * mRigid.mass * G * G;
F32 Kg = mRigid.mass * G * G;
if (k < sRestTol * Kg && ++restCount > sRestCount)
mRigid.setAtRest();
}