(Ray) Fixed Intersect(Plane, T) method
Former-commit-id: 5acfae80d778087a2e2b423d34da8a218a802cd4
This commit is contained in:
parent
0e48f052e5
commit
cdff689403
|
|
@ -225,7 +225,7 @@ bool NzRay<T>::Intersect(const NzPlane<T>& plane, T* hit) const
|
||||||
if (NzNumberEquals(divisor, F(0.0)))
|
if (NzNumberEquals(divisor, F(0.0)))
|
||||||
return false; // perpendicular
|
return false; // perpendicular
|
||||||
|
|
||||||
T lambda = -(plane.normal.DotProduct(origin) - plane.distance) / divisor; // The plane is ax+by+cz=d
|
T lambda = -(plane.normal.DotProduct(origin) + plane.distance) / divisor; // The plane is ax+by+cz=d
|
||||||
if (lambda < F(0.0))
|
if (lambda < F(0.0))
|
||||||
return false; // Le plan est derrière le rayon
|
return false; // Le plan est derrière le rayon
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue