diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-02 19:46:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-02 19:46:45 +0400 |
commit | fed1b8b16d2d6a56aeea496677f24b286672bb74 (patch) | |
tree | 542e5f6bcfef3491e61f745b4aa1cee769dff63c /source/blender/blenkernel/intern/smoke.c | |
parent | dda63375b2fa581197e909c45116ac17b5f8782c (diff) |
Code cleanup: suffix vars to make obvious they are squared
Diffstat (limited to 'source/blender/blenkernel/intern/smoke.c')
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index e83323ea7a3..8636614f7ed 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -797,7 +797,7 @@ static void obstacles_from_derivedmesh(Object *coll_ob, SmokeDomainSettings *sds float ray_start[3] = {(float)x + 0.5f, (float)y + 0.5f, (float)z + 0.5f}; BVHTreeNearest nearest = {0}; nearest.index = -1; - nearest.dist = surface_distance * surface_distance; /* find_nearest uses squared distance */ + nearest.dist_sq = surface_distance * surface_distance; /* find_nearest uses squared distance */ /* find the nearest point on the mesh */ if (BLI_bvhtree_find_nearest(treeData.tree, ray_start, &nearest, treeData.nearest_callback, &treeData) != -1) { @@ -1434,7 +1434,7 @@ static void sample_derivedmesh(SmokeFlowSettings *sfs, MVert *mvert, MTFace *tfa hit.index = -1; hit.dist = 9999; nearest.index = -1; - nearest.dist = sfs->surface_distance * sfs->surface_distance; /* find_nearest uses squared distance */ + nearest.dist_sq = sfs->surface_distance * sfs->surface_distance; /* find_nearest uses squared distance */ /* Check volume collision */ if (sfs->volume_density) { @@ -1465,7 +1465,7 @@ static void sample_derivedmesh(SmokeFlowSettings *sfs, MVert *mvert, MTFace *tfa /* emit from surface based on distance */ if (sfs->surface_distance) { - sample_str = sqrtf(nearest.dist) / sfs->surface_distance; + sample_str = sqrtf(nearest.dist_sq) / sfs->surface_distance; CLAMP(sample_str, 0.0f, 1.0f); sample_str = pow(1.0f - sample_str, 0.5f); } |