Clarify some notation in plane intersection
This commit is contained in:
parent
964b6a5751
commit
20b88f6dac
1 changed files with 4 additions and 4 deletions
|
@ -91,16 +91,16 @@ Plane::DoesIntersect(const Ray &ray,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* The denominator for the t equation above. */
|
/* The denominator for the t equation above. */
|
||||||
Double ndotd = mNormal.dot(ray.direction);
|
Double vd = mNormal.dot(ray.direction);
|
||||||
if (ndotd == 0.0) {
|
if (vd == 0.0) {
|
||||||
/* The ray is parallel to the plane. */
|
/* The ray is parallel to the plane. */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The numerator of the equation for t above. */
|
/* The numerator of the equation for t above. */
|
||||||
Double ndoto = -(mNormal.dot(ray.origin) + mDistance);
|
Double vo = -(mNormal.dot(ray.origin) + mDistance);
|
||||||
|
|
||||||
Double t0 = ndoto / ndotd;
|
Double t0 = vo / vd;
|
||||||
if (t0 < 0.0) {
|
if (t0 < 0.0) {
|
||||||
/* The plane is behind the ray's origin. */
|
/* The plane is behind the ray's origin. */
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue