[Bf-blender-cvs] [5c06ff8bb9] master: Cycles: Cleanup, remove unused function

Sergey Sharybin noreply at git.blender.org
Thu Mar 23 18:05:08 CET 2017


Commit: 5c06ff8bb96d014dda33874d357ecb4652558998
Author: Sergey Sharybin
Date:   Thu Mar 23 12:04:49 2017 +0100
Branches: master
https://developer.blender.org/rB5c06ff8bb96d014dda33874d357ecb4652558998

Cycles: Cleanup, remove unused function

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

M	intern/cycles/util/util_math.h

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

diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index 27d4ae510c..da18ae907a 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -1514,49 +1514,6 @@ ccl_device bool ray_aligned_disk_intersect(
 	return true;
 }
 
-ccl_device bool ray_triangle_intersect(
-	float3 ray_P, float3 ray_D, float ray_t,
-	float3 v0, float3 v1, float3 v2,
-	float3 *isect_P, float *isect_t)
-{
-	/* Calculate intersection */
-	float3 e1 = v1 - v0;
-	float3 e2 = v2 - v0;
-	float3 s1 = cross(ray_D, e2);
-
-	const float divisor = dot(s1, e1);
-	if(UNLIKELY(divisor == 0.0f))
-		return false;
-
-	const float invdivisor = 1.0f/divisor;
-
-	/* compute first barycentric coordinate */
-	const float3 d = ray_P - v0;
-	const float u = dot(d, s1)*invdivisor;
-	if(u < 0.0f)
-		return false;
-
-	/* Compute second barycentric coordinate */
-	const float3 s2 = cross(d, e1);
-	const float v = dot(ray_D, s2)*invdivisor;
-	if(v < 0.0f)
-		return false;
-
-	const float b0 = 1.0f - u - v;
-	if(b0 < 0.0f)
-		return false;
-
-	/* compute t to intersection point */
-	const float t = dot(e2, s2)*invdivisor;
-	if(t < 0.0f || t > ray_t)
-		return false;
-
-	*isect_t = t;
-	*isect_P = ray_P + ray_D*t;
-
-	return true;
-}
-
 ccl_device_inline bool ray_triangle_intersect_uv(
         float3 ray_P, float3 ray_D, float ray_t,
         float3 v0, float3 v1, float3 v2,




More information about the Bf-blender-cvs mailing list