mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-03 04:20:30 +00:00
physics findings
rigid: main finding is rigid needs to take delta into account for integration (aka interpolation) also used POINT_EPSILON for thresholds for consistency for rigidshape/item/player, main finding was length calcs for the search area were all over the place, so we now derive the extended length of the cached area based on the velocity and the object's radius itself rather than guessin per class atrest gravity calc suplimental syncing between rigidshape and vehicle **remindernote POINT_EPSILO is 0.0001
This commit is contained in:
parent
af73e79424
commit
4c083d713d
6 changed files with 15 additions and 14 deletions
|
|
@ -1138,7 +1138,7 @@ void RigidShape::updatePos(F32 dt)
|
|||
|
||||
// Update collision information based on our current pos.
|
||||
bool collided = false;
|
||||
if (!mDisableMove)
|
||||
if (!mRigid.atRest && !mDisableMove)
|
||||
{
|
||||
collided = updateCollision(dt);
|
||||
|
||||
|
|
@ -1151,7 +1151,7 @@ void RigidShape::updatePos(F32 dt)
|
|||
{
|
||||
F32 k = mRigid.getKineticEnergy();
|
||||
F32 G = mNetGravity* dt * TickMs / mDataBlock->integration;
|
||||
F32 Kg = mRigid.mass * G * G;
|
||||
F32 Kg = mRigid.mass * G * G * TickSec;
|
||||
if (k < sRestTol * Kg && ++restCount > sRestCount)
|
||||
mRigid.setAtRest();
|
||||
}
|
||||
|
|
@ -1447,7 +1447,7 @@ void RigidShape::updateWorkingCollisionSet(const U32 mask)
|
|||
// working list is updated on a Tick basis, which means we only expand our box by
|
||||
// the possible movement in that tick, plus some extra for caching purposes
|
||||
Box3F convexBox = mConvex.getBoundingBox(getTransform(), getScale());
|
||||
F32 len = (mRigid.linVelocity.len() + 50) * TickSec;
|
||||
F32 len = (mRigid.linVelocity.len() + mDataBlock->getShape()->mRadius) * TickSec;
|
||||
F32 l = (len * 1.1) + 0.1; // fudge factor
|
||||
convexBox.minExtents -= Point3F(l, l, l);
|
||||
convexBox.maxExtents += Point3F(l, l, l);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue