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:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-06-19 13:16:18 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-06-19 15:22:48 +0300
commit92823275af65c64e6edfeca3c513d64f5445640c (patch)
tree342136d175594fd66ef99df8b74f17f385d2641f /source/blender/blenkernel/intern/rigidbody.c
parent4b5f3690bb5758cbc5a3c099632fe6759e020c71 (diff)
Fixed rigid body simulation randomly stopping
This was caused by a floating point comparison using ==, instead of using compare_ff_relative().
Diffstat (limited to 'source/blender/blenkernel/intern/rigidbody.c')
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index eec0e8b387d..3012c1b7f99 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1631,7 +1631,7 @@ void BKE_rigidbody_do_simulation(Depsgraph *depsgraph, Scene *scene, float ctime
}
/* advance simulation, we can only step one frame forward */
- if (ctime == rbw->ltime + 1) {
+ if (compare_ff_relative(ctime, rbw->ltime + 1, FLT_EPSILON, 64)) {
/* write cache for first frame when on second frame */
if (rbw->ltime == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0)) {
BKE_ptcache_write(&pid, startframe);