|
|
|
|
|
|
// Optimize: |
|
|
|
// NdotV / (length(N) * length(V)) < Epsilon |
|
|
|
// NdotV < Epsilon * length(N) * length(V) |
|
|
|
// NdotV < Epsilon * sqrt(dot(N, N) * sqrt(dot(V, V) |
|
|
|
// NdotV < Epsilon * sqrt(dot(N, N)) * sqrt(dot(V, V)) |
|
|
|
// NdotV < Epsilon * sqrt(dot(N, N) * dot(V, V)) |
|
|
|
return NdotV < epsilon * sqrt(dot(N, N) * dot(V, V)); |
|
|
|
} |