Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergej Reich <sergej.reich@googlemail.com>2013-02-16 03:48:36 +0400
committerSergej Reich <sergej.reich@googlemail.com>2013-02-16 03:48:36 +0400
commit6072322312308fe13e51ce4c394eeb79434f38f2 (patch)
treeeda21c3b287908b7b42980c09c07d2c3471b02c7 /source/blender/blenkernel/intern/rigidbody.c
parent207dca55f46e8c9e6948adf0d45f834dced9a274 (diff)
rigidbody: Avoid unnecessary simulation updates
Now we flag the world for update on frame change and only call BKE_rigidbody_do_simulation() when needed.
Diffstat (limited to 'source/blender/blenkernel/intern/rigidbody.c')
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 055ada33867..9ae82422ca2 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1223,6 +1223,8 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
BKE_ptcache_id_time(&pid, scene, ctime, &startframe, &endframe, NULL);
cache = rbw->pointcache;
+ rbw->flag &= ~RBW_FLAG_FRAME_UPDATE;
+
/* flag cache as outdated if we don't have a world or number of objects in the simulation has changed */
if (rbw->physics_world == NULL || rbw->numbodies != BLI_countlist(&rbw->group->gobject)) {
cache->flag |= PTCACHE_OUTDATED;