diff options
author | Thomas Dinges <blender@dingto.org> | 2013-05-14 22:31:55 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-05-14 22:31:55 +0400 |
commit | 1f3bf34ccd8b7b29560b819c72619fce7bfc7f4c (patch) | |
tree | 58eecca0c36cd3d3822b8b04b9a89cdcacc4f82c /intern/cycles/bvh | |
parent | 6fc51bf20e48fd0565ccce928693455f6a12551c (diff) |
Cycles :
* Use is_zero(a) rather than dot(a, a) == 0, saves some calculations.
Diffstat (limited to 'intern/cycles/bvh')
-rw-r--r-- | intern/cycles/bvh/bvh.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp index 5732efef357..82a444bda76 100644 --- a/intern/cycles/bvh/bvh.cpp +++ b/intern/cycles/bvh/bvh.cpp @@ -32,6 +32,7 @@ #include "util_progress.h" #include "util_system.h" #include "util_types.h" +#include "util_math.h" CCL_NAMESPACE_BEGIN @@ -251,7 +252,7 @@ void BVH::pack_triangle(int idx, float4 woop[3]) float3 r1 = v1 - v2; float3 r2 = cross(r0, r1); - if(dot(r0, r0) == 0.0f || dot(r1, r1) == 0.0f || dot(r2, r2) == 0.0f) { + if(is_zero(r0) || is_zero(r1) || is_zero(r2)) { /* degenerate */ woop[0] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); woop[1] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); |