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:
authorLuca Rood <dev@lucarood.com>2017-06-30 16:56:44 +0300
committerLuca Rood <dev@lucarood.com>2017-06-30 16:58:57 +0300
commit9cd6b03187b91bb2c267a45eac3cee7738e0e220 (patch)
tree20fb8efef649762ca4ff1d3d94303e6fd605cd57 /source/blender/blenkernel/intern/rigidbody.c
parent76eefa5c0d034d00ddec42efa7351e1c85df3906 (diff)
Fix T50230: Rigid Body simulation shouldn't step when time is beyond cached area
This makes the last time (`ltime`) stored in the rigid body world (`rbw`) only be updated once a simulation step actually occurs, this prevents another simulation step from being solved unless the current time is exactly one frame after the last cached frame. Thus this prevents the formation of gaps in the cache, such as seen in T50230. Reviewers: mont29, sergey, angavrilov Tags: #physics Maniphest Tasks: T50230 Differential Revision: https://developer.blender.org/D2458
Diffstat (limited to 'source/blender/blenkernel/intern/rigidbody.c')
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 390e6dedc3f..c4fb0aec97b 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1563,12 +1563,8 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
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 */
- else if (ctime > endframe) {
+ if (ctime > endframe) {
ctime = endframe;
}
@@ -1584,7 +1580,6 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
if (BKE_ptcache_read(&pid, ctime, can_simulate)) {
BKE_ptcache_validate(cache, (int)ctime);
- rbw->ltime = ctime;
return;
}