[Bf-blender-cvs] [219937f] master: Fix T43674: Smoke collision does not detect obstacles reliably.

Lukas Tönne noreply at git.blender.org
Mon Mar 9 15:24:01 CET 2015


Commit: 219937fc5dbde485bdd50feaccf496e26c63df40
Author: Lukas Tönne
Date:   Mon Mar 9 15:15:47 2015 +0100
Branches: master
https://developer.blender.org/rB219937fc5dbde485bdd50feaccf496e26c63df40

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.

===================================================================

M	source/blender/blenkernel/intern/smoke.c

===================================================================

diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index a34aa50..559e1e0 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;




More information about the Bf-blender-cvs mailing list