From 45fc9158e406b4d65d6d2dcf07ba2b73e2b0631e Mon Sep 17 00:00:00 2001 From: Gawaboumga Date: Tue, 1 Jul 2014 10:57:43 +0200 Subject: [PATCH] Add of source Add of the source Former-commit-id: f3d01ef18ccc1ae906693f388e696c0763576a3b --- include/Nazara/Math/Ray.inl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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));