Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-02-06 14:29:13 +0000
committerStijn Buys <ingar@osirion.org>2011-02-06 14:29:13 +0000
commit84dd93a63305bd3b1ff3c5c897a6f3e729bfefed (patch)
treebf257bf95e771d70cabe681e8b054b1772885880 /src/core/entity.cc
parent551b18ebf76e26ce8c528863a8308c066bffd4d8 (diff)
Mark an EntityDynamic as dirty when required.
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r--src/core/entity.cc12
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();
+ }
}
}