diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-05-18 19:04:27 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-05-18 19:04:35 +0300 |
commit | de7635f607e7b53d69f7befe2d07979f9150314e (patch) | |
tree | 0d94b49b684333ba6ff7e43cf63387fe8d3b3400 /source/blender/blenkernel | |
parent | 30673ff3252864f6d8a1e96a20d8af7e156c5bc7 (diff) |
Fix: Use DEG_get_ctime() for rigidbody sims instead of BKE_scene_frame_get()
There are still probably other massive problems to solve (i.e. which copies
of data cache/sim gets written/read from for COW eval) that need to be solved
before we can get the sims actually running though.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/rigidbody.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 5a9b5585efd..28d5cad3da8 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -67,6 +67,7 @@ #include "BKE_scene.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" /* ************************************** */ /* Memory Management */ @@ -1697,7 +1698,7 @@ void BKE_rigidbody_do_simulation(struct Depsgraph *depsgraph, Scene *scene, floa void BKE_rigidbody_rebuild_sim(struct Depsgraph *depsgraph, Scene *scene) { - float ctime = BKE_scene_frame_get(scene); + float ctime = DEG_get_ctime(depsgraph); DEG_debug_print_eval_time(depsgraph, __func__, scene->id.name, scene, ctime); /* rebuild sim data (i.e. after resetting to start of timeline) */ if (BKE_scene_check_rigidbody_active(scene)) { @@ -1708,7 +1709,7 @@ void BKE_rigidbody_rebuild_sim(struct Depsgraph *depsgraph, void BKE_rigidbody_eval_simulation(struct Depsgraph *depsgraph, Scene *scene) { - float ctime = BKE_scene_frame_get(scene); + float ctime = DEG_get_ctime(depsgraph); DEG_debug_print_eval_time(depsgraph, __func__, scene->id.name, scene, ctime); /* evaluate rigidbody sim */ if (BKE_scene_check_rigidbody_active(scene)) { @@ -1721,7 +1722,7 @@ void BKE_rigidbody_object_sync_transforms(struct Depsgraph *depsgraph, Object *ob) { RigidBodyWorld *rbw = scene->rigidbody_world; - float ctime = BKE_scene_frame_get(scene); + float ctime = DEG_get_ctime(depsgraph); DEG_debug_print_eval_time(depsgraph, __func__, ob->id.name, ob, ctime); /* read values pushed into RBO from sim/cache... */ BKE_rigidbody_sync_transforms(rbw, ob, ctime); |