Marko Pintera 11 лет назад
Родитель
Сommit
59e5766079

+ 6 - 4
CamelotUtility/Include/CmAABox.h

@@ -68,16 +68,18 @@ namespace CamelotFramework
 		/**
 		 * @brief	Transforms the bounding box by the given matrix.
 		 *
-		 * @note	As the resulting box will no longer be axis aligned,
-		 * 			an axis align box is instead created from the transformed oriented bounding box.
+		 * @note	As the resulting box will no longer be axis aligned, an axis align box 
+		 * 			is instead created by encompassing the transformed oriented bounding box.
+		 * 			Retrieving the value as an actual OBB would provide a tighter fit.
 		 */
 		void transform(const Matrix4& matrix);
 
 		/**
 		 * @brief	Transforms the bounding box by the given matrix.
 		 *
-		 * @note	As the resulting box will no longer be axis aligned,
-		 * 			an axis align box is instead created from the transformed oriented bounding box.
+		 * @note	As the resulting box will no longer be axis aligned, an axis align box 
+		 * 			is instead created by encompassing the transformed oriented bounding box.
+		 * 			Retrieving the value as an actual OBB would provide a tighter fit.
 		 * 			
 		 *			Provided matrix must be affine.
 		 */

+ 4 - 35
CamelotUtility/Include/CmPlane.h

@@ -1,37 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-// This file is based on material originally from:
-// Geometric Tools, LLC
-// Copyright (c) 1998-2010
-// Distributed under the Boost Software License, Version 1.0.
-// http://www.boost.org/LICENSE_1_0.txt
-// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
-
 #pragma once
 
 #include "CmPrerequisitesUtil.h"
@@ -39,6 +5,9 @@ THE SOFTWARE.
 
 namespace CamelotFramework 
 {
+    /**
+     * @brief	A plane represented by a normal and a distance.
+     */
     class CM_UTILITY_EXPORT Plane
     {
 	public:
@@ -107,7 +76,7 @@ namespace CamelotFramework
 		bool intersects(const Sphere& sphere) const;
 
 		/**
-		 * @brief	Ray/plane intersection, returns boolean result and distance.
+		 * @brief	Ray/plane intersection, returns boolean result and distance to intersection point.
 		 */
 		std::pair<bool, float> intersects(const Ray& ray) const;
 

+ 50 - 41
CamelotUtility/Include/CmQuaternion.h

@@ -1,38 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-// This file is based on material originally from:
-// Geometric Tools, LLC
-// Copyright (c) 1998-2010
-// Distributed under the Boost Software License, Version 1.0.
-// http://www.boost.org/LICENSE_1_0.txt
-// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
-
-
 #pragma once
 
 #include "CmPrerequisitesUtil.h"
@@ -41,6 +6,9 @@ THE SOFTWARE.
 
 namespace CamelotFramework 
 {
+    /**
+     * @brief	Represents a quaternion used for 3D rotations.
+     */
     class CM_UTILITY_EXPORT Quaternion
     {
 	private:
@@ -123,8 +91,25 @@ namespace CamelotFramework
 			return *(&w+i);
 		}
 
+		/**
+		 * @brief	Initializes the quaternion from a 3x3 rotation matrix.
+		 * 			
+		 * @note	It's up to the caller to ensure the matrix is orthonormal.
+		 */
 		void fromRotationMatrix(const Matrix3& mat);
+
+		/**
+		 * @brief	Initializes the quaternion from an angle axis pair. Quaternion
+		 * 			will represent a rotation of "angle" radians around "axis".
+		 */
         void fromAxisAngle(const Vector3& axis, const Radian& angle);
+
+        /**
+         * @brief	Initializes the quaternion from orthonormal set of axes. Quaternion
+         * 			will represent a rotation from base axes to the specified set of axes.
+         * 			
+		 * @note	It's up to the caller to ensure the axes are orthonormal.
+         */
         void fromAxes(const Vector3& xAxis, const Vector3& yAxis, const Vector3& zAxis);
         
         /**
@@ -150,16 +135,34 @@ namespace CamelotFramework
          */
         void fromEulerAngles(const Radian& xAngle, const Radian& yAngle, const Radian& zAngle, EulerAngleOrder order);
 
+		/**
+		 * @brief	Converts a quaternion to a rotation matrix.
+		 */
 		void toRotationMatrix(Matrix3& mat) const;
+
+		/**
+		 * @brief	Converts a quaternion to an angle axis pair.
+		 *
+		 * @param [out]	axis 	The axis around the which rotation takes place.
+		 * @param [out]	angle	The angle in radians determining amount of rotation around the axis.
+		 */
 		void toAxisAngle(Vector3& axis, Radian& angle) const;
+
+		/**
+		 * @brief	Converts a quaternion to an orthonormal set of axes.
+		 *
+		 * @param [out]	xAxis	The X axis.
+		 * @param [out]	yAxis	The Y axis.
+		 * @param [out]	zAxis	The Z axis.
+		 */
 		void toAxes(Vector3& xAxis, Vector3& yAxis, Vector3& zAxis) const;
 
 		/**
          * @brief	Extracts Pitch/Yaw/Roll rotations from this quaternion.
          *
-         * @param [in,out]	xAngle	Rotation about x axis. (AKA Pitch)
-         * @param [in,out]	yAngle  Rotation about y axis. (AKA Yaw)
-         * @param [in,out]	zAngle 	Rotation about z axis. (AKA Roll)
+         * @param [out]	xAngle	Rotation about x axis. (AKA Pitch)
+         * @param [out]	yAngle  Rotation about y axis. (AKA Yaw)
+         * @param [out]	zAngle 	Rotation about z axis. (AKA Roll)
          *
          * @return	True if unique solution was found, false otherwise.
          * 			
@@ -171,9 +174,9 @@ namespace CamelotFramework
 		/**
 		 * @brief	Extracts Pitch/Yaw/Roll rotations from this quaternion.
 		 *
-		 * @param	xAngle	Rotation about x axis. (AKA Pitch)
-		 * @param	yAngle	Rotation about y axis. (AKA Yaw)
-		 * @param	zAngle	Rotation about z axis. (AKA Roll)
+		 * @param [out]	xAngle	Rotation about x axis. (AKA Pitch)
+		 * @param [out]	yAngle	Rotation about y axis. (AKA Yaw)
+		 * @param [out]	zAngle	Rotation about z axis. (AKA Roll)
 		 * @param	order 	The order in which rotations will be extracted. 
 		 * 					Different values can be retrieved depending on the order.
 		 *
@@ -224,6 +227,9 @@ namespace CamelotFramework
 
 		friend Quaternion operator* (float lhs, const Quaternion& rhs);
 
+        /**
+         * @brief	Calculates the dot product of this quaternion and another.
+         */
         float dot(const Quaternion& other) const;  
 
         /**
@@ -243,6 +249,9 @@ namespace CamelotFramework
          */
         Vector3 rotate(const Vector3& vec) const;
 
+		/**
+		* @brief	Query if any of the components of the quaternion are NaN.
+		 */
 		bool isNaN() const
 		{
 			return Math::isNaN(x) || Math::isNaN(y) || Math::isNaN(z) || Math::isNaN(w);

+ 53 - 107
CamelotUtility/Include/CmRay.h

@@ -1,132 +1,78 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
+#pragma once
 
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#ifndef __Ray_H_
-#define __Ray_H_
-
-// Precompiler options
 #include "CmPrerequisitesUtil.h"
-
 #include "CmVector3.h"
 
-namespace CamelotFramework {
-
-	/** \addtogroup Core
-	*  @{
-	*/
-	/** \addtogroup Math
-	*  @{
-	*/
-	/** Representation of a ray in space, i.e. a line with an origin and direction. */
+namespace CamelotFramework 
+{
+    /**
+     * @brief	A ray in 3D space represented with an origin and direction.
+     */
     class CM_UTILITY_EXPORT Ray
     {
-    protected:
-        Vector3 mOrigin;
-        Vector3 mDirection;
     public:
-        Ray():mOrigin(Vector3::ZERO), mDirection(Vector3::UNIT_Z) {}
+        Ray()
+			:mOrigin(Vector3::ZERO), mDirection(Vector3::UNIT_Z) 
+		{ }
+
         Ray(const Vector3& origin, const Vector3& direction)
-            :mOrigin(origin), mDirection(direction) {}
+            :mOrigin(origin), mDirection(direction) 
+		{ }
 
-        /** Sets the origin of the ray. */
-        void setOrigin(const Vector3& origin) {mOrigin = origin;} 
-        /** Gets the origin of the ray. */
-        const Vector3& getOrigin(void) const {return mOrigin;} 
+        void setOrigin(const Vector3& origin) { mOrigin = origin; } 
+        const Vector3& getOrigin(void) const { return mOrigin; } 
 
-        /** Sets the direction of the ray. */
-        void setDirection(const Vector3& dir) {mDirection = dir;} 
-        /** Gets the direction of the ray. */
+        void setDirection(const Vector3& dir) { mDirection = dir; } 
         const Vector3& getDirection(void) const {return mDirection;} 
 
-		/** Gets the position of a point t units along the ray. */
-		Vector3 getPoint(float t) const { 
+		/**
+		 * @brief	Gets the position of a point t units along the ray.
+		 */
+		Vector3 getPoint(float t) const 
+		{ 
 			return Vector3(mOrigin + (mDirection * t));
 		}
 		
-		/** Gets the position of a point t units along the ray. */
-		Vector3 operator*(float t) const { 
+		/**
+		 * @brief	Gets the position of a point t units along the ray.
+		 */
+		Vector3 operator*(float t) const 
+		{ 
 			return getPoint(t);
 		}
 
-		/** Tests whether this ray intersects the given plane. 
-		@returns A pair structure where the first element indicates whether
-			an intersection occurs, and if true, the second element will
-			indicate the distance along the ray at which it intersects. 
-			This can be converted to a point in space by calling getPoint().
-		*/
+		/**
+		 * @brief	Ray/plane intersection, returns boolean result and distance to intersection point.
+		 */
 		std::pair<bool, float> intersects(const Plane& p) const;
 
-		/** Tests whether this ray intersects the given sphere. 
-		@returns A pair structure where the first element indicates whether
-			an intersection occurs, and if true, the second element will
-			indicate the distance along the ray at which it intersects. 
-			This can be converted to a point in space by calling getPoint().
-		*/
+		/**
+		 * @brief	Ray/sphere intersection, returns boolean result and distance to nearest intersection point.
+		 */
 		std::pair<bool, float> intersects(const Sphere& s) const;
 
-		/** Tests whether this ray intersects the given box. 
-		@returns A pair structure where the first element indicates whether
-			an intersection occurs, and if true, the second element will
-			indicate the distance along the ray at which it intersects. 
-			This can be converted to a point in space by calling getPoint().
-		*/
+		/**
+		 * @brief	Ray/axis aligned box intersection, returns boolean result and distance to nearest intersection point.
+		 */
 		std::pair<bool, float> intersects(const AABox& box) const;
 
-        /** Ray / triangle intersection, returns boolean result and distance.
-        @param
-            ray The ray.
-        @param
-            a The triangle's first vertex.
-        @param
-            b The triangle's second vertex.
-        @param
-            c The triangle's third vertex.
-		@param 
-			normal The triangle plane's normal (passed in rather than calculated
-				on demand since the caller may already have it), doesn't need
-                normalised since we don't care.
-        @param
-            positiveSide Intersect with "positive side" of the triangle
-        @param
-            negativeSide Intersect with "negative side" of the triangle
-        @returns
-            If the ray is intersects the triangle, a pair of <b>true</b> and the
-            distance between intersection point and ray origin returned.
-        @par
-            If the ray isn't intersects the triangle, a pair of <b>false</b> and
-            <b>0</b> returned.
-        */
-        std::pair<bool, float> intersects(const Vector3& a,
-            const Vector3& b, const Vector3& c, const Vector3& normal,
-            bool positiveSide = true, bool negativeSide = true) const;
-
+        /**
+         * @brief	Ray/triangle intersection, returns boolean result and distance to intersection point.
+         *
+         * @param	a				Triangle first vertex.
+         * @param	b				Triangle second vertex.
+         * @param	c				Triangle third vertex.
+         * @param	normal			The normal of the triangle. Doesn't need to be normalized.
+         * @param	positiveSide	(optional) Should intersections with the positive side (normal facing) count.
+         * @param	negativeSide	(optional) Should intersections with the negative side (opposite of normal facing) count.
+         *
+         * @return	Boolean result if intersection happened and distance to intersection point.
+         */
+        std::pair<bool, float> intersects(const Vector3& a, const Vector3& b, const Vector3& c, 
+			const Vector3& normal, bool positiveSide = true, bool negativeSide = true) const;
+
+	protected:
+		Vector3 mOrigin;
+		Vector3 mDirection;
     };
-	/** @} */
-	/** @} */
-
-}
-#endif
+}

+ 23 - 0
CamelotUtility/Include/CmRectF.h

@@ -4,6 +4,10 @@
 
 namespace CamelotFramework
 {
+	/**
+	 * @brief	Represents a 2D rectangle using real values.
+	 * 			Rectangle is represented with an origin and size values.
+	 */
 	class CM_UTILITY_EXPORT RectF
 	{
 	public:
@@ -12,9 +16,28 @@ namespace CamelotFramework
 
 		float x, y, width, height;
 
+		/**
+		 * @brief	Returns true if the rectangle contains the provided point.
+		 */
 		bool contains(const Vector2& point) const;
+
+		/**
+		 * @brief	Returns true if the rectangle overlaps the provided rectangle.
+		 * 			Also returns true if the rectangles are contained within each other completely
+		 * 			(no intersecting edges).
+		 */
 		bool overlaps(const RectF& other) const;
+
+		/**
+		 * @brief	Extends this rectangle so that the provided rectangle is
+		 * 			completely contained within it.
+		 */
 		void encapsulate(const RectF& other);
+
+		/**
+		 * @brief	Clips current rectangle so that it does not overlap
+		 * 			the provided rectangle.
+		 */
 		void clip(const RectF& clipRect);
 
 		/**

+ 23 - 0
CamelotUtility/Include/CmRectI.h

@@ -4,6 +4,10 @@
 
 namespace CamelotFramework
 {
+	/**
+	 * @brief	Represents a 2D rectangle using integer values.
+	 * 			Rectangle is represented with an origin and size values.
+	 */
 	class CM_UTILITY_EXPORT RectI
 	{
 	public:
@@ -12,9 +16,28 @@ namespace CamelotFramework
 
 		int x, y, width, height;
 
+		/**
+		 * @brief	Returns true if the rectangle contains the provided point.
+		 */
 		bool contains(const Vector2I& point) const;
+
+		/**
+		 * @brief	Returns true if the rectangle overlaps the provided rectangle.
+		 * 			Also returns true if the rectangles are contained within each other completely
+		 * 			(no intersecting edges).
+		 */
 		bool overlaps(const RectI& other) const;
+
+		/**
+		 * @brief	Extends this rectangle so that the provided rectangle is
+		 * 			completely contained within it.
+		 */
 		void encapsulate(const RectI& other);
+
+		/**
+		 * @brief	Clips current rectangle so that it does not overlap
+		 * 			the provided rectangle.
+		 */
 		void clip(const RectI& clipRect);
 
 		/**

+ 15 - 36
CamelotUtility/Include/CmSphere.h

@@ -1,30 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #pragma once
 
 #include "CmPrerequisitesUtil.h"
@@ -32,6 +5,9 @@ THE SOFTWARE.
 
 namespace CamelotFramework 
 {
+    /**
+     * @brief	A sphere represented by a center point and a radius.
+     */
     class CM_UTILITY_EXPORT Sphere
     {
     public:
@@ -65,6 +41,14 @@ namespace CamelotFramework
          */
         void setCenter(const Vector3& center) { mCenter = center; }
 
+		/**
+		 * @brief	Returns whether or not this sphere contains the provided point.
+		 */
+		bool contains(const Vector3& v) const
+		{
+            return ((v - mCenter).squaredLength() <= Math::sqr(mRadius));
+		}
+
 		/**
 		 * @brief	Returns whether or not this sphere intersects another sphere.
 		 */
@@ -85,15 +69,10 @@ namespace CamelotFramework
 		bool intersects(const Plane& plane) const;
 
 		/**
-		 * @brief	Returns whether or not this sphere intersects a point.
-		 */
-		bool intersects(const Vector3& v) const
-		{
-            return ((v - mCenter).squaredLength() <= Math::sqr(mRadius));
-		}
-
-		/**
-		 * @brief	Ray / sphere intersection, returns boolean result and distance.
+		 * @brief	Ray/sphere intersection, returns boolean result and distance to nearest intersection.
+		 * 			
+		 * @param	discardInside	(optional) If true the intersection will be discarded if ray origin
+		 * 							is located within the sphere.
 		 */
 		std::pair<bool, float> intersects(const Ray& ray, bool discardInside = true) const;
 

+ 0 - 28
CamelotUtility/Source/CmPlane.cpp

@@ -1,31 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
 #include "CmPlane.h"
 #include "CmMatrix3.h"
 #include "CmAABox.h"

+ 0 - 35
CamelotUtility/Source/CmQuaternion.cpp

@@ -1,38 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-// NOTE THAT THIS FILE IS BASED ON MATERIAL FROM:
-
-// Geometric Tools, LLC
-// Copyright (c) 1998-2010
-// Distributed under the Boost Software License, Version 1.0.
-// http://www.boost.org/LICENSE_1_0.txt
-// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
-
 #include "CmQuaternion.h"
 
 #include "CmMath.h"

+ 2 - 8
CamelotUtility/Source/CmRay.cpp

@@ -24,9 +24,7 @@ namespace CamelotFramework
 		const Vector3& b, const Vector3& c, const Vector3& normal,
 		bool positiveSide, bool negativeSide) const
 	{
-		//
 		// Calculate intersection with plane.
-		//
 		float t;
 		{
 			float denom = normal.dot(getDirection());
@@ -45,7 +43,7 @@ namespace CamelotFramework
 			else
 			{
 				// Parallel or triangle area is close to zero when
-				// the plane normal not normalised.
+				// the plane normal not normalized.
 				return std::pair<bool, float>(false, 0.0f);
 			}
 
@@ -58,9 +56,7 @@ namespace CamelotFramework
 			}
 		}
 
-		//
 		// Calculate the largest area projection plane in X, Y or Z.
-		//
 		size_t i0, i1;
 		{
 			float n0 = Math::abs(normal[0]);
@@ -78,9 +74,7 @@ namespace CamelotFramework
 			}
 		}
 
-		//
 		// Check the intersection point is inside the triangle.
-		//
 		{
 			float u1 = b[i0] - a[i0];
 			float v1 = b[i1] - a[i1];
@@ -93,7 +87,7 @@ namespace CamelotFramework
 			float beta  = u1 * v0 - u0 * v1;
 			float area  = u1 * v2 - u2 * v1;
 
-			// epsilon to avoid float precision error
+			// Epsilon to avoid float precision errors.
 			const float EPSILON = 1e-6f;
 
 			float tolerance = - EPSILON * area;