0.9.9 API documenation
fast_square_root.hpp
Go to the documentation of this file.
1 
15 #pragma once
16 
17 // Dependency:
18 #include "../common.hpp"
19 #include "../exponential.hpp"
20 #include "../geometric.hpp"
21 
22 #ifndef GLM_ENABLE_EXPERIMENTAL
23 # error "GLM: GLM_GTX_fast_square_root is an experimetal extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
24 #endif
25 
26 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
27 # pragma message("GLM: GLM_GTX_fast_square_root extension included")
28 #endif
29 
30 namespace glm
31 {
34 
38  template <typename genType>
39  GLM_FUNC_DECL genType fastSqrt(genType x);
40 
44  template <typename T, precision P, template <typename, precision> class vecType>
45  GLM_FUNC_DECL vecType<T, P> fastSqrt(vecType<T, P> const & x);
46 
50  template <typename genType>
51  GLM_FUNC_DECL genType fastInverseSqrt(genType x);
52 
56  template <typename T, precision P, template <typename, precision> class vecType>
57  GLM_FUNC_DECL vecType<T, P> fastInverseSqrt(vecType<T, P> const & x);
58 
62  template <typename genType>
63  GLM_FUNC_DECL genType fastLength(genType x);
64 
68  template <typename T, precision P, template <typename, precision> class vecType>
69  GLM_FUNC_DECL T fastLength(vecType<T, P> const & x);
70 
74  template <typename genType>
75  GLM_FUNC_DECL genType fastDistance(genType x, genType y);
76 
80  template <typename T, precision P, template <typename, precision> class vecType>
81  GLM_FUNC_DECL T fastDistance(vecType<T, P> const & x, vecType<T, P> const & y);
82 
86  template <typename genType>
87  GLM_FUNC_DECL genType fastNormalize(genType const & x);
88 
90 }// namespace glm
91 
92 #include "fast_square_root.inl"
GLM_FUNC_DECL T fastDistance(vecType< T, P > const &x, vecType< T, P > const &y)
Faster than the common distance function but less accurate.
GLM_FUNC_DECL genType fastNormalize(genType const &x)
Faster than the common normalize function but less accurate.
GLM_FUNC_DECL vecType< T, P > fastInverseSqrt(vecType< T, P > const &x)
Faster than the common inversesqrt function but less accurate.
GLM_FUNC_DECL vecType< T, P > fastSqrt(vecType< T, P > const &x)
Faster than the common sqrt function but less accurate.
GLM_FUNC_DECL T fastLength(vecType< T, P > const &x)
Faster than the common length function but less accurate.
Definition: _noise.hpp:11