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 namespace gtx{
00029 namespace fast_square_root      
00030 {
00033 
00036         template <typename genType> 
00037         genType fastSqrt(genType const & x);
00038 
00041         template <typename genType> 
00042         genType fastInverseSqrt(genType const & x);
00043                 
00046         template <typename genType> 
00047         typename genType::value_type fastLength(genType const & x);
00048 
00051         template <typename genType> 
00052         typename genType::value_type fastDistance(genType const & x, genType const & y);
00053 
00056         template <typename genType> 
00057         genType fastNormalize(genType const & x);
00058 
00060 }// namespace fast_square_root
00061 }// namespace gtx
00062 }// namespace glm
00063 
00064 #include "fast_square_root.inl"
00065 
00066 namespace glm{using namespace gtx::fast_square_root;}
00067 
00068 #endif//glm_gtx_fast_square_root