physics notes

based on https://github.com/TorqueGameEngines/Torque3D/pull/1165 and after further talks with @AtomicWalrus:
use the massbox or bounds box based  mRigid.setObjectInertia method
to reduce recirulating, combine resolvecollision and resolvecontacts
clamp seperation force for contact resolution
gravity normalized to earth standard (9.8,not 20)
take delta-time into account *once* for kinetic energy vs gravity rest checks
and for debug purposes, expose mRigid.atRest to the inspector to see if it's truly at reast or grinding calcs to minimal effect
This commit is contained in:
AzaezelX 2023-12-28 21:04:16 -06:00
parent 4c58a3601f
commit 3c7d2b1b6a
4 changed files with 57 additions and 22 deletions

View file

@ -807,9 +807,9 @@ void Vehicle::updatePos(F32 dt)
if (mCollisionList.getCount())
{
F32 k = mRigid.getKineticEnergy();
F32 G = mNetGravity * dt;
F32 G = mNetGravity;
F32 Kg = 0.5 * mRigid.mass * G * G;
if (k < sRestTol * Kg && ++restCount > sRestCount)
if (k < sRestTol * Kg * dt && ++restCount > sRestCount)
mRigid.setAtRest();
}
else