Commit 9374d642 authored by Maciej Suminski's avatar Maciej Suminski

Fixind GLM headers problem.

parent 58280f74
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net) /// OpenGL Mathematics (glm.g-truc.net)
/// ///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy /// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal /// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights /// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is /// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions: /// furnished to do so, subject to the following conditions:
/// ///
/// The above copyright notice and this permission notice shall be included in /// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software. /// all copies or substantial portions of the Software.
/// ///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, /// 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 /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE. /// THE SOFTWARE.
/// ///
/// @ref core /// @ref core
/// @file glm/core/_fixes.hpp /// @file glm/core/_fixes.hpp
/// @date 2011-02-21 / 2011-11-22 /// @date 2011-02-21 / 2011-11-22
/// @author Christophe Riccio /// @author Christophe Riccio
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include <cmath> #include <cmath>
//! Workaround for compatibility with other libraries //! Workaround for compatibility with other libraries
#ifdef max #ifdef max
#undef max #undef max
#endif #endif
//! Workaround for compatibility with other libraries //! Workaround for compatibility with other libraries
#ifdef min #ifdef min
#undef min #undef min
#endif #endif
//! Workaround for Android //! Workaround for Android
#ifdef isnan #ifdef isnan
#undef isnan #undef isnan
#endif #endif
//! Workaround for Android //! Workaround for Android
#ifdef isinf #ifdef isinf
#undef isinf #undef isinf
#endif #endif
//! Workaround for Chrone Native Client //! Workaround for Chrone Native Client
#ifdef log2 #ifdef log2
#undef log2 #undef log2
#endif #endif
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net) /// OpenGL Mathematics (glm.g-truc.net)
/// ///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy /// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal /// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights /// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is /// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions: /// furnished to do so, subject to the following conditions:
/// ///
/// The above copyright notice and this permission notice shall be included in /// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software. /// all copies or substantial portions of the Software.
/// ///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, /// 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 /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE. /// THE SOFTWARE.
/// ///
/// @ref core /// @ref core
/// @file glm/core/_vectorize.hpp /// @file glm/core/_vectorize.hpp
/// @date 2011-10-14 / 2011-10-14 /// @date 2011-10-14 / 2011-10-14
/// @author Christophe Riccio /// @author Christophe Riccio
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#define VECTORIZE2_VEC(func) \ #define VECTORIZE2_VEC(func) \
template <typename T> \ template <typename T> \
GLM_FUNC_QUALIFIER detail::tvec2<T> func( \ GLM_FUNC_QUALIFIER detail::tvec2<T> func( \
detail::tvec2<T> const & v) \ detail::tvec2<T> const & v) \
{ \ { \
return detail::tvec2<T>( \ return detail::tvec2<T>( \
func(v.x), \ func(v.x), \
func(v.y)); \ func(v.y)); \
} }
#define VECTORIZE3_VEC(func) \ #define VECTORIZE3_VEC(func) \
template <typename T> \ template <typename T> \
GLM_FUNC_QUALIFIER detail::tvec3<T> func( \ GLM_FUNC_QUALIFIER detail::tvec3<T> func( \
detail::tvec3<T> const & v) \ detail::tvec3<T> const & v) \
{ \ { \
return detail::tvec3<T>( \ return detail::tvec3<T>( \
func(v.x), \ func(v.x), \
func(v.y), \ func(v.y), \
func(v.z)); \ func(v.z)); \
} }
#define VECTORIZE4_VEC(func) \ #define VECTORIZE4_VEC(func) \
template <typename T> \ template <typename T> \
GLM_FUNC_QUALIFIER detail::tvec4<T> func( \ GLM_FUNC_QUALIFIER detail::tvec4<T> func( \
detail::tvec4<T> const & v) \ detail::tvec4<T> const & v) \
{ \ { \
return detail::tvec4<T>( \ return detail::tvec4<T>( \
func(v.x), \ func(v.x), \
func(v.y), \ func(v.y), \
func(v.z), \ func(v.z), \
func(v.w)); \ func(v.w)); \
} }
#define VECTORIZE_VEC(func) \ #define VECTORIZE_VEC(func) \
VECTORIZE2_VEC(func) \ VECTORIZE2_VEC(func) \
VECTORIZE3_VEC(func) \ VECTORIZE3_VEC(func) \
VECTORIZE4_VEC(func) VECTORIZE4_VEC(func)
#define VECTORIZE2_VEC_SCA(func) \ #define VECTORIZE2_VEC_SCA(func) \
template <typename T> \ template <typename T> \
GLM_FUNC_QUALIFIER detail::tvec2<T> func \ GLM_FUNC_QUALIFIER detail::tvec2<T> func \
( \ ( \
detail::tvec2<T> const & x, \ detail::tvec2<T> const & x, \
typename detail::tvec2<T>::value_type const & y \ typename detail::tvec2<T>::value_type const & y \
) \ ) \
{ \ { \
return detail::tvec2<T>( \ return detail::tvec2<T>( \
func(x.x, y), \ func(x.x, y), \
func(x.y, y)); \ func(x.y, y)); \
} }
#define VECTORIZE3_VEC_SCA(func) \ #define VECTORIZE3_VEC_SCA(func) \
template <typename T> \ template <typename T> \
GLM_FUNC_QUALIFIER detail::tvec3<T> func \ GLM_FUNC_QUALIFIER detail::tvec3<T> func \
( \ ( \
detail::tvec3<T> const & x, \ detail::tvec3<T> const & x, \
typename detail::tvec3<T>::value_type const & y \ typename detail::tvec3<T>::value_type const & y \
) \ ) \
{ \ { \
return detail::tvec3<T>( \ return detail::tvec3<T>( \
func(x.x, y), \ func(x.x, y), \
func(x.y, y), \ func(x.y, y), \
func(x.z, y)); \ func(x.z, y)); \
} }
#define VECTORIZE4_VEC_SCA(func) \ #define VECTORIZE4_VEC_SCA(func) \
template <typename T> \ template <typename T> \
GLM_FUNC_QUALIFIER detail::tvec4<T> func \ GLM_FUNC_QUALIFIER detail::tvec4<T> func \
( \ ( \
detail::tvec4<T> const & x, \ detail::tvec4<T> const & x, \
typename detail::tvec4<T>::value_type const & y \ typename detail::tvec4<T>::value_type const & y \
) \ ) \
{ \ { \
return detail::tvec4<T>( \ return detail::tvec4<T>( \
func(x.x, y), \ func(x.x, y), \
func(x.y, y), \ func(x.y, y), \
func(x.z, y), \ func(x.z, y), \
func(x.w, y)); \ func(x.w, y)); \
} }
#define VECTORIZE_VEC_SCA(func) \ #define VECTORIZE_VEC_SCA(func) \
VECTORIZE2_VEC_SCA(func) \ VECTORIZE2_VEC_SCA(func) \
VECTORIZE3_VEC_SCA(func) \ VECTORIZE3_VEC_SCA(func) \
VECTORIZE4_VEC_SCA(func) VECTORIZE4_VEC_SCA(func)
#define VECTORIZE2_VEC_VEC(func) \ #define VECTORIZE2_VEC_VEC(func) \
template <typename T> \ template <typename T> \
GLM_FUNC_QUALIFIER detail::tvec2<T> func \ GLM_FUNC_QUALIFIER detail::tvec2<T> func \
( \ ( \
detail::tvec2<T> const & x, \ detail::tvec2<T> const & x, \
detail::tvec2<T> const & y \ detail::tvec2<T> const & y \
) \ ) \
{ \ { \
return detail::tvec2<T>( \ return detail::tvec2<T>( \
func(x.x, y.x), \ func(x.x, y.x), \
func(x.y, y.y)); \ func(x.y, y.y)); \
} }
#define VECTORIZE3_VEC_VEC(func) \ #define VECTORIZE3_VEC_VEC(func) \
template <typename T> \ template <typename T> \
GLM_FUNC_QUALIFIER detail::tvec3<T> func \ GLM_FUNC_QUALIFIER detail::tvec3<T> func \
( \ ( \
detail::tvec3<T> const & x, \ detail::tvec3<T> const & x, \
detail::tvec3<T> const & y \ detail::tvec3<T> const & y \
) \ ) \
{ \ { \
return detail::tvec3<T>( \ return detail::tvec3<T>( \
func(x.x, y.x), \ func(x.x, y.x), \
func(x.y, y.y), \ func(x.y, y.y), \
func(x.z, y.z)); \ func(x.z, y.z)); \
} }
#define VECTORIZE4_VEC_VEC(func) \ #define VECTORIZE4_VEC_VEC(func) \
template <typename T> \ template <typename T> \
GLM_FUNC_QUALIFIER detail::tvec4<T> func \ GLM_FUNC_QUALIFIER detail::tvec4<T> func \
( \ ( \
detail::tvec4<T> const & x, \ detail::tvec4<T> const & x, \
detail::tvec4<T> const & y \ detail::tvec4<T> const & y \
) \ ) \
{ \ { \
return detail::tvec4<T>( \ return detail::tvec4<T>( \
func(x.x, y.x), \ func(x.x, y.x), \
func(x.y, y.y), \ func(x.y, y.y), \
func(x.z, y.z), \ func(x.z, y.z), \
func(x.w, y.w)); \ func(x.w, y.w)); \
} }
#define VECTORIZE_VEC_VEC(func) \ #define VECTORIZE_VEC_VEC(func) \
VECTORIZE2_VEC_VEC(func) \ VECTORIZE2_VEC_VEC(func) \
VECTORIZE3_VEC_VEC(func) \ VECTORIZE3_VEC_VEC(func) \
VECTORIZE4_VEC_VEC(func) VECTORIZE4_VEC_VEC(func)
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net) /// OpenGL Mathematics (glm.g-truc.net)
/// ///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy /// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal /// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights /// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is /// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions: /// furnished to do so, subject to the following conditions:
/// ///
/// The above copyright notice and this permission notice shall be included in /// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software. /// all copies or substantial portions of the Software.
/// ///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, /// 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 /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE. /// THE SOFTWARE.
/// ///
/// @ref core /// @ref core
/// @file glm/core/dummy.cpp /// @file glm/core/dummy.cpp
/// @date 2011-01-19 / 2011-06-15 /// @date 2011-01-19 / 2011-06-15
/// @author Christophe Riccio /// @author Christophe Riccio
/// ///
/// GLM is a header only library. There is nothing to compile. /// GLM is a header only library. There is nothing to compile.
/// dummy.cpp exist only a wordaround for CMake file. /// dummy.cpp exist only a wordaround for CMake file.
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#define GLM_MESSAGES #define GLM_MESSAGES
#include "../glm.hpp" #include "../glm.hpp"
//#error "GLM is a header only library" //#error "GLM is a header only library"
int main() int main()
{ {
} }
This diff is collapsed.
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net) /// OpenGL Mathematics (glm.g-truc.net)
/// ///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy /// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal /// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights /// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is /// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions: /// furnished to do so, subject to the following conditions:
/// ///
/// The above copyright notice and this permission notice shall be included in /// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software. /// all copies or substantial portions of the Software.
/// ///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, /// 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 /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE. /// THE SOFTWARE.
/// ///
/// @ref core /// @ref core
/// @file glm/core/func_exponential.inl /// @file glm/core/func_exponential.inl
/// @date 2008-08-03 / 2011-06-15 /// @date 2008-08-03 / 2011-06-15
/// @author Christophe Riccio /// @author Christophe Riccio
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
namespace glm namespace glm
{ {
// pow // pow
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType pow GLM_FUNC_QUALIFIER genType pow
( (
genType const & x, genType const & x,
genType const & y genType const & y
) )
{ {
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'pow' only accept floating-point input"); GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'pow' only accept floating-point input");
return genType(::std::pow(x, y)); return genType(::std::pow(x, y));
} }
VECTORIZE_VEC_VEC(pow) VECTORIZE_VEC_VEC(pow)
// exp // exp
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType exp GLM_FUNC_QUALIFIER genType exp
( (
genType const & x genType const & x
) )
{ {
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'exp' only accept floating-point input"); GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'exp' only accept floating-point input");
return genType(::std::exp(x)); return genType(::std::exp(x));
} }
VECTORIZE_VEC(exp) VECTORIZE_VEC(exp)
// log // log
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType log GLM_FUNC_QUALIFIER genType log
( (
genType const & x genType const & x
) )
{ {
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'log' only accept floating-point input"); GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'log' only accept floating-point input");
return genType(::std::log(x)); return genType(::std::log(x));
} }
VECTORIZE_VEC(log) VECTORIZE_VEC(log)
//exp2, ln2 = 0.69314718055994530941723212145818f //exp2, ln2 = 0.69314718055994530941723212145818f
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType exp2 GLM_FUNC_QUALIFIER genType exp2
( (
genType const & x genType const & x
) )
{ {
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'exp2' only accept floating-point input"); GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'exp2' only accept floating-point input");
return genType(::std::exp(genType(0.69314718055994530941723212145818) * x)); return genType(::std::exp(genType(0.69314718055994530941723212145818) * x));
} }
VECTORIZE_VEC(exp2) VECTORIZE_VEC(exp2)
namespace _detail namespace _detail
{ {
template <int _PATH = detail::float_or_int_value::GLM_ERROR> template <int _PATH = detail::float_or_int_value::GLM_ERROR>
struct _compute_log2 struct _compute_log2
{ {
template <typename T> template <typename T>
T operator() (T const & Value) const; T operator() (T const & Value) const;
/* /*
{ {
GLM_STATIC_ASSERT(0, "'log2' parameter has an invalid template parameter type. GLM core features only supports floating-point types, include <glm/gtx/integer.hpp> for integer types support. Others types are not supported."); GLM_STATIC_ASSERT(0, "'log2' parameter has an invalid template parameter type. GLM core features only supports floating-point types, include <glm/gtx/integer.hpp> for integer types support. Others types are not supported.");
return Value; return Value;
} }
*/ */
}; };
template <> template <>
struct _compute_log2<detail::float_or_int_value::GLM_FLOAT> struct _compute_log2<detail::float_or_int_value::GLM_FLOAT>
{ {
template <typename T> template <typename T>
T operator() (T const & Value) const T operator() (T const & Value) const
{ {
return T(::std::log(Value)) / T(0.69314718055994530941723212145818); return T(::std::log(Value)) / T(0.69314718055994530941723212145818);
} }
}; };
}//namespace _detail }//namespace _detail
// log2, ln2 = 0.69314718055994530941723212145818f // log2, ln2 = 0.69314718055994530941723212145818f
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType log2 GLM_FUNC_QUALIFIER genType log2
( (
genType const & x genType const & x
) )
{ {
assert(x > genType(0)); // log2 is only defined on the range (0, inf] assert(x > genType(0)); // log2 is only defined on the range (0, inf]
return _detail::_compute_log2<detail::float_or_int_trait<genType>::ID>()(x); return _detail::_compute_log2<detail::float_or_int_trait<genType>::ID>()(x);
} }
VECTORIZE_VEC(log2) VECTORIZE_VEC(log2)
// sqrt // sqrt
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType sqrt GLM_FUNC_QUALIFIER genType sqrt
( (
genType const & x genType const & x
) )
{ {
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'sqrt' only accept floating-point input"); GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'sqrt' only accept floating-point input");
return genType(::std::sqrt(x)); return genType(::std::sqrt(x));
} }
VECTORIZE_VEC(sqrt) VECTORIZE_VEC(sqrt)
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType inversesqrt GLM_FUNC_QUALIFIER genType inversesqrt
( (
genType const & x genType const & x
) )
{ {
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'inversesqrt' only accept floating-point input"); GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'inversesqrt' only accept floating-point input");
return genType(1) / ::std::sqrt(x); return genType(1) / ::std::sqrt(x);
} }
VECTORIZE_VEC(inversesqrt) VECTORIZE_VEC(inversesqrt)
}//namespace glm }//namespace glm
This diff is collapsed.
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net) /// OpenGL Mathematics (glm.g-truc.net)
/// ///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy /// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal /// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights /// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is /// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions: /// furnished to do so, subject to the following conditions:
/// ///
/// The above copyright notice and this permission notice shall be included in /// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software. /// all copies or substantial portions of the Software.
/// ///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, /// 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 /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE. /// THE SOFTWARE.
/// ///
/// @ref core /// @ref core
/// @file glm/core/func_noise.hpp /// @file glm/core/func_noise.hpp
/// @date 2008-08-01 / 2011-06-18 /// @date 2008-08-01 / 2011-06-18
/// @author Christophe Riccio /// @author Christophe Riccio
/// ///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
/// ///
/// @defgroup core_func_noise Noise functions /// @defgroup core_func_noise Noise functions
/// @ingroup core /// @ingroup core
/// ///
/// Noise functions are stochastic functions that can be used to increase visual /// Noise functions are stochastic functions that can be used to increase visual
/// complexity. Values returned by the following noise functions give the /// complexity. Values returned by the following noise functions give the
/// appearance of randomness, but are not truly random. /// appearance of randomness, but are not truly random.
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_noise #ifndef glm_core_func_noise
#define glm_core_func_noise GLM_VERSION #define glm_core_func_noise GLM_VERSION
namespace glm namespace glm
{ {
/// @addtogroup core_func_noise /// @addtogroup core_func_noise
/// @{ /// @{
/// Returns a 1D noise value based on the input value x. /// Returns a 1D noise value based on the input value x.
/// ///
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType> template <typename genType>
typename genType::value_type noise1(genType const & x); typename genType::value_type noise1(genType const & x);
/// Returns a 2D noise value based on the input value x. /// Returns a 2D noise value based on the input value x.
/// ///
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType> template <typename genType>
detail::tvec2<typename genType::value_type> noise2(genType const & x); detail::tvec2<typename genType::value_type> noise2(genType const & x);
/// Returns a 3D noise value based on the input value x. /// Returns a 3D noise value based on the input value x.
/// ///
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType> template <typename genType>
detail::tvec3<typename genType::value_type> noise3(genType const & x); detail::tvec3<typename genType::value_type> noise3(genType const & x);
/// Returns a 4D noise value based on the input value x. /// Returns a 4D noise value based on the input value x.
/// ///
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType> template <typename genType>
detail::tvec4<typename genType::value_type> noise4(genType const & x); detail::tvec4<typename genType::value_type> noise4(genType const & x);
/// @} /// @}
}//namespace glm }//namespace glm
#include "func_noise.inl" #include "func_noise.inl"
#endif//glm_core_func_noise #endif//glm_core_func_noise
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment