diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-06 23:30:18 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-06 23:30:18 +0000 |
commit | fbdada1d6f81ba5ca17de33393badafd9be1fab2 (patch) | |
tree | e036af4fcb2ad689e9c6a456ab0291db686c2185 | |
parent | 0e781f78c62f8f32c6829d9ae9aa244998e7d0a7 (diff) | |
download | chromium_src-fbdada1d6f81ba5ca17de33393badafd9be1fab2.zip chromium_src-fbdada1d6f81ba5ca17de33393badafd9be1fab2.tar.gz chromium_src-fbdada1d6f81ba5ca17de33393badafd9be1fab2.tar.bz2 |
Further doc improvements for Line_.closestPointToRay() based on
comments in http://codereview.chromium.org/251097 .
Review URL: http://codereview.chromium.org/243111
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28181 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | o3d/samples/o3djs/manipulators.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/o3d/samples/o3djs/manipulators.js b/o3d/samples/o3djs/manipulators.js index d84cea0..e1ddce6 100644 --- a/o3d/samples/o3djs/manipulators.js +++ b/o3d/samples/o3djs/manipulators.js @@ -152,7 +152,7 @@ o3djs.manipulators.Line_.prototype.setPoint = function(point) { this.point_ = o3djs.math.copyVector(point);
this.recalc_();
}
-
+
/**
* Gets one point through which this line travels.
* @private
@@ -208,26 +208,25 @@ o3djs.manipulators.Line_.prototype.closestPointToRay = function(startPoint, // the ray are closest together, the line segment between cp1 and
// cp2 is perpendicular to both of the lines.
//
- // We can therefore write the following equations ("**" is the "dot"
- // operator):
+ // We can therefore write the following equations:
//
- // dir ** (cp2 - cp1) = 0
- // raydir ** (cp2 - cp1) = 0
+ // dot( dir, (cp2 - cp1)) = 0
+ // dot(raydir, (cp2 - cp1)) = 0
//
// Define t' and u' as the parameter values for cp1 and cp2,
// respectively. Expanding, these equations become
//
- // dir ** ((raystart + u' * raydir) - (point + t' * dir)) = 0
- // raydir ** ((raystart + u' * raydir) - (point + t' * dir)) = 0
+ // dot( dir, ((raystart + u' * raydir) - (point + t' * dir))) = 0
+ // dot(raydir, ((raystart + u' * raydir) - (point + t' * dir))) = 0
//
// With some reshuffling, these can be expressed in vector/matrix
// form:
//
- // [ dir ** raystart - dir ** point ]
- // [ raydir ** raystart - raydir ** point ] * (continued)
+ // [ dot( dir, raystart) - dot( dir, point) ]
+ // [ dot(raydir, raystart) - dot(raydir, point) ] + (continued)
//
- // [ -( dir ** dir) dir ** raydir ] [ t' ] [0]
- // [ -(raydir ** dir) raydir ** raydir ] [ u' ] = [0]
+ // [ -dot( dir, dir) dot( dir, raydir) ] [ t' ] [0]
+ // [ -dot(raydir, dir) dot(raydir, raydir) ] * [ u' ] = [0]
//
// u' is the parameter for the world space ray being cast into the
// screen. We can deduce whether the starting point of the ray is
|