fix bad time measurment in AtRestDetector

This commit is contained in:
U-GAPOS\andrew 2015-11-04 10:47:39 -08:00
parent 9de5721a48
commit f260c6b12b

View file

@ -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);