mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 19:15:56 +02:00
handle case where obj at rest but still falls
This commit is contained in:
parent
1e5c44f117
commit
44ebf37510
1 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue