lib/mittsu/math/ray.rb in mittsu-0.1.7 vs lib/mittsu/math/ray.rb in mittsu-0.2.0
- old
+ new
@@ -243,10 +243,9 @@
# E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by
# |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))
# |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))
# |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)
d_dot_n = @direction.dot(normal)
- sign
if d_dot_n > 0
return nil if backface_culling
sign = 1.0
elsif d_dot_n < 0
sign = -1.0