diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/entity.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc index c7b3efe..6aef6e5 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -622,11 +622,19 @@ void EntityDynamic::frame(float seconds) get_location().assign(t.getOrigin()); get_axis().assign(t.getBasis()); - entity_speed = (float) entity_body->getLinearVelocity().length(); - + // if speed goes to 0 in this frame, the entity still needs to be marked as dirty + if (entity_speed > 0) { + set_dirty(); + } + entity_speed = (float) entity_body->getLinearVelocity().length(); if (entity_speed > 0) { set_dirty(); } + + float entity_angular = (float) entity_body->getAngularVelocity().length(); + if (entity_angular > 0) { + set_dirty(); + } } } |