diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-03-09 17:15:47 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-03-09 17:23:52 +0300 |
commit | 219937fc5dbde485bdd50feaccf496e26c63df40 (patch) | |
tree | fcf46a6197e309281d62efc9076f090247cd04bb /source | |
parent | b14e2876a759470df30002d98fe28176ac1a3836 (diff) |
Fix T43674: Smoke collision does not detect obstacles reliably.
The smoke obstacle detection was using a maximum distance for BVH
checks to find mesh elements that define boundary cells in the grid.
This BVH test was using an arbitrary value of 0.6 cell units. It should
be `sqrt(3)*0.5` to account for the maximum possible distance of mesh
elements inside a cell. Otherwise some cells that should form the
boundary are not detected as such (no closest mesh element found inside
the radius), so you get gaps in the smoke obstacle.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index a34aa5009e6..559e1e05f3f 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -730,7 +730,8 @@ static void obstacles_from_derivedmesh(Object *coll_ob, SmokeDomainSettings *sds BVHTreeFromMesh treeData = {NULL}; int numverts, i, z; - float surface_distance = 0.6; + /* slightly rounded-up sqrt(3 * (0.5)^2) == max. distance of cell boundary along the diagonal */ + const float surface_distance = 0.867f; float *vert_vel = NULL; int has_velocity = 0; |