handle case where obj at rest but still falls

This commit is contained in:
Andrew Meadows 2014-12-17 15:52:34 -08:00
parent 1e5c44f117
commit 44ebf37510

View file

@ -650,7 +650,7 @@ void EntityItem::simulate(const quint64& now) {
} }
} }
if (hasVelocity()) { if (hasVelocity() || hasGravity()) {
glm::vec3 position = getPosition(); glm::vec3 position = getPosition();
glm::vec3 velocity = getVelocity(); glm::vec3 velocity = getVelocity();
glm::vec3 newPosition = position + (velocity * timeElapsed); glm::vec3 newPosition = position + (velocity * timeElapsed);
@ -731,7 +731,7 @@ void EntityItem::simulate(const quint64& now) {
} }
bool EntityItem::isMoving() const { bool EntityItem::isMoving() const {
return hasVelocity() || hasAngularVelocity(); return hasVelocity() (hasGravity() && !isRestingOnSurface()) || hasAngularVelocity();
} }
bool EntityItem::lifetimeHasExpired() const { bool EntityItem::lifetimeHasExpired() const {