Przeglądaj źródła

Porting Utility

Marko Pintera 13 lat temu
rodzic
commit
6797774cf4
30 zmienionych plików z 727 dodań i 1677 usunięć
  1. 3 8
      CamelotUtility/CamelotUtility.vcxproj
  2. 5 20
      CamelotUtility/CamelotUtility.vcxproj.filters
  3. 22 0
      CamelotUtility/Include/CmTypes.h
  4. 1 53
      CamelotUtility/Include/CmUtilPrerequisites.h
  5. 0 81
      CamelotUtility/Include/OgreAlignedAllocator.cpp
  6. 0 108
      CamelotUtility/Include/OgreAlignedAllocator.h
  7. 0 0
      CamelotUtility/Include/OgreAxisAlignedBox.cpp
  8. 16 16
      CamelotUtility/Include/OgreAxisAlignedBox.h
  9. 0 331
      CamelotUtility/Include/OgreBitwise.h
  10. 0 58
      CamelotUtility/Include/OgreBuildSettings.h
  11. 0 197
      CamelotUtility/Include/OgreConfig.h
  12. 95 95
      CamelotUtility/Include/OgreMath.h
  13. 29 29
      CamelotUtility/Include/OgreMatrix3.h
  14. 19 19
      CamelotUtility/Include/OgreMatrix4.h
  15. 6 6
      CamelotUtility/Include/OgrePlane.h
  16. 5 53
      CamelotUtility/Include/OgrePlatform.h
  17. 1 1
      CamelotUtility/Include/OgrePlatformInformation.h
  18. 0 77
      CamelotUtility/Include/OgrePortMemory.h
  19. 20 20
      CamelotUtility/Include/OgreQuaternion.h
  20. 6 6
      CamelotUtility/Include/OgreRay.h
  21. 5 5
      CamelotUtility/Include/OgreSphere.h
  22. 40 40
      CamelotUtility/Include/OgreVector2.h
  23. 49 49
      CamelotUtility/Include/OgreVector3.h
  24. 30 30
      CamelotUtility/Include/OgreVector4.h
  25. 1 1
      CamelotUtility/Include/asm_math.h
  26. 108 108
      CamelotUtility/Source/OgreMath.cpp
  27. 102 102
      CamelotUtility/Source/OgreMatrix3.cpp
  28. 58 58
      CamelotUtility/Source/OgreMatrix4.cpp
  29. 9 9
      CamelotUtility/Source/OgrePlane.cpp
  30. 97 97
      CamelotUtility/Source/OgreQuaternion.cpp

+ 3 - 8
CamelotUtility/CamelotUtility.vcxproj

@@ -67,19 +67,15 @@
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemGroup>
   <ItemGroup>
     <ClInclude Include="Include\asm_math.h" />
     <ClInclude Include="Include\asm_math.h" />
-    <ClInclude Include="Include\OgreAlignedAllocator.h" />
+    <ClInclude Include="Include\CmTypes.h" />
     <ClInclude Include="Include\OgreAxisAlignedBox.h" />
     <ClInclude Include="Include\OgreAxisAlignedBox.h" />
-    <ClInclude Include="Include\OgreBitwise.h" />
-    <ClInclude Include="Include\OgreBuildSettings.h" />
-    <ClInclude Include="Include\OgreConfig.h" />
     <ClInclude Include="Include\OgreMath.h" />
     <ClInclude Include="Include\OgreMath.h" />
     <ClInclude Include="Include\OgreMatrix3.h" />
     <ClInclude Include="Include\OgreMatrix3.h" />
     <ClInclude Include="Include\OgreMatrix4.h" />
     <ClInclude Include="Include\OgreMatrix4.h" />
     <ClInclude Include="Include\OgrePlane.h" />
     <ClInclude Include="Include\OgrePlane.h" />
     <ClInclude Include="Include\OgrePlatform.h" />
     <ClInclude Include="Include\OgrePlatform.h" />
     <ClInclude Include="Include\OgrePlatformInformation.h" />
     <ClInclude Include="Include\OgrePlatformInformation.h" />
-    <ClInclude Include="Include\OgrePortMemory.h" />
-    <ClInclude Include="Include\OgrePrerequisites.h" />
+    <ClInclude Include="Include\CmUtilPrerequisites.h" />
     <ClInclude Include="Include\OgreQuaternion.h" />
     <ClInclude Include="Include\OgreQuaternion.h" />
     <ClInclude Include="Include\OgreRay.h" />
     <ClInclude Include="Include\OgreRay.h" />
     <ClInclude Include="Include\OgreSphere.h" />
     <ClInclude Include="Include\OgreSphere.h" />
@@ -90,8 +86,7 @@
     <ClInclude Include="Include\OgreVector4.h" />
     <ClInclude Include="Include\OgreVector4.h" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <ClCompile Include="Include\OgreAlignedAllocator.cpp" />
-    <ClCompile Include="Source\OgreAxisAlignedBox.cpp" />
+    <ClCompile Include="Include\OgreAxisAlignedBox.cpp" />
     <ClCompile Include="Source\OgreMath.cpp" />
     <ClCompile Include="Source\OgreMath.cpp" />
     <ClCompile Include="Source\OgreMatrix3.cpp" />
     <ClCompile Include="Source\OgreMatrix3.cpp" />
     <ClCompile Include="Source\OgreMatrix4.cpp" />
     <ClCompile Include="Source\OgreMatrix4.cpp" />

+ 5 - 20
CamelotUtility/CamelotUtility.vcxproj.filters

@@ -54,41 +54,26 @@
     <ClInclude Include="Include\OgreVector4.h">
     <ClInclude Include="Include\OgreVector4.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\OgreAlignedAllocator.h">
-      <Filter>Header Files\Prerequisites</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\OgreBitwise.h">
-      <Filter>Header Files\Prerequisites</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\OgreBuildSettings.h">
-      <Filter>Header Files\Prerequisites</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\OgreConfig.h">
-      <Filter>Header Files\Prerequisites</Filter>
-    </ClInclude>
     <ClInclude Include="Include\OgrePlatform.h">
     <ClInclude Include="Include\OgrePlatform.h">
       <Filter>Header Files\Prerequisites</Filter>
       <Filter>Header Files\Prerequisites</Filter>
     </ClInclude>
     </ClInclude>
     <ClInclude Include="Include\OgrePlatformInformation.h">
     <ClInclude Include="Include\OgrePlatformInformation.h">
       <Filter>Header Files\Prerequisites</Filter>
       <Filter>Header Files\Prerequisites</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\OgrePortMemory.h">
+    <ClInclude Include="Include\OgreStdHeaders.h">
       <Filter>Header Files\Prerequisites</Filter>
       <Filter>Header Files\Prerequisites</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\OgrePrerequisites.h">
+    <ClInclude Include="Include\OgreThreadDefines.h">
       <Filter>Header Files\Prerequisites</Filter>
       <Filter>Header Files\Prerequisites</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\OgreStdHeaders.h">
+    <ClInclude Include="Include\CmUtilPrerequisites.h">
       <Filter>Header Files\Prerequisites</Filter>
       <Filter>Header Files\Prerequisites</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\OgreThreadDefines.h">
+    <ClInclude Include="Include\CmTypes.h">
       <Filter>Header Files\Prerequisites</Filter>
       <Filter>Header Files\Prerequisites</Filter>
     </ClInclude>
     </ClInclude>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <ClCompile Include="Source\OgreAxisAlignedBox.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Source\OgreMath.cpp">
     <ClCompile Include="Source\OgreMath.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
@@ -113,7 +98,7 @@
     <ClCompile Include="Source\OgreVector4.cpp">
     <ClCompile Include="Source\OgreVector4.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
-    <ClCompile Include="Include\OgreAlignedAllocator.cpp">
+    <ClCompile Include="Include\OgreAxisAlignedBox.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
   </ItemGroup>
   </ItemGroup>

+ 22 - 0
CamelotUtility/Include/CmTypes.h

@@ -0,0 +1,22 @@
+#pragma once
+
+#include "OgrePlatform.h"
+
+namespace CamelotEngine
+{
+	typedef char INT8;
+	typedef unsigned char UINT8;
+	typedef short INT16;
+	typedef unsigned short UINT16;
+	typedef int INT32;
+	typedef unsigned int UINT32;
+	typedef unsigned short WCHAR;
+
+#if OGRE_COMPILER == OGRE_COMPILER_MSVC
+	typedef unsigned __int64 UINT64;
+	typedef __int64 INT64;
+#else
+	typedef unsigned long long UINT64;
+	typedef long long INT64;
+#endif
+}

+ 1 - 53
CamelotUtility/Include/OgrePrerequisites.h → CamelotUtility/Include/CmUtilPrerequisites.h

@@ -30,51 +30,9 @@ THE SOFTWARE
 
 
 // Platform-specific stuff
 // Platform-specific stuff
 #include "OgrePlatform.h"
 #include "OgrePlatform.h"
-
-#include "OgrePortMemory.h"
-
-// configure memory tracking
-#if OGRE_DEBUG_MODE 
-#	if OGRE_MEMORY_TRACKER_DEBUG_MODE
-#		define OGRE_MEMORY_TRACKER 1
-#	else
-#		define OGRE_MEMORY_TRACKER 0
-#	endif
-#else
-#	if OGRE_MEMORY_TRACKER_RELEASE_MODE
-#		define OGRE_MEMORY_TRACKER 1
-#	else
-#		define OGRE_MEMORY_TRACKER 0
-#	endif
-#endif
-
-
-
+#include "CmTypes.h"
 
 
 namespace Ogre {
 namespace Ogre {
-    // Define ogre version
-    #define OGRE_VERSION_MAJOR 1
-    #define OGRE_VERSION_MINOR 7
-    #define OGRE_VERSION_PATCH 4
-	#define OGRE_VERSION_SUFFIX ""
-    #define OGRE_VERSION_NAME "Cthugha"
-
-    #define OGRE_VERSION    ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH)
-
-    // define the real number values to be used
-    // default to use 'float' unless precompiler option set
-    #if OGRE_DOUBLE_PRECISION == 1
-		/** Software floating point type.
-		@note Not valid as a pointer to GPU buffers / parameters
-		*/
-        typedef double Real;
-    #else
-		/** Software floating point type.
-		@note Not valid as a pointer to GPU buffers / parameters
-		*/
-        typedef float Real;
-    #endif
-
     #if OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER >= 310 && !defined(STLPORT)
     #if OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER >= 310 && !defined(STLPORT)
 	#   if OGRE_COMP_VER >= 430
 	#   if OGRE_COMP_VER >= 430
 	#       define HashMap ::std::tr1::unordered_map
 	#       define HashMap ::std::tr1::unordered_map
@@ -101,14 +59,6 @@ namespace Ogre {
     #   endif
     #   endif
     #endif
     #endif
 
 
-    /** In order to avoid finger-aches :)
-    */
-    typedef unsigned char uchar;
-    typedef unsigned short ushort;
-    typedef unsigned int uint;
-	typedef unsigned long ulong;
-
-
 	// Useful threading defines
 	// Useful threading defines
 #include "OgreThreadDefines.h"
 #include "OgreThreadDefines.h"
 
 
@@ -139,8 +89,6 @@ settings have been made.
 //for stl containter
 //for stl containter
 namespace Ogre
 namespace Ogre
 { 
 { 
-
-
 	template <typename T, typename A = char > 
 	template <typename T, typename A = char > 
 	struct deque 
 	struct deque 
 	{ 
 	{ 

+ 0 - 81
CamelotUtility/Include/OgreAlignedAllocator.cpp

@@ -1,81 +0,0 @@
-/*
------------------------------------------------------------------------------
-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 "OgrePrerequisites.h"
-#include "OgreAlignedAllocator.h"
-
-#include "OgrePlatformInformation.h"
-#include "OgreBitwise.h"
-
-
-/**
-*
-* |___2___|3|_________5__________|__6__|
-* ^         ^
-* 1         4
-*
-* 1 -> Pointer to start of the block allocated by new.
-* 2 -> Gap used to get 4 aligned on given alignment
-* 3 -> Byte offset between 1 and 4
-* 4 -> Pointer to the start of data block.
-* 5 -> Data block.
-* 6 -> Wasted memory at rear of data block.
-*/
-
-namespace Ogre {
-
-    //---------------------------------------------------------------------
-    void* AlignedMemory::allocate(size_t size, size_t alignment)
-    {
-        assert(0 < alignment && alignment <= 128 && Bitwise::isPO2(alignment));
-
-        unsigned char* p = new unsigned char[size + alignment];
-        size_t offset = alignment - (size_t(p) & (alignment-1));
-
-        unsigned char* result = p + offset;
-        result[-1] = (unsigned char)offset;
-
-        return result;
-    }
-    //---------------------------------------------------------------------
-    void* AlignedMemory::allocate(size_t size)
-    {
-        return allocate(size, OGRE_SIMD_ALIGNMENT);
-    }
-    //---------------------------------------------------------------------
-    void AlignedMemory::deallocate(void* p)
-    {
-        if (p)
-        {
-            unsigned char* mem = (unsigned char*)p;
-            mem = mem - mem[-1];
-            delete [] mem;
-        }
-    }
-
-}

+ 0 - 108
CamelotUtility/Include/OgreAlignedAllocator.h

@@ -1,108 +0,0 @@
-/*
------------------------------------------------------------------------------
-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.
------------------------------------------------------------------------------
-*/
-
-#ifndef __AlignedAllocator_H__
-#define __AlignedAllocator_H__
-
-// Now we're only including this within OgreMemoryAllocatorConfig.h which is already in
-// the prerequisites header (circlar reference)
-//#include "OgrePrerequisites.h"
-
-namespace Ogre {
-
-	/** \addtogroup Core
-	*  @{
-	*/
-
-	/** \addtogroup Memory
-	*  @{
-	*/
-
-	/** Class to provide aligned memory allocate functionality.
-    @remarks
-        All SIMD processing are friendly with aligned memory, and some SIMD routines
-        are designed for working with aligned memory only. If the data are intended to
-        use SIMD processing, it's need to be aligned for better performance boost.
-        In additional, most time cache boundary aligned data also lead to better
-        performance even if didn't used SIMD processing. So this class provides a couple
-        of functions for allocate aligned memory.
-    @par
-        Anyways, in general, you don't need to use this class directly, Ogre internally
-        will take care with most SIMD and cache friendly optimisation if possible.
-    @par
-        This isn't a "one-step" optimisation, there are a lot of underlying work to
-        achieve performance boost. If you didn't know what are you doing or what there
-        are going, just ignore this class.
-    @note
-        This class intended to use by advanced user only.
-    */
-	class _OgreExport AlignedMemory
-	{
-	public:
-        /** Allocate memory with given alignment.
-            @param
-                size The size of memory need to allocate.
-            @param
-                alignment The alignment of result pointer, must be power of two
-                and in range [1, 128].
-            @returns
-                The allocated memory pointer.
-            @par
-                On failure, exception will be throw.
-        */
-        static void* allocate(size_t size, size_t alignment);
-
-        /** Allocate memory with default platform dependent alignment.
-            @remarks
-                The default alignment depend on target machine, this function
-                guarantee aligned memory according with SIMD processing and
-                cache boundary friendly.
-            @param
-                size The size of memory need to allocate.
-            @returns
-                The allocated memory pointer.
-            @par
-                On failure, exception will be throw.
-        */
-        static void* allocate(size_t size);
-
-        /** Deallocate memory that allocated by this class.
-            @param
-                p Pointer to the memory allocated by this class or <b>NULL</b> pointer.
-            @par
-                On <b>NULL</b> pointer, nothing happen.
-        */
-        static void deallocate(void* p);
-	};
-
-	/** @} */
-	/** @} */
-
-}
-
-#endif  // __AlignedAllocator_H__

+ 0 - 0
CamelotUtility/Source/OgreAxisAlignedBox.cpp → CamelotUtility/Include/OgreAxisAlignedBox.cpp


+ 16 - 16
CamelotUtility/Include/OgreAxisAlignedBox.h

@@ -29,7 +29,7 @@ THE SOFTWARE.
 #define __AxisAlignedBox_H_
 #define __AxisAlignedBox_H_
 
 
 // Precompiler options
 // Precompiler options
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 
 
 #include "OgreVector3.h"
 #include "OgreVector3.h"
 #include "OgreMatrix4.h"
 #include "OgreMatrix4.h"
@@ -119,8 +119,8 @@ namespace Ogre {
 		}
 		}
 
 
 		inline AxisAlignedBox(
 		inline AxisAlignedBox(
-			Real mx, Real my, Real mz,
-			Real Mx, Real My, Real Mz ) : mMinimum(Vector3::ZERO), mMaximum(Vector3::UNIT_SCALE), mpCorners(0)
+			float mx, float my, float mz,
+			float Mx, float My, float Mz ) : mMinimum(Vector3::ZERO), mMaximum(Vector3::UNIT_SCALE), mpCorners(0)
 		{
 		{
 			setExtents( mx, my, mz, Mx, My, Mz );
 			setExtents( mx, my, mz, Mx, My, Mz );
 		}
 		}
@@ -141,7 +141,7 @@ namespace Ogre {
 		~AxisAlignedBox()
 		~AxisAlignedBox()
 		{
 		{
 			if (mpCorners)
 			if (mpCorners)
-				OGRE_FREE(mpCorners, MEMCATEGORY_SCENE_CONTROL);
+				free(mpCorners);
 		}
 		}
 
 
 
 
@@ -184,7 +184,7 @@ namespace Ogre {
 			mMinimum = vec;
 			mMinimum = vec;
 		}
 		}
 
 
-		inline void setMinimum( Real x, Real y, Real z )
+		inline void setMinimum( float x, float y, float z )
 		{
 		{
 			mExtent = EXTENT_FINITE;
 			mExtent = EXTENT_FINITE;
 			mMinimum.x = x;
 			mMinimum.x = x;
@@ -195,17 +195,17 @@ namespace Ogre {
 		/** Changes one of the components of the minimum corner of the box
 		/** Changes one of the components of the minimum corner of the box
 		used to resize only one dimension of the box
 		used to resize only one dimension of the box
 		*/
 		*/
-		inline void setMinimumX(Real x)
+		inline void setMinimumX(float x)
 		{
 		{
 			mMinimum.x = x;
 			mMinimum.x = x;
 		}
 		}
 
 
-		inline void setMinimumY(Real y)
+		inline void setMinimumY(float y)
 		{
 		{
 			mMinimum.y = y;
 			mMinimum.y = y;
 		}
 		}
 
 
-		inline void setMinimumZ(Real z)
+		inline void setMinimumZ(float z)
 		{
 		{
 			mMinimum.z = z;
 			mMinimum.z = z;
 		}
 		}
@@ -218,7 +218,7 @@ namespace Ogre {
 			mMaximum = vec;
 			mMaximum = vec;
 		}
 		}
 
 
-		inline void setMaximum( Real x, Real y, Real z )
+		inline void setMaximum( float x, float y, float z )
 		{
 		{
 			mExtent = EXTENT_FINITE;
 			mExtent = EXTENT_FINITE;
 			mMaximum.x = x;
 			mMaximum.x = x;
@@ -229,17 +229,17 @@ namespace Ogre {
 		/** Changes one of the components of the maximum corner of the box
 		/** Changes one of the components of the maximum corner of the box
 		used to resize only one dimension of the box
 		used to resize only one dimension of the box
 		*/
 		*/
-		inline void setMaximumX( Real x )
+		inline void setMaximumX( float x )
 		{
 		{
 			mMaximum.x = x;
 			mMaximum.x = x;
 		}
 		}
 
 
-		inline void setMaximumY( Real y )
+		inline void setMaximumY( float y )
 		{
 		{
 			mMaximum.y = y;
 			mMaximum.y = y;
 		}
 		}
 
 
-		inline void setMaximumZ( Real z )
+		inline void setMaximumZ( float z )
 		{
 		{
 			mMaximum.z = z;
 			mMaximum.z = z;
 		}
 		}
@@ -257,8 +257,8 @@ namespace Ogre {
 		}
 		}
 
 
 		inline void setExtents(
 		inline void setExtents(
-			Real mx, Real my, Real mz,
-			Real Mx, Real My, Real Mz )
+			float mx, float my, float mz,
+			float Mx, float My, float Mz )
 		{
 		{
             assert( (mx <= Mx && my <= My && mz <= Mz) &&
             assert( (mx <= Mx && my <= My && mz <= Mz) &&
                 "The minimum corner of the box must be less than or equal to maximum corner" );
                 "The minimum corner of the box must be less than or equal to maximum corner" );
@@ -310,7 +310,7 @@ namespace Ogre {
 			//   around face (looking onto the face)
 			//   around face (looking onto the face)
 			// Only for optimization/compatibility.
 			// Only for optimization/compatibility.
 			if (!mpCorners)
 			if (!mpCorners)
-				mpCorners = OGRE_ALLOC_T(Vector3, 8, MEMCATEGORY_SCENE_CONTROL);
+				mpCorners = (Vector3*)malloc(sizeof(Vector3) * 8);
 
 
 			mpCorners[0] = mMinimum;
 			mpCorners[0] = mMinimum;
 			mpCorners[1].x = mMinimum.x; mpCorners[1].y = mMaximum.y; mpCorners[1].z = mMinimum.z;
 			mpCorners[1].x = mMinimum.x; mpCorners[1].y = mMaximum.y; mpCorners[1].z = mMinimum.z;
@@ -625,7 +625,7 @@ namespace Ogre {
 		}
 		}
 
 
 		/// Calculate the volume of this box
 		/// Calculate the volume of this box
-		Real volume(void) const
+		float volume(void) const
 		{
 		{
 			switch (mExtent)
 			switch (mExtent)
 			{
 			{

+ 0 - 331
CamelotUtility/Include/OgreBitwise.h

@@ -1,331 +0,0 @@
-/*
------------------------------------------------------------------------------
-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.
------------------------------------------------------------------------------
-*/
-#ifndef _Bitwise_H__
-#define _Bitwise_H__
-
-#include "OgrePrerequisites.h"
-
-namespace Ogre {
-	/** \addtogroup Core
-	*  @{
-	*/
-	/** \addtogroup Math
-	*  @{
-	*/
-
-    /** Class for manipulating bit patterns.
-    */
-    class Bitwise {
-    public:
-        /** Returns the most significant bit set in a value.
-        */
-        static FORCEINLINE unsigned int mostSignificantBitSet(unsigned int value)
-        {
-            unsigned int result = 0;
-            while (value != 0) {
-                ++result;
-                value >>= 1;
-            }
-            return result-1;
-        }
-        /** Returns the closest power-of-two number greater or equal to value.
-            @note 0 and 1 are powers of two, so 
-                firstPO2From(0)==0 and firstPO2From(1)==1.
-        */
-        static FORCEINLINE uint32 firstPO2From(uint32 n)
-        {
-            --n;            
-            n |= n >> 16;
-            n |= n >> 8;
-            n |= n >> 4;
-            n |= n >> 2;
-            n |= n >> 1;
-            ++n;
-            return n;
-        }
-        /** Determines whether the number is power-of-two or not.
-            @note 0 and 1 are tread as power of two.
-        */
-        template<typename T>
-        static FORCEINLINE bool isPO2(T n)
-        {
-            return (n & (n-1)) == 0;
-        }
-        /** Returns the number of bits a pattern must be shifted right by to
-            remove right-hand zeros.
-        */
-		template<typename T>
-        static FORCEINLINE unsigned int getBitShift(T mask)
-		{
-			if (mask == 0)
-				return 0;
-
-			unsigned int result = 0;
-			while ((mask & 1) == 0) {
-				++result;
-				mask >>= 1;
-			}
-			return result;
-		}
-
-        /** Takes a value with a given src bit mask, and produces another
-            value with a desired bit mask.
-            @remarks
-                This routine is useful for colour conversion.
-        */
-		template<typename SrcT, typename DestT>
-        static inline DestT convertBitPattern(SrcT srcValue, SrcT srcBitMask, DestT destBitMask)
-		{
-			// Mask off irrelevant source value bits (if any)
-			srcValue = srcValue & srcBitMask;
-
-			// Shift source down to bottom of DWORD
-			const unsigned int srcBitShift = getBitShift(srcBitMask);
-			srcValue >>= srcBitShift;
-
-			// Get max value possible in source from srcMask
-			const SrcT srcMax = srcBitMask >> srcBitShift;
-
-			// Get max available in dest
-			const unsigned int destBitShift = getBitShift(destBitMask);
-			const DestT destMax = destBitMask >> destBitShift;
-
-			// Scale source value into destination, and shift back
-			DestT destValue = (srcValue * destMax) / srcMax;
-			return (destValue << destBitShift);
-		}
-
-        /**
-         * Convert N bit colour channel value to P bits. It fills P bits with the
-         * bit pattern repeated. (this is /((1<<n)-1) in fixed point)
-         */
-        static inline unsigned int fixedToFixed(uint32 value, unsigned int n, unsigned int p) 
-        {
-            if(n > p) 
-            {
-                // Less bits required than available; this is easy
-                value >>= n-p;
-            } 
-            else if(n < p)
-            {
-                // More bits required than are there, do the fill
-                // Use old fashioned division, probably better than a loop
-                if(value == 0)
-                        value = 0;
-                else if(value == (static_cast<unsigned int>(1)<<n)-1)
-                        value = (1<<p)-1;
-                else    value = value*(1<<p)/((1<<n)-1);
-            }
-            return value;    
-        }
-
-        /**
-         * Convert floating point colour channel value between 0.0 and 1.0 (otherwise clamped) 
-         * to integer of a certain number of bits. Works for any value of bits between 0 and 31.
-         */
-        static inline unsigned int floatToFixed(const float value, const unsigned int bits)
-        {
-            if(value <= 0.0f) return 0;
-            else if (value >= 1.0f) return (1<<bits)-1;
-            else return (unsigned int)(value * (1<<bits));     
-        }
-
-        /**
-         * Fixed point to float
-         */
-        static inline float fixedToFloat(unsigned value, unsigned int bits)
-        {
-            return (float)value/(float)((1<<bits)-1);
-        }
-
-        /**
-         * Write a n*8 bits integer value to memory in native endian.
-         */
-        static inline void intWrite(void *dest, const int n, const unsigned int value)
-        {
-            switch(n) {
-                case 1:
-                    ((uint8*)dest)[0] = (uint8)value;
-                    break;
-                case 2:
-                    ((uint16*)dest)[0] = (uint16)value;
-                    break;
-                case 3:
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG      
-                    ((uint8*)dest)[0] = (uint8)((value >> 16) & 0xFF);
-                    ((uint8*)dest)[1] = (uint8)((value >> 8) & 0xFF);
-                    ((uint8*)dest)[2] = (uint8)(value & 0xFF);
-#else
-                    ((uint8*)dest)[2] = (uint8)((value >> 16) & 0xFF);
-                    ((uint8*)dest)[1] = (uint8)((value >> 8) & 0xFF);
-                    ((uint8*)dest)[0] = (uint8)(value & 0xFF);
-#endif
-                    break;
-                case 4:
-                    ((uint32*)dest)[0] = (uint32)value;                
-                    break;                
-            }        
-        }
-        /**
-         * Read a n*8 bits integer value to memory in native endian.
-         */
-        static inline unsigned int intRead(const void *src, int n) {
-            switch(n) {
-                case 1:
-                    return ((uint8*)src)[0];
-                case 2:
-                    return ((uint16*)src)[0];
-                case 3:
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG      
-                    return ((uint32)((uint8*)src)[0]<<16)|
-                            ((uint32)((uint8*)src)[1]<<8)|
-                            ((uint32)((uint8*)src)[2]);
-#else
-                    return ((uint32)((uint8*)src)[0])|
-                            ((uint32)((uint8*)src)[1]<<8)|
-                            ((uint32)((uint8*)src)[2]<<16);
-#endif
-                case 4:
-                    return ((uint32*)src)[0];
-            } 
-            return 0; // ?
-        }
-
-        /** Convert a float32 to a float16 (NV_half_float)
-         	Courtesy of OpenEXR
-        */
-        static inline uint16 floatToHalf(float i)
-        {
-            union { float f; uint32 i; } v;
-            v.f = i;
-            return floatToHalfI(v.i);
-        }
-		/** Converts float in uint32 format to a a half in uint16 format
-		*/
-        static inline uint16 floatToHalfI(uint32 i)
-        {
-            register int s =  (i >> 16) & 0x00008000;
-            register int e = ((i >> 23) & 0x000000ff) - (127 - 15);
-            register int m =   i        & 0x007fffff;
-        
-            if (e <= 0)
-            {
-                if (e < -10)
-                {
-                    return 0;
-                }
-                m = (m | 0x00800000) >> (1 - e);
-        
-                return static_cast<uint16>(s | (m >> 13));
-            }
-            else if (e == 0xff - (127 - 15))
-            {
-                if (m == 0) // Inf
-                {
-                    return static_cast<uint16>(s | 0x7c00);
-                } 
-                else    // NAN
-                {
-                    m >>= 13;
-                    return static_cast<uint16>(s | 0x7c00 | m | (m == 0));
-                }
-            }
-            else
-            {
-                if (e > 30) // Overflow
-                {
-                    return static_cast<uint16>(s | 0x7c00);
-                }
-        
-                return static_cast<uint16>(s | (e << 10) | (m >> 13));
-            }
-        }
-        
-        /**
-         * Convert a float16 (NV_half_float) to a float32
-         * Courtesy of OpenEXR
-         */
-        static inline float halfToFloat(uint16 y)
-        {
-            union { float f; uint32 i; } v;
-            v.i = halfToFloatI(y);
-            return v.f;
-        }
-		/** Converts a half in uint16 format to a float
-		 	in uint32 format
-		 */
-        static inline uint32 halfToFloatI(uint16 y)
-        {
-            register int s = (y >> 15) & 0x00000001;
-            register int e = (y >> 10) & 0x0000001f;
-            register int m =  y        & 0x000003ff;
-        
-            if (e == 0)
-            {
-                if (m == 0) // Plus or minus zero
-                {
-                    return s << 31;
-                }
-                else // Denormalized number -- renormalize it
-                {
-                    while (!(m & 0x00000400))
-                    {
-                        m <<= 1;
-                        e -=  1;
-                    }
-        
-                    e += 1;
-                    m &= ~0x00000400;
-                }
-            }
-            else if (e == 31)
-            {
-                if (m == 0) // Inf
-                {
-                    return (s << 31) | 0x7f800000;
-                }
-                else // NaN
-                {
-                    return (s << 31) | 0x7f800000 | (m << 13);
-                }
-            }
-        
-            e = e + (127 - 15);
-            m = m << 13;
-        
-            return (s << 31) | (e << 23) | m;
-        }
-         
-
-    };
-	/** @} */
-	/** @} */
-
-}
-
-#endif

+ 0 - 58
CamelotUtility/Include/OgreBuildSettings.h

@@ -1,58 +0,0 @@
-#ifndef __Custom_Config_H_
-#define __Custom_Config_H_
-
-// CMake auto-generated configuration options
-
-/* #undef OGRE_STATIC_LIB */
-
-#define OGRE_BUILD_RENDERSYSTEM_D3D9
-/* #undef OGRE_BUILD_RENDERSYSTEM_D3D10 */
-/* #undef OGRE_BUILD_RENDERSYSTEM_D3D11 */
-#define OGRE_BUILD_RENDERSYSTEM_GL
-/* #undef OGRE_BUILD_RENDERSYSTEM_GLES */
-#define OGRE_BUILD_PLUGIN_BSP
-#define OGRE_BUILD_PLUGIN_OCTREE
-#define OGRE_BUILD_PLUGIN_PCZ
-#define OGRE_BUILD_PLUGIN_PFX
-#define OGRE_BUILD_PLUGIN_CG
-
-#define OGRE_CONFIG_LITTLE_ENDIAN
-/* #undef OGRE_CONFIG_BIG_ENDIAN */
-
-#define OGRE_DOUBLE_PRECISION 0
-
-#define OGRE_MEMORY_ALLOCATOR 4
-
-#define OGRE_CONTAINERS_USE_CUSTOM_MEMORY_ALLOCATOR 1
-
-#define OGRE_STRING_USE_CUSTOM_MEMORY_ALLOCATOR 0
-
-#define OGRE_MEMORY_TRACKER_DEBUG_MODE 0
-
-#define OGRE_MEMORY_TRACKER_RELEASE_MODE 0
-
-#define OGRE_THREAD_SUPPORT 0
-
-#define OGRE_THREAD_PROVIDER 0
-
-#define OGRE_NO_FREEIMAGE 0
-
-#define OGRE_NO_DDS_CODEC 0
-
-#define OGRE_NO_PVRTC_CODEC 1
-
-#define OGRE_NO_ZIP_ARCHIVE 0
-
-#define OGRE_NO_VIEWPORT_ORIENTATIONMODE 1
-
-#define OGRE_USE_NEW_COMPILERS 1
-
-#define OGRE_USE_BOOST 1
-
-#define OGRE_PROFILING 0
-
-#define RTSHADER_SYSTEM_BUILD_CORE_SHADERS
-
-#define RTSHADER_SYSTEM_BUILD_EXT_SHADERS
-
-#endif

+ 0 - 197
CamelotUtility/Include/OgreConfig.h

@@ -1,197 +0,0 @@
-/*
------------------------------------------------------------------------------
-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.
------------------------------------------------------------------------------
-*/
-#ifndef __Config_H_
-#define __Config_H_
-
-// Include the CMake-generated build settings.
-// If you get complaints that this file is missing, then you're probably
-// trying to link directly against your source dir. You must then add
-// %BUILD_DIR%/include to your include search path to find OgreBuildSettings.h.
-#include "OgreBuildSettings.h"
-
-/** If set to 1, profiling code will be included in the application. When you
-	are deploying your application you will probably want to set this to 0 */
-#ifndef OGRE_PROFILING
-#define OGRE_PROFILING 0
-#endif
-
-/** There are three modes for handling asserts in OGRE:
-0 - STANDARD - Standard asserts in debug builds, nothing in release builds
-1 - RELEASE_EXCEPTIONS - Standard asserts in debug builds, exceptions in release builds
-2 - EXCEPTIONS - Exceptions in debug builds, exceptions in release builds
-*/
-#define OGRE_ASSERT_MODE 0
-
-/** If set to >0, OGRE will always 'think' that the graphics card only has the
-    number of texture units specified. Very useful for testing multipass fallback.
-*/
-#define OGRE_PRETEND_TEXTURE_UNITS 0
-
-/** If set to 1, Real is typedef'ed to double. Otherwise, Real is typedef'ed
-    to float. Setting this allows you to perform mathematical operations in the
-	CPU (Quaternion, Vector3 etc) with more precision, but bear in mind that the
-	GPU still operates in single-precision mode.
-*/
-#ifndef OGRE_DOUBLE_PRECISION
-#define OGRE_DOUBLE_PRECISION 0
-#endif
-
-/** Define number of texture coordinate sets allowed per vertex.
-*/
-#define OGRE_MAX_TEXTURE_COORD_SETS 6
-
-/** Define max number of texture layers allowed per pass on any card.
-*/
-#define OGRE_MAX_TEXTURE_LAYERS 16
-
-/** Define max number of lights allowed per pass.
-*/
-#define OGRE_MAX_SIMULTANEOUS_LIGHTS 8
-
-/** Define max number of blending weights allowed per vertex.
-*/
-#define OGRE_MAX_BLEND_WEIGHTS 4
-
-/** Define this if you want to link OGRE as a static lib (preferably as a project file)
-*/
-//#define OGRE_STATIC_LIB
-
-
-// define the memory allocator configuration to use
-#define OGRE_MEMORY_ALLOCATOR_STD 1
-#define OGRE_MEMORY_ALLOCATOR_NED 2
-#define OGRE_MEMORY_ALLOCATOR_USER 3
-#define OGRE_MEMORY_ALLOCATOR_NEDPOOLING 4
-
-#ifndef OGRE_MEMORY_ALLOCATOR
-#  define OGRE_MEMORY_ALLOCATOR OGRE_MEMORY_ALLOCATOR_NEDPOOLING
-#endif
-
-// Whether to use the custom memory allocator in STL containers
-#ifndef OGRE_CONTAINERS_USE_CUSTOM_MEMORY_ALLOCATOR
-#  define OGRE_CONTAINERS_USE_CUSTOM_MEMORY_ALLOCATOR 1
-#endif
-
-//if you want to make Ogre::String use the custom memory allocator then set:
-//#define OGRE_STRING_USE_CUSTOM_MEMORY_ALLOCATOR 1
-// Doing this will mean Ogre's strings will not be compatible with std::string however
-#ifndef OGRE_STRING_USE_CUSTOM_MEMORY_ALLOCATOR
-#	define OGRE_STRING_USE_CUSTOM_MEMORY_ALLOCATOR 0
-#endif
-
-// enable or disable the memory tracker, recording the memory allocations & tracking leaks
-// default is to disable since it's expensive, but you can enable if needed per build target
-
-#ifndef OGRE_MEMORY_TRACKER_DEBUG_MODE
-#  define OGRE_MEMORY_TRACKER_DEBUG_MODE 0
-#endif
-
-#ifndef OGRE_MEMORY_TRACKER_RELEASE_MODE
-#  define OGRE_MEMORY_TRACKER_RELEASE_MODE 0
-#endif
-/** Define max number of multiple render targets (MRTs) to render to at once.
-*/
-#define OGRE_MAX_MULTIPLE_RENDER_TARGETS 8
-
-/** Support for multithreading, there are 3 options
-
-OGRE_THREAD_SUPPORT = 0
-	No support for threading.		
-OGRE_THREAD_SUPPORT = 1
-	Thread support for background loading, by both loading and constructing resources
-	in a background thread. Resource management and SharedPtr handling becomes
-	thread-safe, and resources may be completely loaded in the background. 
-	The places where threading is available are clearly
-	marked, you should assume state is NOT thread safe unless otherwise
-	stated in relation to this flag.
-OGRE_THREAD_SUPPORT = 2
-	Thread support for background resource preparation. This means that resource
-	data can streamed into memory in the background, but the final resource
-	construction (including RenderSystem dependencies) is still done in the primary
-	thread. Has a lower synchronisation primitive overhead than full threading
-	while still allowing the major blocking aspects of resource management (I/O)
-	to be done in the background.
-*/
-#ifndef OGRE_THREAD_SUPPORT
-#define OGRE_THREAD_SUPPORT 0
-#endif
-#if OGRE_THREAD_SUPPORT != 0 && OGRE_THREAD_SUPPORT != 1 && OGRE_THREAD_SUPPORT != 2
-#define OGRE_THREAD_SUPPORT 0
-#endif
-
-/** Provider for threading functionality, there are 4 options.
-
-OGRE_THREAD_PROVIDER = 0
-	No support for threading.
-OGRE_THREAD_PROVIDER = 1
-	Boost libraries provide threading functionality.
-OGRE_THREAD_PROVIDER = 2
-	Poco libraries provide threading functionality.
-OGRE_THREAD_PROVIDER = 3
-	TBB library provides threading functionality.
-*/
-#ifndef OGRE_THREAD_PROVIDER
-#define OGRE_THREAD_PROVIDER 0
-#endif
-
-/** Disables use of the FreeImage image library for loading images.
-WARNING: Use only when you want to provide your own image loading code via codecs.
-*/
-#ifndef OGRE_NO_FREEIMAGE
-#define OGRE_NO_FREEIMAGE 0
-#endif
-
-/** Disables use of the DevIL image library for loading images.
-By default DevIL is disabled in Eihort in favour of FreeImage, but you may re-enable
-it if you choose
-*/
-#ifndef OGRE_NO_DEVIL
-#define OGRE_NO_DEVIL 1
-#endif
-
-/** Disables use of the internal image codec for loading DDS files.
-WARNING: Use only when you want to provide your own image loading code via codecs.
-*/
-#ifndef OGRE_NO_DDS_CODEC
-#define OGRE_NO_DDS_CODEC 0
-#endif
-
-/** Disables use of the ZIP archive support.
-WARNING: Disabling this will make the samples unusable.
-*/
-#ifndef OGRE_NO_ZIP_ARCHIVE
-#define OGRE_NO_ZIP_ARCHIVE 0
-#endif
-
-/** Enables the use of the new script compilers when Ogre compiles resource scripts.
-*/
-#ifndef OGRE_USE_NEW_COMPILERS
-#define OGRE_USE_NEW_COMPILERS 1
-#endif
-
-#endif

+ 95 - 95
CamelotUtility/Include/OgreMath.h

@@ -28,7 +28,7 @@ THE SOFTWARE.
 #ifndef __Math_H__
 #ifndef __Math_H__
 #define __Math_H__
 #define __Math_H__
 
 
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 
 
 namespace Ogre
 namespace Ogre
 {
 {
@@ -45,18 +45,18 @@ namespace Ogre
     */
     */
 	class Radian
 	class Radian
 	{
 	{
-		Real mRad;
+		float mRad;
 
 
 	public:
 	public:
-		explicit Radian ( Real r=0 ) : mRad(r) {}
+		explicit Radian ( float r=0 ) : mRad(r) {}
 		Radian ( const Degree& d );
 		Radian ( const Degree& d );
-		Radian& operator = ( const Real& f ) { mRad = f; return *this; }
+		Radian& operator = ( const float& f ) { mRad = f; return *this; }
 		Radian& operator = ( const Radian& r ) { mRad = r.mRad; return *this; }
 		Radian& operator = ( const Radian& r ) { mRad = r.mRad; return *this; }
 		Radian& operator = ( const Degree& d );
 		Radian& operator = ( const Degree& d );
 
 
-		Real valueDegrees() const; // see bottom of this file
-		Real valueRadians() const { return mRad; }
-		Real valueAngleUnits() const;
+		float valueDegrees() const; // see bottom of this file
+		float valueRadians() const { return mRad; }
+		float valueAngleUnits() const;
 
 
         const Radian& operator + () const { return *this; }
         const Radian& operator + () const { return *this; }
 		Radian operator + ( const Radian& r ) const { return Radian ( mRad + r.mRad ); }
 		Radian operator + ( const Radian& r ) const { return Radian ( mRad + r.mRad ); }
@@ -68,11 +68,11 @@ namespace Ogre
 		Radian operator - ( const Degree& d ) const;
 		Radian operator - ( const Degree& d ) const;
 		Radian& operator -= ( const Radian& r ) { mRad -= r.mRad; return *this; }
 		Radian& operator -= ( const Radian& r ) { mRad -= r.mRad; return *this; }
 		Radian& operator -= ( const Degree& d );
 		Radian& operator -= ( const Degree& d );
-		Radian operator * ( Real f ) const { return Radian ( mRad * f ); }
+		Radian operator * ( float f ) const { return Radian ( mRad * f ); }
         Radian operator * ( const Radian& f ) const { return Radian ( mRad * f.mRad ); }
         Radian operator * ( const Radian& f ) const { return Radian ( mRad * f.mRad ); }
-		Radian& operator *= ( Real f ) { mRad *= f; return *this; }
-		Radian operator / ( Real f ) const { return Radian ( mRad / f ); }
-		Radian& operator /= ( Real f ) { mRad /= f; return *this; }
+		Radian& operator *= ( float f ) { mRad *= f; return *this; }
+		Radian operator / ( float f ) const { return Radian ( mRad / f ); }
+		Radian& operator /= ( float f ) { mRad /= f; return *this; }
 
 
 		bool operator <  ( const Radian& r ) const { return mRad <  r.mRad; }
 		bool operator <  ( const Radian& r ) const { return mRad <  r.mRad; }
 		bool operator <= ( const Radian& r ) const { return mRad <= r.mRad; }
 		bool operator <= ( const Radian& r ) const { return mRad <= r.mRad; }
@@ -96,18 +96,18 @@ namespace Ogre
     */
     */
 	class Degree
 	class Degree
 	{
 	{
-		Real mDeg; // if you get an error here - make sure to define/typedef 'Real' first
+		float mDeg; // if you get an error here - make sure to define/typedef 'float' first
 
 
 	public:
 	public:
-		explicit Degree ( Real d=0 ) : mDeg(d) {}
+		explicit Degree ( float d=0 ) : mDeg(d) {}
 		Degree ( const Radian& r ) : mDeg(r.valueDegrees()) {}
 		Degree ( const Radian& r ) : mDeg(r.valueDegrees()) {}
-		Degree& operator = ( const Real& f ) { mDeg = f; return *this; }
+		Degree& operator = ( const float& f ) { mDeg = f; return *this; }
 		Degree& operator = ( const Degree& d ) { mDeg = d.mDeg; return *this; }
 		Degree& operator = ( const Degree& d ) { mDeg = d.mDeg; return *this; }
 		Degree& operator = ( const Radian& r ) { mDeg = r.valueDegrees(); return *this; }
 		Degree& operator = ( const Radian& r ) { mDeg = r.valueDegrees(); return *this; }
 
 
-		Real valueDegrees() const { return mDeg; }
-		Real valueRadians() const; // see bottom of this file
-		Real valueAngleUnits() const;
+		float valueDegrees() const { return mDeg; }
+		float valueRadians() const; // see bottom of this file
+		float valueAngleUnits() const;
 
 
 		const Degree& operator + () const { return *this; }
 		const Degree& operator + () const { return *this; }
 		Degree operator + ( const Degree& d ) const { return Degree ( mDeg + d.mDeg ); }
 		Degree operator + ( const Degree& d ) const { return Degree ( mDeg + d.mDeg ); }
@@ -119,11 +119,11 @@ namespace Ogre
 		Degree operator - ( const Radian& r ) const { return Degree ( mDeg - r.valueDegrees() ); }
 		Degree operator - ( const Radian& r ) const { return Degree ( mDeg - r.valueDegrees() ); }
 		Degree& operator -= ( const Degree& d ) { mDeg -= d.mDeg; return *this; }
 		Degree& operator -= ( const Degree& d ) { mDeg -= d.mDeg; return *this; }
 		Degree& operator -= ( const Radian& r ) { mDeg -= r.valueDegrees(); return *this; }
 		Degree& operator -= ( const Radian& r ) { mDeg -= r.valueDegrees(); return *this; }
-		Degree operator * ( Real f ) const { return Degree ( mDeg * f ); }
+		Degree operator * ( float f ) const { return Degree ( mDeg * f ); }
         Degree operator * ( const Degree& f ) const { return Degree ( mDeg * f.mDeg ); }
         Degree operator * ( const Degree& f ) const { return Degree ( mDeg * f.mDeg ); }
-		Degree& operator *= ( Real f ) { mDeg *= f; return *this; }
-		Degree operator / ( Real f ) const { return Degree ( mDeg / f ); }
-		Degree& operator /= ( Real f ) { mDeg /= f; return *this; }
+		Degree& operator *= ( float f ) { mDeg *= f; return *this; }
+		Degree operator / ( float f ) const { return Degree ( mDeg / f ); }
+		Degree& operator /= ( float f ) { mDeg /= f; return *this; }
 
 
 		bool operator <  ( const Degree& d ) const { return mDeg <  d.mDeg; }
 		bool operator <  ( const Degree& d ) const { return mDeg <  d.mDeg; }
 		bool operator <= ( const Degree& d ) const { return mDeg <= d.mDeg; }
 		bool operator <= ( const Degree& d ) const { return mDeg <= d.mDeg; }
@@ -148,9 +148,9 @@ namespace Ogre
     */
     */
 	class Angle
 	class Angle
 	{
 	{
-		Real mAngle;
+		float mAngle;
 	public:
 	public:
-		explicit Angle ( Real angle ) : mAngle(angle) {}
+		explicit Angle ( float angle ) : mAngle(angle) {}
 		operator Radian() const;
 		operator Radian() const;
 		operator Degree() const;
 		operator Degree() const;
 	};
 	};
@@ -209,16 +209,16 @@ namespace Ogre
         static int mTrigTableSize;
         static int mTrigTableSize;
 
 
         /// Radian -> index factor value ( mTrigTableSize / 2 * PI )
         /// Radian -> index factor value ( mTrigTableSize / 2 * PI )
-        static Real mTrigTableFactor;
-        static Real* mSinTable;
-        static Real* mTanTable;
+        static float mTrigTableFactor;
+        static float* mSinTable;
+        static float* mTanTable;
 
 
         /** Private function to build trig tables.
         /** Private function to build trig tables.
         */
         */
         void buildTrigTables();
         void buildTrigTables();
 
 
-		static Real SinTable (Real fValue);
-		static Real TanTable (Real fValue);
+		static float SinTable (float fValue);
+		static float TanTable (float fValue);
     public:
     public:
         /** Default constructor.
         /** Default constructor.
             @param
             @param
@@ -236,15 +236,15 @@ namespace Ogre
 		static inline int IFloor (float fValue) { return int(floor(fValue)); }
 		static inline int IFloor (float fValue) { return int(floor(fValue)); }
         static int ISign (int iValue);
         static int ISign (int iValue);
 
 
-		static inline Real Abs (Real fValue) { return Real(fabs(fValue)); }
+		static inline float Abs (float fValue) { return float(fabs(fValue)); }
 		static inline Degree Abs (const Degree& dValue) { return Degree(fabs(dValue.valueDegrees())); }
 		static inline Degree Abs (const Degree& dValue) { return Degree(fabs(dValue.valueDegrees())); }
 		static inline Radian Abs (const Radian& rValue) { return Radian(fabs(rValue.valueRadians())); }
 		static inline Radian Abs (const Radian& rValue) { return Radian(fabs(rValue.valueRadians())); }
-		static Radian ACos (Real fValue);
-		static Radian ASin (Real fValue);
-		static inline Radian ATan (Real fValue) { return Radian(atan(fValue)); }
-		static inline Radian ATan2 (Real fY, Real fX) { return Radian(atan2(fY,fX)); }
-		static inline Real Ceil (Real fValue) { return Real(ceil(fValue)); }
-		static inline bool isNaN(Real f)
+		static Radian ACos (float fValue);
+		static Radian ASin (float fValue);
+		static inline Radian ATan (float fValue) { return Radian(atan(fValue)); }
+		static inline Radian ATan2 (float fY, float fX) { return Radian(atan2(fY,fX)); }
+		static inline float Ceil (float fValue) { return float(ceil(fValue)); }
+		static inline bool isNaN(float f)
 		{
 		{
 			// std::isnan() is C99, not supported by all compilers
 			// std::isnan() is C99, not supported by all compilers
 			// However NaN always fails this next test, no other number does.
 			// However NaN always fails this next test, no other number does.
@@ -258,8 +258,8 @@ namespace Ogre
                 useTables If true, uses lookup tables rather than
                 useTables If true, uses lookup tables rather than
                 calculation - faster but less accurate.
                 calculation - faster but less accurate.
         */
         */
-        static inline Real Cos (const Radian& fValue, bool useTables = false) {
-			return (!useTables) ? Real(cos(fValue.valueRadians())) : SinTable(fValue.valueRadians() + HALF_PI);
+        static inline float Cos (const Radian& fValue, bool useTables = false) {
+			return (!useTables) ? float(cos(fValue.valueRadians())) : SinTable(fValue.valueRadians() + HALF_PI);
 		}
 		}
         /** Cosine function.
         /** Cosine function.
             @param
             @param
@@ -268,26 +268,26 @@ namespace Ogre
                 useTables If true, uses lookup tables rather than
                 useTables If true, uses lookup tables rather than
                 calculation - faster but less accurate.
                 calculation - faster but less accurate.
         */
         */
-        static inline Real Cos (Real fValue, bool useTables = false) {
-			return (!useTables) ? Real(cos(fValue)) : SinTable(fValue + HALF_PI);
+        static inline float Cos (float fValue, bool useTables = false) {
+			return (!useTables) ? float(cos(fValue)) : SinTable(fValue + HALF_PI);
 		}
 		}
 
 
-		static inline Real Exp (Real fValue) { return Real(exp(fValue)); }
+		static inline float Exp (float fValue) { return float(exp(fValue)); }
 
 
-		static inline Real Floor (Real fValue) { return Real(floor(fValue)); }
+		static inline float Floor (float fValue) { return float(floor(fValue)); }
 
 
-		static inline Real Log (Real fValue) { return Real(log(fValue)); }
+		static inline float Log (float fValue) { return float(log(fValue)); }
 
 
 		/// Stored value of log(2) for frequent use
 		/// Stored value of log(2) for frequent use
-		static const Real LOG2;
+		static const float LOG2;
 
 
-		static inline Real Log2 (Real fValue) { return Real(log(fValue)/LOG2); }
+		static inline float Log2 (float fValue) { return float(log(fValue)/LOG2); }
 
 
-		static inline Real LogN (Real base, Real fValue) { return Real(log(fValue)/log(base)); }
+		static inline float LogN (float base, float fValue) { return float(log(fValue)/log(base)); }
 
 
-		static inline Real Pow (Real fBase, Real fExponent) { return Real(pow(fBase,fExponent)); }
+		static inline float Pow (float fBase, float fExponent) { return float(pow(fBase,fExponent)); }
 
 
-        static Real Sign (Real fValue);
+        static float Sign (float fValue);
 		static inline Radian Sign ( const Radian& rValue )
 		static inline Radian Sign ( const Radian& rValue )
 		{
 		{
 			return Radian(Sign(rValue.valueRadians()));
 			return Radian(Sign(rValue.valueRadians()));
@@ -304,8 +304,8 @@ namespace Ogre
                 useTables If true, uses lookup tables rather than
                 useTables If true, uses lookup tables rather than
                 calculation - faster but less accurate.
                 calculation - faster but less accurate.
         */
         */
-        static inline Real Sin (const Radian& fValue, bool useTables = false) {
-			return (!useTables) ? Real(sin(fValue.valueRadians())) : SinTable(fValue.valueRadians());
+        static inline float Sin (const Radian& fValue, bool useTables = false) {
+			return (!useTables) ? float(sin(fValue.valueRadians())) : SinTable(fValue.valueRadians());
 		}
 		}
         /** Sine function.
         /** Sine function.
             @param
             @param
@@ -314,13 +314,13 @@ namespace Ogre
                 useTables If true, uses lookup tables rather than
                 useTables If true, uses lookup tables rather than
                 calculation - faster but less accurate.
                 calculation - faster but less accurate.
         */
         */
-        static inline Real Sin (Real fValue, bool useTables = false) {
-			return (!useTables) ? Real(sin(fValue)) : SinTable(fValue);
+        static inline float Sin (float fValue, bool useTables = false) {
+			return (!useTables) ? float(sin(fValue)) : SinTable(fValue);
 		}
 		}
 
 
-		static inline Real Sqr (Real fValue) { return fValue*fValue; }
+		static inline float Sqr (float fValue) { return fValue*fValue; }
 
 
-		static inline Real Sqrt (Real fValue) { return Real(sqrt(fValue)); }
+		static inline float Sqrt (float fValue) { return float(sqrt(fValue)); }
 
 
         static inline Radian Sqrt (const Radian& fValue) { return Radian(sqrt(fValue.valueRadians())); }
         static inline Radian Sqrt (const Radian& fValue) { return Radian(sqrt(fValue.valueRadians())); }
 
 
@@ -329,13 +329,13 @@ namespace Ogre
         /** Inverse square root i.e. 1 / Sqrt(x), good for vector
         /** Inverse square root i.e. 1 / Sqrt(x), good for vector
             normalisation.
             normalisation.
         */
         */
-		static Real InvSqrt(Real fValue);
+		static float InvSqrt(float fValue);
 
 
-        static Real UnitRandom ();  // in [0,1]
+        static float UnitRandom ();  // in [0,1]
 
 
-        static Real RangeRandom (Real fLow, Real fHigh);  // in [fLow,fHigh]
+        static float RangeRandom (float fLow, float fHigh);  // in [fLow,fHigh]
 
 
-        static Real SymmetricRandom ();  // in [-1,1]
+        static float SymmetricRandom ();  // in [-1,1]
 
 
         /** Tangent function.
         /** Tangent function.
             @param
             @param
@@ -344,8 +344,8 @@ namespace Ogre
                 useTables If true, uses lookup tables rather than
                 useTables If true, uses lookup tables rather than
                 calculation - faster but less accurate.
                 calculation - faster but less accurate.
         */
         */
-		static inline Real Tan (const Radian& fValue, bool useTables = false) {
-			return (!useTables) ? Real(tan(fValue.valueRadians())) : TanTable(fValue.valueRadians());
+		static inline float Tan (const Radian& fValue, bool useTables = false) {
+			return (!useTables) ? float(tan(fValue.valueRadians())) : TanTable(fValue.valueRadians());
 		}
 		}
         /** Tangent function.
         /** Tangent function.
             @param
             @param
@@ -354,12 +354,12 @@ namespace Ogre
                 useTables If true, uses lookup tables rather than
                 useTables If true, uses lookup tables rather than
                 calculation - faster but less accurate.
                 calculation - faster but less accurate.
         */
         */
-		static inline Real Tan (Real fValue, bool useTables = false) {
-			return (!useTables) ? Real(tan(fValue)) : TanTable(fValue);
+		static inline float Tan (float fValue, bool useTables = false) {
+			return (!useTables) ? float(tan(fValue)) : TanTable(fValue);
 		}
 		}
 
 
-		static inline Real DegreesToRadians(Real degrees) { return degrees * fDeg2Rad; }
-        static inline Real RadiansToDegrees(Real radians) { return radians * fRad2Deg; }
+		static inline float DegreesToRadians(float degrees) { return degrees * fDeg2Rad; }
+        static inline float RadiansToDegrees(float radians) { return radians * fRad2Deg; }
 
 
        /** These functions used to set the assumed angle units (radians or degrees) 
        /** These functions used to set the assumed angle units (radians or degrees) 
             expected when using the Angle type.
             expected when using the Angle type.
@@ -372,13 +372,13 @@ namespace Ogre
        static AngleUnit getAngleUnit(void);
        static AngleUnit getAngleUnit(void);
 
 
        /** Convert from the current AngleUnit to radians. */
        /** Convert from the current AngleUnit to radians. */
-       static Real AngleUnitsToRadians(Real units);
+       static float AngleUnitsToRadians(float units);
        /** Convert from radians to the current AngleUnit . */
        /** Convert from radians to the current AngleUnit . */
-       static Real RadiansToAngleUnits(Real radians);
+       static float RadiansToAngleUnits(float radians);
        /** Convert from the current AngleUnit to degrees. */
        /** Convert from the current AngleUnit to degrees. */
-       static Real AngleUnitsToDegrees(Real units);
+       static float AngleUnitsToDegrees(float units);
        /** Convert from degrees to the current AngleUnit. */
        /** Convert from degrees to the current AngleUnit. */
-       static Real DegreesToAngleUnits(Real degrees);
+       static float DegreesToAngleUnits(float degrees);
 
 
        /** Checks whether a given point is inside a triangle, in a
        /** Checks whether a given point is inside a triangle, in a
             2-dimensional (Cartesian) space.
             2-dimensional (Cartesian) space.
@@ -431,14 +431,14 @@ namespace Ogre
         static bool pointInTri3D(const Vector3& p, const Vector3& a, 
         static bool pointInTri3D(const Vector3& p, const Vector3& a, 
 			const Vector3& b, const Vector3& c, const Vector3& normal);
 			const Vector3& b, const Vector3& c, const Vector3& normal);
         /** Ray / plane intersection, returns boolean result and distance. */
         /** Ray / plane intersection, returns boolean result and distance. */
-        static std::pair<bool, Real> intersects(const Ray& ray, const Plane& plane);
+        static std::pair<bool, float> intersects(const Ray& ray, const Plane& plane);
 
 
         /** Ray / sphere intersection, returns boolean result and distance. */
         /** Ray / sphere intersection, returns boolean result and distance. */
-        static std::pair<bool, Real> intersects(const Ray& ray, const Sphere& sphere, 
+        static std::pair<bool, float> intersects(const Ray& ray, const Sphere& sphere, 
             bool discardInside = true);
             bool discardInside = true);
         
         
         /** Ray / box intersection, returns boolean result and distance. */
         /** Ray / box intersection, returns boolean result and distance. */
-        static std::pair<bool, Real> intersects(const Ray& ray, const AxisAlignedBox& box);
+        static std::pair<bool, float> intersects(const Ray& ray, const AxisAlignedBox& box);
 
 
         /** Ray / box intersection, returns boolean result and two intersection distance.
         /** Ray / box intersection, returns boolean result and two intersection distance.
         @param
         @param
@@ -463,7 +463,7 @@ namespace Ogre
             <i>d1</i> and <i>d2</i> is unmodified.
             <i>d1</i> and <i>d2</i> is unmodified.
         */
         */
         static bool intersects(const Ray& ray, const AxisAlignedBox& box,
         static bool intersects(const Ray& ray, const AxisAlignedBox& box,
-            Real* d1, Real* d2);
+            float* d1, float* d2);
 
 
         /** Ray / triangle intersection, returns boolean result and distance.
         /** Ray / triangle intersection, returns boolean result and distance.
         @param
         @param
@@ -489,7 +489,7 @@ namespace Ogre
             If the ray isn't intersects the triangle, a pair of <b>false</b> and
             If the ray isn't intersects the triangle, a pair of <b>false</b> and
             <b>0</b> returned.
             <b>0</b> returned.
         */
         */
-        static std::pair<bool, Real> intersects(const Ray& ray, const Vector3& a,
+        static std::pair<bool, float> intersects(const Ray& ray, const Vector3& a,
             const Vector3& b, const Vector3& c, const Vector3& normal,
             const Vector3& b, const Vector3& c, const Vector3& normal,
             bool positiveSide = true, bool negativeSide = true);
             bool positiveSide = true, bool negativeSide = true);
 
 
@@ -513,7 +513,7 @@ namespace Ogre
             If the ray isn't intersects the triangle, a pair of <b>false</b> and
             If the ray isn't intersects the triangle, a pair of <b>false</b> and
             <b>0</b> returned.
             <b>0</b> returned.
         */
         */
-        static std::pair<bool, Real> intersects(const Ray& ray, const Vector3& a,
+        static std::pair<bool, float> intersects(const Ray& ray, const Vector3& a,
             const Vector3& b, const Vector3& c,
             const Vector3& b, const Vector3& c,
             bool positiveSide = true, bool negativeSide = true);
             bool positiveSide = true, bool negativeSide = true);
 
 
@@ -528,7 +528,7 @@ namespace Ogre
         @param plaeList List of planes which form a convex volume
         @param plaeList List of planes which form a convex volume
         @param normalIsOutside Does the normal point outside the volume
         @param normalIsOutside Does the normal point outside the volume
         */
         */
-        static std::pair<bool, Real> intersects(
+        static std::pair<bool, float> intersects(
             const Ray& ray, const vector<Plane>::type& planeList, 
             const Ray& ray, const vector<Plane>::type& planeList, 
             bool normalIsOutside);
             bool normalIsOutside);
         /** Ray / convex plane list intersection test. 
         /** Ray / convex plane list intersection test. 
@@ -536,7 +536,7 @@ namespace Ogre
         @param plaeList List of planes which form a convex volume
         @param plaeList List of planes which form a convex volume
         @param normalIsOutside Does the normal point outside the volume
         @param normalIsOutside Does the normal point outside the volume
         */
         */
-        static std::pair<bool, Real> intersects(
+        static std::pair<bool, float> intersects(
             const Ray& ray, const list<Plane>::type& planeList, 
             const Ray& ray, const list<Plane>::type& planeList, 
             bool normalIsOutside);
             bool normalIsOutside);
 
 
@@ -547,13 +547,13 @@ namespace Ogre
 
 
         /** Compare 2 reals, using tolerance for inaccuracies.
         /** Compare 2 reals, using tolerance for inaccuracies.
         */
         */
-        static bool RealEqual(Real a, Real b,
-            Real tolerance = std::numeric_limits<Real>::epsilon());
+        static bool RealEqual(float a, float b,
+            float tolerance = std::numeric_limits<float>::epsilon());
 
 
         /** Calculates the tangent space vector for a given set of positions / texture coords. */
         /** Calculates the tangent space vector for a given set of positions / texture coords. */
         static Vector3 calculateTangentSpaceVector(
         static Vector3 calculateTangentSpaceVector(
             const Vector3& position1, const Vector3& position2, const Vector3& position3,
             const Vector3& position1, const Vector3& position2, const Vector3& position3,
-            Real u1, Real v1, Real u2, Real v2, Real u3, Real v3);
+            float u1, float v1, float u2, float v2, float u3, float v3);
 
 
         /** Build a reflection matrix for the passed in plane. */
         /** Build a reflection matrix for the passed in plane. */
         static Matrix4 buildReflectionMatrix(const Plane& p);
         static Matrix4 buildReflectionMatrix(const Plane& p);
@@ -569,7 +569,7 @@ namespace Ogre
 		/** Generates a value based on the Gaussian (normal) distribution function
 		/** Generates a value based on the Gaussian (normal) distribution function
 			with the given offset and scale parameters.
 			with the given offset and scale parameters.
 		*/
 		*/
-		static Real gaussianDistribution(Real x, Real offset = 0.0f, Real scale = 1.0f);
+		static float gaussianDistribution(float x, float offset = 0.0f, float scale = 1.0f);
 
 
 		/** Clamp a value within an inclusive range. */
 		/** Clamp a value within an inclusive range. */
 		template <typename T>
 		template <typename T>
@@ -583,39 +583,39 @@ namespace Ogre
 			const Matrix4* reflectMatrix = 0);
 			const Matrix4* reflectMatrix = 0);
 
 
 		/** Get a bounding radius value from a bounding box. */
 		/** Get a bounding radius value from a bounding box. */
-		static Real boundingRadiusFromAABB(const AxisAlignedBox& aabb);
+		static float boundingRadiusFromAABB(const AxisAlignedBox& aabb);
 
 
 
 
 
 
-        static const Real POS_INFINITY;
-        static const Real NEG_INFINITY;
-        static const Real PI;
-        static const Real TWO_PI;
-        static const Real HALF_PI;
-		static const Real fDeg2Rad;
-		static const Real fRad2Deg;
+        static const float POS_INFINITY;
+        static const float NEG_INFINITY;
+        static const float PI;
+        static const float TWO_PI;
+        static const float HALF_PI;
+		static const float fDeg2Rad;
+		static const float fRad2Deg;
 
 
     };
     };
 
 
 	// these functions must be defined down here, because they rely on the
 	// these functions must be defined down here, because they rely on the
 	// angle unit conversion functions in class Math:
 	// angle unit conversion functions in class Math:
 
 
-	inline Real Radian::valueDegrees() const
+	inline float Radian::valueDegrees() const
 	{
 	{
 		return Math::RadiansToDegrees ( mRad );
 		return Math::RadiansToDegrees ( mRad );
 	}
 	}
 
 
-	inline Real Radian::valueAngleUnits() const
+	inline float Radian::valueAngleUnits() const
 	{
 	{
 		return Math::RadiansToAngleUnits ( mRad );
 		return Math::RadiansToAngleUnits ( mRad );
 	}
 	}
 
 
-	inline Real Degree::valueRadians() const
+	inline float Degree::valueRadians() const
 	{
 	{
 		return Math::DegreesToRadians ( mDeg );
 		return Math::DegreesToRadians ( mDeg );
 	}
 	}
 
 
-	inline Real Degree::valueAngleUnits() const
+	inline float Degree::valueAngleUnits() const
 	{
 	{
 		return Math::DegreesToAngleUnits ( mDeg );
 		return Math::DegreesToAngleUnits ( mDeg );
 	}
 	}
@@ -630,22 +630,22 @@ namespace Ogre
 		return Degree(Math::AngleUnitsToDegrees(mAngle));
 		return Degree(Math::AngleUnitsToDegrees(mAngle));
 	}
 	}
 
 
-	inline Radian operator * ( Real a, const Radian& b )
+	inline Radian operator * ( float a, const Radian& b )
 	{
 	{
 		return Radian ( a * b.valueRadians() );
 		return Radian ( a * b.valueRadians() );
 	}
 	}
 
 
-	inline Radian operator / ( Real a, const Radian& b )
+	inline Radian operator / ( float a, const Radian& b )
 	{
 	{
 		return Radian ( a / b.valueRadians() );
 		return Radian ( a / b.valueRadians() );
 	}
 	}
 
 
-	inline Degree operator * ( Real a, const Degree& b )
+	inline Degree operator * ( float a, const Degree& b )
 	{
 	{
 		return Degree ( a * b.valueDegrees() );
 		return Degree ( a * b.valueDegrees() );
 	}
 	}
 
 
-	inline Degree operator / ( Real a, const Degree& b )
+	inline Degree operator / ( float a, const Degree& b )
 	{
 	{
 		return Degree ( a / b.valueDegrees() );
 		return Degree ( a / b.valueDegrees() );
 	}
 	}

+ 29 - 29
CamelotUtility/Include/OgreMatrix3.h

@@ -28,7 +28,7 @@ THE SOFTWARE.
 #ifndef __Matrix3_H__
 #ifndef __Matrix3_H__
 #define __Matrix3_H__
 #define __Matrix3_H__
 
 
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 
 
 #include "OgreVector3.h"
 #include "OgreVector3.h"
 
 
@@ -73,17 +73,17 @@ namespace Ogre
                 It does <b>NOT</b> initialize the matrix for efficiency.
                 It does <b>NOT</b> initialize the matrix for efficiency.
         */
         */
 		inline Matrix3 () {}
 		inline Matrix3 () {}
-        inline explicit Matrix3 (const Real arr[3][3])
+        inline explicit Matrix3 (const float arr[3][3])
 		{
 		{
-			memcpy(m,arr,9*sizeof(Real));
+			memcpy(m,arr,9*sizeof(float));
 		}
 		}
         inline Matrix3 (const Matrix3& rkMatrix)
         inline Matrix3 (const Matrix3& rkMatrix)
 		{
 		{
-			memcpy(m,rkMatrix.m,9*sizeof(Real));
+			memcpy(m,rkMatrix.m,9*sizeof(float));
 		}
 		}
-        Matrix3 (Real fEntry00, Real fEntry01, Real fEntry02,
-                    Real fEntry10, Real fEntry11, Real fEntry12,
-                    Real fEntry20, Real fEntry21, Real fEntry22)
+        Matrix3 (float fEntry00, float fEntry01, float fEntry02,
+                    float fEntry10, float fEntry11, float fEntry12,
+                    float fEntry20, float fEntry21, float fEntry22)
 		{
 		{
 			m[0][0] = fEntry00;
 			m[0][0] = fEntry00;
 			m[0][1] = fEntry01;
 			m[0][1] = fEntry01;
@@ -112,13 +112,13 @@ namespace Ogre
 		}
 		}
 
 
         // member access, allows use of construct mat[r][c]
         // member access, allows use of construct mat[r][c]
-        inline Real* operator[] (size_t iRow) const
+        inline float* operator[] (size_t iRow) const
 		{
 		{
-			return (Real*)m[iRow];
+			return (float*)m[iRow];
 		}
 		}
-        /*inline operator Real* ()
+        /*inline operator float* ()
 		{
 		{
-			return (Real*)m[0];
+			return (float*)m[0];
 		}*/
 		}*/
         Vector3 GetColumn (size_t iCol) const;
         Vector3 GetColumn (size_t iCol) const;
         void SetColumn(size_t iCol, const Vector3& vec);
         void SetColumn(size_t iCol, const Vector3& vec);
@@ -127,7 +127,7 @@ namespace Ogre
         // assignment and comparison
         // assignment and comparison
         inline Matrix3& operator= (const Matrix3& rkMatrix)
         inline Matrix3& operator= (const Matrix3& rkMatrix)
 		{
 		{
-			memcpy(m,rkMatrix.m,9*sizeof(Real));
+			memcpy(m,rkMatrix.m,9*sizeof(float));
 			return *this;
 			return *this;
 		}
 		}
         bool operator== (const Matrix3& rkMatrix) const;
         bool operator== (const Matrix3& rkMatrix) const;
@@ -150,16 +150,16 @@ namespace Ogre
             const Matrix3& rkMatrix);
             const Matrix3& rkMatrix);
 
 
         // matrix * scalar
         // matrix * scalar
-        Matrix3 operator* (Real fScalar) const;
+        Matrix3 operator* (float fScalar) const;
 
 
         // scalar * matrix
         // scalar * matrix
-        _OgreExport friend Matrix3 operator* (Real fScalar, const Matrix3& rkMatrix);
+        _OgreExport friend Matrix3 operator* (float fScalar, const Matrix3& rkMatrix);
 
 
         // utilities
         // utilities
         Matrix3 Transpose () const;
         Matrix3 Transpose () const;
-        bool Inverse (Matrix3& rkInverse, Real fTolerance = 1e-06) const;
-        Matrix3 Inverse (Real fTolerance = 1e-06) const;
-        Real Determinant () const;
+        bool Inverse (Matrix3& rkInverse, float fTolerance = 1e-06) const;
+        Matrix3 Inverse (float fTolerance = 1e-06) const;
+        float Determinant () const;
 
 
         // singular value decomposition
         // singular value decomposition
         void SingularValueDecomposition (Matrix3& rkL, Vector3& rkS,
         void SingularValueDecomposition (Matrix3& rkL, Vector3& rkS,
@@ -174,7 +174,7 @@ namespace Ogre
         void QDUDecomposition (Matrix3& rkQ, Vector3& rkD,
         void QDUDecomposition (Matrix3& rkQ, Vector3& rkD,
             Vector3& rkU) const;
             Vector3& rkU) const;
 
 
-        Real SpectralNorm () const;
+        float SpectralNorm () const;
 
 
         // matrix must be orthonormal
         // matrix must be orthonormal
         void ToAxisAngle (Vector3& rkAxis, Radian& rfAngle) const;
         void ToAxisAngle (Vector3& rkAxis, Radian& rfAngle) const;
@@ -207,7 +207,7 @@ namespace Ogre
         void FromEulerAnglesZXY (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
         void FromEulerAnglesZXY (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
         void FromEulerAnglesZYX (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
         void FromEulerAnglesZYX (const Radian& fYAngle, const Radian& fPAngle, const Radian& fRAngle);
         // eigensolver, matrix must be symmetric
         // eigensolver, matrix must be symmetric
-        void EigenSolveSymmetric (Real afEigenvalue[3],
+        void EigenSolveSymmetric (float afEigenvalue[3],
             Vector3 akEigenvector[3]) const;
             Vector3 akEigenvector[3]) const;
 
 
         static void TensorProduct (const Vector3& rkU, const Vector3& rkV,
         static void TensorProduct (const Vector3& rkU, const Vector3& rkV,
@@ -217,14 +217,14 @@ namespace Ogre
 		inline bool hasScale() const
 		inline bool hasScale() const
 		{
 		{
 			// check magnitude of column vectors (==local axes)
 			// check magnitude of column vectors (==local axes)
-			Real t = m[0][0] * m[0][0] + m[1][0] * m[1][0] + m[2][0] * m[2][0];
-			if (!Math::RealEqual(t, 1.0, (Real)1e-04))
+			float t = m[0][0] * m[0][0] + m[1][0] * m[1][0] + m[2][0] * m[2][0];
+			if (!Math::RealEqual(t, 1.0, (float)1e-04))
 				return true;
 				return true;
 			t = m[0][1] * m[0][1] + m[1][1] * m[1][1] + m[2][1] * m[2][1];
 			t = m[0][1] * m[0][1] + m[1][1] * m[1][1] + m[2][1] * m[2][1];
-			if (!Math::RealEqual(t, 1.0, (Real)1e-04))
+			if (!Math::RealEqual(t, 1.0, (float)1e-04))
 				return true;
 				return true;
 			t = m[0][2] * m[0][2] + m[1][2] * m[1][2] + m[2][2] * m[2][2];
 			t = m[0][2] * m[0][2] + m[1][2] * m[1][2] + m[2][2] * m[2][2];
-			if (!Math::RealEqual(t, 1.0, (Real)1e-04))
+			if (!Math::RealEqual(t, 1.0, (float)1e-04))
 				return true;
 				return true;
 
 
 			return false;
 			return false;
@@ -241,17 +241,17 @@ namespace Ogre
 			return o;
 			return o;
 		}
 		}
 
 
-        static const Real EPSILON;
+        static const float EPSILON;
         static const Matrix3 ZERO;
         static const Matrix3 ZERO;
         static const Matrix3 IDENTITY;
         static const Matrix3 IDENTITY;
 
 
     protected:
     protected:
         // support for eigensolver
         // support for eigensolver
-        void Tridiagonal (Real afDiag[3], Real afSubDiag[3]);
-        bool QLAlgorithm (Real afDiag[3], Real afSubDiag[3]);
+        void Tridiagonal (float afDiag[3], float afSubDiag[3]);
+        bool QLAlgorithm (float afDiag[3], float afSubDiag[3]);
 
 
         // support for singular value decomposition
         // support for singular value decomposition
-        static const Real ms_fSvdEpsilon;
+        static const float ms_fSvdEpsilon;
         static const unsigned int ms_iSvdMaxIterations;
         static const unsigned int ms_iSvdMaxIterations;
         static void Bidiagonalize (Matrix3& kA, Matrix3& kL,
         static void Bidiagonalize (Matrix3& kA, Matrix3& kL,
             Matrix3& kR);
             Matrix3& kR);
@@ -259,9 +259,9 @@ namespace Ogre
             Matrix3& kR);
             Matrix3& kR);
 
 
         // support for spectral norm
         // support for spectral norm
-        static Real MaxCubicRoot (Real afCoeff[3]);
+        static float MaxCubicRoot (float afCoeff[3]);
 
 
-        Real m[3][3];
+        float m[3][3];
 
 
         // for faster access
         // for faster access
         friend class Matrix4;
         friend class Matrix4;

+ 19 - 19
CamelotUtility/Include/OgreMatrix4.h

@@ -29,7 +29,7 @@ THE SOFTWARE.
 #define __Matrix4__
 #define __Matrix4__
 
 
 // Precompiler options
 // Precompiler options
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 
 
 #include "OgreVector3.h"
 #include "OgreVector3.h"
 #include "OgreMatrix3.h"
 #include "OgreMatrix3.h"
@@ -80,8 +80,8 @@ namespace Ogre
     protected:
     protected:
         /// The matrix entries, indexed by [row][col].
         /// The matrix entries, indexed by [row][col].
         union {
         union {
-            Real m[4][4];
-            Real _m[16];
+            float m[4][4];
+            float _m[16];
         };
         };
     public:
     public:
         /** Default constructor.
         /** Default constructor.
@@ -93,10 +93,10 @@ namespace Ogre
         }
         }
 
 
         inline Matrix4(
         inline Matrix4(
-            Real m00, Real m01, Real m02, Real m03,
-            Real m10, Real m11, Real m12, Real m13,
-            Real m20, Real m21, Real m22, Real m23,
-            Real m30, Real m31, Real m32, Real m33 )
+            float m00, float m01, float m02, float m03,
+            float m10, float m11, float m12, float m13,
+            float m20, float m21, float m22, float m23,
+            float m30, float m31, float m32, float m33 )
         {
         {
             m[0][0] = m00;
             m[0][0] = m00;
             m[0][1] = m01;
             m[0][1] = m01;
@@ -159,13 +159,13 @@ namespace Ogre
 			std::swap(m[3][3], other.m[3][3]);
 			std::swap(m[3][3], other.m[3][3]);
 		}
 		}
 
 
-		inline Real* operator [] ( size_t iRow )
+		inline float* operator [] ( size_t iRow )
         {
         {
             assert( iRow < 4 );
             assert( iRow < 4 );
             return m[iRow];
             return m[iRow];
         }
         }
 
 
-        inline const Real *operator [] ( size_t iRow ) const
+        inline const float *operator [] ( size_t iRow ) const
         {
         {
             assert( iRow < 4 );
             assert( iRow < 4 );
             return m[iRow];
             return m[iRow];
@@ -217,7 +217,7 @@ namespace Ogre
         {
         {
             Vector3 r;
             Vector3 r;
 
 
-            Real fInvW = 1.0f / ( m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] );
+            float fInvW = 1.0f / ( m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] );
 
 
             r.x = ( m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] ) * fInvW;
             r.x = ( m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] ) * fInvW;
             r.y = ( m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] ) * fInvW;
             r.y = ( m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] ) * fInvW;
@@ -381,7 +381,7 @@ namespace Ogre
             m[3][0] = 0.0; m[3][1] = 0.0; m[3][2] = 0.0; m[3][3] = 1.0;
             m[3][0] = 0.0; m[3][1] = 0.0; m[3][2] = 0.0; m[3][3] = 1.0;
         }
         }
 
 
-        inline void makeTrans( Real tx, Real ty, Real tz )
+        inline void makeTrans( float tx, float ty, float tz )
         {
         {
             m[0][0] = 1.0; m[0][1] = 0.0; m[0][2] = 0.0; m[0][3] = tx;
             m[0][0] = 1.0; m[0][1] = 0.0; m[0][2] = 0.0; m[0][3] = tx;
             m[1][0] = 0.0; m[1][1] = 1.0; m[1][2] = 0.0; m[1][3] = ty;
             m[1][0] = 0.0; m[1][1] = 1.0; m[1][2] = 0.0; m[1][3] = ty;
@@ -405,7 +405,7 @@ namespace Ogre
 
 
         /** Gets a translation matrix - variation for not using a vector.
         /** Gets a translation matrix - variation for not using a vector.
         */
         */
-        inline static Matrix4 getTrans( Real t_x, Real t_y, Real t_z )
+        inline static Matrix4 getTrans( float t_x, float t_y, float t_z )
         {
         {
             Matrix4 r;
             Matrix4 r;
 
 
@@ -446,7 +446,7 @@ namespace Ogre
 
 
         /** Gets a scale matrix - variation for not using a vector.
         /** Gets a scale matrix - variation for not using a vector.
         */
         */
-        inline static Matrix4 getScale( Real s_x, Real s_y, Real s_z )
+        inline static Matrix4 getScale( float s_x, float s_y, float s_z )
         {
         {
             Matrix4 r;
             Matrix4 r;
             r.m[0][0] = s_x; r.m[0][1] = 0.0; r.m[0][2] = 0.0; r.m[0][3] = 0.0;
             r.m[0][0] = s_x; r.m[0][1] = 0.0; r.m[0][2] = 0.0; r.m[0][3] = 0.0;
@@ -478,14 +478,14 @@ namespace Ogre
 		inline bool hasScale() const
 		inline bool hasScale() const
 		{
 		{
 			// check magnitude of column vectors (==local axes)
 			// check magnitude of column vectors (==local axes)
-			Real t = m[0][0] * m[0][0] + m[1][0] * m[1][0] + m[2][0] * m[2][0];
-			if (!Math::RealEqual(t, 1.0, (Real)1e-04))
+			float t = m[0][0] * m[0][0] + m[1][0] * m[1][0] + m[2][0] * m[2][0];
+			if (!Math::RealEqual(t, 1.0, (float)1e-04))
 				return true;
 				return true;
 			t = m[0][1] * m[0][1] + m[1][1] * m[1][1] + m[2][1] * m[2][1];
 			t = m[0][1] * m[0][1] + m[1][1] * m[1][1] + m[2][1] * m[2][1];
-			if (!Math::RealEqual(t, 1.0, (Real)1e-04))
+			if (!Math::RealEqual(t, 1.0, (float)1e-04))
 				return true;
 				return true;
 			t = m[0][2] * m[0][2] + m[1][2] * m[1][2] + m[2][2] * m[2][2];
 			t = m[0][2] * m[0][2] + m[1][2] * m[1][2] + m[2][2] * m[2][2];
-			if (!Math::RealEqual(t, 1.0, (Real)1e-04))
+			if (!Math::RealEqual(t, 1.0, (float)1e-04))
 				return true;
 				return true;
 
 
 			return false;
 			return false;
@@ -512,7 +512,7 @@ namespace Ogre
             and inverts the Y. */
             and inverts the Y. */
         static const Matrix4 CLIPSPACE2DTOIMAGESPACE;
         static const Matrix4 CLIPSPACE2DTOIMAGESPACE;
 
 
-        inline Matrix4 operator*(Real scalar) const
+        inline Matrix4 operator*(float scalar) const
         {
         {
             return Matrix4(
             return Matrix4(
                 scalar*m[0][0], scalar*m[0][1], scalar*m[0][2], scalar*m[0][3],
                 scalar*m[0][0], scalar*m[0][1], scalar*m[0][2], scalar*m[0][3],
@@ -541,7 +541,7 @@ namespace Ogre
         }
         }
 		
 		
 		Matrix4 adjoint() const;
 		Matrix4 adjoint() const;
-		Real determinant() const;
+		float determinant() const;
 		Matrix4 inverse() const;
 		Matrix4 inverse() const;
 
 
         /** Building a Matrix4 from orientation / scale / position.
         /** Building a Matrix4 from orientation / scale / position.

+ 6 - 6
CamelotUtility/Include/OgrePlane.h

@@ -36,7 +36,7 @@ THE SOFTWARE.
 #ifndef __Plane_H__
 #ifndef __Plane_H__
 #define __Plane_H__
 #define __Plane_H__
 
 
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 
 
 #include "OgreVector3.h"
 #include "OgreVector3.h"
 
 
@@ -66,9 +66,9 @@ namespace Ogre {
         Plane ();
         Plane ();
         Plane (const Plane& rhs);
         Plane (const Plane& rhs);
         /** Construct a plane through a normal, and a distance to move the plane along the normal.*/
         /** Construct a plane through a normal, and a distance to move the plane along the normal.*/
-        Plane (const Vector3& rkNormal, Real fConstant);
+        Plane (const Vector3& rkNormal, float fConstant);
 		/** Construct a plane using the 4 constants directly **/
 		/** Construct a plane using the 4 constants directly **/
-		Plane (Real a, Real b, Real c, Real d);
+		Plane (float a, float b, float c, float d);
         Plane (const Vector3& rkNormal, const Vector3& rkPoint);
         Plane (const Vector3& rkNormal, const Vector3& rkPoint);
         Plane (const Vector3& rkPoint0, const Vector3& rkPoint1,
         Plane (const Vector3& rkPoint0, const Vector3& rkPoint1,
             const Vector3& rkPoint2);
             const Vector3& rkPoint2);
@@ -112,7 +112,7 @@ namespace Ogre {
             The absolute value of the return value is the true distance only
             The absolute value of the return value is the true distance only
             when the plane normal is a unit length vector.
             when the plane normal is a unit length vector.
         */
         */
-        Real getDistance (const Vector3& rkPoint) const;
+        float getDistance (const Vector3& rkPoint) const;
 
 
         /** Redefine this plane based on 3 points. */
         /** Redefine this plane based on 3 points. */
         void redefine(const Vector3& rkPoint0, const Vector3& rkPoint1,
         void redefine(const Vector3& rkPoint0, const Vector3& rkPoint1,
@@ -139,10 +139,10 @@ namespace Ogre {
                 will be no changes made to their components.
                 will be no changes made to their components.
             @returns The previous length of the plane's normal.
             @returns The previous length of the plane's normal.
         */
         */
-        Real normalise(void);
+        float normalise(void);
 
 
 		Vector3 normal;
 		Vector3 normal;
-        Real d;
+        float d;
 
 
         /// Comparison operator
         /// Comparison operator
         bool operator==(const Plane& rhs) const
         bool operator==(const Plane& rhs) const

+ 5 - 53
CamelotUtility/Include/OgrePlatform.h

@@ -28,16 +28,12 @@ THE SOFTWARE.
 #ifndef __Platform_H_
 #ifndef __Platform_H_
 #define __Platform_H_
 #define __Platform_H_
 
 
-#include "OgreConfig.h"
-
 namespace Ogre {
 namespace Ogre {
 /* Initial platform/compiler-related stuff to set.
 /* Initial platform/compiler-related stuff to set.
 */
 */
 #define OGRE_PLATFORM_WIN32 1
 #define OGRE_PLATFORM_WIN32 1
 #define OGRE_PLATFORM_LINUX 2
 #define OGRE_PLATFORM_LINUX 2
 #define OGRE_PLATFORM_APPLE 3
 #define OGRE_PLATFORM_APPLE 3
-#define OGRE_PLATFORM_SYMBIAN 4
-#define OGRE_PLATFORM_IPHONE 5
 
 
 #define OGRE_COMPILER_MSVC 1
 #define OGRE_COMPILER_MSVC 1
 #define OGRE_COMPILER_GNUC 2
 #define OGRE_COMPILER_GNUC 2
@@ -93,18 +89,10 @@ namespace Ogre {
 
 
 /* Finds the current platform */
 /* Finds the current platform */
 
 
-#if defined( __SYMBIAN32__ ) 
-#   define OGRE_PLATFORM OGRE_PLATFORM_SYMBIAN
-#elif defined( __WIN32__ ) || defined( _WIN32 )
+#if defined( __WIN32__ ) || defined( _WIN32 )
 #   define OGRE_PLATFORM OGRE_PLATFORM_WIN32
 #   define OGRE_PLATFORM OGRE_PLATFORM_WIN32
 #elif defined( __APPLE_CC__)
 #elif defined( __APPLE_CC__)
-    // Device                                                     Simulator
-    // Both requiring OS version 3.0 or greater
-#   if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 30000 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 30000
-#       define OGRE_PLATFORM OGRE_PLATFORM_IPHONE
-#   else
-#       define OGRE_PLATFORM OGRE_PLATFORM_APPLE
-#   endif
+#   define OGRE_PLATFORM OGRE_PLATFORM_APPLE
 #else
 #else
 #   define OGRE_PLATFORM OGRE_PLATFORM_LINUX
 #   define OGRE_PLATFORM OGRE_PLATFORM_LINUX
 #endif
 #endif
@@ -178,22 +166,9 @@ namespace Ogre {
 
 
 #endif // OGRE_PLATFORM == OGRE_PLATFORM_WIN32
 #endif // OGRE_PLATFORM == OGRE_PLATFORM_WIN32
 
 
-//----------------------------------------------------------------------------
-// Symbian Settings
-#if OGRE_PLATFORM == OGRE_PLATFORM_SYMBIAN
-#	define OGRE_UNICODE_SUPPORT 1
-#   define OGRE_DEBUG_MODE 0
-#   define _OgreExport
-#   define _OgrePrivate
-#	define CLOCKS_PER_SEC  1000
-// pragma def were found here: http://www.inf.pucrs.br/~eduardob/disciplinas/SistEmbarcados/Mobile/Nokia/Tools/Carbide_vs/WINSCW/Help/PDF/C_Compilers_Reference_3.2.pdf
-#	pragma warn_unusedarg off
-#	pragma warn_emptydecl off
-#	pragma warn_possunwant off
-#endif
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 // Linux/Apple/Symbian Settings
 // Linux/Apple/Symbian Settings
-#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_IPHONE || OGRE_PLATFORM == OGRE_PLATFORM_SYMBIAN
+#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE
 
 
 // Enable GCC symbol visibility
 // Enable GCC symbol visibility
 #   if defined( OGRE_GCC_VISIBILITY )
 #   if defined( OGRE_GCC_VISIBILITY )
@@ -218,17 +193,11 @@ namespace Ogre {
 #   endif
 #   endif
 
 
 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-    #define OGRE_PLATFORM_LIB "OgrePlatform.bundle"
-#elif OGRE_PLATFORM == OGRE_PLATFORM_IPHONE
-    #define OGRE_PLATFORM_LIB "OgrePlatform.a"
+    #define OGRE_PLATFORM_LIB "CmPlatform.bundle"
 #else //OGRE_PLATFORM_LINUX
 #else //OGRE_PLATFORM_LINUX
-    #define OGRE_PLATFORM_LIB "libOgrePlatform.so"
+    #define OGRE_PLATFORM_LIB "libCmPlatform.so"
 #endif
 #endif
 
 
-// Always enable unicode support for the moment
-// Perhaps disable in old versions of gcc if necessary
-#define OGRE_UNICODE_SUPPORT 1
-
 #endif
 #endif
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
@@ -242,23 +211,6 @@ namespace Ogre {
 #    define OGRE_ENDIAN OGRE_ENDIAN_LITTLE
 #    define OGRE_ENDIAN OGRE_ENDIAN_LITTLE
 #endif
 #endif
 
 
-// Integer formats of fixed bit width
-typedef unsigned int uint32;
-typedef unsigned short uint16;
-typedef unsigned char uint8;
-typedef int int32;
-typedef short int16;
-typedef char int8;
-// define uint64 type
-#if OGRE_COMPILER == OGRE_COMPILER_MSVC
-	typedef unsigned __int64 uint64;
-	typedef __int64 int64;
-#else
-	typedef unsigned long long uint64;
-	typedef long long int64;
-#endif
-
-
 }
 }
 
 
 #endif
 #endif

+ 1 - 1
CamelotUtility/Include/OgrePlatformInformation.h

@@ -28,7 +28,7 @@ THE SOFTWARE.
 #ifndef __PlatformInformation_H__
 #ifndef __PlatformInformation_H__
 #define __PlatformInformation_H__
 #define __PlatformInformation_H__
 
 
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 
 
 namespace Ogre {
 namespace Ogre {
 //
 //

+ 0 - 77
CamelotUtility/Include/OgrePortMemory.h

@@ -1,77 +0,0 @@
-#pragma once
-
-// TODO PORT - I define the memory allocation here because they're often used but I don't have an implementation for them. I should remove calls to the macros altogether but this will do for now
-
-#include <malloc.h>
-#include "OgreAlignedAllocator.h"
-
-#define OGRE_NEW new
-#define OGRE_DELETE delete
-
-#define OGRE_MALLOC(bytes, category) malloc(bytes)
-#define OGRE_ALLOC_T(T, count, category) static_cast<T*>(malloc(sizeof(T)*(count)))
-#define OGRE_FREE(ptr, category) free((void*)ptr)
-
-#define OGRE_NEW_T(T, category) new T
-#define OGRE_NEW_ARRAY_T(T, count, category) new T[count] 
-#define OGRE_DELETE_T(ptr, T, category) if(ptr){delete ptr;}
-#define OGRE_DELETE_ARRAY_T(ptr, T, count, category) if(ptr){delete[] ptr;}
-
-namespace Ogre
-{
-	template<typename T>
-	T* constructN(T* basePtr, size_t count)
-	{
-		for (size_t i = 0; i < count; ++i)
-		{
-			new ((void*)(basePtr+i)) T();
-		}
-		return basePtr;
-	}
-}
-
-#define OGRE_MALLOC_SIMD(bytes, category) ::Ogre::AlignedMemory::allocate(bytes)
-#define OGRE_MALLOC_ALIGN(bytes, category, align) ::Ogre::AlignedMemory::allocate(bytes, align)
-#define OGRE_ALLOC_T_SIMD(T, count, category) static_cast<T*>(::Ogre::AlignedMemory::allocate(sizeof(T)*(count),OGRE_SIMD_ALIGNMENT))
-#define OGRE_ALLOC_T_ALIGN(T, count, category, align) static_cast<T*>(::Ogre::AlignedMemory::allocate(sizeof(T)*(count), align))
-#define OGRE_FREE_SIMD(ptr, category) ::Ogre::AlignedMemory::deallocate(ptr)
-#define OGRE_FREE_ALIGN(ptr, category, align) ::Ogre::AlignedMemory::deallocate(ptr)
-//
-#define OGRE_NEW_T_SIMD(T, category) new (::Ogre::AlignedMemory::allocate(sizeof(T))) T
-#define OGRE_NEW_ARRAY_T_SIMD(T, count, category) ::Ogre::constructN(static_cast<T*>(::Ogre::AlignedMemory::allocate(sizeof(T)*(count))), count) 
-#define OGRE_DELETE_T_SIMD(ptr, T, category) if(ptr){(ptr)->~T(); ::Ogre::AlignedMemory::deallocate(ptr);}
-#define OGRE_DELETE_ARRAY_T_SIMD(ptr, T, count, category) if(ptr){for (size_t b = 0; b < count; ++b) { (ptr)[b].~T();} ::Ogre::AlignedMemory::deallocate(ptr);}
-#define OGRE_NEW_T_ALIGN(T, category, align) new (::Ogre::AlignedMemory::allocate(sizeof(T), align)) T
-#define OGRE_NEW_ARRAY_T_ALIGN(T, count, category, align) ::Ogre::constructN(static_cast<T*>(::Ogre::AlignedMemory::allocate(sizeof(T)*(count), align)), count) 
-#define OGRE_DELETE_T_ALIGN(ptr, T, category, align) if(ptr){(ptr)->~T(); ::Ogre::AlignedMemory::deallocate(ptr);}
-#define OGRE_DELETE_ARRAY_T_ALIGN(ptr, T, count, category, align) if(ptr){for (size_t _b = 0; _b < count; ++_b) { (ptr)[_b].~T();} ::Ogre::AlignedMemory::deallocate(ptr);}
-
-namespace Ogre
-{
-	enum MemoryCategory
-	{
-		/// General purpose
-		MEMCATEGORY_GENERAL = 0,
-		/// Geometry held in main memory
-		MEMCATEGORY_GEOMETRY = 1, 
-		/// Animation data like tracks, bone matrices
-		MEMCATEGORY_ANIMATION = 2, 
-		/// Nodes, control data
-		MEMCATEGORY_SCENE_CONTROL = 3,
-		/// Scene object instances
-		MEMCATEGORY_SCENE_OBJECTS = 4,
-		/// Other resources
-		MEMCATEGORY_RESOURCE = 5,
-		/// Scripting
-		MEMCATEGORY_SCRIPTING = 6,
-		/// Rendersystem structures
-		MEMCATEGORY_RENDERSYS = 7,
-
-		
-		// sentinel value, do not use 
-		MEMCATEGORY_COUNT = 8
-	};
-	/** @} */
-	/** @} */
-
-}

+ 20 - 20
CamelotUtility/Include/OgreQuaternion.h

@@ -36,7 +36,7 @@ THE SOFTWARE.
 #ifndef __Quaternion_H__
 #ifndef __Quaternion_H__
 #define __Quaternion_H__
 #define __Quaternion_H__
 
 
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 #include "OgreMath.h"
 #include "OgreMath.h"
 
 
 namespace Ogre {
 namespace Ogre {
@@ -53,8 +53,8 @@ namespace Ogre {
     {
     {
     public:
     public:
         inline Quaternion (
         inline Quaternion (
-            Real fW = 1.0,
-            Real fX = 0.0, Real fY = 0.0, Real fZ = 0.0)
+            float fW = 1.0,
+            float fX = 0.0, float fY = 0.0, float fZ = 0.0)
 		{
 		{
 			w = fW;
 			w = fW;
 			x = fX;
 			x = fX;
@@ -82,9 +82,9 @@ namespace Ogre {
             this->FromAxes(akAxis);
             this->FromAxes(akAxis);
         }
         }
 		/// Construct a quaternion from 4 manual w/x/y/z values
 		/// Construct a quaternion from 4 manual w/x/y/z values
-		inline Quaternion(Real* valptr)
+		inline Quaternion(float* valptr)
 		{
 		{
-			memcpy(&w, valptr, sizeof(Real)*4);
+			memcpy(&w, valptr, sizeof(float)*4);
 		}
 		}
 
 
 		/** Exchange the contents of this quaternion with another. 
 		/** Exchange the contents of this quaternion with another. 
@@ -98,7 +98,7 @@ namespace Ogre {
 		}
 		}
 
 
 		/// Array accessor operator
 		/// Array accessor operator
-		inline Real operator [] ( const size_t i ) const
+		inline float operator [] ( const size_t i ) const
 		{
 		{
 			assert( i < 4 );
 			assert( i < 4 );
 
 
@@ -106,7 +106,7 @@ namespace Ogre {
 		}
 		}
 
 
 		/// Array accessor operator
 		/// Array accessor operator
-		inline Real& operator [] ( const size_t i )
+		inline float& operator [] ( const size_t i )
 		{
 		{
 			assert( i < 4 );
 			assert( i < 4 );
 
 
@@ -114,13 +114,13 @@ namespace Ogre {
 		}
 		}
 
 
 		/// Pointer accessor for direct copying
 		/// Pointer accessor for direct copying
-		inline Real* ptr()
+		inline float* ptr()
 		{
 		{
 			return &w;
 			return &w;
 		}
 		}
 
 
 		/// Pointer accessor for direct copying
 		/// Pointer accessor for direct copying
-		inline const Real* ptr() const
+		inline const float* ptr() const
 		{
 		{
 			return &w;
 			return &w;
 		}
 		}
@@ -156,8 +156,8 @@ namespace Ogre {
         Quaternion operator+ (const Quaternion& rkQ) const;
         Quaternion operator+ (const Quaternion& rkQ) const;
         Quaternion operator- (const Quaternion& rkQ) const;
         Quaternion operator- (const Quaternion& rkQ) const;
         Quaternion operator* (const Quaternion& rkQ) const;
         Quaternion operator* (const Quaternion& rkQ) const;
-        Quaternion operator* (Real fScalar) const;
-        _OgreExport friend Quaternion operator* (Real fScalar,
+        Quaternion operator* (float fScalar) const;
+        _OgreExport friend Quaternion operator* (float fScalar,
             const Quaternion& rkQ);
             const Quaternion& rkQ);
         Quaternion operator- () const;
         Quaternion operator- () const;
         inline bool operator== (const Quaternion& rhs) const
         inline bool operator== (const Quaternion& rhs) const
@@ -170,10 +170,10 @@ namespace Ogre {
 			return !operator==(rhs);
 			return !operator==(rhs);
 		}
 		}
         // functions of a quaternion
         // functions of a quaternion
-        Real Dot (const Quaternion& rkQ) const;  // dot product
-        Real Norm () const;  // squared-length
+        float Dot (const Quaternion& rkQ) const;  // dot product
+        float Norm () const;  // squared-length
         /// Normalises this quaternion, and returns the previous length
         /// Normalises this quaternion, and returns the previous length
-        Real normalise(void); 
+        float normalise(void); 
         Quaternion Inverse () const;  // apply to non-zero quaternion
         Quaternion Inverse () const;  // apply to non-zero quaternion
         Quaternion UnitInverse () const;  // apply to unit-length quaternion
         Quaternion UnitInverse () const;  // apply to unit-length quaternion
         Quaternion Exp () const;
         Quaternion Exp () const;
@@ -213,10 +213,10 @@ namespace Ogre {
 		bool equals(const Quaternion& rhs, const Radian& tolerance) const;
 		bool equals(const Quaternion& rhs, const Radian& tolerance) const;
 		
 		
 	    // spherical linear interpolation
 	    // spherical linear interpolation
-        static Quaternion Slerp (Real fT, const Quaternion& rkP,
+        static Quaternion Slerp (float fT, const Quaternion& rkP,
             const Quaternion& rkQ, bool shortestPath = false);
             const Quaternion& rkQ, bool shortestPath = false);
 
 
-        static Quaternion SlerpExtraSpins (Real fT,
+        static Quaternion SlerpExtraSpins (float fT,
             const Quaternion& rkP, const Quaternion& rkQ,
             const Quaternion& rkP, const Quaternion& rkQ,
             int iExtraSpins);
             int iExtraSpins);
 
 
@@ -226,22 +226,22 @@ namespace Ogre {
             Quaternion& rka, Quaternion& rkB);
             Quaternion& rka, Quaternion& rkB);
 
 
         // spherical quadratic interpolation
         // spherical quadratic interpolation
-        static Quaternion Squad (Real fT, const Quaternion& rkP,
+        static Quaternion Squad (float fT, const Quaternion& rkP,
             const Quaternion& rkA, const Quaternion& rkB,
             const Quaternion& rkA, const Quaternion& rkB,
             const Quaternion& rkQ, bool shortestPath = false);
             const Quaternion& rkQ, bool shortestPath = false);
 
 
         // normalised linear interpolation - faster but less accurate (non-constant rotation velocity)
         // normalised linear interpolation - faster but less accurate (non-constant rotation velocity)
-        static Quaternion nlerp(Real fT, const Quaternion& rkP, 
+        static Quaternion nlerp(float fT, const Quaternion& rkP, 
             const Quaternion& rkQ, bool shortestPath = false);
             const Quaternion& rkQ, bool shortestPath = false);
 
 
         // cutoff for sine near zero
         // cutoff for sine near zero
-        static const Real ms_fEpsilon;
+        static const float ms_fEpsilon;
 
 
         // special values
         // special values
         static const Quaternion ZERO;
         static const Quaternion ZERO;
         static const Quaternion IDENTITY;
         static const Quaternion IDENTITY;
 
 
-		Real w, x, y, z;
+		float w, x, y, z;
 
 
 		/// Check whether this quaternion contains valid values
 		/// Check whether this quaternion contains valid values
 		inline bool isNaN() const
 		inline bool isNaN() const

+ 6 - 6
CamelotUtility/Include/OgreRay.h

@@ -29,7 +29,7 @@ THE SOFTWARE.
 #define __Ray_H_
 #define __Ray_H_
 
 
 // Precompiler options
 // Precompiler options
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 
 
 #include "OgreVector3.h"
 #include "OgreVector3.h"
 
 
@@ -63,12 +63,12 @@ namespace Ogre {
         const Vector3& getDirection(void) const {return mDirection;} 
         const Vector3& getDirection(void) const {return mDirection;} 
 
 
 		/** Gets the position of a point t units along the ray. */
 		/** Gets the position of a point t units along the ray. */
-		Vector3 getPoint(Real t) const { 
+		Vector3 getPoint(float t) const { 
 			return Vector3(mOrigin + (mDirection * t));
 			return Vector3(mOrigin + (mDirection * t));
 		}
 		}
 		
 		
 		/** Gets the position of a point t units along the ray. */
 		/** Gets the position of a point t units along the ray. */
-		Vector3 operator*(Real t) const { 
+		Vector3 operator*(float t) const { 
 			return getPoint(t);
 			return getPoint(t);
 		}
 		}
 
 
@@ -78,7 +78,7 @@ namespace Ogre {
 			indicate the distance along the ray at which it intersects. 
 			indicate the distance along the ray at which it intersects. 
 			This can be converted to a point in space by calling getPoint().
 			This can be converted to a point in space by calling getPoint().
 		*/
 		*/
-		std::pair<bool, Real> intersects(const Plane& p) const
+		std::pair<bool, float> intersects(const Plane& p) const
 		{
 		{
 			return Math::intersects(*this, p);
 			return Math::intersects(*this, p);
 		}
 		}
@@ -88,7 +88,7 @@ namespace Ogre {
 			indicate the distance along the ray at which it intersects. 
 			indicate the distance along the ray at which it intersects. 
 			This can be converted to a point in space by calling getPoint().
 			This can be converted to a point in space by calling getPoint().
 		*/
 		*/
-		std::pair<bool, Real> intersects(const Sphere& s) const
+		std::pair<bool, float> intersects(const Sphere& s) const
 		{
 		{
 			return Math::intersects(*this, s);
 			return Math::intersects(*this, s);
 		}
 		}
@@ -98,7 +98,7 @@ namespace Ogre {
 			indicate the distance along the ray at which it intersects. 
 			indicate the distance along the ray at which it intersects. 
 			This can be converted to a point in space by calling getPoint().
 			This can be converted to a point in space by calling getPoint().
 		*/
 		*/
-		std::pair<bool, Real> intersects(const AxisAlignedBox& box) const
+		std::pair<bool, float> intersects(const AxisAlignedBox& box) const
 		{
 		{
 			return Math::intersects(*this, box);
 			return Math::intersects(*this, box);
 		}
 		}

+ 5 - 5
CamelotUtility/Include/OgreSphere.h

@@ -29,7 +29,7 @@ THE SOFTWARE.
 #define __Sphere_H_
 #define __Sphere_H_
 
 
 // Precompiler options
 // Precompiler options
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 
 
 #include "OgreVector3.h"
 #include "OgreVector3.h"
 
 
@@ -51,7 +51,7 @@ namespace Ogre {
     class _OgreExport Sphere
     class _OgreExport Sphere
     {
     {
     protected:
     protected:
-        Real mRadius;
+        float mRadius;
         Vector3 mCenter;
         Vector3 mCenter;
     public:
     public:
         /** Standard constructor - creates a unit sphere around the origin.*/
         /** Standard constructor - creates a unit sphere around the origin.*/
@@ -60,14 +60,14 @@ namespace Ogre {
             @param center The center point of the sphere.
             @param center The center point of the sphere.
             @param radius The radius of the sphere.
             @param radius The radius of the sphere.
         */
         */
-        Sphere(const Vector3& center, Real radius)
+        Sphere(const Vector3& center, float radius)
             : mRadius(radius), mCenter(center) {}
             : mRadius(radius), mCenter(center) {}
 
 
         /** Returns the radius of the sphere. */
         /** Returns the radius of the sphere. */
-        Real getRadius(void) const { return mRadius; }
+        float getRadius(void) const { return mRadius; }
 
 
         /** Sets the radius of the sphere. */
         /** Sets the radius of the sphere. */
-        void setRadius(Real radius) { mRadius = radius; }
+        void setRadius(float radius) { mRadius = radius; }
 
 
         /** Returns the center point of the sphere. */
         /** Returns the center point of the sphere. */
         const Vector3& getCenter(void) const { return mCenter; }
         const Vector3& getCenter(void) const { return mCenter; }

+ 40 - 40
CamelotUtility/Include/OgreVector2.h

@@ -29,7 +29,7 @@ THE SOFTWARE.
 #define __Vector2_H__
 #define __Vector2_H__
 
 
 
 
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 #include "OgreMath.h"
 #include "OgreMath.h"
 
 
 namespace Ogre
 namespace Ogre
@@ -51,24 +51,24 @@ namespace Ogre
     class _OgreExport Vector2
     class _OgreExport Vector2
     {
     {
     public:
     public:
-        Real x, y;
+        float x, y;
 
 
     public:
     public:
         inline Vector2()
         inline Vector2()
         {
         {
         }
         }
 
 
-        inline Vector2(const Real fX, const Real fY )
+        inline Vector2(const float fX, const float fY )
             : x( fX ), y( fY )
             : x( fX ), y( fY )
         {
         {
         }
         }
 
 
-        inline explicit Vector2( const Real scaler )
+        inline explicit Vector2( const float scaler )
             : x( scaler), y( scaler )
             : x( scaler), y( scaler )
         {
         {
         }
         }
 
 
-        inline explicit Vector2( const Real afCoordinate[2] )
+        inline explicit Vector2( const float afCoordinate[2] )
             : x( afCoordinate[0] ),
             : x( afCoordinate[0] ),
               y( afCoordinate[1] )
               y( afCoordinate[1] )
         {
         {
@@ -76,11 +76,11 @@ namespace Ogre
 
 
         inline explicit Vector2( const int afCoordinate[2] )
         inline explicit Vector2( const int afCoordinate[2] )
         {
         {
-            x = (Real)afCoordinate[0];
-            y = (Real)afCoordinate[1];
+            x = (float)afCoordinate[0];
+            y = (float)afCoordinate[1];
         }
         }
 
 
-        inline explicit Vector2( Real* const r )
+        inline explicit Vector2( float* const r )
             : x( r[0] ), y( r[1] )
             : x( r[0] ), y( r[1] )
         {
         {
         }
         }
@@ -93,14 +93,14 @@ namespace Ogre
 			std::swap(y, other.y);
 			std::swap(y, other.y);
 		}
 		}
 
 
-		inline Real operator [] ( const size_t i ) const
+		inline float operator [] ( const size_t i ) const
         {
         {
             assert( i < 2 );
             assert( i < 2 );
 
 
             return *(&x+i);
             return *(&x+i);
         }
         }
 
 
-		inline Real& operator [] ( const size_t i )
+		inline float& operator [] ( const size_t i )
         {
         {
             assert( i < 2 );
             assert( i < 2 );
 
 
@@ -108,12 +108,12 @@ namespace Ogre
         }
         }
 
 
 		/// Pointer accessor for direct copying
 		/// Pointer accessor for direct copying
-		inline Real* ptr()
+		inline float* ptr()
 		{
 		{
 			return &x;
 			return &x;
 		}
 		}
 		/// Pointer accessor for direct copying
 		/// Pointer accessor for direct copying
-		inline const Real* ptr() const
+		inline const float* ptr() const
 		{
 		{
 			return &x;
 			return &x;
 		}
 		}
@@ -130,7 +130,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-		inline Vector2& operator = ( const Real fScalar)
+		inline Vector2& operator = ( const float fScalar)
 		{
 		{
 			x = fScalar;
 			x = fScalar;
 			y = fScalar;
 			y = fScalar;
@@ -163,7 +163,7 @@ namespace Ogre
                 y - rkVector.y);
                 y - rkVector.y);
         }
         }
 
 
-        inline Vector2 operator * ( const Real fScalar ) const
+        inline Vector2 operator * ( const float fScalar ) const
         {
         {
             return Vector2(
             return Vector2(
                 x * fScalar,
                 x * fScalar,
@@ -177,11 +177,11 @@ namespace Ogre
                 y * rhs.y);
                 y * rhs.y);
         }
         }
 
 
-        inline Vector2 operator / ( const Real fScalar ) const
+        inline Vector2 operator / ( const float fScalar ) const
         {
         {
             assert( fScalar != 0.0 );
             assert( fScalar != 0.0 );
 
 
-            Real fInv = 1.0f / fScalar;
+            float fInv = 1.0f / fScalar;
 
 
             return Vector2(
             return Vector2(
                 x * fInv,
                 x * fInv,
@@ -206,42 +206,42 @@ namespace Ogre
         }
         }
 
 
         // overloaded operators to help Vector2
         // overloaded operators to help Vector2
-        inline friend Vector2 operator * ( const Real fScalar, const Vector2& rkVector )
+        inline friend Vector2 operator * ( const float fScalar, const Vector2& rkVector )
         {
         {
             return Vector2(
             return Vector2(
                 fScalar * rkVector.x,
                 fScalar * rkVector.x,
                 fScalar * rkVector.y);
                 fScalar * rkVector.y);
         }
         }
 
 
-        inline friend Vector2 operator / ( const Real fScalar, const Vector2& rkVector )
+        inline friend Vector2 operator / ( const float fScalar, const Vector2& rkVector )
         {
         {
             return Vector2(
             return Vector2(
                 fScalar / rkVector.x,
                 fScalar / rkVector.x,
                 fScalar / rkVector.y);
                 fScalar / rkVector.y);
         }
         }
 
 
-        inline friend Vector2 operator + (const Vector2& lhs, const Real rhs)
+        inline friend Vector2 operator + (const Vector2& lhs, const float rhs)
         {
         {
             return Vector2(
             return Vector2(
                 lhs.x + rhs,
                 lhs.x + rhs,
                 lhs.y + rhs);
                 lhs.y + rhs);
         }
         }
 
 
-        inline friend Vector2 operator + (const Real lhs, const Vector2& rhs)
+        inline friend Vector2 operator + (const float lhs, const Vector2& rhs)
         {
         {
             return Vector2(
             return Vector2(
                 lhs + rhs.x,
                 lhs + rhs.x,
                 lhs + rhs.y);
                 lhs + rhs.y);
         }
         }
 
 
-        inline friend Vector2 operator - (const Vector2& lhs, const Real rhs)
+        inline friend Vector2 operator - (const Vector2& lhs, const float rhs)
         {
         {
             return Vector2(
             return Vector2(
                 lhs.x - rhs,
                 lhs.x - rhs,
                 lhs.y - rhs);
                 lhs.y - rhs);
         }
         }
 
 
-        inline friend Vector2 operator - (const Real lhs, const Vector2& rhs)
+        inline friend Vector2 operator - (const float lhs, const Vector2& rhs)
         {
         {
             return Vector2(
             return Vector2(
                 lhs - rhs.x,
                 lhs - rhs.x,
@@ -256,7 +256,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector2& operator += ( const Real fScaler )
+        inline Vector2& operator += ( const float fScaler )
         {
         {
             x += fScaler;
             x += fScaler;
             y += fScaler;
             y += fScaler;
@@ -272,7 +272,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector2& operator -= ( const Real fScaler )
+        inline Vector2& operator -= ( const float fScaler )
         {
         {
             x -= fScaler;
             x -= fScaler;
             y -= fScaler;
             y -= fScaler;
@@ -280,7 +280,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector2& operator *= ( const Real fScalar )
+        inline Vector2& operator *= ( const float fScalar )
         {
         {
             x *= fScalar;
             x *= fScalar;
             y *= fScalar;
             y *= fScalar;
@@ -296,11 +296,11 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector2& operator /= ( const Real fScalar )
+        inline Vector2& operator /= ( const float fScalar )
         {
         {
             assert( fScalar != 0.0 );
             assert( fScalar != 0.0 );
 
 
-            Real fInv = 1.0f / fScalar;
+            float fInv = 1.0f / fScalar;
 
 
             x *= fInv;
             x *= fInv;
             y *= fInv;
             y *= fInv;
@@ -323,7 +323,7 @@ namespace Ogre
                 length (e.g. for just comparing lengths) use squaredLength()
                 length (e.g. for just comparing lengths) use squaredLength()
                 instead.
                 instead.
         */
         */
-        inline Real length () const
+        inline float length () const
         {
         {
             return Math::Sqrt( x * x + y * y );
             return Math::Sqrt( x * x + y * y );
         }
         }
@@ -338,7 +338,7 @@ namespace Ogre
                 want to find the longest / shortest vector without incurring
                 want to find the longest / shortest vector without incurring
                 the square root.
                 the square root.
         */
         */
-        inline Real squaredLength () const
+        inline float squaredLength () const
         {
         {
             return x * x + y * y;
             return x * x + y * y;
         }
         }
@@ -349,7 +349,7 @@ namespace Ogre
                 distance (e.g. for just comparing distances) use squaredDistance()
                 distance (e.g. for just comparing distances) use squaredDistance()
                 instead.
                 instead.
         */
         */
-        inline Real distance(const Vector2& rhs) const
+        inline float distance(const Vector2& rhs) const
         {
         {
             return (*this - rhs).length();
             return (*this - rhs).length();
         }
         }
@@ -364,7 +364,7 @@ namespace Ogre
                 Use this if you want to find the longest / shortest distance
                 Use this if you want to find the longest / shortest distance
                 without incurring the square root.
                 without incurring the square root.
         */
         */
-        inline Real squaredDistance(const Vector2& rhs) const
+        inline float squaredDistance(const Vector2& rhs) const
         {
         {
             return (*this - rhs).squaredLength();
             return (*this - rhs).squaredLength();
         }
         }
@@ -383,7 +383,7 @@ namespace Ogre
             @returns
             @returns
                 A float representing the dot product value.
                 A float representing the dot product value.
         */
         */
-        inline Real dotProduct(const Vector2& vec) const
+        inline float dotProduct(const Vector2& vec) const
         {
         {
             return x * vec.x + y * vec.y;
             return x * vec.x + y * vec.y;
         }
         }
@@ -397,14 +397,14 @@ namespace Ogre
                 will be no changes made to their components.
                 will be no changes made to their components.
             @returns The previous length of the vector.
             @returns The previous length of the vector.
         */
         */
-        inline Real normalise()
+        inline float normalise()
         {
         {
-            Real fLength = Math::Sqrt( x * x + y * y);
+            float fLength = Math::Sqrt( x * x + y * y);
 
 
             // Will also work for zero-sized vectors, but will change nothing
             // Will also work for zero-sized vectors, but will change nothing
             if ( fLength > 1e-08 )
             if ( fLength > 1e-08 )
             {
             {
-                Real fInvLength = 1.0f / fLength;
+                float fInvLength = 1.0f / fLength;
                 x *= fInvLength;
                 x *= fInvLength;
                 y *= fInvLength;
                 y *= fInvLength;
             }
             }
@@ -484,7 +484,7 @@ namespace Ogre
         /** Calculates the 2 dimensional cross-product of 2 vectors, which results
         /** Calculates the 2 dimensional cross-product of 2 vectors, which results
 			in a single floating point value which is 2 times the area of the triangle.
 			in a single floating point value which is 2 times the area of the triangle.
         */
         */
-        inline Real crossProduct( const Vector2& rkVector ) const
+        inline float crossProduct( const Vector2& rkVector ) const
         {
         {
             return x * rkVector.y - y * rkVector.x;
             return x * rkVector.y - y * rkVector.x;
         }
         }
@@ -508,12 +508,12 @@ namespace Ogre
                 afterwards.
                 afterwards.
         */
         */
         inline Vector2 randomDeviant(
         inline Vector2 randomDeviant(
-            Real angle) const
+            float angle) const
         {
         {
 
 
             angle *=  Math::UnitRandom() * Math::TWO_PI;
             angle *=  Math::UnitRandom() * Math::TWO_PI;
-            Real cosa = cos(angle);
-            Real sina = sin(angle);
+            float cosa = cos(angle);
+            float sina = sin(angle);
             return  Vector2(cosa * x - sina * y,
             return  Vector2(cosa * x - sina * y,
                             sina * x + cosa * y);
                             sina * x + cosa * y);
         }
         }
@@ -521,7 +521,7 @@ namespace Ogre
         /** Returns true if this vector is zero length. */
         /** Returns true if this vector is zero length. */
         inline bool isZeroLength(void) const
         inline bool isZeroLength(void) const
         {
         {
-            Real sqlen = (x * x) + (y * y);
+            float sqlen = (x * x) + (y * y);
             return (sqlen < (1e-06 * 1e-06));
             return (sqlen < (1e-06 * 1e-06));
 
 
         }
         }

+ 49 - 49
CamelotUtility/Include/OgreVector3.h

@@ -28,7 +28,7 @@ THE SOFTWARE.
 #ifndef __Vector3_H__
 #ifndef __Vector3_H__
 #define __Vector3_H__
 #define __Vector3_H__
 
 
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 #include "OgreMath.h"
 #include "OgreMath.h"
 #include "OgreQuaternion.h"
 #include "OgreQuaternion.h"
 
 
@@ -51,19 +51,19 @@ namespace Ogre
     class _OgreExport Vector3
     class _OgreExport Vector3
     {
     {
     public:
     public:
-		Real x, y, z;
+		float x, y, z;
 
 
     public:
     public:
         inline Vector3()
         inline Vector3()
         {
         {
         }
         }
 
 
-        inline Vector3( const Real fX, const Real fY, const Real fZ )
+        inline Vector3( const float fX, const float fY, const float fZ )
             : x( fX ), y( fY ), z( fZ )
             : x( fX ), y( fY ), z( fZ )
         {
         {
         }
         }
 
 
-        inline explicit Vector3( const Real afCoordinate[3] )
+        inline explicit Vector3( const float afCoordinate[3] )
             : x( afCoordinate[0] ),
             : x( afCoordinate[0] ),
               y( afCoordinate[1] ),
               y( afCoordinate[1] ),
               z( afCoordinate[2] )
               z( afCoordinate[2] )
@@ -72,17 +72,17 @@ namespace Ogre
 
 
         inline explicit Vector3( const int afCoordinate[3] )
         inline explicit Vector3( const int afCoordinate[3] )
         {
         {
-            x = (Real)afCoordinate[0];
-            y = (Real)afCoordinate[1];
-            z = (Real)afCoordinate[2];
+            x = (float)afCoordinate[0];
+            y = (float)afCoordinate[1];
+            z = (float)afCoordinate[2];
         }
         }
 
 
-        inline explicit Vector3( Real* const r )
+        inline explicit Vector3( float* const r )
             : x( r[0] ), y( r[1] ), z( r[2] )
             : x( r[0] ), y( r[1] ), z( r[2] )
         {
         {
         }
         }
 
 
-        inline explicit Vector3( const Real scaler )
+        inline explicit Vector3( const float scaler )
             : x( scaler )
             : x( scaler )
             , y( scaler )
             , y( scaler )
             , z( scaler )
             , z( scaler )
@@ -99,26 +99,26 @@ namespace Ogre
 			std::swap(z, other.z);
 			std::swap(z, other.z);
 		}
 		}
 
 
-		inline Real operator [] ( const size_t i ) const
+		inline float operator [] ( const size_t i ) const
         {
         {
             assert( i < 3 );
             assert( i < 3 );
 
 
             return *(&x+i);
             return *(&x+i);
         }
         }
 
 
-		inline Real& operator [] ( const size_t i )
+		inline float& operator [] ( const size_t i )
         {
         {
             assert( i < 3 );
             assert( i < 3 );
 
 
             return *(&x+i);
             return *(&x+i);
         }
         }
 		/// Pointer accessor for direct copying
 		/// Pointer accessor for direct copying
-		inline Real* ptr()
+		inline float* ptr()
 		{
 		{
 			return &x;
 			return &x;
 		}
 		}
 		/// Pointer accessor for direct copying
 		/// Pointer accessor for direct copying
-		inline const Real* ptr() const
+		inline const float* ptr() const
 		{
 		{
 			return &x;
 			return &x;
 		}
 		}
@@ -136,7 +136,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector3& operator = ( const Real fScaler )
+        inline Vector3& operator = ( const float fScaler )
         {
         {
             x = fScaler;
             x = fScaler;
             y = fScaler;
             y = fScaler;
@@ -172,7 +172,7 @@ namespace Ogre
                 z - rkVector.z);
                 z - rkVector.z);
         }
         }
 
 
-        inline Vector3 operator * ( const Real fScalar ) const
+        inline Vector3 operator * ( const float fScalar ) const
         {
         {
             return Vector3(
             return Vector3(
                 x * fScalar,
                 x * fScalar,
@@ -188,11 +188,11 @@ namespace Ogre
                 z * rhs.z);
                 z * rhs.z);
         }
         }
 
 
-        inline Vector3 operator / ( const Real fScalar ) const
+        inline Vector3 operator / ( const float fScalar ) const
         {
         {
             assert( fScalar != 0.0 );
             assert( fScalar != 0.0 );
 
 
-            Real fInv = 1.0f / fScalar;
+            float fInv = 1.0f / fScalar;
 
 
             return Vector3(
             return Vector3(
                 x * fInv,
                 x * fInv,
@@ -219,7 +219,7 @@ namespace Ogre
         }
         }
 
 
         // overloaded operators to help Vector3
         // overloaded operators to help Vector3
-        inline friend Vector3 operator * ( const Real fScalar, const Vector3& rkVector )
+        inline friend Vector3 operator * ( const float fScalar, const Vector3& rkVector )
         {
         {
             return Vector3(
             return Vector3(
                 fScalar * rkVector.x,
                 fScalar * rkVector.x,
@@ -227,7 +227,7 @@ namespace Ogre
                 fScalar * rkVector.z);
                 fScalar * rkVector.z);
         }
         }
 
 
-        inline friend Vector3 operator / ( const Real fScalar, const Vector3& rkVector )
+        inline friend Vector3 operator / ( const float fScalar, const Vector3& rkVector )
         {
         {
             return Vector3(
             return Vector3(
                 fScalar / rkVector.x,
                 fScalar / rkVector.x,
@@ -235,7 +235,7 @@ namespace Ogre
                 fScalar / rkVector.z);
                 fScalar / rkVector.z);
         }
         }
 
 
-        inline friend Vector3 operator + (const Vector3& lhs, const Real rhs)
+        inline friend Vector3 operator + (const Vector3& lhs, const float rhs)
         {
         {
             return Vector3(
             return Vector3(
                 lhs.x + rhs,
                 lhs.x + rhs,
@@ -243,7 +243,7 @@ namespace Ogre
                 lhs.z + rhs);
                 lhs.z + rhs);
         }
         }
 
 
-        inline friend Vector3 operator + (const Real lhs, const Vector3& rhs)
+        inline friend Vector3 operator + (const float lhs, const Vector3& rhs)
         {
         {
             return Vector3(
             return Vector3(
                 lhs + rhs.x,
                 lhs + rhs.x,
@@ -251,7 +251,7 @@ namespace Ogre
                 lhs + rhs.z);
                 lhs + rhs.z);
         }
         }
 
 
-        inline friend Vector3 operator - (const Vector3& lhs, const Real rhs)
+        inline friend Vector3 operator - (const Vector3& lhs, const float rhs)
         {
         {
             return Vector3(
             return Vector3(
                 lhs.x - rhs,
                 lhs.x - rhs,
@@ -259,7 +259,7 @@ namespace Ogre
                 lhs.z - rhs);
                 lhs.z - rhs);
         }
         }
 
 
-        inline friend Vector3 operator - (const Real lhs, const Vector3& rhs)
+        inline friend Vector3 operator - (const float lhs, const Vector3& rhs)
         {
         {
             return Vector3(
             return Vector3(
                 lhs - rhs.x,
                 lhs - rhs.x,
@@ -277,7 +277,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector3& operator += ( const Real fScalar )
+        inline Vector3& operator += ( const float fScalar )
         {
         {
             x += fScalar;
             x += fScalar;
             y += fScalar;
             y += fScalar;
@@ -294,7 +294,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector3& operator -= ( const Real fScalar )
+        inline Vector3& operator -= ( const float fScalar )
         {
         {
             x -= fScalar;
             x -= fScalar;
             y -= fScalar;
             y -= fScalar;
@@ -302,7 +302,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector3& operator *= ( const Real fScalar )
+        inline Vector3& operator *= ( const float fScalar )
         {
         {
             x *= fScalar;
             x *= fScalar;
             y *= fScalar;
             y *= fScalar;
@@ -319,11 +319,11 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector3& operator /= ( const Real fScalar )
+        inline Vector3& operator /= ( const float fScalar )
         {
         {
             assert( fScalar != 0.0 );
             assert( fScalar != 0.0 );
 
 
-            Real fInv = 1.0f / fScalar;
+            float fInv = 1.0f / fScalar;
 
 
             x *= fInv;
             x *= fInv;
             y *= fInv;
             y *= fInv;
@@ -349,7 +349,7 @@ namespace Ogre
                 length (e.g. for just comparing lengths) use squaredLength()
                 length (e.g. for just comparing lengths) use squaredLength()
                 instead.
                 instead.
         */
         */
-        inline Real length () const
+        inline float length () const
         {
         {
             return Math::Sqrt( x * x + y * y + z * z );
             return Math::Sqrt( x * x + y * y + z * z );
         }
         }
@@ -364,7 +364,7 @@ namespace Ogre
                 want to find the longest / shortest vector without incurring
                 want to find the longest / shortest vector without incurring
                 the square root.
                 the square root.
         */
         */
-        inline Real squaredLength () const
+        inline float squaredLength () const
         {
         {
             return x * x + y * y + z * z;
             return x * x + y * y + z * z;
         }
         }
@@ -376,7 +376,7 @@ namespace Ogre
                 distance (e.g. for just comparing distances) use squaredDistance()
                 distance (e.g. for just comparing distances) use squaredDistance()
                 instead.
                 instead.
         */
         */
-        inline Real distance(const Vector3& rhs) const
+        inline float distance(const Vector3& rhs) const
         {
         {
             return (*this - rhs).length();
             return (*this - rhs).length();
         }
         }
@@ -391,7 +391,7 @@ namespace Ogre
                 Use this if you want to find the longest / shortest distance
                 Use this if you want to find the longest / shortest distance
                 without incurring the square root.
                 without incurring the square root.
         */
         */
-        inline Real squaredDistance(const Vector3& rhs) const
+        inline float squaredDistance(const Vector3& rhs) const
         {
         {
             return (*this - rhs).squaredLength();
             return (*this - rhs).squaredLength();
         }
         }
@@ -410,7 +410,7 @@ namespace Ogre
             @returns
             @returns
                 A float representing the dot product value.
                 A float representing the dot product value.
         */
         */
-        inline Real dotProduct(const Vector3& vec) const
+        inline float dotProduct(const Vector3& vec) const
         {
         {
             return x * vec.x + y * vec.y + z * vec.z;
             return x * vec.x + y * vec.y + z * vec.z;
         }
         }
@@ -423,9 +423,9 @@ namespace Ogre
                 vec Vector with which to calculate the absolute dot product (together
                 vec Vector with which to calculate the absolute dot product (together
                 with this one).
                 with this one).
             @returns
             @returns
-                A Real representing the absolute dot product value.
+                A float representing the absolute dot product value.
         */
         */
-        inline Real absDotProduct(const Vector3& vec) const
+        inline float absDotProduct(const Vector3& vec) const
         {
         {
             return Math::Abs(x * vec.x) + Math::Abs(y * vec.y) + Math::Abs(z * vec.z);
             return Math::Abs(x * vec.x) + Math::Abs(y * vec.y) + Math::Abs(z * vec.z);
         }
         }
@@ -439,14 +439,14 @@ namespace Ogre
                 will be no changes made to their components.
                 will be no changes made to their components.
             @returns The previous length of the vector.
             @returns The previous length of the vector.
         */
         */
-        inline Real normalise()
+        inline float normalise()
         {
         {
-            Real fLength = Math::Sqrt( x * x + y * y + z * z );
+            float fLength = Math::Sqrt( x * x + y * y + z * z );
 
 
             // Will also work for zero-sized vectors, but will change nothing
             // Will also work for zero-sized vectors, but will change nothing
             if ( fLength > 1e-08 )
             if ( fLength > 1e-08 )
             {
             {
-                Real fInvLength = 1.0f / fLength;
+                float fInvLength = 1.0f / fLength;
                 x *= fInvLength;
                 x *= fInvLength;
                 y *= fInvLength;
                 y *= fInvLength;
                 z *= fInvLength;
                 z *= fInvLength;
@@ -559,7 +559,7 @@ namespace Ogre
         */
         */
         inline Vector3 perpendicular(void) const
         inline Vector3 perpendicular(void) const
         {
         {
-            static const Real fSquareZero = (Real)(1e-06 * 1e-06);
+            static const float fSquareZero = (float)(1e-06 * 1e-06);
 
 
             Vector3 perp = this->crossProduct( Vector3::UNIT_X );
             Vector3 perp = this->crossProduct( Vector3::UNIT_X );
 
 
@@ -626,15 +626,15 @@ namespace Ogre
 		*/
 		*/
 		inline Radian angleBetween(const Vector3& dest)
 		inline Radian angleBetween(const Vector3& dest)
 		{
 		{
-			Real lenProduct = length() * dest.length();
+			float lenProduct = length() * dest.length();
 
 
 			// Divide by zero check
 			// Divide by zero check
 			if(lenProduct < 1e-6f)
 			if(lenProduct < 1e-6f)
 				lenProduct = 1e-6f;
 				lenProduct = 1e-6f;
 
 
-			Real f = dotProduct(dest) / lenProduct;
+			float f = dotProduct(dest) / lenProduct;
 
 
-			f = Math::Clamp(f, (Real)-1.0, (Real)1.0);
+			f = Math::Clamp(f, (float)-1.0, (float)1.0);
 			return Math::ACos(f);
 			return Math::ACos(f);
 
 
 		}
 		}
@@ -657,7 +657,7 @@ namespace Ogre
             v0.normalise();
             v0.normalise();
             v1.normalise();
             v1.normalise();
 
 
-            Real d = v0.dotProduct(v1);
+            float d = v0.dotProduct(v1);
             // If dot == 1, vectors are the same
             // If dot == 1, vectors are the same
             if (d >= 1.0f)
             if (d >= 1.0f)
             {
             {
@@ -682,8 +682,8 @@ namespace Ogre
 			}
 			}
 			else
 			else
 			{
 			{
-                Real s = Math::Sqrt( (1+d)*2 );
-	            Real invs = 1 / s;
+                float s = Math::Sqrt( (1+d)*2 );
+	            float invs = 1 / s;
 
 
 				Vector3 c = v0.crossProduct(v1);
 				Vector3 c = v0.crossProduct(v1);
 
 
@@ -699,7 +699,7 @@ namespace Ogre
         /** Returns true if this vector is zero length. */
         /** Returns true if this vector is zero length. */
         inline bool isZeroLength(void) const
         inline bool isZeroLength(void) const
         {
         {
-            Real sqlen = (x * x) + (y * y) + (z * z);
+            float sqlen = (x * x) + (y * y) + (z * z);
             return (sqlen < (1e-06 * 1e-06));
             return (sqlen < (1e-06 * 1e-06));
 
 
         }
         }
@@ -727,7 +727,7 @@ namespace Ogre
 		@param tolerance The amount that each element of the vector may vary by
 		@param tolerance The amount that each element of the vector may vary by
 			and still be considered equal
 			and still be considered equal
 		*/
 		*/
-		inline bool positionEquals(const Vector3& rhs, Real tolerance = 1e-03) const
+		inline bool positionEquals(const Vector3& rhs, float tolerance = 1e-03) const
 		{
 		{
 			return Math::RealEqual(x, rhs.x, tolerance) &&
 			return Math::RealEqual(x, rhs.x, tolerance) &&
 				Math::RealEqual(y, rhs.y, tolerance) &&
 				Math::RealEqual(y, rhs.y, tolerance) &&
@@ -741,7 +741,7 @@ namespace Ogre
 		@param tolerance The amount (related to the scale of vectors) that distance
 		@param tolerance The amount (related to the scale of vectors) that distance
             of the vector may vary by and still be considered close
             of the vector may vary by and still be considered close
 		*/
 		*/
-		inline bool positionCloses(const Vector3& rhs, Real tolerance = 1e-03f) const
+		inline bool positionCloses(const Vector3& rhs, float tolerance = 1e-03f) const
 		{
 		{
 			return squaredDistance(rhs) <=
 			return squaredDistance(rhs) <=
                 (squaredLength() + rhs.squaredLength()) * tolerance;
                 (squaredLength() + rhs.squaredLength()) * tolerance;
@@ -757,7 +757,7 @@ namespace Ogre
 		inline bool directionEquals(const Vector3& rhs,
 		inline bool directionEquals(const Vector3& rhs,
 			const Radian& tolerance) const
 			const Radian& tolerance) const
 		{
 		{
-			Real dot = dotProduct(rhs);
+			float dot = dotProduct(rhs);
 			Radian angle = Math::ACos(dot);
 			Radian angle = Math::ACos(dot);
 
 
 			return Math::Abs(angle.valueRadians()) <= tolerance.valueRadians();
 			return Math::Abs(angle.valueRadians()) <= tolerance.valueRadians();

+ 30 - 30
CamelotUtility/Include/OgreVector4.h

@@ -28,7 +28,7 @@ THE SOFTWARE.
 #ifndef __Vector4_H__
 #ifndef __Vector4_H__
 #define __Vector4_H__
 #define __Vector4_H__
 
 
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 #include "OgreVector3.h"
 #include "OgreVector3.h"
 
 
 namespace Ogre
 namespace Ogre
@@ -45,19 +45,19 @@ namespace Ogre
     class _OgreExport Vector4
     class _OgreExport Vector4
     {
     {
     public:
     public:
-        Real x, y, z, w;
+        float x, y, z, w;
 
 
     public:
     public:
         inline Vector4()
         inline Vector4()
         {
         {
         }
         }
 
 
-        inline Vector4( const Real fX, const Real fY, const Real fZ, const Real fW )
+        inline Vector4( const float fX, const float fY, const float fZ, const float fW )
             : x( fX ), y( fY ), z( fZ ), w( fW)
             : x( fX ), y( fY ), z( fZ ), w( fW)
         {
         {
         }
         }
 
 
-        inline explicit Vector4( const Real afCoordinate[4] )
+        inline explicit Vector4( const float afCoordinate[4] )
             : x( afCoordinate[0] ),
             : x( afCoordinate[0] ),
               y( afCoordinate[1] ),
               y( afCoordinate[1] ),
               z( afCoordinate[2] ),
               z( afCoordinate[2] ),
@@ -67,18 +67,18 @@ namespace Ogre
 
 
         inline explicit Vector4( const int afCoordinate[4] )
         inline explicit Vector4( const int afCoordinate[4] )
         {
         {
-            x = (Real)afCoordinate[0];
-            y = (Real)afCoordinate[1];
-            z = (Real)afCoordinate[2];
-            w = (Real)afCoordinate[3];
+            x = (float)afCoordinate[0];
+            y = (float)afCoordinate[1];
+            z = (float)afCoordinate[2];
+            w = (float)afCoordinate[3];
         }
         }
 
 
-        inline explicit Vector4( Real* const r )
+        inline explicit Vector4( float* const r )
             : x( r[0] ), y( r[1] ), z( r[2] ), w( r[3] )
             : x( r[0] ), y( r[1] ), z( r[2] ), w( r[3] )
         {
         {
         }
         }
 
 
-        inline explicit Vector4( const Real scaler )
+        inline explicit Vector4( const float scaler )
             : x( scaler )
             : x( scaler )
             , y( scaler )
             , y( scaler )
             , z( scaler )
             , z( scaler )
@@ -101,14 +101,14 @@ namespace Ogre
 			std::swap(w, other.w);
 			std::swap(w, other.w);
 		}
 		}
 	
 	
-		inline Real operator [] ( const size_t i ) const
+		inline float operator [] ( const size_t i ) const
         {
         {
             assert( i < 4 );
             assert( i < 4 );
 
 
             return *(&x+i);
             return *(&x+i);
         }
         }
 
 
-		inline Real& operator [] ( const size_t i )
+		inline float& operator [] ( const size_t i )
         {
         {
             assert( i < 4 );
             assert( i < 4 );
 
 
@@ -116,12 +116,12 @@ namespace Ogre
         }
         }
 
 
 		/// Pointer accessor for direct copying
 		/// Pointer accessor for direct copying
-		inline Real* ptr()
+		inline float* ptr()
 		{
 		{
 			return &x;
 			return &x;
 		}
 		}
 		/// Pointer accessor for direct copying
 		/// Pointer accessor for direct copying
-		inline const Real* ptr() const
+		inline const float* ptr() const
 		{
 		{
 			return &x;
 			return &x;
 		}
 		}
@@ -140,7 +140,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-		inline Vector4& operator = ( const Real fScalar)
+		inline Vector4& operator = ( const float fScalar)
 		{
 		{
 			x = fScalar;
 			x = fScalar;
 			y = fScalar;
 			y = fScalar;
@@ -193,7 +193,7 @@ namespace Ogre
                 w - rkVector.w);
                 w - rkVector.w);
         }
         }
 
 
-        inline Vector4 operator * ( const Real fScalar ) const
+        inline Vector4 operator * ( const float fScalar ) const
         {
         {
             return Vector4(
             return Vector4(
                 x * fScalar,
                 x * fScalar,
@@ -211,11 +211,11 @@ namespace Ogre
                 rhs.w * w);
                 rhs.w * w);
         }
         }
 
 
-        inline Vector4 operator / ( const Real fScalar ) const
+        inline Vector4 operator / ( const float fScalar ) const
         {
         {
             assert( fScalar != 0.0 );
             assert( fScalar != 0.0 );
 
 
-            Real fInv = 1.0f / fScalar;
+            float fInv = 1.0f / fScalar;
 
 
             return Vector4(
             return Vector4(
                 x * fInv,
                 x * fInv,
@@ -243,7 +243,7 @@ namespace Ogre
             return Vector4(-x, -y, -z, -w);
             return Vector4(-x, -y, -z, -w);
         }
         }
 
 
-        inline friend Vector4 operator * ( const Real fScalar, const Vector4& rkVector )
+        inline friend Vector4 operator * ( const float fScalar, const Vector4& rkVector )
         {
         {
             return Vector4(
             return Vector4(
                 fScalar * rkVector.x,
                 fScalar * rkVector.x,
@@ -252,7 +252,7 @@ namespace Ogre
                 fScalar * rkVector.w);
                 fScalar * rkVector.w);
         }
         }
 
 
-        inline friend Vector4 operator / ( const Real fScalar, const Vector4& rkVector )
+        inline friend Vector4 operator / ( const float fScalar, const Vector4& rkVector )
         {
         {
             return Vector4(
             return Vector4(
                 fScalar / rkVector.x,
                 fScalar / rkVector.x,
@@ -261,7 +261,7 @@ namespace Ogre
                 fScalar / rkVector.w);
                 fScalar / rkVector.w);
         }
         }
 
 
-        inline friend Vector4 operator + (const Vector4& lhs, const Real rhs)
+        inline friend Vector4 operator + (const Vector4& lhs, const float rhs)
         {
         {
             return Vector4(
             return Vector4(
                 lhs.x + rhs,
                 lhs.x + rhs,
@@ -270,7 +270,7 @@ namespace Ogre
                 lhs.w + rhs);
                 lhs.w + rhs);
         }
         }
 
 
-        inline friend Vector4 operator + (const Real lhs, const Vector4& rhs)
+        inline friend Vector4 operator + (const float lhs, const Vector4& rhs)
         {
         {
             return Vector4(
             return Vector4(
                 lhs + rhs.x,
                 lhs + rhs.x,
@@ -279,7 +279,7 @@ namespace Ogre
                 lhs + rhs.w);
                 lhs + rhs.w);
         }
         }
 
 
-        inline friend Vector4 operator - (const Vector4& lhs, Real rhs)
+        inline friend Vector4 operator - (const Vector4& lhs, float rhs)
         {
         {
             return Vector4(
             return Vector4(
                 lhs.x - rhs,
                 lhs.x - rhs,
@@ -288,7 +288,7 @@ namespace Ogre
                 lhs.w - rhs);
                 lhs.w - rhs);
         }
         }
 
 
-        inline friend Vector4 operator - (const Real lhs, const Vector4& rhs)
+        inline friend Vector4 operator - (const float lhs, const Vector4& rhs)
         {
         {
             return Vector4(
             return Vector4(
                 lhs - rhs.x,
                 lhs - rhs.x,
@@ -318,7 +318,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector4& operator *= ( const Real fScalar )
+        inline Vector4& operator *= ( const float fScalar )
         {
         {
             x *= fScalar;
             x *= fScalar;
             y *= fScalar;
             y *= fScalar;
@@ -327,7 +327,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector4& operator += ( const Real fScalar )
+        inline Vector4& operator += ( const float fScalar )
         {
         {
             x += fScalar;
             x += fScalar;
             y += fScalar;
             y += fScalar;
@@ -336,7 +336,7 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector4& operator -= ( const Real fScalar )
+        inline Vector4& operator -= ( const float fScalar )
         {
         {
             x -= fScalar;
             x -= fScalar;
             y -= fScalar;
             y -= fScalar;
@@ -355,11 +355,11 @@ namespace Ogre
             return *this;
             return *this;
         }
         }
 
 
-        inline Vector4& operator /= ( const Real fScalar )
+        inline Vector4& operator /= ( const float fScalar )
         {
         {
             assert( fScalar != 0.0 );
             assert( fScalar != 0.0 );
 
 
-            Real fInv = 1.0f / fScalar;
+            float fInv = 1.0f / fScalar;
 
 
             x *= fInv;
             x *= fInv;
             y *= fInv;
             y *= fInv;
@@ -386,7 +386,7 @@ namespace Ogre
             @returns
             @returns
                 A float representing the dot product value.
                 A float representing the dot product value.
         */
         */
-        inline Real dotProduct(const Vector4& vec) const
+        inline float dotProduct(const Vector4& vec) const
         {
         {
             return x * vec.x + y * vec.y + z * vec.z + w * vec.w;
             return x * vec.x + y * vec.y + z * vec.z + w * vec.w;
         }
         }

+ 1 - 1
CamelotUtility/Include/asm_math.h

@@ -1,7 +1,7 @@
 #ifndef __asm_math_H__
 #ifndef __asm_math_H__
 #define __asm_math_H__
 #define __asm_math_H__
 
 
-#include "OgrePrerequisites.h"
+#include "CmUtilPrerequisites.h"
 
 
 #if  OGRE_COMPILER == OGRE_COMPILER_MSVC
 #if  OGRE_COMPILER == OGRE_COMPILER_MSVC
 #  pragma warning (push)
 #  pragma warning (push)

+ 108 - 108
CamelotUtility/Source/OgreMath.cpp

@@ -39,21 +39,21 @@ THE SOFTWARE.
 namespace Ogre
 namespace Ogre
 {
 {
 
 
-    const Real Math::POS_INFINITY = std::numeric_limits<Real>::infinity();
-    const Real Math::NEG_INFINITY = -std::numeric_limits<Real>::infinity();
-    const Real Math::PI = Real( 4.0 * atan( 1.0 ) );
-    const Real Math::TWO_PI = Real( 2.0 * PI );
-    const Real Math::HALF_PI = Real( 0.5 * PI );
-	const Real Math::fDeg2Rad = PI / Real(180.0);
-	const Real Math::fRad2Deg = Real(180.0) / PI;
-	const Real Math::LOG2 = log(Real(2.0));
+    const float Math::POS_INFINITY = std::numeric_limits<float>::infinity();
+    const float Math::NEG_INFINITY = -std::numeric_limits<float>::infinity();
+    const float Math::PI = float( 4.0 * atan( 1.0 ) );
+    const float Math::TWO_PI = float( 2.0 * PI );
+    const float Math::HALF_PI = float( 0.5 * PI );
+	const float Math::fDeg2Rad = PI / float(180.0);
+	const float Math::fRad2Deg = float(180.0) / PI;
+	const float Math::LOG2 = log(float(2.0));
 
 
     int Math::mTrigTableSize;
     int Math::mTrigTableSize;
    Math::AngleUnit Math::msAngleUnit;
    Math::AngleUnit Math::msAngleUnit;
 
 
-    Real  Math::mTrigTableFactor;
-    Real *Math::mSinTable = NULL;
-    Real *Math::mTanTable = NULL;
+    float  Math::mTrigTableFactor;
+    float *Math::mSinTable = NULL;
+    float *Math::mTanTable = NULL;
 
 
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     Math::Math( unsigned int trigTableSize )
     Math::Math( unsigned int trigTableSize )
@@ -63,8 +63,8 @@ namespace Ogre
         mTrigTableSize = trigTableSize;
         mTrigTableSize = trigTableSize;
         mTrigTableFactor = mTrigTableSize / Math::TWO_PI;
         mTrigTableFactor = mTrigTableSize / Math::TWO_PI;
 
 
-        mSinTable = OGRE_ALLOC_T(Real, mTrigTableSize, MEMCATEGORY_GENERAL);
-        mTanTable = OGRE_ALLOC_T(Real, mTrigTableSize, MEMCATEGORY_GENERAL);
+        mSinTable = (float*)malloc(sizeof(float) * mTrigTableSize);
+        mTanTable = (float*)malloc(sizeof(float) * mTrigTableSize);
 
 
         buildTrigTables();
         buildTrigTables();
     }
     }
@@ -72,8 +72,8 @@ namespace Ogre
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     Math::~Math()
     Math::~Math()
     {
     {
-        OGRE_FREE(mSinTable, MEMCATEGORY_GENERAL);
-        OGRE_FREE(mTanTable, MEMCATEGORY_GENERAL);
+        free(mSinTable);
+        free(mTanTable);
     }
     }
 
 
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
@@ -83,7 +83,7 @@ namespace Ogre
         // Could get away with building only PI sized Sin table but simpler this 
         // Could get away with building only PI sized Sin table but simpler this 
         // way. Who cares, it'll ony use an extra 8k of memory anyway and I like 
         // way. Who cares, it'll ony use an extra 8k of memory anyway and I like 
         // simplicity.
         // simplicity.
-        Real angle;
+        float angle;
         for (int i = 0; i < mTrigTableSize; ++i)
         for (int i = 0; i < mTrigTableSize; ++i)
         {
         {
             angle = Math::TWO_PI * i / mTrigTableSize;
             angle = Math::TWO_PI * i / mTrigTableSize;
@@ -92,7 +92,7 @@ namespace Ogre
         }
         }
     }
     }
 	//-----------------------------------------------------------------------	
 	//-----------------------------------------------------------------------	
-	Real Math::SinTable (Real fValue)
+	float Math::SinTable (float fValue)
     {
     {
         // Convert range to index values, wrap if required
         // Convert range to index values, wrap if required
         int idx;
         int idx;
@@ -108,7 +108,7 @@ namespace Ogre
         return mSinTable[idx];
         return mSinTable[idx];
     }
     }
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-	Real Math::TanTable (Real fValue)
+	float Math::TanTable (float fValue)
     {
     {
         // Convert range to index values, wrap if required
         // Convert range to index values, wrap if required
 		int idx = int(fValue *= mTrigTableFactor) % mTrigTableSize;
 		int idx = int(fValue *= mTrigTableFactor) % mTrigTableSize;
@@ -120,7 +120,7 @@ namespace Ogre
         return ( iValue > 0 ? +1 : ( iValue < 0 ? -1 : 0 ) );
         return ( iValue > 0 ? +1 : ( iValue < 0 ? -1 : 0 ) );
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Radian Math::ACos (Real fValue)
+    Radian Math::ACos (float fValue)
     {
     {
         if ( -1.0 < fValue )
         if ( -1.0 < fValue )
         {
         {
@@ -135,7 +135,7 @@ namespace Ogre
         }
         }
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Radian Math::ASin (Real fValue)
+    Radian Math::ASin (float fValue)
     {
     {
         if ( -1.0 < fValue )
         if ( -1.0 < fValue )
         {
         {
@@ -150,7 +150,7 @@ namespace Ogre
         }
         }
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Math::Sign (Real fValue)
+    float Math::Sign (float fValue)
     {
     {
         if ( fValue > 0.0 )
         if ( fValue > 0.0 )
             return 1.0;
             return 1.0;
@@ -161,24 +161,24 @@ namespace Ogre
         return 0.0;
         return 0.0;
     }
     }
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-	Real Math::InvSqrt(Real fValue)
+	float Math::InvSqrt(float fValue)
 	{
 	{
-		return Real(asm_rsq(fValue));
+		return float(asm_rsq(fValue));
 	}
 	}
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Math::UnitRandom ()
+    float Math::UnitRandom ()
     {
     {
         return asm_rand() / asm_rand_max();
         return asm_rand() / asm_rand_max();
     }
     }
     
     
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Math::RangeRandom (Real fLow, Real fHigh)
+    float Math::RangeRandom (float fLow, float fHigh)
     {
     {
         return (fHigh-fLow)*UnitRandom() + fLow;
         return (fHigh-fLow)*UnitRandom() + fLow;
     }
     }
 
 
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Math::SymmetricRandom ()
+    float Math::SymmetricRandom ()
     {
     {
 		return 2.0f * UnitRandom() - 1.0f;
 		return 2.0f * UnitRandom() - 1.0f;
     }
     }
@@ -194,7 +194,7 @@ namespace Ogre
        return msAngleUnit;
        return msAngleUnit;
    }
    }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Math::AngleUnitsToRadians(Real angleunits)
+    float Math::AngleUnitsToRadians(float angleunits)
     {
     {
        if (msAngleUnit == AU_DEGREE)
        if (msAngleUnit == AU_DEGREE)
            return angleunits * fDeg2Rad;
            return angleunits * fDeg2Rad;
@@ -203,7 +203,7 @@ namespace Ogre
     }
     }
 
 
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Math::RadiansToAngleUnits(Real radians)
+    float Math::RadiansToAngleUnits(float radians)
     {
     {
        if (msAngleUnit == AU_DEGREE)
        if (msAngleUnit == AU_DEGREE)
            return radians * fRad2Deg;
            return radians * fRad2Deg;
@@ -212,7 +212,7 @@ namespace Ogre
     }
     }
 
 
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Math::AngleUnitsToDegrees(Real angleunits)
+    float Math::AngleUnitsToDegrees(float angleunits)
     {
     {
        if (msAngleUnit == AU_RADIAN)
        if (msAngleUnit == AU_RADIAN)
            return angleunits * fRad2Deg;
            return angleunits * fRad2Deg;
@@ -221,7 +221,7 @@ namespace Ogre
     }
     }
 
 
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Math::DegreesToAngleUnits(Real degrees)
+    float Math::DegreesToAngleUnits(float degrees)
     {
     {
        if (msAngleUnit == AU_RADIAN)
        if (msAngleUnit == AU_RADIAN)
            return degrees * fDeg2Rad;
            return degrees * fDeg2Rad;
@@ -235,7 +235,7 @@ namespace Ogre
     {
     {
 		// Winding must be consistent from all edges for point to be inside
 		// Winding must be consistent from all edges for point to be inside
 		Vector2 v1, v2;
 		Vector2 v1, v2;
-		Real dot[3];
+		float dot[3];
 		bool zeroDot[3];
 		bool zeroDot[3];
 
 
 		v1 = b - a;
 		v1 = b - a;
@@ -283,7 +283,7 @@ namespace Ogre
 	{
 	{
         // Winding must be consistent from all edges for point to be inside
         // Winding must be consistent from all edges for point to be inside
 		Vector3 v1, v2;
 		Vector3 v1, v2;
-		Real dot[3];
+		float dot[3];
 		bool zeroDot[3];
 		bool zeroDot[3];
 
 
         v1 = b - a;
         v1 = b - a;
@@ -326,7 +326,7 @@ namespace Ogre
         return true;
         return true;
 	}
 	}
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    bool Math::RealEqual( Real a, Real b, Real tolerance )
+    bool Math::RealEqual( float a, float b, float tolerance )
     {
     {
         if (fabs(b-a) <= tolerance)
         if (fabs(b-a) <= tolerance)
             return true;
             return true;
@@ -335,25 +335,25 @@ namespace Ogre
     }
     }
 
 
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    std::pair<bool, Real> Math::intersects(const Ray& ray, const Plane& plane)
+    std::pair<bool, float> Math::intersects(const Ray& ray, const Plane& plane)
     {
     {
 
 
-        Real denom = plane.normal.dotProduct(ray.getDirection());
-        if (Math::Abs(denom) < std::numeric_limits<Real>::epsilon())
+        float denom = plane.normal.dotProduct(ray.getDirection());
+        if (Math::Abs(denom) < std::numeric_limits<float>::epsilon())
         {
         {
             // Parallel
             // Parallel
-            return std::pair<bool, Real>(false, 0);
+            return std::pair<bool, float>(false, 0);
         }
         }
         else
         else
         {
         {
-            Real nom = plane.normal.dotProduct(ray.getOrigin()) + plane.d;
-            Real t = -(nom/denom);
-            return std::pair<bool, Real>(t >= 0, t);
+            float nom = plane.normal.dotProduct(ray.getOrigin()) + plane.d;
+            float t = -(nom/denom);
+            return std::pair<bool, float>(t >= 0, t);
         }
         }
         
         
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    std::pair<bool, Real> Math::intersects(const Ray& ray, 
+    std::pair<bool, float> Math::intersects(const Ray& ray, 
         const vector<Plane>::type& planes, bool normalIsOutside)
         const vector<Plane>::type& planes, bool normalIsOutside)
     {
     {
 		list<Plane>::type planesList;
 		list<Plane>::type planesList;
@@ -364,14 +364,14 @@ namespace Ogre
 		return intersects(ray, planesList, normalIsOutside);
 		return intersects(ray, planesList, normalIsOutside);
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    std::pair<bool, Real> Math::intersects(const Ray& ray, 
+    std::pair<bool, float> Math::intersects(const Ray& ray, 
         const list<Plane>::type& planes, bool normalIsOutside)
         const list<Plane>::type& planes, bool normalIsOutside)
     {
     {
 		list<Plane>::type::const_iterator planeit, planeitend;
 		list<Plane>::type::const_iterator planeit, planeitend;
 		planeitend = planes.end();
 		planeitend = planes.end();
 		bool allInside = true;
 		bool allInside = true;
-		std::pair<bool, Real> ret;
-		std::pair<bool, Real> end;
+		std::pair<bool, float> ret;
+		std::pair<bool, float> end;
 		ret.first = false;
 		ret.first = false;
 		ret.second = 0.0f;
 		ret.second = 0.0f;
 		end.first = false;
 		end.first = false;
@@ -391,7 +391,7 @@ namespace Ogre
 			{
 			{
 				allInside = false;
 				allInside = false;
 				// Test single plane
 				// Test single plane
-				std::pair<bool, Real> planeRes = 
+				std::pair<bool, float> planeRes = 
 					ray.intersects(plane);
 					ray.intersects(plane);
 				if (planeRes.first)
 				if (planeRes.first)
 				{
 				{
@@ -409,7 +409,7 @@ namespace Ogre
 			}
 			}
 			else
 			else
 			{
 			{
-				std::pair<bool, Real> planeRes = 
+				std::pair<bool, float> planeRes = 
 					ray.intersects(plane);
 					ray.intersects(plane);
 				if (planeRes.first)
 				if (planeRes.first)
 				{
 				{
@@ -447,55 +447,55 @@ namespace Ogre
 		return ret;
 		return ret;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    std::pair<bool, Real> Math::intersects(const Ray& ray, const Sphere& sphere, 
+    std::pair<bool, float> Math::intersects(const Ray& ray, const Sphere& sphere, 
         bool discardInside)
         bool discardInside)
     {
     {
         const Vector3& raydir = ray.getDirection();
         const Vector3& raydir = ray.getDirection();
         // Adjust ray origin relative to sphere center
         // Adjust ray origin relative to sphere center
         const Vector3& rayorig = ray.getOrigin() - sphere.getCenter();
         const Vector3& rayorig = ray.getOrigin() - sphere.getCenter();
-        Real radius = sphere.getRadius();
+        float radius = sphere.getRadius();
 
 
         // Check origin inside first
         // Check origin inside first
         if (rayorig.squaredLength() <= radius*radius && discardInside)
         if (rayorig.squaredLength() <= radius*radius && discardInside)
         {
         {
-            return std::pair<bool, Real>(true, 0);
+            return std::pair<bool, float>(true, 0);
         }
         }
 
 
         // Mmm, quadratics
         // Mmm, quadratics
         // Build coeffs which can be used with std quadratic solver
         // Build coeffs which can be used with std quadratic solver
         // ie t = (-b +/- sqrt(b*b + 4ac)) / 2a
         // ie t = (-b +/- sqrt(b*b + 4ac)) / 2a
-        Real a = raydir.dotProduct(raydir);
-        Real b = 2 * rayorig.dotProduct(raydir);
-        Real c = rayorig.dotProduct(rayorig) - radius*radius;
+        float a = raydir.dotProduct(raydir);
+        float b = 2 * rayorig.dotProduct(raydir);
+        float c = rayorig.dotProduct(rayorig) - radius*radius;
 
 
         // Calc determinant
         // Calc determinant
-        Real d = (b*b) - (4 * a * c);
+        float d = (b*b) - (4 * a * c);
         if (d < 0)
         if (d < 0)
         {
         {
             // No intersection
             // No intersection
-            return std::pair<bool, Real>(false, 0);
+            return std::pair<bool, float>(false, 0);
         }
         }
         else
         else
         {
         {
             // BTW, if d=0 there is one intersection, if d > 0 there are 2
             // BTW, if d=0 there is one intersection, if d > 0 there are 2
             // But we only want the closest one, so that's ok, just use the 
             // But we only want the closest one, so that's ok, just use the 
             // '-' version of the solver
             // '-' version of the solver
-            Real t = ( -b - Math::Sqrt(d) ) / (2 * a);
+            float t = ( -b - Math::Sqrt(d) ) / (2 * a);
             if (t < 0)
             if (t < 0)
                 t = ( -b + Math::Sqrt(d) ) / (2 * a);
                 t = ( -b + Math::Sqrt(d) ) / (2 * a);
-            return std::pair<bool, Real>(true, t);
+            return std::pair<bool, float>(true, t);
         }
         }
 
 
 
 
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-	std::pair<bool, Real> Math::intersects(const Ray& ray, const AxisAlignedBox& box)
+	std::pair<bool, float> Math::intersects(const Ray& ray, const AxisAlignedBox& box)
 	{
 	{
-		if (box.isNull()) return std::pair<bool, Real>(false, 0);
-		if (box.isInfinite()) return std::pair<bool, Real>(true, 0);
+		if (box.isNull()) return std::pair<bool, float>(false, 0);
+		if (box.isInfinite()) return std::pair<bool, float>(true, 0);
 
 
-		Real lowt = 0.0f;
-		Real t;
+		float lowt = 0.0f;
+		float t;
 		bool hit = false;
 		bool hit = false;
 		Vector3 hitpoint;
 		Vector3 hitpoint;
 		const Vector3& min = box.getMinimum();
 		const Vector3& min = box.getMinimum();
@@ -506,7 +506,7 @@ namespace Ogre
 		// Check origin inside first
 		// Check origin inside first
 		if ( rayorig > min && rayorig < max )
 		if ( rayorig > min && rayorig < max )
 		{
 		{
-			return std::pair<bool, Real>(true, 0);
+			return std::pair<bool, float>(true, 0);
 		}
 		}
 
 
 		// Check each face in turn, only check closest 3
 		// Check each face in turn, only check closest 3
@@ -613,12 +613,12 @@ namespace Ogre
 			}
 			}
 		}
 		}
 
 
-		return std::pair<bool, Real>(hit, lowt);
+		return std::pair<bool, float>(hit, lowt);
 
 
 	} 
 	} 
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     bool Math::intersects(const Ray& ray, const AxisAlignedBox& box,
     bool Math::intersects(const Ray& ray, const AxisAlignedBox& box,
-        Real* d1, Real* d2)
+        float* d1, float* d2)
     {
     {
         if (box.isNull())
         if (box.isNull())
             return false;
             return false;
@@ -658,13 +658,13 @@ namespace Ogre
             imax = 1;
             imax = 1;
         }
         }
 
 
-        Real start = 0, end = Math::POS_INFINITY;
+        float start = 0, end = Math::POS_INFINITY;
 
 
 #define _CALC_AXIS(i)                                       \
 #define _CALC_AXIS(i)                                       \
     do {                                                    \
     do {                                                    \
-        Real denom = 1 / raydir[i];                         \
-        Real newstart = (min[i] - rayorig[i]) * denom;      \
-        Real newend = (max[i] - rayorig[i]) * denom;        \
+        float denom = 1 / raydir[i];                         \
+        float newstart = (min[i] - rayorig[i]) * denom;      \
+        float newend = (max[i] - rayorig[i]) * denom;        \
         if (newstart > newend) std::swap(newstart, newend); \
         if (newstart > newend) std::swap(newstart, newend); \
         if (newstart > end || newend < start) return false; \
         if (newstart > end || newend < start) return false; \
         if (newstart > start) start = newstart;             \
         if (newstart > start) start = newstart;             \
@@ -675,7 +675,7 @@ namespace Ogre
 
 
         _CALC_AXIS(imax);
         _CALC_AXIS(imax);
 
 
-        if (absDir[imid] < std::numeric_limits<Real>::epsilon())
+        if (absDir[imid] < std::numeric_limits<float>::epsilon())
         {
         {
             // Parallel with middle and minimise axis, check bounds only
             // Parallel with middle and minimise axis, check bounds only
             if (rayorig[imid] < min[imid] || rayorig[imid] > max[imid] ||
             if (rayorig[imid] < min[imid] || rayorig[imid] > max[imid] ||
@@ -686,7 +686,7 @@ namespace Ogre
         {
         {
             _CALC_AXIS(imid);
             _CALC_AXIS(imid);
 
 
-            if (absDir[imin] < std::numeric_limits<Real>::epsilon())
+            if (absDir[imin] < std::numeric_limits<float>::epsilon())
             {
             {
                 // Parallel with minimise axis, check bounds only
                 // Parallel with minimise axis, check bounds only
                 if (rayorig[imin] < min[imin] || rayorig[imin] > max[imin])
                 if (rayorig[imin] < min[imin] || rayorig[imin] > max[imin])
@@ -705,33 +705,33 @@ namespace Ogre
         return true;
         return true;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    std::pair<bool, Real> Math::intersects(const Ray& ray, const Vector3& a,
+    std::pair<bool, float> Math::intersects(const Ray& ray, const Vector3& a,
         const Vector3& b, const Vector3& c, const Vector3& normal,
         const Vector3& b, const Vector3& c, const Vector3& normal,
         bool positiveSide, bool negativeSide)
         bool positiveSide, bool negativeSide)
     {
     {
         //
         //
         // Calculate intersection with plane.
         // Calculate intersection with plane.
         //
         //
-        Real t;
+        float t;
         {
         {
-            Real denom = normal.dotProduct(ray.getDirection());
+            float denom = normal.dotProduct(ray.getDirection());
 
 
             // Check intersect side
             // Check intersect side
-            if (denom > + std::numeric_limits<Real>::epsilon())
+            if (denom > + std::numeric_limits<float>::epsilon())
             {
             {
                 if (!negativeSide)
                 if (!negativeSide)
-                    return std::pair<bool, Real>(false, 0);
+                    return std::pair<bool, float>(false, 0);
             }
             }
-            else if (denom < - std::numeric_limits<Real>::epsilon())
+            else if (denom < - std::numeric_limits<float>::epsilon())
             {
             {
                 if (!positiveSide)
                 if (!positiveSide)
-                    return std::pair<bool, Real>(false, 0);
+                    return std::pair<bool, float>(false, 0);
             }
             }
             else
             else
             {
             {
                 // Parallel or triangle area is close to zero when
                 // Parallel or triangle area is close to zero when
                 // the plane normal not normalised.
                 // the plane normal not normalised.
-                return std::pair<bool, Real>(false, 0);
+                return std::pair<bool, float>(false, 0);
             }
             }
 
 
             t = normal.dotProduct(a - ray.getOrigin()) / denom;
             t = normal.dotProduct(a - ray.getOrigin()) / denom;
@@ -739,7 +739,7 @@ namespace Ogre
             if (t < 0)
             if (t < 0)
             {
             {
                 // Intersection is behind origin
                 // Intersection is behind origin
-                return std::pair<bool, Real>(false, 0);
+                return std::pair<bool, float>(false, 0);
             }
             }
         }
         }
 
 
@@ -748,9 +748,9 @@ namespace Ogre
         //
         //
         size_t i0, i1;
         size_t i0, i1;
         {
         {
-            Real n0 = Math::Abs(normal[0]);
-            Real n1 = Math::Abs(normal[1]);
-            Real n2 = Math::Abs(normal[2]);
+            float n0 = Math::Abs(normal[0]);
+            float n1 = Math::Abs(normal[1]);
+            float n2 = Math::Abs(normal[2]);
 
 
             i0 = 1; i1 = 2;
             i0 = 1; i1 = 2;
             if (n1 > n2)
             if (n1 > n2)
@@ -767,38 +767,38 @@ namespace Ogre
         // Check the intersection point is inside the triangle.
         // Check the intersection point is inside the triangle.
         //
         //
         {
         {
-            Real u1 = b[i0] - a[i0];
-            Real v1 = b[i1] - a[i1];
-            Real u2 = c[i0] - a[i0];
-            Real v2 = c[i1] - a[i1];
-            Real u0 = t * ray.getDirection()[i0] + ray.getOrigin()[i0] - a[i0];
-            Real v0 = t * ray.getDirection()[i1] + ray.getOrigin()[i1] - a[i1];
+            float u1 = b[i0] - a[i0];
+            float v1 = b[i1] - a[i1];
+            float u2 = c[i0] - a[i0];
+            float v2 = c[i1] - a[i1];
+            float u0 = t * ray.getDirection()[i0] + ray.getOrigin()[i0] - a[i0];
+            float v0 = t * ray.getDirection()[i1] + ray.getOrigin()[i1] - a[i1];
 
 
-            Real alpha = u0 * v2 - u2 * v0;
-            Real beta  = u1 * v0 - u0 * v1;
-            Real area  = u1 * v2 - u2 * v1;
+            float alpha = u0 * v2 - u2 * v0;
+            float beta  = u1 * v0 - u0 * v1;
+            float area  = u1 * v2 - u2 * v1;
 
 
             // epsilon to avoid float precision error
             // epsilon to avoid float precision error
-            const Real EPSILON = 1e-6f;
+            const float EPSILON = 1e-6f;
 
 
-            Real tolerance = - EPSILON * area;
+            float tolerance = - EPSILON * area;
 
 
             if (area > 0)
             if (area > 0)
             {
             {
                 if (alpha < tolerance || beta < tolerance || alpha+beta > area-tolerance)
                 if (alpha < tolerance || beta < tolerance || alpha+beta > area-tolerance)
-                    return std::pair<bool, Real>(false, 0);
+                    return std::pair<bool, float>(false, 0);
             }
             }
             else
             else
             {
             {
                 if (alpha > tolerance || beta > tolerance || alpha+beta < area-tolerance)
                 if (alpha > tolerance || beta > tolerance || alpha+beta < area-tolerance)
-                    return std::pair<bool, Real>(false, 0);
+                    return std::pair<bool, float>(false, 0);
             }
             }
         }
         }
 
 
-        return std::pair<bool, Real>(true, t);
+        return std::pair<bool, float>(true, t);
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    std::pair<bool, Real> Math::intersects(const Ray& ray, const Vector3& a,
+    std::pair<bool, float> Math::intersects(const Ray& ray, const Vector3& a,
         const Vector3& b, const Vector3& c,
         const Vector3& b, const Vector3& c,
         bool positiveSide, bool negativeSide)
         bool positiveSide, bool negativeSide)
     {
     {
@@ -813,12 +813,12 @@ namespace Ogre
 
 
         // Use splitting planes
         // Use splitting planes
         const Vector3& center = sphere.getCenter();
         const Vector3& center = sphere.getCenter();
-        Real radius = sphere.getRadius();
+        float radius = sphere.getRadius();
         const Vector3& min = box.getMinimum();
         const Vector3& min = box.getMinimum();
         const Vector3& max = box.getMaximum();
         const Vector3& max = box.getMaximum();
 
 
 		// Arvo's algorithm
 		// Arvo's algorithm
-		Real s, d = 0;
+		float s, d = 0;
 		for (int i = 0; i < 3; ++i)
 		for (int i = 0; i < 3; ++i)
 		{
 		{
 			if (center.ptr()[i] < min.ptr()[i])
 			if (center.ptr()[i] < min.ptr()[i])
@@ -850,7 +850,7 @@ namespace Ogre
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     Vector3 Math::calculateTangentSpaceVector(
     Vector3 Math::calculateTangentSpaceVector(
         const Vector3& position1, const Vector3& position2, const Vector3& position3,
         const Vector3& position1, const Vector3& position2, const Vector3& position3,
-        Real u1, Real v1, Real u2, Real v2, Real u3, Real v3)
+        float u1, float v1, float u2, float v2, float u3, float v3)
     {
     {
 	    //side0 is the vector along one side of the triangle of vertices passed in, 
 	    //side0 is the vector along one side of the triangle of vertices passed in, 
 	    //and side1 is the vector along another side. Taking the cross product of these returns the normal.
 	    //and side1 is the vector along another side. Taking the cross product of these returns the normal.
@@ -860,13 +860,13 @@ namespace Ogre
 	    Vector3 normal = side1.crossProduct(side0);
 	    Vector3 normal = side1.crossProduct(side0);
 	    normal.normalise();
 	    normal.normalise();
 	    //Now we use a formula to calculate the tangent. 
 	    //Now we use a formula to calculate the tangent. 
-	    Real deltaV0 = v1 - v2;
-	    Real deltaV1 = v3 - v1;
+	    float deltaV0 = v1 - v2;
+	    float deltaV1 = v3 - v1;
 	    Vector3 tangent = deltaV1 * side0 - deltaV0 * side1;
 	    Vector3 tangent = deltaV1 * side0 - deltaV0 * side1;
 	    tangent.normalise();
 	    tangent.normalise();
 	    //Calculate binormal
 	    //Calculate binormal
-	    Real deltaU0 = u1 - u2;
-	    Real deltaU1 = u3 - u1;
+	    float deltaU0 = u1 - u2;
+	    float deltaU1 = u3 - u1;
 	    Vector3 binormal = deltaU1 * side0 - deltaU0 * side1;
 	    Vector3 binormal = deltaU1 * side0 - deltaU0 * side1;
 	    binormal.normalise();
 	    binormal.normalise();
 	    //Now, we take the cross product of the tangents to get a vector which 
 	    //Now, we take the cross product of the tangents to get a vector which 
@@ -922,11 +922,11 @@ namespace Ogre
         return normal;
         return normal;
     }
     }
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-	Real Math::gaussianDistribution(Real x, Real offset, Real scale)
+	float Math::gaussianDistribution(float x, float offset, float scale)
 	{
 	{
-		Real nom = Math::Exp(
+		float nom = Math::Exp(
 			-Math::Sqr(x - offset) / (2 * Math::Sqr(scale)));
 			-Math::Sqr(x - offset) / (2 * Math::Sqr(scale)));
-		Real denom = scale * Math::Sqrt(2 * Math::PI);
+		float denom = scale * Math::Sqrt(2 * Math::PI);
 
 
 		return nom / denom;
 		return nom / denom;
 
 
@@ -971,7 +971,7 @@ namespace Ogre
 
 
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	Real Math::boundingRadiusFromAABB(const AxisAlignedBox& aabb)
+	float Math::boundingRadiusFromAABB(const AxisAlignedBox& aabb)
 	{
 	{
 		Vector3 max = aabb.getMaximum();
 		Vector3 max = aabb.getMaximum();
 		Vector3 min = aabb.getMinimum();
 		Vector3 min = aabb.getMinimum();

+ 102 - 102
CamelotUtility/Source/OgreMatrix3.cpp

@@ -33,10 +33,10 @@ THE SOFTWARE.
 
 
 namespace Ogre
 namespace Ogre
 {
 {
-    const Real Matrix3::EPSILON = 1e-06f;
+    const float Matrix3::EPSILON = 1e-06f;
     const Matrix3 Matrix3::ZERO(0,0,0,0,0,0,0,0,0);
     const Matrix3 Matrix3::ZERO(0,0,0,0,0,0,0,0,0);
     const Matrix3 Matrix3::IDENTITY(1,0,0,0,1,0,0,0,1);
     const Matrix3 Matrix3::IDENTITY(1,0,0,0,1,0,0,0,1);
-    const Real Matrix3::ms_fSvdEpsilon = 1e-04f;
+    const float Matrix3::ms_fSvdEpsilon = 1e-04f;
     const unsigned int Matrix3::ms_iSvdMaxIterations = 32;
     const unsigned int Matrix3::ms_iSvdMaxIterations = 32;
 
 
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
@@ -160,7 +160,7 @@ namespace Ogre
         return kNeg;
         return kNeg;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Matrix3 Matrix3::operator* (Real fScalar) const
+    Matrix3 Matrix3::operator* (float fScalar) const
     {
     {
         Matrix3 kProd;
         Matrix3 kProd;
         for (size_t iRow = 0; iRow < 3; iRow++)
         for (size_t iRow = 0; iRow < 3; iRow++)
@@ -171,7 +171,7 @@ namespace Ogre
         return kProd;
         return kProd;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Matrix3 operator* (Real fScalar, const Matrix3& rkMatrix)
+    Matrix3 operator* (float fScalar, const Matrix3& rkMatrix)
     {
     {
         Matrix3 kProd;
         Matrix3 kProd;
         for (size_t iRow = 0; iRow < 3; iRow++)
         for (size_t iRow = 0; iRow < 3; iRow++)
@@ -193,7 +193,7 @@ namespace Ogre
         return kTranspose;
         return kTranspose;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    bool Matrix3::Inverse (Matrix3& rkInverse, Real fTolerance) const
+    bool Matrix3::Inverse (Matrix3& rkInverse, float fTolerance) const
     {
     {
         // Invert a 3x3 using cofactors.  This is about 8 times faster than
         // Invert a 3x3 using cofactors.  This is about 8 times faster than
         // the Numerical Recipes code which uses Gaussian elimination.
         // the Numerical Recipes code which uses Gaussian elimination.
@@ -217,7 +217,7 @@ namespace Ogre
         rkInverse[2][2] = m[0][0]*m[1][1] -
         rkInverse[2][2] = m[0][0]*m[1][1] -
             m[0][1]*m[1][0];
             m[0][1]*m[1][0];
 
 
-        Real fDet =
+        float fDet =
             m[0][0]*rkInverse[0][0] +
             m[0][0]*rkInverse[0][0] +
             m[0][1]*rkInverse[1][0]+
             m[0][1]*rkInverse[1][0]+
             m[0][2]*rkInverse[2][0];
             m[0][2]*rkInverse[2][0];
@@ -225,7 +225,7 @@ namespace Ogre
         if ( Math::Abs(fDet) <= fTolerance )
         if ( Math::Abs(fDet) <= fTolerance )
             return false;
             return false;
 
 
-        Real fInvDet = 1.0f/fDet;
+        float fInvDet = 1.0f/fDet;
         for (size_t iRow = 0; iRow < 3; iRow++)
         for (size_t iRow = 0; iRow < 3; iRow++)
         {
         {
             for (size_t iCol = 0; iCol < 3; iCol++)
             for (size_t iCol = 0; iCol < 3; iCol++)
@@ -235,23 +235,23 @@ namespace Ogre
         return true;
         return true;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Matrix3 Matrix3::Inverse (Real fTolerance) const
+    Matrix3 Matrix3::Inverse (float fTolerance) const
     {
     {
         Matrix3 kInverse = Matrix3::ZERO;
         Matrix3 kInverse = Matrix3::ZERO;
         Inverse(kInverse,fTolerance);
         Inverse(kInverse,fTolerance);
         return kInverse;
         return kInverse;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Matrix3::Determinant () const
+    float Matrix3::Determinant () const
     {
     {
-        Real fCofactor00 = m[1][1]*m[2][2] -
+        float fCofactor00 = m[1][1]*m[2][2] -
             m[1][2]*m[2][1];
             m[1][2]*m[2][1];
-        Real fCofactor10 = m[1][2]*m[2][0] -
+        float fCofactor10 = m[1][2]*m[2][0] -
             m[1][0]*m[2][2];
             m[1][0]*m[2][2];
-        Real fCofactor20 = m[1][0]*m[2][1] -
+        float fCofactor20 = m[1][0]*m[2][1] -
             m[1][1]*m[2][0];
             m[1][1]*m[2][0];
 
 
-        Real fDet =
+        float fDet =
             m[0][0]*fCofactor00 +
             m[0][0]*fCofactor00 +
             m[0][1]*fCofactor10 +
             m[0][1]*fCofactor10 +
             m[0][2]*fCofactor20;
             m[0][2]*fCofactor20;
@@ -262,8 +262,8 @@ namespace Ogre
     void Matrix3::Bidiagonalize (Matrix3& kA, Matrix3& kL,
     void Matrix3::Bidiagonalize (Matrix3& kA, Matrix3& kL,
         Matrix3& kR)
         Matrix3& kR)
     {
     {
-        Real afV[3], afW[3];
-        Real fLength, fSign, fT1, fInvT1, fT2;
+        float afV[3], afW[3];
+        float fLength, fSign, fT1, fInvT1, fT2;
         bool bIdentity;
         bool bIdentity;
 
 
         // map first column to (*,0,0)
         // map first column to (*,0,0)
@@ -348,9 +348,9 @@ namespace Ogre
             kA[1][2] += afW[2];
             kA[1][2] += afW[2];
             kA[2][2] += afV[2]*afW[2];
             kA[2][2] += afV[2]*afW[2];
 
 
-            Real fA = 1.0f+fT2;
-            Real fB = fT2*afV[2];
-            Real fC = 1.0f+fB*afV[2];
+            float fA = 1.0f+fT2;
+            float fB = fT2*afV[2];
+            float fC = 1.0f+fB*afV[2];
 
 
             if ( bIdentity )
             if ( bIdentity )
             {
             {
@@ -365,8 +365,8 @@ namespace Ogre
             {
             {
                 for (int iRow = 0; iRow < 3; iRow++)
                 for (int iRow = 0; iRow < 3; iRow++)
                 {
                 {
-                    Real fTmp0 = kL[iRow][1];
-                    Real fTmp1 = kL[iRow][2];
+                    float fTmp0 = kL[iRow][1];
+                    float fTmp1 = kL[iRow][2];
                     kL[iRow][1] = fA*fTmp0+fB*fTmp1;
                     kL[iRow][1] = fA*fTmp0+fB*fTmp1;
                     kL[iRow][2] = fB*fTmp0+fC*fTmp1;
                     kL[iRow][2] = fB*fTmp0+fC*fTmp1;
                 }
                 }
@@ -377,25 +377,25 @@ namespace Ogre
     void Matrix3::GolubKahanStep (Matrix3& kA, Matrix3& kL,
     void Matrix3::GolubKahanStep (Matrix3& kA, Matrix3& kL,
         Matrix3& kR)
         Matrix3& kR)
     {
     {
-        Real fT11 = kA[0][1]*kA[0][1]+kA[1][1]*kA[1][1];
-        Real fT22 = kA[1][2]*kA[1][2]+kA[2][2]*kA[2][2];
-        Real fT12 = kA[1][1]*kA[1][2];
-        Real fTrace = fT11+fT22;
-        Real fDiff = fT11-fT22;
-        Real fDiscr = Math::Sqrt(fDiff*fDiff+4.0f*fT12*fT12);
-        Real fRoot1 = 0.5f*(fTrace+fDiscr);
-        Real fRoot2 = 0.5f*(fTrace-fDiscr);
+        float fT11 = kA[0][1]*kA[0][1]+kA[1][1]*kA[1][1];
+        float fT22 = kA[1][2]*kA[1][2]+kA[2][2]*kA[2][2];
+        float fT12 = kA[1][1]*kA[1][2];
+        float fTrace = fT11+fT22;
+        float fDiff = fT11-fT22;
+        float fDiscr = Math::Sqrt(fDiff*fDiff+4.0f*fT12*fT12);
+        float fRoot1 = 0.5f*(fTrace+fDiscr);
+        float fRoot2 = 0.5f*(fTrace-fDiscr);
 
 
         // adjust right
         // adjust right
-        Real fY = kA[0][0] - (Math::Abs(fRoot1-fT22) <=
+        float fY = kA[0][0] - (Math::Abs(fRoot1-fT22) <=
             Math::Abs(fRoot2-fT22) ? fRoot1 : fRoot2);
             Math::Abs(fRoot2-fT22) ? fRoot1 : fRoot2);
-        Real fZ = kA[0][1];
-		Real fInvLength = Math::InvSqrt(fY*fY+fZ*fZ);
-        Real fSin = fZ*fInvLength;
-        Real fCos = -fY*fInvLength;
+        float fZ = kA[0][1];
+		float fInvLength = Math::InvSqrt(fY*fY+fZ*fZ);
+        float fSin = fZ*fInvLength;
+        float fCos = -fY*fInvLength;
 
 
-        Real fTmp0 = kA[0][0];
-        Real fTmp1 = kA[0][1];
+        float fTmp0 = kA[0][0];
+        float fTmp1 = kA[0][1];
         kA[0][0] = fCos*fTmp0-fSin*fTmp1;
         kA[0][0] = fCos*fTmp0-fSin*fTmp1;
         kA[0][1] = fSin*fTmp0+fCos*fTmp1;
         kA[0][1] = fSin*fTmp0+fCos*fTmp1;
         kA[1][0] = -fSin*kA[1][1];
         kA[1][0] = -fSin*kA[1][1];
@@ -491,9 +491,9 @@ namespace Ogre
 
 
         for (unsigned int i = 0; i < ms_iSvdMaxIterations; i++)
         for (unsigned int i = 0; i < ms_iSvdMaxIterations; i++)
         {
         {
-            Real fTmp, fTmp0, fTmp1;
-            Real fSin0, fCos0, fTan0;
-            Real fSin1, fCos1, fTan1;
+            float fTmp, fTmp0, fTmp1;
+            float fSin0, fCos0, fTan0;
+            float fSin1, fCos1, fTan1;
 
 
             bool bTest1 = (Math::Abs(kA[0][1]) <=
             bool bTest1 = (Math::Abs(kA[0][1]) <=
                 ms_fSvdEpsilon*(Math::Abs(kA[0][0])+Math::Abs(kA[1][1])));
                 ms_fSvdEpsilon*(Math::Abs(kA[0][0])+Math::Abs(kA[1][1])));
@@ -640,7 +640,7 @@ namespace Ogre
         // product of vectors A and B.
         // product of vectors A and B.
 
 
         // compute q0
         // compute q0
-        Real fInvLength = Math::InvSqrt(m[0][0]*m[0][0]
+        float fInvLength = Math::InvSqrt(m[0][0]*m[0][0]
             + m[1][0]*m[1][0] +
             + m[1][0]*m[1][0] +
             m[2][0]*m[2][0]);
             m[2][0]*m[2][0]);
 
 
@@ -649,7 +649,7 @@ namespace Ogre
         m[2][0] *= fInvLength;
         m[2][0] *= fInvLength;
 
 
         // compute q1
         // compute q1
-        Real fDot0 =
+        float fDot0 =
             m[0][0]*m[0][1] +
             m[0][0]*m[0][1] +
             m[1][0]*m[1][1] +
             m[1][0]*m[1][1] +
             m[2][0]*m[2][1];
             m[2][0]*m[2][1];
@@ -667,7 +667,7 @@ namespace Ogre
         m[2][1] *= fInvLength;
         m[2][1] *= fInvLength;
 
 
         // compute q2
         // compute q2
-        Real fDot1 =
+        float fDot1 =
             m[0][1]*m[0][2] +
             m[0][1]*m[0][2] +
             m[1][1]*m[1][2] +
             m[1][1]*m[1][2] +
             m[2][1]*m[2][2];
             m[2][1]*m[2][2];
@@ -721,14 +721,14 @@ namespace Ogre
         // U stores the entries U[0] = u01, U[1] = u02, U[2] = u12
         // U stores the entries U[0] = u01, U[1] = u02, U[2] = u12
 
 
         // build orthogonal matrix Q
         // build orthogonal matrix Q
-        Real fInvLength = Math::InvSqrt(m[0][0]*m[0][0]
+        float fInvLength = Math::InvSqrt(m[0][0]*m[0][0]
             + m[1][0]*m[1][0] +
             + m[1][0]*m[1][0] +
             m[2][0]*m[2][0]);
             m[2][0]*m[2][0]);
         kQ[0][0] = m[0][0]*fInvLength;
         kQ[0][0] = m[0][0]*fInvLength;
         kQ[1][0] = m[1][0]*fInvLength;
         kQ[1][0] = m[1][0]*fInvLength;
         kQ[2][0] = m[2][0]*fInvLength;
         kQ[2][0] = m[2][0]*fInvLength;
 
 
-        Real fDot = kQ[0][0]*m[0][1] + kQ[1][0]*m[1][1] +
+        float fDot = kQ[0][0]*m[0][1] + kQ[1][0]*m[1][1] +
             kQ[2][0]*m[2][1];
             kQ[2][0]*m[2][1];
         kQ[0][1] = m[0][1]-fDot*kQ[0][0];
         kQ[0][1] = m[0][1]-fDot*kQ[0][0];
         kQ[1][1] = m[1][1]-fDot*kQ[1][0];
         kQ[1][1] = m[1][1]-fDot*kQ[1][0];
@@ -756,7 +756,7 @@ namespace Ogre
         kQ[2][2] *= fInvLength;
         kQ[2][2] *= fInvLength;
 
 
         // guarantee that orthogonal matrix has determinant 1 (no reflections)
         // guarantee that orthogonal matrix has determinant 1 (no reflections)
-        Real fDet = kQ[0][0]*kQ[1][1]*kQ[2][2] + kQ[0][1]*kQ[1][2]*kQ[2][0] +
+        float fDet = kQ[0][0]*kQ[1][1]*kQ[2][2] + kQ[0][1]*kQ[1][2]*kQ[2][0] +
             kQ[0][2]*kQ[1][0]*kQ[2][1] - kQ[0][2]*kQ[1][1]*kQ[2][0] -
             kQ[0][2]*kQ[1][0]*kQ[2][1] - kQ[0][2]*kQ[1][1]*kQ[2][0] -
             kQ[0][1]*kQ[1][0]*kQ[2][2] - kQ[0][0]*kQ[1][2]*kQ[2][1];
             kQ[0][1]*kQ[1][0]*kQ[2][2] - kQ[0][0]*kQ[1][2]*kQ[2][1];
 
 
@@ -788,34 +788,34 @@ namespace Ogre
         kD[2] = kR[2][2];
         kD[2] = kR[2][2];
 
 
         // the shear component
         // the shear component
-        Real fInvD0 = 1.0f/kD[0];
+        float fInvD0 = 1.0f/kD[0];
         kU[0] = kR[0][1]*fInvD0;
         kU[0] = kR[0][1]*fInvD0;
         kU[1] = kR[0][2]*fInvD0;
         kU[1] = kR[0][2]*fInvD0;
         kU[2] = kR[1][2]/kD[1];
         kU[2] = kR[1][2]/kD[1];
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Matrix3::MaxCubicRoot (Real afCoeff[3])
+    float Matrix3::MaxCubicRoot (float afCoeff[3])
     {
     {
         // Spectral norm is for A^T*A, so characteristic polynomial
         // Spectral norm is for A^T*A, so characteristic polynomial
         // P(x) = c[0]+c[1]*x+c[2]*x^2+x^3 has three positive real roots.
         // P(x) = c[0]+c[1]*x+c[2]*x^2+x^3 has three positive real roots.
         // This yields the assertions c[0] < 0 and c[2]*c[2] >= 3*c[1].
         // This yields the assertions c[0] < 0 and c[2]*c[2] >= 3*c[1].
 
 
         // quick out for uniform scale (triple root)
         // quick out for uniform scale (triple root)
-        const Real fOneThird = 1.0f/3.0f;
-        const Real fEpsilon = 1e-06f;
-        Real fDiscr = afCoeff[2]*afCoeff[2] - 3.0f*afCoeff[1];
+        const float fOneThird = 1.0f/3.0f;
+        const float fEpsilon = 1e-06f;
+        float fDiscr = afCoeff[2]*afCoeff[2] - 3.0f*afCoeff[1];
         if ( fDiscr <= fEpsilon )
         if ( fDiscr <= fEpsilon )
             return -fOneThird*afCoeff[2];
             return -fOneThird*afCoeff[2];
 
 
         // Compute an upper bound on roots of P(x).  This assumes that A^T*A
         // Compute an upper bound on roots of P(x).  This assumes that A^T*A
         // has been scaled by its largest entry.
         // has been scaled by its largest entry.
-        Real fX = 1.0;
-        Real fPoly = afCoeff[0]+fX*(afCoeff[1]+fX*(afCoeff[2]+fX));
+        float fX = 1.0;
+        float fPoly = afCoeff[0]+fX*(afCoeff[1]+fX*(afCoeff[2]+fX));
         if ( fPoly < 0.0 )
         if ( fPoly < 0.0 )
         {
         {
             // uses a matrix norm to find an upper bound on maximum root
             // uses a matrix norm to find an upper bound on maximum root
             fX = Math::Abs(afCoeff[0]);
             fX = Math::Abs(afCoeff[0]);
-            Real fTmp = 1.0f+Math::Abs(afCoeff[1]);
+            float fTmp = 1.0f+Math::Abs(afCoeff[1]);
             if ( fTmp > fX )
             if ( fTmp > fX )
                 fX = fTmp;
                 fX = fTmp;
             fTmp = 1.0f+Math::Abs(afCoeff[2]);
             fTmp = 1.0f+Math::Abs(afCoeff[2]);
@@ -824,25 +824,25 @@ namespace Ogre
         }
         }
 
 
         // Newton's method to find root
         // Newton's method to find root
-        Real fTwoC2 = 2.0f*afCoeff[2];
+        float fTwoC2 = 2.0f*afCoeff[2];
         for (int i = 0; i < 16; i++)
         for (int i = 0; i < 16; i++)
         {
         {
             fPoly = afCoeff[0]+fX*(afCoeff[1]+fX*(afCoeff[2]+fX));
             fPoly = afCoeff[0]+fX*(afCoeff[1]+fX*(afCoeff[2]+fX));
             if ( Math::Abs(fPoly) <= fEpsilon )
             if ( Math::Abs(fPoly) <= fEpsilon )
                 return fX;
                 return fX;
 
 
-            Real fDeriv = afCoeff[1]+fX*(fTwoC2+3.0f*fX);
+            float fDeriv = afCoeff[1]+fX*(fTwoC2+3.0f*fX);
             fX -= fPoly/fDeriv;
             fX -= fPoly/fDeriv;
         }
         }
 
 
         return fX;
         return fX;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Matrix3::SpectralNorm () const
+    float Matrix3::SpectralNorm () const
     {
     {
         Matrix3 kP;
         Matrix3 kP;
         size_t iRow, iCol;
         size_t iRow, iCol;
-        Real fPmax = 0.0;
+        float fPmax = 0.0;
         for (iRow = 0; iRow < 3; iRow++)
         for (iRow = 0; iRow < 3; iRow++)
         {
         {
             for (iCol = 0; iCol < 3; iCol++)
             for (iCol = 0; iCol < 3; iCol++)
@@ -858,14 +858,14 @@ namespace Ogre
             }
             }
         }
         }
 
 
-        Real fInvPmax = 1.0f/fPmax;
+        float fInvPmax = 1.0f/fPmax;
         for (iRow = 0; iRow < 3; iRow++)
         for (iRow = 0; iRow < 3; iRow++)
         {
         {
             for (iCol = 0; iCol < 3; iCol++)
             for (iCol = 0; iCol < 3; iCol++)
                 kP[iRow][iCol] *= fInvPmax;
                 kP[iRow][iCol] *= fInvPmax;
         }
         }
 
 
-        Real afCoeff[3];
+        float afCoeff[3];
         afCoeff[0] = -(kP[0][0]*(kP[1][1]*kP[2][2]-kP[1][2]*kP[2][1]) +
         afCoeff[0] = -(kP[0][0]*(kP[1][1]*kP[2][2]-kP[1][2]*kP[2][1]) +
             kP[0][1]*(kP[2][0]*kP[1][2]-kP[1][0]*kP[2][2]) +
             kP[0][1]*(kP[2][0]*kP[1][2]-kP[1][0]*kP[2][2]) +
             kP[0][2]*(kP[1][0]*kP[2][1]-kP[2][0]*kP[1][1]));
             kP[0][2]*(kP[1][0]*kP[2][1]-kP[2][0]*kP[1][1]));
@@ -874,8 +874,8 @@ namespace Ogre
             kP[1][1]*kP[2][2]-kP[1][2]*kP[2][1];
             kP[1][1]*kP[2][2]-kP[1][2]*kP[2][1];
         afCoeff[2] = -(kP[0][0]+kP[1][1]+kP[2][2]);
         afCoeff[2] = -(kP[0][0]+kP[1][1]+kP[2][2]);
 
 
-        Real fRoot = MaxCubicRoot(afCoeff);
-        Real fNorm = Math::Sqrt(fPmax*fRoot);
+        float fRoot = MaxCubicRoot(afCoeff);
+        float fNorm = Math::Sqrt(fPmax*fRoot);
         return fNorm;
         return fNorm;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
@@ -903,8 +903,8 @@ namespace Ogre
         // z^2-1.  We can solve these for axis (x,y,z).  Because the angle is pi,
         // z^2-1.  We can solve these for axis (x,y,z).  Because the angle is pi,
         // it does not matter which sign you choose on the square roots.
         // it does not matter which sign you choose on the square roots.
 
 
-        Real fTrace = m[0][0] + m[1][1] + m[2][2];
-        Real fCos = 0.5f*(fTrace-1.0f);
+        float fTrace = m[0][0] + m[1][1] + m[2][2];
+        float fCos = 0.5f*(fTrace-1.0f);
         rfRadians = Math::ACos(fCos);  // in [0,PI]
         rfRadians = Math::ACos(fCos);  // in [0,PI]
 
 
         if ( rfRadians > Radian(0.0) )
         if ( rfRadians > Radian(0.0) )
@@ -978,18 +978,18 @@ namespace Ogre
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     void Matrix3::FromAxisAngle (const Vector3& rkAxis, const Radian& fRadians)
     void Matrix3::FromAxisAngle (const Vector3& rkAxis, const Radian& fRadians)
     {
     {
-        Real fCos = Math::Cos(fRadians);
-        Real fSin = Math::Sin(fRadians);
-        Real fOneMinusCos = 1.0f-fCos;
-        Real fX2 = rkAxis.x*rkAxis.x;
-        Real fY2 = rkAxis.y*rkAxis.y;
-        Real fZ2 = rkAxis.z*rkAxis.z;
-        Real fXYM = rkAxis.x*rkAxis.y*fOneMinusCos;
-        Real fXZM = rkAxis.x*rkAxis.z*fOneMinusCos;
-        Real fYZM = rkAxis.y*rkAxis.z*fOneMinusCos;
-        Real fXSin = rkAxis.x*fSin;
-        Real fYSin = rkAxis.y*fSin;
-        Real fZSin = rkAxis.z*fSin;
+        float fCos = Math::Cos(fRadians);
+        float fSin = Math::Sin(fRadians);
+        float fOneMinusCos = 1.0f-fCos;
+        float fX2 = rkAxis.x*rkAxis.x;
+        float fY2 = rkAxis.y*rkAxis.y;
+        float fZ2 = rkAxis.z*rkAxis.z;
+        float fXYM = rkAxis.x*rkAxis.y*fOneMinusCos;
+        float fXZM = rkAxis.x*rkAxis.z*fOneMinusCos;
+        float fYZM = rkAxis.y*rkAxis.z*fOneMinusCos;
+        float fXSin = rkAxis.x*fSin;
+        float fYSin = rkAxis.y*fSin;
+        float fZSin = rkAxis.z*fSin;
 
 
         m[0][0] = fX2*fOneMinusCos+fCos;
         m[0][0] = fX2*fOneMinusCos+fCos;
         m[0][1] = fXYM-fZSin;
         m[0][1] = fXYM-fZSin;
@@ -1215,7 +1215,7 @@ namespace Ogre
     void Matrix3::FromEulerAnglesXYZ (const Radian& fYAngle, const Radian& fPAngle,
     void Matrix3::FromEulerAnglesXYZ (const Radian& fYAngle, const Radian& fPAngle,
         const Radian& fRAngle)
         const Radian& fRAngle)
     {
     {
-        Real fCos, fSin;
+        float fCos, fSin;
 
 
         fCos = Math::Cos(fYAngle);
         fCos = Math::Cos(fYAngle);
         fSin = Math::Sin(fYAngle);
         fSin = Math::Sin(fYAngle);
@@ -1235,7 +1235,7 @@ namespace Ogre
     void Matrix3::FromEulerAnglesXZY (const Radian& fYAngle, const Radian& fPAngle,
     void Matrix3::FromEulerAnglesXZY (const Radian& fYAngle, const Radian& fPAngle,
         const Radian& fRAngle)
         const Radian& fRAngle)
     {
     {
-        Real fCos, fSin;
+        float fCos, fSin;
 
 
         fCos = Math::Cos(fYAngle);
         fCos = Math::Cos(fYAngle);
         fSin = Math::Sin(fYAngle);
         fSin = Math::Sin(fYAngle);
@@ -1255,7 +1255,7 @@ namespace Ogre
     void Matrix3::FromEulerAnglesYXZ (const Radian& fYAngle, const Radian& fPAngle,
     void Matrix3::FromEulerAnglesYXZ (const Radian& fYAngle, const Radian& fPAngle,
         const Radian& fRAngle)
         const Radian& fRAngle)
     {
     {
-        Real fCos, fSin;
+        float fCos, fSin;
 
 
         fCos = Math::Cos(fYAngle);
         fCos = Math::Cos(fYAngle);
         fSin = Math::Sin(fYAngle);
         fSin = Math::Sin(fYAngle);
@@ -1275,7 +1275,7 @@ namespace Ogre
     void Matrix3::FromEulerAnglesYZX (const Radian& fYAngle, const Radian& fPAngle,
     void Matrix3::FromEulerAnglesYZX (const Radian& fYAngle, const Radian& fPAngle,
         const Radian& fRAngle)
         const Radian& fRAngle)
     {
     {
-        Real fCos, fSin;
+        float fCos, fSin;
 
 
         fCos = Math::Cos(fYAngle);
         fCos = Math::Cos(fYAngle);
         fSin = Math::Sin(fYAngle);
         fSin = Math::Sin(fYAngle);
@@ -1295,7 +1295,7 @@ namespace Ogre
     void Matrix3::FromEulerAnglesZXY (const Radian& fYAngle, const Radian& fPAngle,
     void Matrix3::FromEulerAnglesZXY (const Radian& fYAngle, const Radian& fPAngle,
         const Radian& fRAngle)
         const Radian& fRAngle)
     {
     {
-        Real fCos, fSin;
+        float fCos, fSin;
 
 
         fCos = Math::Cos(fYAngle);
         fCos = Math::Cos(fYAngle);
         fSin = Math::Sin(fYAngle);
         fSin = Math::Sin(fYAngle);
@@ -1315,7 +1315,7 @@ namespace Ogre
     void Matrix3::FromEulerAnglesZYX (const Radian& fYAngle, const Radian& fPAngle,
     void Matrix3::FromEulerAnglesZYX (const Radian& fYAngle, const Radian& fPAngle,
         const Radian& fRAngle)
         const Radian& fRAngle)
     {
     {
-        Real fCos, fSin;
+        float fCos, fSin;
 
 
         fCos = Math::Cos(fYAngle);
         fCos = Math::Cos(fYAngle);
         fSin = Math::Sin(fYAngle);
         fSin = Math::Sin(fYAngle);
@@ -1332,7 +1332,7 @@ namespace Ogre
         *this = kZMat*(kYMat*kXMat);
         *this = kZMat*(kYMat*kXMat);
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    void Matrix3::Tridiagonal (Real afDiag[3], Real afSubDiag[3])
+    void Matrix3::Tridiagonal (float afDiag[3], float afSubDiag[3])
     {
     {
         // Householder reduction T = Q^t M Q
         // Householder reduction T = Q^t M Q
         //   Input:
         //   Input:
@@ -1342,22 +1342,22 @@ namespace Ogre
         //     diag, diagonal entries of T
         //     diag, diagonal entries of T
         //     subd, subdiagonal entries of T (T is symmetric)
         //     subd, subdiagonal entries of T (T is symmetric)
 
 
-        Real fA = m[0][0];
-        Real fB = m[0][1];
-        Real fC = m[0][2];
-        Real fD = m[1][1];
-        Real fE = m[1][2];
-        Real fF = m[2][2];
+        float fA = m[0][0];
+        float fB = m[0][1];
+        float fC = m[0][2];
+        float fD = m[1][1];
+        float fE = m[1][2];
+        float fF = m[2][2];
 
 
         afDiag[0] = fA;
         afDiag[0] = fA;
         afSubDiag[2] = 0.0;
         afSubDiag[2] = 0.0;
         if ( Math::Abs(fC) >= EPSILON )
         if ( Math::Abs(fC) >= EPSILON )
         {
         {
-            Real fLength = Math::Sqrt(fB*fB+fC*fC);
-            Real fInvLength = 1.0f/fLength;
+            float fLength = Math::Sqrt(fB*fB+fC*fC);
+            float fInvLength = 1.0f/fLength;
             fB *= fInvLength;
             fB *= fInvLength;
             fC *= fInvLength;
             fC *= fInvLength;
-            Real fQ = 2.0f*fB*fE+fC*(fF-fD);
+            float fQ = 2.0f*fB*fE+fC*(fF-fD);
             afDiag[1] = fD+fC*fQ;
             afDiag[1] = fD+fC*fQ;
             afDiag[2] = fF-fC*fQ;
             afDiag[2] = fF-fC*fQ;
             afSubDiag[0] = fLength;
             afSubDiag[0] = fLength;
@@ -1390,7 +1390,7 @@ namespace Ogre
         }
         }
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    bool Matrix3::QLAlgorithm (Real afDiag[3], Real afSubDiag[3])
+    bool Matrix3::QLAlgorithm (float afDiag[3], float afSubDiag[3])
     {
     {
         // QL iteration with implicit shifting to reduce matrix from tridiagonal
         // QL iteration with implicit shifting to reduce matrix from tridiagonal
         // to diagonal
         // to diagonal
@@ -1404,7 +1404,7 @@ namespace Ogre
                 int i1;
                 int i1;
                 for (i1 = i0; i1 <= 1; i1++)
                 for (i1 = i0; i1 <= 1; i1++)
                 {
                 {
-                    Real fSum = Math::Abs(afDiag[i1]) +
+                    float fSum = Math::Abs(afDiag[i1]) +
                         Math::Abs(afDiag[i1+1]);
                         Math::Abs(afDiag[i1+1]);
                     if ( Math::Abs(afSubDiag[i1]) + fSum == fSum )
                     if ( Math::Abs(afSubDiag[i1]) + fSum == fSum )
                         break;
                         break;
@@ -1412,19 +1412,19 @@ namespace Ogre
                 if ( i1 == i0 )
                 if ( i1 == i0 )
                     break;
                     break;
 
 
-                Real fTmp0 = (afDiag[i0+1]-afDiag[i0])/(2.0f*afSubDiag[i0]);
-                Real fTmp1 = Math::Sqrt(fTmp0*fTmp0+1.0f);
+                float fTmp0 = (afDiag[i0+1]-afDiag[i0])/(2.0f*afSubDiag[i0]);
+                float fTmp1 = Math::Sqrt(fTmp0*fTmp0+1.0f);
                 if ( fTmp0 < 0.0 )
                 if ( fTmp0 < 0.0 )
                     fTmp0 = afDiag[i1]-afDiag[i0]+afSubDiag[i0]/(fTmp0-fTmp1);
                     fTmp0 = afDiag[i1]-afDiag[i0]+afSubDiag[i0]/(fTmp0-fTmp1);
                 else
                 else
                     fTmp0 = afDiag[i1]-afDiag[i0]+afSubDiag[i0]/(fTmp0+fTmp1);
                     fTmp0 = afDiag[i1]-afDiag[i0]+afSubDiag[i0]/(fTmp0+fTmp1);
-                Real fSin = 1.0;
-                Real fCos = 1.0;
-                Real fTmp2 = 0.0;
+                float fSin = 1.0;
+                float fCos = 1.0;
+                float fTmp2 = 0.0;
                 for (int i2 = i1-1; i2 >= i0; i2--)
                 for (int i2 = i1-1; i2 >= i0; i2--)
                 {
                 {
-                    Real fTmp3 = fSin*afSubDiag[i2];
-                    Real fTmp4 = fCos*afSubDiag[i2];
+                    float fTmp3 = fSin*afSubDiag[i2];
+                    float fTmp4 = fCos*afSubDiag[i2];
                     if ( Math::Abs(fTmp3) >= Math::Abs(fTmp0) )
                     if ( Math::Abs(fTmp3) >= Math::Abs(fTmp0) )
                     {
                     {
                         fCos = fTmp0/fTmp3;
                         fCos = fTmp0/fTmp3;
@@ -1471,11 +1471,11 @@ namespace Ogre
         return true;
         return true;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    void Matrix3::EigenSolveSymmetric (Real afEigenvalue[3],
+    void Matrix3::EigenSolveSymmetric (float afEigenvalue[3],
         Vector3 akEigenvector[3]) const
         Vector3 akEigenvector[3]) const
     {
     {
         Matrix3 kMatrix = *this;
         Matrix3 kMatrix = *this;
-        Real afSubDiag[3];
+        float afSubDiag[3];
         kMatrix.Tridiagonal(afEigenvalue,afSubDiag);
         kMatrix.Tridiagonal(afEigenvalue,afSubDiag);
         kMatrix.QLAlgorithm(afEigenvalue,afSubDiag);
         kMatrix.QLAlgorithm(afEigenvalue,afSubDiag);
 
 
@@ -1488,7 +1488,7 @@ namespace Ogre
 
 
         // make eigenvectors form a right--handed system
         // make eigenvectors form a right--handed system
         Vector3 kCross = akEigenvector[1].crossProduct(akEigenvector[2]);
         Vector3 kCross = akEigenvector[1].crossProduct(akEigenvector[2]);
-        Real fDet = akEigenvector[0].dotProduct(kCross);
+        float fDet = akEigenvector[0].dotProduct(kCross);
         if ( fDet < 0.0 )
         if ( fDet < 0.0 )
         {
         {
             akEigenvector[2][0] = - akEigenvector[2][0];
             akEigenvector[2][0] = - akEigenvector[2][0];

+ 58 - 58
CamelotUtility/Source/OgreMatrix4.cpp

@@ -52,7 +52,7 @@ namespace Ogre
           0,    0,  0,   1);
           0,    0,  0,   1);
 
 
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    inline static Real
+    inline static float
         MINOR(const Matrix4& m, const size_t r0, const size_t r1, const size_t r2, 
         MINOR(const Matrix4& m, const size_t r0, const size_t r1, const size_t r2, 
 								const size_t c0, const size_t c1, const size_t c2)
 								const size_t c0, const size_t c1, const size_t c2)
     {
     {
@@ -84,7 +84,7 @@ namespace Ogre
             MINOR(*this, 0, 1, 2, 0, 1, 2));
             MINOR(*this, 0, 1, 2, 0, 1, 2));
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Matrix4::determinant() const
+    float Matrix4::determinant() const
     {
     {
         return m[0][0] * MINOR(*this, 1, 2, 3, 1, 2, 3) -
         return m[0][0] * MINOR(*this, 1, 2, 3, 1, 2, 3) -
             m[0][1] * MINOR(*this, 1, 2, 3, 0, 2, 3) +
             m[0][1] * MINOR(*this, 1, 2, 3, 0, 2, 3) +
@@ -94,34 +94,34 @@ namespace Ogre
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     Matrix4 Matrix4::inverse() const
     Matrix4 Matrix4::inverse() const
     {
     {
-        Real m00 = m[0][0], m01 = m[0][1], m02 = m[0][2], m03 = m[0][3];
-        Real m10 = m[1][0], m11 = m[1][1], m12 = m[1][2], m13 = m[1][3];
-        Real m20 = m[2][0], m21 = m[2][1], m22 = m[2][2], m23 = m[2][3];
-        Real m30 = m[3][0], m31 = m[3][1], m32 = m[3][2], m33 = m[3][3];
-
-        Real v0 = m20 * m31 - m21 * m30;
-        Real v1 = m20 * m32 - m22 * m30;
-        Real v2 = m20 * m33 - m23 * m30;
-        Real v3 = m21 * m32 - m22 * m31;
-        Real v4 = m21 * m33 - m23 * m31;
-        Real v5 = m22 * m33 - m23 * m32;
-
-        Real t00 = + (v5 * m11 - v4 * m12 + v3 * m13);
-        Real t10 = - (v5 * m10 - v2 * m12 + v1 * m13);
-        Real t20 = + (v4 * m10 - v2 * m11 + v0 * m13);
-        Real t30 = - (v3 * m10 - v1 * m11 + v0 * m12);
-
-        Real invDet = 1 / (t00 * m00 + t10 * m01 + t20 * m02 + t30 * m03);
-
-        Real d00 = t00 * invDet;
-        Real d10 = t10 * invDet;
-        Real d20 = t20 * invDet;
-        Real d30 = t30 * invDet;
-
-        Real d01 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
-        Real d11 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
-        Real d21 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
-        Real d31 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
+        float m00 = m[0][0], m01 = m[0][1], m02 = m[0][2], m03 = m[0][3];
+        float m10 = m[1][0], m11 = m[1][1], m12 = m[1][2], m13 = m[1][3];
+        float m20 = m[2][0], m21 = m[2][1], m22 = m[2][2], m23 = m[2][3];
+        float m30 = m[3][0], m31 = m[3][1], m32 = m[3][2], m33 = m[3][3];
+
+        float v0 = m20 * m31 - m21 * m30;
+        float v1 = m20 * m32 - m22 * m30;
+        float v2 = m20 * m33 - m23 * m30;
+        float v3 = m21 * m32 - m22 * m31;
+        float v4 = m21 * m33 - m23 * m31;
+        float v5 = m22 * m33 - m23 * m32;
+
+        float t00 = + (v5 * m11 - v4 * m12 + v3 * m13);
+        float t10 = - (v5 * m10 - v2 * m12 + v1 * m13);
+        float t20 = + (v4 * m10 - v2 * m11 + v0 * m13);
+        float t30 = - (v3 * m10 - v1 * m11 + v0 * m12);
+
+        float invDet = 1 / (t00 * m00 + t10 * m01 + t20 * m02 + t30 * m03);
+
+        float d00 = t00 * invDet;
+        float d10 = t10 * invDet;
+        float d20 = t20 * invDet;
+        float d30 = t30 * invDet;
+
+        float d01 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
+        float d11 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
+        float d21 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
+        float d31 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
 
 
         v0 = m10 * m31 - m11 * m30;
         v0 = m10 * m31 - m11 * m30;
         v1 = m10 * m32 - m12 * m30;
         v1 = m10 * m32 - m12 * m30;
@@ -130,10 +130,10 @@ namespace Ogre
         v4 = m11 * m33 - m13 * m31;
         v4 = m11 * m33 - m13 * m31;
         v5 = m12 * m33 - m13 * m32;
         v5 = m12 * m33 - m13 * m32;
 
 
-        Real d02 = + (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
-        Real d12 = - (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
-        Real d22 = + (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
-        Real d32 = - (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
+        float d02 = + (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
+        float d12 = - (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
+        float d22 = + (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
+        float d32 = - (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
 
 
         v0 = m21 * m10 - m20 * m11;
         v0 = m21 * m10 - m20 * m11;
         v1 = m22 * m10 - m20 * m12;
         v1 = m22 * m10 - m20 * m12;
@@ -142,10 +142,10 @@ namespace Ogre
         v4 = m23 * m11 - m21 * m13;
         v4 = m23 * m11 - m21 * m13;
         v5 = m23 * m12 - m22 * m13;
         v5 = m23 * m12 - m22 * m13;
 
 
-        Real d03 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
-        Real d13 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
-        Real d23 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
-        Real d33 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
+        float d03 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet;
+        float d13 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet;
+        float d23 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet;
+        float d33 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet;
 
 
         return Matrix4(
         return Matrix4(
             d00, d01, d02, d03,
             d00, d01, d02, d03,
@@ -158,38 +158,38 @@ namespace Ogre
     {
     {
         assert(isAffine());
         assert(isAffine());
 
 
-        Real m10 = m[1][0], m11 = m[1][1], m12 = m[1][2];
-        Real m20 = m[2][0], m21 = m[2][1], m22 = m[2][2];
+        float m10 = m[1][0], m11 = m[1][1], m12 = m[1][2];
+        float m20 = m[2][0], m21 = m[2][1], m22 = m[2][2];
 
 
-        Real t00 = m22 * m11 - m21 * m12;
-        Real t10 = m20 * m12 - m22 * m10;
-        Real t20 = m21 * m10 - m20 * m11;
+        float t00 = m22 * m11 - m21 * m12;
+        float t10 = m20 * m12 - m22 * m10;
+        float t20 = m21 * m10 - m20 * m11;
 
 
-        Real m00 = m[0][0], m01 = m[0][1], m02 = m[0][2];
+        float m00 = m[0][0], m01 = m[0][1], m02 = m[0][2];
 
 
-        Real invDet = 1 / (m00 * t00 + m01 * t10 + m02 * t20);
+        float invDet = 1 / (m00 * t00 + m01 * t10 + m02 * t20);
 
 
         t00 *= invDet; t10 *= invDet; t20 *= invDet;
         t00 *= invDet; t10 *= invDet; t20 *= invDet;
 
 
         m00 *= invDet; m01 *= invDet; m02 *= invDet;
         m00 *= invDet; m01 *= invDet; m02 *= invDet;
 
 
-        Real r00 = t00;
-        Real r01 = m02 * m21 - m01 * m22;
-        Real r02 = m01 * m12 - m02 * m11;
+        float r00 = t00;
+        float r01 = m02 * m21 - m01 * m22;
+        float r02 = m01 * m12 - m02 * m11;
 
 
-        Real r10 = t10;
-        Real r11 = m00 * m22 - m02 * m20;
-        Real r12 = m02 * m10 - m00 * m12;
+        float r10 = t10;
+        float r11 = m00 * m22 - m02 * m20;
+        float r12 = m02 * m10 - m00 * m12;
 
 
-        Real r20 = t20;
-        Real r21 = m01 * m20 - m00 * m21;
-        Real r22 = m00 * m11 - m01 * m10;
+        float r20 = t20;
+        float r21 = m01 * m20 - m00 * m21;
+        float r22 = m00 * m11 - m01 * m10;
 
 
-        Real m03 = m[0][3], m13 = m[1][3], m23 = m[2][3];
+        float m03 = m[0][3], m13 = m[1][3], m23 = m[2][3];
 
 
-        Real r03 = - (r00 * m03 + r01 * m13 + r02 * m23);
-        Real r13 = - (r10 * m03 + r11 * m13 + r12 * m23);
-        Real r23 = - (r20 * m03 + r21 * m13 + r22 * m23);
+        float r03 = - (r00 * m03 + r01 * m13 + r02 * m23);
+        float r13 = - (r10 * m03 + r11 * m13 + r12 * m23);
+        float r23 = - (r20 * m03 + r21 * m13 + r22 * m23);
 
 
         return Matrix4(
         return Matrix4(
             r00, r01, r02, r03,
             r00, r01, r02, r03,

+ 9 - 9
CamelotUtility/Source/OgrePlane.cpp

@@ -44,13 +44,13 @@ namespace Ogre {
 		d = rhs.d;
 		d = rhs.d;
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-	Plane::Plane (const Vector3& rkNormal, Real fConstant)
+	Plane::Plane (const Vector3& rkNormal, float fConstant)
 	{
 	{
 		normal = rkNormal;
 		normal = rkNormal;
 		d = -fConstant;
 		d = -fConstant;
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	Plane::Plane (Real a, Real b, Real c, Real _d)
+	Plane::Plane (float a, float b, float c, float _d)
 		: normal(a, b, c), d(_d)
 		: normal(a, b, c), d(_d)
 	{
 	{
 	}
 	}
@@ -66,14 +66,14 @@ namespace Ogre {
 		redefine(rkPoint0, rkPoint1, rkPoint2);
 		redefine(rkPoint0, rkPoint1, rkPoint2);
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-	Real Plane::getDistance (const Vector3& rkPoint) const
+	float Plane::getDistance (const Vector3& rkPoint) const
 	{
 	{
 		return normal.dotProduct(rkPoint) + d;
 		return normal.dotProduct(rkPoint) + d;
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
 	Plane::Side Plane::getSide (const Vector3& rkPoint) const
 	Plane::Side Plane::getSide (const Vector3& rkPoint) const
 	{
 	{
-		Real fDistance = getDistance(rkPoint);
+		float fDistance = getDistance(rkPoint);
 
 
 		if ( fDistance < 0.0 )
 		if ( fDistance < 0.0 )
 			return Plane::NEGATIVE_SIDE;
 			return Plane::NEGATIVE_SIDE;
@@ -99,11 +99,11 @@ namespace Ogre {
     Plane::Side Plane::getSide (const Vector3& centre, const Vector3& halfSize) const
     Plane::Side Plane::getSide (const Vector3& centre, const Vector3& halfSize) const
     {
     {
         // Calculate the distance between box centre and the plane
         // Calculate the distance between box centre and the plane
-        Real dist = getDistance(centre);
+        float dist = getDistance(centre);
 
 
         // Calculate the maximise allows absolute distance for
         // Calculate the maximise allows absolute distance for
         // the distance between box centre and plane
         // the distance between box centre and plane
-        Real maxAbsDist = normal.absDotProduct(halfSize);
+        float maxAbsDist = normal.absDotProduct(halfSize);
 
 
         if (dist < -maxAbsDist)
         if (dist < -maxAbsDist)
             return Plane::NEGATIVE_SIDE;
             return Plane::NEGATIVE_SIDE;
@@ -147,14 +147,14 @@ namespace Ogre {
 
 
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-    Real Plane::normalise(void)
+    float Plane::normalise(void)
     {
     {
-        Real fLength = normal.length();
+        float fLength = normal.length();
 
 
         // Will also work for zero-sized vectors, but will change nothing
         // Will also work for zero-sized vectors, but will change nothing
         if (fLength > 1e-08f)
         if (fLength > 1e-08f)
         {
         {
-            Real fInvLength = 1.0f / fLength;
+            float fInvLength = 1.0f / fLength;
             normal *= fInvLength;
             normal *= fInvLength;
             d *= fInvLength;
             d *= fInvLength;
         }
         }

+ 97 - 97
CamelotUtility/Source/OgreQuaternion.cpp

@@ -41,7 +41,7 @@ THE SOFTWARE.
 
 
 namespace Ogre {
 namespace Ogre {
 
 
-    const Real Quaternion::ms_fEpsilon = 1e-03f;
+    const float Quaternion::ms_fEpsilon = 1e-03f;
     const Quaternion Quaternion::ZERO(0.0,0.0,0.0,0.0);
     const Quaternion Quaternion::ZERO(0.0,0.0,0.0,0.0);
     const Quaternion Quaternion::IDENTITY(1.0,0.0,0.0,0.0);
     const Quaternion Quaternion::IDENTITY(1.0,0.0,0.0,0.0);
 
 
@@ -51,8 +51,8 @@ namespace Ogre {
         // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes
         // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes
         // article "Quaternion Calculus and Fast Animation".
         // article "Quaternion Calculus and Fast Animation".
 
 
-        Real fTrace = kRot[0][0]+kRot[1][1]+kRot[2][2];
-        Real fRoot;
+        float fTrace = kRot[0][0]+kRot[1][1]+kRot[2][2];
+        float fRoot;
 
 
         if ( fTrace > 0.0 )
         if ( fTrace > 0.0 )
         {
         {
@@ -77,7 +77,7 @@ namespace Ogre {
             size_t k = s_iNext[j];
             size_t k = s_iNext[j];
 
 
             fRoot = Math::Sqrt(kRot[i][i]-kRot[j][j]-kRot[k][k] + 1.0f);
             fRoot = Math::Sqrt(kRot[i][i]-kRot[j][j]-kRot[k][k] + 1.0f);
-            Real* apkQuat[3] = { &x, &y, &z };
+            float* apkQuat[3] = { &x, &y, &z };
             *apkQuat[i] = 0.5f*fRoot;
             *apkQuat[i] = 0.5f*fRoot;
             fRoot = 0.5f/fRoot;
             fRoot = 0.5f/fRoot;
             w = (kRot[k][j]-kRot[j][k])*fRoot;
             w = (kRot[k][j]-kRot[j][k])*fRoot;
@@ -88,18 +88,18 @@ namespace Ogre {
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     void Quaternion::ToRotationMatrix (Matrix3& kRot) const
     void Quaternion::ToRotationMatrix (Matrix3& kRot) const
     {
     {
-        Real fTx  = x+x;
-        Real fTy  = y+y;
-        Real fTz  = z+z;
-        Real fTwx = fTx*w;
-        Real fTwy = fTy*w;
-        Real fTwz = fTz*w;
-        Real fTxx = fTx*x;
-        Real fTxy = fTy*x;
-        Real fTxz = fTz*x;
-        Real fTyy = fTy*y;
-        Real fTyz = fTz*y;
-        Real fTzz = fTz*z;
+        float fTx  = x+x;
+        float fTy  = y+y;
+        float fTz  = z+z;
+        float fTwx = fTx*w;
+        float fTwy = fTy*w;
+        float fTwz = fTz*w;
+        float fTxx = fTx*x;
+        float fTxy = fTy*x;
+        float fTxz = fTz*x;
+        float fTyy = fTy*y;
+        float fTyz = fTz*y;
+        float fTzz = fTz*z;
 
 
         kRot[0][0] = 1.0f-(fTyy+fTzz);
         kRot[0][0] = 1.0f-(fTyy+fTzz);
         kRot[0][1] = fTxy-fTwz;
         kRot[0][1] = fTxy-fTwz;
@@ -121,7 +121,7 @@ namespace Ogre {
         //   q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
         //   q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
 
 
         Radian fHalfAngle ( 0.5*rfAngle );
         Radian fHalfAngle ( 0.5*rfAngle );
-        Real fSin = Math::Sin(fHalfAngle);
+        float fSin = Math::Sin(fHalfAngle);
         w = Math::Cos(fHalfAngle);
         w = Math::Cos(fHalfAngle);
         x = fSin*rkAxis.x;
         x = fSin*rkAxis.x;
         y = fSin*rkAxis.y;
         y = fSin*rkAxis.y;
@@ -133,11 +133,11 @@ namespace Ogre {
         // The quaternion representing the rotation is
         // The quaternion representing the rotation is
         //   q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
         //   q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
 
 
-        Real fSqrLength = x*x+y*y+z*z;
+        float fSqrLength = x*x+y*y+z*z;
         if ( fSqrLength > 0.0 )
         if ( fSqrLength > 0.0 )
         {
         {
             rfAngle = 2.0*Math::ACos(w);
             rfAngle = 2.0*Math::ACos(w);
-            Real fInvLength = Math::InvSqrt(fSqrLength);
+            float fInvLength = Math::InvSqrt(fSqrLength);
             rkAxis.x = x*fInvLength;
             rkAxis.x = x*fInvLength;
             rkAxis.y = y*fInvLength;
             rkAxis.y = y*fInvLength;
             rkAxis.z = z*fInvLength;
             rkAxis.z = z*fInvLength;
@@ -202,45 +202,45 @@ namespace Ogre {
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     Vector3 Quaternion::xAxis(void) const
     Vector3 Quaternion::xAxis(void) const
     {
     {
-        //Real fTx  = 2.0*x;
-        Real fTy  = 2.0f*y;
-        Real fTz  = 2.0f*z;
-        Real fTwy = fTy*w;
-        Real fTwz = fTz*w;
-        Real fTxy = fTy*x;
-        Real fTxz = fTz*x;
-        Real fTyy = fTy*y;
-        Real fTzz = fTz*z;
+        //float fTx  = 2.0*x;
+        float fTy  = 2.0f*y;
+        float fTz  = 2.0f*z;
+        float fTwy = fTy*w;
+        float fTwz = fTz*w;
+        float fTxy = fTy*x;
+        float fTxz = fTz*x;
+        float fTyy = fTy*y;
+        float fTzz = fTz*z;
 
 
         return Vector3(1.0f-(fTyy+fTzz), fTxy+fTwz, fTxz-fTwy);
         return Vector3(1.0f-(fTyy+fTzz), fTxy+fTwz, fTxz-fTwy);
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     Vector3 Quaternion::yAxis(void) const
     Vector3 Quaternion::yAxis(void) const
     {
     {
-        Real fTx  = 2.0f*x;
-        Real fTy  = 2.0f*y;
-        Real fTz  = 2.0f*z;
-        Real fTwx = fTx*w;
-        Real fTwz = fTz*w;
-        Real fTxx = fTx*x;
-        Real fTxy = fTy*x;
-        Real fTyz = fTz*y;
-        Real fTzz = fTz*z;
+        float fTx  = 2.0f*x;
+        float fTy  = 2.0f*y;
+        float fTz  = 2.0f*z;
+        float fTwx = fTx*w;
+        float fTwz = fTz*w;
+        float fTxx = fTx*x;
+        float fTxy = fTy*x;
+        float fTyz = fTz*y;
+        float fTzz = fTz*z;
 
 
         return Vector3(fTxy-fTwz, 1.0f-(fTxx+fTzz), fTyz+fTwx);
         return Vector3(fTxy-fTwz, 1.0f-(fTxx+fTzz), fTyz+fTwx);
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     Vector3 Quaternion::zAxis(void) const
     Vector3 Quaternion::zAxis(void) const
     {
     {
-        Real fTx  = 2.0f*x;
-        Real fTy  = 2.0f*y;
-        Real fTz  = 2.0f*z;
-        Real fTwx = fTx*w;
-        Real fTwy = fTy*w;
-        Real fTxx = fTx*x;
-        Real fTxz = fTz*x;
-        Real fTyy = fTy*y;
-        Real fTyz = fTz*y;
+        float fTx  = 2.0f*x;
+        float fTy  = 2.0f*y;
+        float fTz  = 2.0f*z;
+        float fTwx = fTx*w;
+        float fTwy = fTy*w;
+        float fTxx = fTx*x;
+        float fTxz = fTz*x;
+        float fTyy = fTy*y;
+        float fTyz = fTz*y;
 
 
         return Vector3(fTxz+fTwy, fTyz-fTwx, 1.0f-(fTxx+fTyy));
         return Vector3(fTxz+fTwy, fTyz-fTwx, 1.0f-(fTxx+fTyy));
     }
     }
@@ -289,12 +289,12 @@ namespace Ogre {
         );
         );
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Quaternion Quaternion::operator* (Real fScalar) const
+    Quaternion Quaternion::operator* (float fScalar) const
     {
     {
         return Quaternion(fScalar*w,fScalar*x,fScalar*y,fScalar*z);
         return Quaternion(fScalar*w,fScalar*x,fScalar*y,fScalar*z);
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Quaternion operator* (Real fScalar, const Quaternion& rkQ)
+    Quaternion operator* (float fScalar, const Quaternion& rkQ)
     {
     {
         return Quaternion(fScalar*rkQ.w,fScalar*rkQ.x,fScalar*rkQ.y,
         return Quaternion(fScalar*rkQ.w,fScalar*rkQ.x,fScalar*rkQ.y,
             fScalar*rkQ.z);
             fScalar*rkQ.z);
@@ -305,22 +305,22 @@ namespace Ogre {
         return Quaternion(-w,-x,-y,-z);
         return Quaternion(-w,-x,-y,-z);
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Quaternion::Dot (const Quaternion& rkQ) const
+    float Quaternion::Dot (const Quaternion& rkQ) const
     {
     {
         return w*rkQ.w+x*rkQ.x+y*rkQ.y+z*rkQ.z;
         return w*rkQ.w+x*rkQ.x+y*rkQ.y+z*rkQ.z;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Quaternion::Norm () const
+    float Quaternion::Norm () const
     {
     {
         return w*w+x*x+y*y+z*z;
         return w*w+x*x+y*y+z*z;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     Quaternion Quaternion::Inverse () const
     Quaternion Quaternion::Inverse () const
     {
     {
-        Real fNorm = w*w+x*x+y*y+z*z;
+        float fNorm = w*w+x*x+y*y+z*z;
         if ( fNorm > 0.0 )
         if ( fNorm > 0.0 )
         {
         {
-            Real fInvNorm = 1.0f/fNorm;
+            float fInvNorm = 1.0f/fNorm;
             return Quaternion(w*fInvNorm,-x*fInvNorm,-y*fInvNorm,-z*fInvNorm);
             return Quaternion(w*fInvNorm,-x*fInvNorm,-y*fInvNorm,-z*fInvNorm);
         }
         }
         else
         else
@@ -343,14 +343,14 @@ namespace Ogre {
         // use exp(q) = cos(A)+A*(x*i+y*j+z*k) since A/sin(A) has limit 1.
         // use exp(q) = cos(A)+A*(x*i+y*j+z*k) since A/sin(A) has limit 1.
 
 
         Radian fAngle ( Math::Sqrt(x*x+y*y+z*z) );
         Radian fAngle ( Math::Sqrt(x*x+y*y+z*z) );
-        Real fSin = Math::Sin(fAngle);
+        float fSin = Math::Sin(fAngle);
 
 
         Quaternion kResult;
         Quaternion kResult;
         kResult.w = Math::Cos(fAngle);
         kResult.w = Math::Cos(fAngle);
 
 
         if ( Math::Abs(fSin) >= ms_fEpsilon )
         if ( Math::Abs(fSin) >= ms_fEpsilon )
         {
         {
-            Real fCoeff = fSin/(fAngle.valueRadians());
+            float fCoeff = fSin/(fAngle.valueRadians());
             kResult.x = fCoeff*x;
             kResult.x = fCoeff*x;
             kResult.y = fCoeff*y;
             kResult.y = fCoeff*y;
             kResult.z = fCoeff*z;
             kResult.z = fCoeff*z;
@@ -377,10 +377,10 @@ namespace Ogre {
         if ( Math::Abs(w) < 1.0 )
         if ( Math::Abs(w) < 1.0 )
         {
         {
             Radian fAngle ( Math::ACos(w) );
             Radian fAngle ( Math::ACos(w) );
-            Real fSin = Math::Sin(fAngle);
+            float fSin = Math::Sin(fAngle);
             if ( Math::Abs(fSin) >= ms_fEpsilon )
             if ( Math::Abs(fSin) >= ms_fEpsilon )
             {
             {
-                Real fCoeff = fAngle.valueRadians()/fSin;
+                float fCoeff = fAngle.valueRadians()/fSin;
                 kResult.x = fCoeff*x;
                 kResult.x = fCoeff*x;
                 kResult.y = fCoeff*y;
                 kResult.y = fCoeff*y;
                 kResult.z = fCoeff*z;
                 kResult.z = fCoeff*z;
@@ -411,7 +411,7 @@ namespace Ogre {
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
 	bool Quaternion::equals(const Quaternion& rhs, const Radian& tolerance) const
 	bool Quaternion::equals(const Quaternion& rhs, const Radian& tolerance) const
 	{
 	{
-        Real fCos = Dot(rhs);
+        float fCos = Dot(rhs);
         Radian angle = Math::ACos(fCos);
         Radian angle = Math::ACos(fCos);
 
 
 		return (Math::Abs(angle.valueRadians()) <= tolerance.valueRadians())
 		return (Math::Abs(angle.valueRadians()) <= tolerance.valueRadians())
@@ -420,10 +420,10 @@ namespace Ogre {
 
 
 	}
 	}
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Quaternion Quaternion::Slerp (Real fT, const Quaternion& rkP,
+    Quaternion Quaternion::Slerp (float fT, const Quaternion& rkP,
         const Quaternion& rkQ, bool shortestPath)
         const Quaternion& rkQ, bool shortestPath)
     {
     {
-        Real fCos = rkP.Dot(rkQ);
+        float fCos = rkP.Dot(rkQ);
         Quaternion rkT;
         Quaternion rkT;
 
 
         // Do we need to invert rotation?
         // Do we need to invert rotation?
@@ -440,11 +440,11 @@ namespace Ogre {
         if (Math::Abs(fCos) < 1 - ms_fEpsilon)
         if (Math::Abs(fCos) < 1 - ms_fEpsilon)
         {
         {
             // Standard case (slerp)
             // Standard case (slerp)
-            Real fSin = Math::Sqrt(1 - Math::Sqr(fCos));
+            float fSin = Math::Sqrt(1 - Math::Sqr(fCos));
             Radian fAngle = Math::ATan2(fSin, fCos);
             Radian fAngle = Math::ATan2(fSin, fCos);
-            Real fInvSin = 1.0f / fSin;
-            Real fCoeff0 = Math::Sin((1.0f - fT) * fAngle) * fInvSin;
-            Real fCoeff1 = Math::Sin(fT * fAngle) * fInvSin;
+            float fInvSin = 1.0f / fSin;
+            float fCoeff0 = Math::Sin((1.0f - fT) * fAngle) * fInvSin;
+            float fCoeff1 = Math::Sin(fT * fAngle) * fInvSin;
             return fCoeff0 * rkP + fCoeff1 * rkT;
             return fCoeff0 * rkP + fCoeff1 * rkT;
         }
         }
         else
         else
@@ -462,20 +462,20 @@ namespace Ogre {
         }
         }
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Quaternion Quaternion::SlerpExtraSpins (Real fT,
+    Quaternion Quaternion::SlerpExtraSpins (float fT,
         const Quaternion& rkP, const Quaternion& rkQ, int iExtraSpins)
         const Quaternion& rkP, const Quaternion& rkQ, int iExtraSpins)
     {
     {
-        Real fCos = rkP.Dot(rkQ);
+        float fCos = rkP.Dot(rkQ);
         Radian fAngle ( Math::ACos(fCos) );
         Radian fAngle ( Math::ACos(fCos) );
 
 
         if ( Math::Abs(fAngle.valueRadians()) < ms_fEpsilon )
         if ( Math::Abs(fAngle.valueRadians()) < ms_fEpsilon )
             return rkP;
             return rkP;
 
 
-        Real fSin = Math::Sin(fAngle);
+        float fSin = Math::Sin(fAngle);
         Radian fPhase ( Math::PI*iExtraSpins*fT );
         Radian fPhase ( Math::PI*iExtraSpins*fT );
-        Real fInvSin = 1.0f/fSin;
-        Real fCoeff0 = Math::Sin((1.0f-fT)*fAngle - fPhase)*fInvSin;
-        Real fCoeff1 = Math::Sin(fT*fAngle + fPhase)*fInvSin;
+        float fInvSin = 1.0f/fSin;
+        float fCoeff0 = Math::Sin((1.0f-fT)*fAngle - fPhase)*fInvSin;
+        float fCoeff1 = Math::Sin(fT*fAngle + fPhase)*fInvSin;
         return fCoeff0*rkP + fCoeff1*rkQ;
         return fCoeff0*rkP + fCoeff1*rkQ;
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
@@ -496,20 +496,20 @@ namespace Ogre {
         rkB = rkQ1*kMinusArg.Exp();
         rkB = rkQ1*kMinusArg.Exp();
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Quaternion Quaternion::Squad (Real fT,
+    Quaternion Quaternion::Squad (float fT,
         const Quaternion& rkP, const Quaternion& rkA,
         const Quaternion& rkP, const Quaternion& rkA,
         const Quaternion& rkB, const Quaternion& rkQ, bool shortestPath)
         const Quaternion& rkB, const Quaternion& rkQ, bool shortestPath)
     {
     {
-        Real fSlerpT = 2.0f*fT*(1.0f-fT);
+        float fSlerpT = 2.0f*fT*(1.0f-fT);
         Quaternion kSlerpP = Slerp(fT, rkP, rkQ, shortestPath);
         Quaternion kSlerpP = Slerp(fT, rkP, rkQ, shortestPath);
         Quaternion kSlerpQ = Slerp(fT, rkA, rkB);
         Quaternion kSlerpQ = Slerp(fT, rkA, rkB);
         return Slerp(fSlerpT, kSlerpP ,kSlerpQ);
         return Slerp(fSlerpT, kSlerpP ,kSlerpQ);
     }
     }
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Real Quaternion::normalise(void)
+    float Quaternion::normalise(void)
     {
     {
-        Real len = Norm();
-        Real factor = 1.0f / Math::Sqrt(len);
+        float len = Norm();
+        float factor = 1.0f / Math::Sqrt(len);
         *this = *this * factor;
         *this = *this * factor;
         return len;
         return len;
     }
     }
@@ -520,13 +520,13 @@ namespace Ogre {
 		{
 		{
 			// roll = atan2(localx.y, localx.x)
 			// roll = atan2(localx.y, localx.x)
 			// pick parts of xAxis() implementation that we need
 			// pick parts of xAxis() implementation that we need
-//			Real fTx  = 2.0*x;
-			Real fTy  = 2.0f*y;
-			Real fTz  = 2.0f*z;
-			Real fTwz = fTz*w;
-			Real fTxy = fTy*x;
-			Real fTyy = fTy*y;
-			Real fTzz = fTz*z;
+//			float fTx  = 2.0*x;
+			float fTy  = 2.0f*y;
+			float fTz  = 2.0f*z;
+			float fTwz = fTz*w;
+			float fTxy = fTy*x;
+			float fTyy = fTy*y;
+			float fTzz = fTz*z;
 
 
 			// Vector3(1.0-(fTyy+fTzz), fTxy+fTwz, fTxz-fTwy);
 			// Vector3(1.0-(fTyy+fTzz), fTxy+fTwz, fTxz-fTwy);
 
 
@@ -545,13 +545,13 @@ namespace Ogre {
 		{
 		{
 			// pitch = atan2(localy.z, localy.y)
 			// pitch = atan2(localy.z, localy.y)
 			// pick parts of yAxis() implementation that we need
 			// pick parts of yAxis() implementation that we need
-			Real fTx  = 2.0f*x;
-//			Real fTy  = 2.0f*y;
-			Real fTz  = 2.0f*z;
-			Real fTwx = fTx*w;
-			Real fTxx = fTx*x;
-			Real fTyz = fTz*y;
-			Real fTzz = fTz*z;
+			float fTx  = 2.0f*x;
+//			float fTy  = 2.0f*y;
+			float fTz  = 2.0f*z;
+			float fTwx = fTx*w;
+			float fTxx = fTx*x;
+			float fTyz = fTz*y;
+			float fTzz = fTz*z;
 
 
 			// Vector3(fTxy-fTwz, 1.0-(fTxx+fTzz), fTyz+fTwx);
 			// Vector3(fTxy-fTwz, 1.0-(fTxx+fTzz), fTyz+fTwx);
 			return Radian(Math::ATan2(fTyz+fTwx, 1.0f-(fTxx+fTzz)));
 			return Radian(Math::ATan2(fTyz+fTwx, 1.0f-(fTxx+fTzz)));
@@ -569,13 +569,13 @@ namespace Ogre {
 		{
 		{
 			// yaw = atan2(localz.x, localz.z)
 			// yaw = atan2(localz.x, localz.z)
 			// pick parts of zAxis() implementation that we need
 			// pick parts of zAxis() implementation that we need
-			Real fTx  = 2.0f*x;
-			Real fTy  = 2.0f*y;
-			Real fTz  = 2.0f*z;
-			Real fTwy = fTy*w;
-			Real fTxx = fTx*x;
-			Real fTxz = fTz*x;
-			Real fTyy = fTy*y;
+			float fTx  = 2.0f*x;
+			float fTy  = 2.0f*y;
+			float fTz  = 2.0f*z;
+			float fTwy = fTy*w;
+			float fTxx = fTx*x;
+			float fTxz = fTz*x;
+			float fTyy = fTy*y;
 
 
 			// Vector3(fTxz+fTwy, fTyz-fTwx, 1.0-(fTxx+fTyy));
 			// Vector3(fTxz+fTwy, fTyz-fTwx, 1.0-(fTxx+fTyy));
 
 
@@ -589,11 +589,11 @@ namespace Ogre {
 		}
 		}
 	}
 	}
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    Quaternion Quaternion::nlerp(Real fT, const Quaternion& rkP,
+    Quaternion Quaternion::nlerp(float fT, const Quaternion& rkP,
         const Quaternion& rkQ, bool shortestPath)
         const Quaternion& rkQ, bool shortestPath)
     {
     {
 		Quaternion result;
 		Quaternion result;
-        Real fCos = rkP.Dot(rkQ);
+        float fCos = rkP.Dot(rkQ);
 		if (fCos < 0.0f && shortestPath)
 		if (fCos < 0.0f && shortestPath)
 		{
 		{
 			result = rkP + fT * ((-rkQ) - rkP);
 			result = rkP + fT * ((-rkQ) - rkP);