summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
Diffstat (limited to 'o3d')
-rw-r--r--o3d/samples/o3d-webgl/primitive.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/o3d/samples/o3d-webgl/primitive.js b/o3d/samples/o3d-webgl/primitive.js
index 567544f..71b32ec 100644
--- a/o3d/samples/o3d-webgl/primitive.js
+++ b/o3d/samples/o3d-webgl/primitive.js
@@ -525,7 +525,7 @@ o3d.Primitive.prototype.intersectRay =
(m00 * m12 - m02 * m10) * y +
(m00 * m11 - m01 * m10) * z) / d;
- if (v0 > 0 && v1 > 0 && v2 > 0) {
+ if (v0 >= 0 && v1 >= 0 && v2 >= 0 && (v0 + v1 + v2 > 0)) {
// Rescale by the one-norm to find the intersection of the transformed.
// ray with the unit triangle.
var one_norm = v0 + v1 + v2;