[Bf-blender-cvs] [0992e7f] fluid-mantaflow: reverting to old liquid inflow - previous approach results in inaacurate meshes (interpolation issue)
Sebastián Barschkis
noreply at git.blender.org
Sat Jun 11 18:14:50 CEST 2016
Commit: 0992e7f6861a41b31798249a6b0a37136af1f0de
Author: Sebastián Barschkis
Date: Sat Jun 11 18:01:22 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB0992e7f6861a41b31798249a6b0a37136af1f0de
reverting to old liquid inflow - previous approach results in inaacurate meshes (interpolation issue)
===================================================================
M source/blender/blenkernel/intern/smoke.c
===================================================================
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 832ac1a..7510abb 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -1550,18 +1550,12 @@ static void sample_derivedmesh(
}
}
- // Reset hit tree
- hit.index = -1;
- hit.dist = 9999;
- float first_hit, opposite_hit;
-
/* Calculate map which indicates whether point is inside a mesh or not */
if (BLI_bvhtree_ray_cast(treeData->tree, ray_start, ray_dir, 0.0f, &hit, treeData->raycast_callback, treeData) != -1) {
float dot = ray_dir[0] * hit.no[0] + ray_dir[1] * hit.no[1] + ray_dir[2] * hit.no[2];
/* If ray and hit face normal are facing same direction
* hit point is inside a closed mesh. */
if (dot >= 0) {
- first_hit = hit.dist;
/* Also cast a ray in opposite direction to make sure
* point is at least surrounded by two faces */
negate_v3(ray_dir);
@@ -1571,13 +1565,11 @@ static void sample_derivedmesh(
BLI_bvhtree_ray_cast(treeData->tree, ray_start, ray_dir, 0.0f, &hit, treeData->raycast_callback, treeData);
if (hit.index != -1) {
- opposite_hit = hit.dist;
- inflow_map[index] = -MIN2(first_hit, opposite_hit); // Inside mesh
+ inflow_map[index] = 0.5; // Inside mesh
}
}
}
-
/* find the nearest point on the mesh */
if (BLI_bvhtree_find_nearest(treeData->tree, ray_start, &nearest, treeData->nearest_callback, treeData) != -1) {
float weights[4];
More information about the Bf-blender-cvs
mailing list