fast_square_root.hpp

00001 
00002 // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
00004 // Created : 2006-01-04
00005 // Updated : 2008-10-07
00006 // Licence : This source is under MIT License
00007 // File    : glm/gtx/fast_square_root.hpp
00009 // Dependency:
00010 // - GLM core
00012 // Note:
00013 // - Sqrt optimisation based on Newton's method, 
00014 // www.gamedev.net/community/forums/topic.asp?topic id=139956
00016 
00017 #ifndef glm_gtx_fast_square_root
00018 #define glm_gtx_fast_square_root
00019 
00020 // Dependency:
00021 #include "../glm.hpp"
00022 
00023 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
00024 #       pragma message("GLM: GLM_GTX_fast_square_root extension included")
00025 #endif
00026 
00027 namespace glm
00028 {
00029         namespace test{
00030                 void main_gtx_fast_square_root();
00031         }//namespace test
00032 
00033         namespace gtx{
00035         namespace fast_square_root
00036         {
00039 
00042                 template <typename genType> 
00043                 genType fastSqrt(genType const & x);
00044 
00047                 template <typename genType> 
00048                 genType fastInverseSqrt(genType const & x);
00049                 
00052                 template <typename genType> 
00053                 typename genType::value_type fastLength(genType const & x);
00054 
00057                 template <typename genType> 
00058                 typename genType::value_type fastDistance(genType const & x, genType const & y);
00059 
00062                 template <typename genType> 
00063                 genType fastNormalize(genType const & x);
00064 
00066 
00067         }//namespace fast_square_root
00068         }//     namespace gtx
00069 }//namespace glm
00070 
00071 #include "fast_square_root.inl"
00072 
00073 namespace glm{using namespace gtx::fast_square_root;}
00074 
00075 #endif//glm_gtx_fast_square_root