From 84dd93a63305bd3b1ff3c5c897a6f3e729bfefed Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 6 Feb 2011 14:29:13 +0000 Subject: Mark an EntityDynamic as dirty when required. --- src/core/entity.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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(); + } } } -- cgit v1.2.3