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:
authorCampbell Barton <ideasman42@gmail.com>2017-09-06 09:50:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-09-06 09:50:59 +0300
commitb41d34040b45b6634c3e81c93003326a3bf1d49a (patch)
tree057360c7f476a25c99df9ba790a64968bdeec195 /source/blender/blenkernel/intern/rigidbody.c
parent518e7685790f28789bbe795f370ee3b1a5f776c6 (diff)
parent47b7f06d0e13efba04290d4cfa8c28d2342eebf7 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/rigidbody.c')
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index df048ce5036..f75b14579c7 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1595,8 +1595,12 @@ void BKE_rigidbody_do_simulation(const struct EvaluationContext *eval_ctx, Scene
BKE_ptcache_id_time(&pid, scene, ctime, &startframe, &endframe, NULL);
cache = rbw->pointcache;
+ if (ctime <= startframe) {
+ rbw->ltime = startframe;
+ return;
+ }
/* make sure we don't go out of cache frame range */
- if (ctime > endframe) {
+ else if (ctime > endframe) {
ctime = endframe;
}
@@ -1610,12 +1614,9 @@ void BKE_rigidbody_do_simulation(const struct EvaluationContext *eval_ctx, Scene
// RB_TODO deal with interpolated, old and baked results
bool can_simulate = (ctime == rbw->ltime + 1) && !(cache->flag & PTCACHE_BAKED);
- if (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0) {
- rbw->ltime = cache->startframe;
- }
-
- if (BKE_ptcache_read(&pid, ctime, can_simulate)) {
+ if (BKE_ptcache_read(&pid, ctime, can_simulate) == PTCACHE_READ_EXACT) {
BKE_ptcache_validate(cache, (int)ctime);
+ rbw->ltime = ctime;
return;
}