mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
from marauder: sleep threshold work
This commit is contained in:
parent
d5a111e9ff
commit
a0bd5dd426
2 changed files with 88 additions and 14 deletions
|
|
@ -61,11 +61,18 @@ public:
|
|||
F32 oneOverMass; ///< 1 / mass
|
||||
F32 restitution; ///< Collision restitution
|
||||
F32 friction; ///< Friction coefficient
|
||||
|
||||
// sleep threshold parameters
|
||||
F32 sleepLinearThreshold; ///< M/S ^ 2
|
||||
F32 sleepAngThreshold; ///< R/S ^ 2
|
||||
F32 sleepTimeThreshold; ///< Seconds
|
||||
F32 sleepTimer;
|
||||
|
||||
bool atRest;
|
||||
|
||||
private:
|
||||
void translateCenterOfMass(const Point3F &oldPos,const Point3F &newPos);
|
||||
|
||||
void trySleep(F32 dt);
|
||||
public:
|
||||
//
|
||||
Rigid();
|
||||
|
|
@ -94,6 +101,11 @@ public:
|
|||
|
||||
bool checkRestCondition();
|
||||
void setAtRest();
|
||||
|
||||
//
|
||||
void setSleepThresholds(F32 linVel2, F32 angVel2, F32 timeToSleep);
|
||||
void wake();
|
||||
TORQUE_FORCEINLINE void updateAngularVelocity() { invWorldInertia.mulV(angMomentum, &angVelocity); }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue