diff options
author | luchen@chromium.org <luchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-09 21:36:42 +0000 |
---|---|---|
committer | luchen@chromium.org <luchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-09 21:36:42 +0000 |
commit | 767cc84304d8fb67bae9ccbfea8607028838e94f (patch) | |
tree | f7ad57db633fed08b944751dbd2b70487601a6dc /o3d/samples | |
parent | 2e3e9fece5b3914e0bfb88cd07b381760f70ab87 (diff) | |
download | chromium_src-767cc84304d8fb67bae9ccbfea8607028838e94f.zip chromium_src-767cc84304d8fb67bae9ccbfea8607028838e94f.tar.gz chromium_src-767cc84304d8fb67bae9ccbfea8607028838e94f.tar.bz2 |
Fixes edge case where two components of the world ray are both 0.
Review URL: http://codereview.chromium.org/3013067
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55476 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples')
-rw-r--r-- | o3d/samples/o3d-webgl/primitive.js | 2 |
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; |