mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
fix bad time measurment in AtRestDetector
This commit is contained in:
parent
9de5721a48
commit
f260c6b12b
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ void AtRestDetector::reset(const glm::vec3& startPosition, const glm::quat& star
|
|||
|
||||
bool AtRestDetector::update(const glm::vec3& position, const glm::quat& rotation) {
|
||||
uint64_t now = usecTimestampNow();
|
||||
float dt = (float)(_lastUpdateTime - now) / (float)USECS_PER_SECOND;
|
||||
float dt = (float)(now - _lastUpdateTime) / (float)USECS_PER_SECOND;
|
||||
_lastUpdateTime = now;
|
||||
const float TAU = 1.0f;
|
||||
float delta = glm::min(dt / TAU, 1.0f);
|
||||
|
|
Loading…
Reference in a new issue