diff options
author | Stijn Buys <ingar@osirion.org> | 2011-02-06 14:29:13 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-02-06 14:29:13 +0000 |
commit | 84dd93a63305bd3b1ff3c5c897a6f3e729bfefed (patch) | |
tree | bf257bf95e771d70cabe681e8b054b1772885880 /src/core | |
parent | 551b18ebf76e26ce8c528863a8308c066bffd4d8 (diff) |
Mark an EntityDynamic as dirty when required.
Diffstat (limited to 'src/core')
-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(); + } } } |