diff --git a/include/Nazara/Math/Ray.inl b/include/Nazara/Math/Ray.inl index 0309d5f35..230dc092e 100644 --- a/include/Nazara/Math/Ray.inl +++ b/include/Nazara/Math/Ray.inl @@ -114,6 +114,8 @@ bool NzRay::Intersect(const NzBox& box, NzVector3 * hitPoint, NzVector3 template bool NzRay::Intersect(const NzOrientedBox& orientedBox, const NzMatrix4& matrix, NzVector3 * hitPoint, NzVector3 * hitSecondPoint) const { + // Traduction from http://www.opengl-tutorial.org/miscellaneous/clicking-on-objects/picking-with-custom-ray-obb-function/ written by Arnaud Masserann + // Intersection method from Real-Time Rendering and Essential Mathematics for Games T tMin = F(0.0); @@ -185,7 +187,6 @@ bool NzRay::Intersect(const NzOrientedBox& orientedBox, const NzMatrix4 if (-e + orientedBox.localBox.y > F(0.0) || -e + (orientedBox.localBox.y + orientedBox.localBox.height) < F(0.0)) return false; - // Test intersection with the 2 planes perpendicular to the OBB's Z axis // Exactly the same thing than above. NzVector3 zaxis(matrix(2, 0), matrix(2, 1), matrix(2, 2));