Commit aac662e8 authored by Sylvain Thery's avatar Sylvain Thery

update glm of ThirdParty

parent f608c3d9

Too many changes to show.

To preserve performance only 144 of 144+ files are displayed.

......@@ -84,6 +84,7 @@ ENDIF (WITH_GLEWMX)
add_definitions(-DSHADERPATH="${CGoGN_ROOT_DIR}/lib/Shaders/")
add_definitions(-DGLM_FORCE_RADIANS)
# define includes of external libs
SET (CGoGN_EXT_INCLUDES
......
......@@ -39,6 +39,7 @@ SET( QT_USE_QTSVG TRUE )
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
add_definitions(-DGLM_FORCE_RADIANS)
#MESSAGE HERE FOR MORE EASY READING (MESSAGE AT THE END)
MESSAGE("Build type = " ${CMAKE_BUILD_TYPE} " (for change -DCMAKE_BUILD_TYPE=Release|Debug)" )
......
set(NAME glm_dummy)
file(GLOB ROOT_SOURCE *.cpp)
file(GLOB ROOT_INLINE *.inl)
file(GLOB ROOT_HEADER *.hpp)
file(GLOB ROOT_TEXT ../*.txt)
file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp)
file(GLOB_RECURSE CORE_INLINE ./detail/*.inl)
file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp)
file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp)
file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl)
file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp)
file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp)
file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl)
file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp)
source_group("Text Files" FILES ${ROOT_TEXT})
source_group("Core Files" FILES ${CORE_SOURCE})
source_group("Core Files" FILES ${CORE_INLINE})
source_group("Core Files" FILES ${CORE_HEADER})
source_group("GTC Files" FILES ${GTC_SOURCE})
source_group("GTC Files" FILES ${GTC_INLINE})
source_group("GTC Files" FILES ${GTC_HEADER})
source_group("GTX Files" FILES ${GTX_SOURCE})
source_group("GTX Files" FILES ${GTX_INLINE})
source_group("GTX Files" FILES ${GTX_HEADER})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
if(GLM_TEST_ENABLE)
add_executable(${NAME} ${ROOT_TEXT}
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER})
endif(GLM_TEST_ENABLE)
#add_library(glm STATIC glm.cpp)
#add_library(glm_shared SHARED glm.cpp)
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
/// 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.
///
/// @ref core
/// @file glm/common.hpp
/// @date 2013-12-24 / 2013-12-24
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_COMMON_INCLUDED
#define GLM_COMMON_INCLUDED
#include "detail/func_common.hpp"
#endif//GLM_COMMON_INCLUDED
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-07-24
// Updated : 2008-08-31
// Licence : This source is under MIT License
// File : glm/core/_detail.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_detail
#define glm_core_detail
#include "../setup.hpp"
#include <cassert>
namespace glm{
namespace detail{
class thalf;
#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC))
typedef signed __int64 sint64;
typedef unsigned __int64 uint64;
#elif(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_GCC))
__extension__ typedef signed long long sint64;
__extension__ typedef unsigned long long uint64;
#else//unknown compiler
typedef signed long sint64;
typedef unsigned long uint64;
#endif//GLM_COMPILER
template<bool C>
struct If
{
template<typename F, typename T>
static inline T apply(F functor, const T& val)
{
return functor(val);
}
};
template<>
struct If<false>
{
template<typename F, typename T>
static inline T apply(F, const T& val)
{
return val;
}
};
//template <typename T>
//struct traits
//{
// static const bool is_signed = false;
// static const bool is_float = false;
// static const bool is_vector = false;
// static const bool is_matrix = false;
// static const bool is_genType = false;
// static const bool is_genIType = false;
// static const bool is_genUType = false;
//};
//template <>
//struct traits<half>
//{
// static const bool is_float = true;
// static const bool is_genType = true;
//};
//template <>
//struct traits<float>
//{
// static const bool is_float = true;
// static const bool is_genType = true;
//};
//template <>
//struct traits<double>
//{
// static const bool is_float = true;
// static const bool is_genType = true;
//};
//template <typename genType>
//struct desc
//{
// typedef genType type;
// typedef genType * pointer;
// typedef genType const* const_pointer;
// typedef genType const *const const_pointer_const;
// typedef genType *const pointer_const;
// typedef genType & reference;
// typedef genType const& const_reference;
// typedef genType const& param_type;
// typedef typename genType::value_type value_type;
// typedef typename genType::size_type size_type;
// static const typename size_type value_size;
//};
//template <typename genType>
//const typename desc<genType>::size_type desc<genType>::value_size = genType::value_size();
union uif32
{
uif32() :
i(0)
{}
uif32(float f) :
f(f)
{}
uif32(unsigned int i) :
i(i)
{}
float f;
unsigned int i;
};
union uif64
{
uif64() :
i(0)
{}
uif64(double f) :
f(f)
{}
uif64(uint64 i) :
i(i)
{}
double f;
uint64 i;
};
typedef uif32 uif;
//////////////////
// int
template <typename T>
struct is_int
{
enum is_int_enum
{
_YES = 0,
_NO = 1
};
};
#define GLM_DETAIL_IS_INT(T) \
template <> \
struct is_int<T> \
{ \
enum is_int_enum \
{ \
_YES = 1, \
_NO = 0 \
}; \
}
//////////////////
// uint
template <typename T>
struct is_uint
{
enum is_uint_enum
{
_YES = 0,
_NO = 1
};
};
#define GLM_DETAIL_IS_UINT(T) \
template <> \
struct is_uint<T> \
{ \
enum is_uint_enum \
{ \
_YES = 1, \
_NO = 0 \
}; \
}
//GLM_DETAIL_IS_UINT(unsigned long long)
//////////////////
// float
template <typename T>
struct is_float
{
enum is_float_enum
{
_YES = 0,
_NO = 1
};
};
#define GLM_DETAIL_IS_FLOAT(T) \
template <> \
struct is_float<T> \
{ \
enum is_float_enum \
{ \
_YES = 1, \
_NO = 0 \
}; \
}
//////////////////
// bool
template <typename T>
struct is_bool
{
enum is_bool_enum
{
_YES = 0,
_NO = 1
};
};
template <>
struct is_bool<bool>
{
enum is_bool_enum
{
_YES = 1,
_NO = 0
};
};
//////////////////
// vector
template <typename T>
struct is_vector
{
enum is_vector_enum
{
_YES = 0,
_NO = 1
};
};
#define GLM_DETAIL_IS_VECTOR(T) \
template <> \
struct is_vector \
{ \
enum is_vector_enum \
{ \
_YES = 1, \
_NO = 0 \
}; \
}
//////////////////
// matrix
template <typename T>
struct is_matrix
{
enum is_matrix_enum
{
_YES = 0,
_NO = 1
};
};
#define GLM_DETAIL_IS_MATRIX(T) \
template <> \
struct is_matrix \
{ \
enum is_matrix_enum \
{ \
_YES = 1, \
_NO = 0 \
}; \
}
//////////////////
// type
template <typename T>
struct type
{
enum type_enum
{
is_float = is_float<T>::_YES,
is_int = is_int<T>::_YES,
is_uint = is_uint<T>::_YES,
is_bool = is_bool<T>::_YES
};
};
//////////////////
// type
typedef signed char int8;
typedef signed short int16;
typedef signed int int32;
typedef detail::sint64 int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef detail::uint64 uint64;
typedef detail::thalf float16;
typedef float float32;
typedef double float64;
}//namespace detail
}//namespace glm
#endif//glm_core_detail
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-04-20
// Updated : 2008-08-22
// Licence : This source is under MIT License
// File : glm/core/_swizzle.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_swizzle
#define glm_core_swizzle
namespace glm
{
enum comp
{
X = 0,
R = 0,
S = 0,
Y = 1,
G = 1,
T = 1,
Z = 2,
B = 2,
P = 2,
W = 3,
A = 3,
Q = 3
};
}//namespace glm
#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW)
#define xx swizzle(glm::X, glm::X)
#define yx swizzle(glm::Y, glm::X)
#define zx swizzle(glm::Z, glm::X)
#define wx swizzle(glm::W, glm::X)
#define xy swizzle(glm::X, glm::Y)
#define yy swizzle(glm::Y, glm::Y)
#define zy swizzle(glm::Z, glm::Y)
#define wy swizzle(glm::W, glm::Y)
#define xz swizzle(glm::X, glm::Z)
#define yz swizzle(glm::Y, glm::Z)
#define zz swizzle(glm::Z, glm::Z)
#define wz swizzle(glm::W, glm::Z)
#define xw swizzle(glm::X, glm::W)
#define yw swizzle(glm::Y, glm::W)
#define zw swizzle(glm::Z, glm::W)
#define ww swizzle(glm::W, glm::W)
#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW)
#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA)
#define rr swizzle(glm::X, glm::X)
#define gr swizzle(glm::Y, glm::X)
#define br swizzle(glm::Z, glm::X)
#define ar swizzle(glm::W, glm::X)
#define rg swizzle(glm::X, glm::Y)
#define gg swizzle(glm::Y, glm::Y)
#define bg swizzle(glm::Z, glm::Y)
#define ag swizzle(glm::W, glm::Y)
#define rb swizzle(glm::X, glm::Z)
#define gb swizzle(glm::Y, glm::Z)
#define bb swizzle(glm::Z, glm::Z)
#define ab swizzle(glm::W, glm::Z)
#define ra swizzle(glm::X, glm::W)
#define ga swizzle(glm::Y, glm::W)
#define ba swizzle(glm::Z, glm::W)
#define aa swizzle(glm::W, glm::W)
#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA)
#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ)
#define ss swizzle(glm::X, glm::X)
#define ts swizzle(glm::Y, glm::X)
#define ps swizzle(glm::Z, glm::X)
#define qs swizzle(glm::W, glm::X)
#define st swizzle(glm::X, glm::Y)
#define tt swizzle(glm::Y, glm::Y)
#define pt swizzle(glm::Z, glm::Y)
#define qt swizzle(glm::W, glm::Y)
#define sp swizzle(glm::X, glm::Z)
#define tp swizzle(glm::Y, glm::Z)
#define pp swizzle(glm::Z, glm::Z)
#define qp swizzle(glm::W, glm::Z)
#define sq swizzle(glm::X, glm::W)
#define tq swizzle(glm::Y, glm::W)
#define pq swizzle(glm::Z, glm::W)
#define qq swizzle(glm::W, glm::W)
#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ)
#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW)
#define xxx swizzle(glm::X, glm::X, glm::X)
#define yxx swizzle(glm::Y, glm::X, glm::X)
#define zxx swizzle(glm::Z, glm::X, glm::X)
#define wxx swizzle(glm::W, glm::X, glm::X)
#define xyx swizzle(glm::X, glm::Y, glm::X)
#define yyx swizzle(glm::Y, glm::Y, glm::X)
#define zyx swizzle(glm::Z, glm::Y, glm::X)
#define wyx swizzle(glm::W, glm::Y, glm::X)
#define xzx swizzle(glm::X, glm::Z, glm::X)
#define yzx swizzle(glm::Y, glm::Z, glm::X)
#define zzx swizzle(glm::Z, glm::Z, glm::X)
#define wzx swizzle(glm::W, glm::Z, glm::X)
#define xwx swizzle(glm::X, glm::W, glm::X)
#define ywx swizzle(glm::Y, glm::W, glm::X)
#define zwx swizzle(glm::Z, glm::W, glm::X)
#define wwx swizzle(glm::W, glm::W, glm::X)
#define xxy swizzle(glm::X, glm::X, glm::Y)
#define yxy swizzle(glm::Y, glm::X, glm::Y)
#define zxy swizzle(glm::Z, glm::X, glm::Y)
#define wxy swizzle(glm::W, glm::X, glm::Y)
#define xyy swizzle(glm::X, glm::Y, glm::Y)
#define yyy swizzle(glm::Y, glm::Y, glm::Y)
#define zyy swizzle(glm::Z, glm::Y, glm::Y)
#define wyy swizzle(glm::W, glm::Y, glm::Y)
#define xzy swizzle(glm::X, glm::Z, glm::Y)
#define yzy swizzle(glm::Y, glm::Z, glm::Y)
#define zzy swizzle(glm::Z, glm::Z, glm::Y)
#define wzy swizzle(glm::W, glm::Z, glm::Y)
#define xwy swizzle(glm::X, glm::W, glm::Y)
#define ywy swizzle(glm::Y, glm::W, glm::Y)
#define zwy swizzle(glm::Z, glm::W, glm::Y)
#define wwy swizzle(glm::W, glm::W, glm::Y)
#define xxz swizzle(glm::X, glm::X, glm::Z)
#define yxz swizzle(glm::Y, glm::X, glm::Z)
#define zxz swizzle(glm::Z, glm::X, glm::Z)
#define wxz swizzle(glm::W, glm::X, glm::Z)
#define xyz swizzle(glm::X, glm::Y, glm::Z)
#define yyz swizzle(glm::Y, glm::Y, glm::Z)
#define zyz swizzle(glm::Z, glm::Y, glm::Z)
#define wyz swizzle(glm::W, glm::Y, glm::Z)
#define xzz swizzle(glm::X, glm::Z, glm::Z)
#define yzz swizzle(glm::Y, glm::Z, glm::Z)
#define zzz swizzle(glm::Z, glm::Z, glm::Z)
#define wzz swizzle(glm::W, glm::Z, glm::Z)
#define xwz swizzle(glm::X, glm::W, glm::Z)
#define ywz swizzle(glm::Y, glm::W, glm::Z)
#define zwz swizzle(glm::Z, glm::W, glm::Z)
#define wwz swizzle(glm::W, glm::W, glm::Z)
#define xxw swizzle(glm::X, glm::X, glm::W)
#define yxw swizzle(glm::Y, glm::X, glm::W)
#define zxw swizzle(glm::Z, glm::X, glm::W)
#define wxw swizzle(glm::W, glm::X, glm::W)
#define xyw swizzle(glm::X, glm::Y, glm::W)
#define yyw swizzle(glm::Y, glm::Y, glm::W)
#define zyw swizzle(glm::Z, glm::Y, glm::W)
#define wyw swizzle(glm::W, glm::Y, glm::W)
#define xzw swizzle(glm::X, glm::Z, glm::W)
#define yzw swizzle(glm::Y, glm::Z, glm::W)
#define zzw swizzle(glm::Z, glm::Z, glm::W)
#define wzw swizzle(glm::W, glm::Z, glm::W)
#define xww swizzle(glm::X, glm::W, glm::W)
#define yww swizzle(glm::Y, glm::W, glm::W)
#define zww swizzle(glm::Z, glm::W, glm::W)
#define www swizzle(glm::W, glm::W, glm::W)
#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW)
#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA)
#define rrr swizzle(glm::X, glm::X, glm::X)
#define grr swizzle(glm::Y, glm::X, glm::X)
#define brr swizzle(glm::Z, glm::X, glm::X)
#define arr swizzle(glm::W, glm::X, glm::X)
#define rgr swizzle(glm::X, glm::Y, glm::X)
#define ggr swizzle(glm::Y, glm::Y, glm::X)
#define bgr swizzle(glm::Z, glm::Y, glm::X)
#define agr swizzle(glm::W, glm::Y, glm::X)
#define rbr swizzle(glm::X, glm::Z, glm::X)
#define gbr swizzle(glm::Y, glm::Z, glm::X)
#define bbr swizzle(glm::Z, glm::Z, glm::X)
#define abr swizzle(glm::W, glm::Z, glm::X)
#define rar swizzle(glm::X, glm::W, glm::X)
#define gar swizzle(glm::Y, glm::W, glm::X)
#define bar swizzle(glm::Z, glm::W, glm::X)
#define aar swizzle(glm::W, glm::W, glm::X)
#define rrg swizzle(glm::X, glm::X, glm::Y)
#define grg swizzle(glm::Y, glm::X, glm::Y)
#define brg swizzle(glm::Z, glm::X, glm::Y)
#define arg swizzle(glm::W, glm::X, glm::Y)
#define rgg swizzle(glm::X, glm::Y, glm::Y)
#define ggg swizzle(glm::Y, glm::Y, glm::Y)
#define bgg swizzle(glm::Z, glm::Y, glm::Y)
#define agg swizzle(glm::W, glm::Y, glm::Y)
#define rbg swizzle(glm::X, glm::Z, glm::Y)
#define gbg swizzle(glm::Y, glm::Z, glm::Y)
#define bbg swizzle(glm::Z, glm::Z, glm::Y)
#define abg swizzle(glm::W, glm::Z, glm::Y)
#define rag swizzle(glm::X, glm::W, glm::Y)
#define gag swizzle(glm::Y, glm::W, glm::Y)
#define bag swizzle(glm::Z, glm::W, glm::Y)
#define aag swizzle(glm::W, glm::W, glm::Y)
#define rrb swizzle(glm::X, glm::X, glm::Z)
#define grb swizzle(glm::Y, glm::X, glm::Z)
#define brb swizzle(glm::Z, glm::X, glm::Z)
#define arb swizzle(glm::W, glm::X, glm::Z)
#define rgb swizzle(glm::X, glm::Y, glm::Z)
#define ggb swizzle(glm::Y, glm::Y, glm::Z)
#define bgb swizzle(glm::Z, glm::Y, glm::Z)
#define agb swizzle(glm::W, glm::Y, glm::Z)
#define rbb swizzle(glm::X, glm::Z, glm::Z)
#define gbb swizzle(glm::Y, glm::Z, glm::Z)
#define bbb swizzle(glm::Z, glm::Z, glm::Z)
#define abb swizzle(glm::W, glm::Z, glm::Z)
#define rab swizzle(glm::X, glm::W, glm::Z)
#define gab swizzle(glm::Y, glm::W, glm::Z)
#define bab swizzle(glm::Z, glm::W, glm::Z)
#define aab swizzle(glm::W, glm::W, glm::Z)
#define rra swizzle(glm::X, glm::X, glm::W)
#define gra swizzle(glm::Y, glm::X, glm::W)
#define bra swizzle(glm::Z, glm::X, glm::W)
#define ara swizzle(glm::W, glm::X, glm::W)
#define rga swizzle(glm::X, glm::Y, glm::W)
#define gga swizzle(glm::Y, glm::Y, glm::W)
#define bga swizzle(glm::Z, glm::Y, glm::W)
#define aga swizzle(glm::W, glm::Y, glm::W)
#define rba swizzle(glm::X, glm::Z, glm::W)
#define gba swizzle(glm::Y, glm::Z, glm::W)
#define bba swizzle(glm::Z, glm::Z, glm::W)
#define aba swizzle(glm::W, glm::Z, glm::W)
#define raa swizzle(glm::X, glm::W, glm::W)
#define gaa swizzle(glm::Y, glm::W, glm::W)
#define baa swizzle(glm::Z, glm::W, glm::W)
#define aaa swizzle(glm::W, glm::W, glm::W)
#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA)
#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ)
#define sss swizzle(glm::X, glm::X, glm::X)
#define tss swizzle(glm::Y, glm::X, glm::X)
#define pss swizzle(glm::Z, glm::X, glm::X)
#define qss swizzle(glm::W, glm::X, glm::X)
#define sts swizzle(glm::X, glm::Y, glm::X)
#define tts swizzle(glm::Y, glm::Y, glm::X)
#define pts swizzle(glm::Z, glm::Y, glm::X)
#define qts swizzle(glm::W, glm::Y, glm::X)
#define sps swizzle(glm::X, glm::Z, glm::X)
#define tps swizzle(glm::Y, glm::Z, glm::X)