This commit is contained in:
Groove 2018-07-24 20:15:14 +02:00
commit bf7cc4a002
44 changed files with 186 additions and 162 deletions

View file

@ -155,7 +155,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
message("GLM: Visual C++ - ${CMAKE_CXX_COMPILER_ID} compiler")
add_compile_options(/FAs /W4 /WX)
add_compile_options(/W4 /WX)
add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()

View file

@ -781,6 +781,6 @@ namespace detail
}
}//namespace glm
#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
#if GLM_USE_SIMD == GLM_ENABLE
# include "func_common_simd.inl"
#endif

View file

@ -146,7 +146,7 @@ namespace detail
}
}//namespace glm
#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
#if GLM_USE_SIMD == GLM_ENABLE
# include "func_exponential_simd.inl"
#endif

View file

@ -19,6 +19,7 @@ namespace detail
}
};
# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE
template<>
struct compute_sqrt<4, float, aligned_lowp, true>
{
@ -29,6 +30,7 @@ namespace detail
return Result;
}
};
# endif
}//namespace detail
}//namespace glm

View file

@ -242,6 +242,6 @@ namespace detail
}
}//namespace glm
#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
#if GLM_USE_SIMD == GLM_ENABLE
# include "func_geometric_simd.inl"
#endif

View file

@ -372,7 +372,7 @@ namespace detail
}
}//namespace glm
#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
#if GLM_USE_SIMD == GLM_ENABLE
# include "func_integer_simd.inl"
#endif

View file

@ -395,7 +395,7 @@ namespace detail
}
}//namespace glm
#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
#if GLM_USE_SIMD == GLM_ENABLE
# include "func_matrix_simd.inl"
#endif

View file

@ -61,6 +61,7 @@ namespace detail
};
}//namespace detail
# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE
template<>
GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_lowp> outerProduct<4, 4, float, aligned_lowp>(vec<4, float, aligned_lowp> const& c, vec<4, float, aligned_lowp> const& r)
{
@ -90,6 +91,7 @@ namespace detail
std::memcpy(&Result[0], &NativeResult[0], sizeof(Result));
return Result;
}
# endif
}//namespace glm
#endif

View file

@ -184,7 +184,7 @@ namespace glm
}
}//namespace glm
#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
#if GLM_USE_SIMD == GLM_ENABLE
# include "func_packing_simd.inl"
#endif

View file

@ -194,7 +194,7 @@ namespace glm
}
}//namespace glm
#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
#if GLM_USE_SIMD == GLM_ENABLE
# include "func_trigonometric_simd.inl"
#endif

View file

@ -100,6 +100,6 @@ namespace glm
}
}//namespace glm
#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
#if GLM_USE_SIMD == GLM_ENABLE
# include "func_vector_relational_simd.inl"
#endif

View file

@ -15,7 +15,7 @@ namespace glm
packed_mediump, ///< Typed data is tightly packed in memory and operations are executed with medium precision in term of ULPs for higher performance
packed_lowp, ///< Typed data is tightly packed in memory and operations are executed with low precision in term of ULPs to maximize performance
# if (GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE)
# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE
aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs
aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance
aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance
@ -27,7 +27,7 @@ namespace glm
lowp = packed_lowp, ///< By default lowp qualifier is also packed
packed = packed_highp, ///< By default packed qualifier is also high precision
# if (GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE) && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
defaultp = aligned_highp
# else
defaultp = highp

View file

@ -35,13 +35,6 @@
#include "../simd/platform.h"
///////////////////////////////////////////////////////////////////////////////////
// Incompatible GLM_FORCE defines
#if defined(GLM_FORCE_SWIZZLE) && defined(GLM_FORCE_UNRESTRICTED_GENTYPE)
# error "Both GLM_FORCE_SWIZZLE and GLM_FORCE_UNRESTRICTED_GENTYPE can't be defined at the same time"
#endif
///////////////////////////////////////////////////////////////////////////////////
// Build model
@ -233,9 +226,7 @@
#endif
// N2346
#if defined(GLM_FORCE_UNRESTRICTED_GENTYPE)
# define GLM_HAS_DEFAULTED_FUNCTIONS 0
#elif GLM_COMPILER & GLM_COMPILER_CLANG
#if GLM_COMPILER & GLM_COMPILER_CLANG
# define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_DEFAULTED_FUNCTIONS 1
@ -408,12 +399,12 @@
// nullptr
#if GLM_LANG & GLM_LANG_CXX0X_FLAG
# define GLM_HAS_NULLPTR 1
# define GLM_USE_NULLPTR GLM_ENABLE
#else
# define GLM_HAS_NULLPTR 0
# define GLM_USE_NULLPTR GLM_DISABLE
#endif
#if GLM_HAS_NULLPTR
#if GLM_USE_NULLPTR == GLM_ENABLE
# define GLM_NULLPTR nullptr
#else
# define GLM_NULLPTR 0
@ -442,12 +433,6 @@
# define GLM_CUDA_FUNC_DECL
#endif
#if GLM_COMPILER & GLM_COMPILER_GCC
# define GLM_VAR_USED __attribute__ ((unused))
#else
# define GLM_VAR_USED
#endif
#if defined(GLM_FORCE_INLINE)
# if GLM_COMPILER & GLM_COMPILER_VC
# define GLM_INLINE __forceinline
@ -498,7 +483,8 @@
#endif
///////////////////////////////////////////////////////////////////////////////////
// Clip control
// Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM
// to use a clip space between 0 to 1.
#define GLM_DEPTH_ZERO_TO_ONE 0x00000001
#define GLM_DEPTH_NEGATIVE_ONE_TO_ONE 0x00000002
@ -527,62 +513,16 @@
#if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))
# define GLM_DEPRECATED __declspec(deprecated)
# define GLM_ALIGN(x) __declspec(align(x))
# define GLM_ALIGNED_STRUCT(x) struct __declspec(align(x))
# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name
# define GLM_RESTRICT_FUNC __declspec(restrict)
# define GLM_RESTRICT __restrict
# if GLM_COMPILER >= GLM_COMPILER_VC12
# define GLM_VECTOR_CALL __vectorcall
# else
# define GLM_VECTOR_CALL
# endif
#elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL)
# define GLM_DEPRECATED __attribute__((__deprecated__))
# define GLM_ALIGN(x) __attribute__((aligned(x)))
# define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x)))
# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment)))
# define GLM_RESTRICT_FUNC __restrict__
# define GLM_RESTRICT __restrict__
# if GLM_COMPILER & GLM_COMPILER_CLANG
# if GLM_COMPILER >= GLM_COMPILER_CLANG37
# define GLM_VECTOR_CALL __vectorcall
# else
# define GLM_VECTOR_CALL
# endif
# else
# define GLM_VECTOR_CALL
# endif
#elif GLM_COMPILER & GLM_COMPILER_CUDA
# define GLM_DEPRECATED
# define GLM_ALIGN(x) __align__(x)
# define GLM_ALIGNED_STRUCT(x) struct __align__(x)
# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x)
# define GLM_RESTRICT_FUNC __restrict__
# define GLM_RESTRICT __restrict__
# define GLM_VECTOR_CALL
#else
# define GLM_DEPRECATED
# define GLM_ALIGN
# define GLM_ALIGNED_STRUCT(x) struct
# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name
# define GLM_RESTRICT_FUNC
# define GLM_RESTRICT
# define GLM_VECTOR_CALL
#endif//GLM_COMPILER
///////////////////////////////////////////////////////////////////////////////////
#ifdef GLM_FORCE_NO_CTOR_INIT
# undef GLM_FORCE_CTOR_INIT
#endif
#if GLM_HAS_DEFAULTED_FUNCTIONS && !defined(GLM_FORCE_CTOR_INIT)
# define GLM_USE_DEFAULTED_FUNCTIONS GLM_ENABLE
# define GLM_DEFAULT = default
#else
# define GLM_USE_DEFAULTED_FUNCTIONS GLM_DISABLE
# define GLM_DEFAULT
#endif
///////////////////////////////////////////////////////////////////////////////////
@ -630,30 +570,64 @@ namespace glm
#endif
///////////////////////////////////////////////////////////////////////////////////
// Check inclusions of different versions of GLM
// Configure the use of defaulted initialized types
#elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION))
# error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error."
#elif GLM_SETUP_INCLUDED == GLM_VERSION
#define GLM_CTOR_INITIALIZER_LIST (1 << 1)
#define GLM_CTOR_INITIALISATION (1 << 2)
#if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
# define GLM_USE_CTOR_INIT GLM_CTOR_INITIALIZER_LIST
#elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
# define GLM_USE_CTOR_INIT GLM_CTOR_INITIALISATION
#else
# define GLM_USE_CTOR_INIT GLM_DISABLE
#endif
///////////////////////////////////////////////////////////////////////////////////
// Enable aligned gentypes
// Configure the use of defaulted function
#if defined(GLM_FORCE_ALIGNED_GENTYPES) && GLM_HAS_ALIGNOF
#if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_USE_CTOR_INIT == GLM_DISABLE
# define GLM_USE_DEFAULTED_FUNCTIONS GLM_ENABLE
# define GLM_DEFAULT = default
#else
# define GLM_USE_DEFAULTED_FUNCTIONS GLM_DISABLE
# define GLM_DEFAULT
#endif
///////////////////////////////////////////////////////////////////////////////////
// Configure the use of aligned gentypes
#if defined(GLM_FORCE_ALIGNED_GENTYPES) && GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG)
# define GLM_USE_ALIGNED_GENTYPES GLM_ENABLE
#else
# define GLM_USE_ALIGNED_GENTYPES GLM_DISABLE
#endif
///////////////////////////////////////////////////////////////////////////////////
// Implementation detail
// Use SIMD instruction sets
#if (((GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)) || (GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE))
#if (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)
#define GLM_USE_SIMD GLM_ENABLE
#else
#define GLM_USE_SIMD GLM_DISABLE
#endif
///////////////////////////////////////////////////////////////////////////////////
// Configure the use of anonymous structure as implementation detail
#if ((GLM_USE_SIMD == GLM_ENABLE) || (GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE))
# define GLM_USE_ANONYMOUS_STRUCT GLM_ENABLE
#else
# define GLM_USE_ANONYMOUS_STRUCT GLM_DISABLE
#endif
///////////////////////////////////////////////////////////////////////////////////
// Check inclusions of different versions of GLM
#elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION))
# error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error."
#elif GLM_SETUP_INCLUDED == GLM_VERSION
///////////////////////////////////////////////////////////////////////////////////
// Messages

View file

@ -7,14 +7,14 @@ namespace glm
{
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 2, T, Q>::mat()
# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
: value{col_type(1, 0), col_type(0, 1)}
# endif
{
# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
this->value[0] = col_type(1, 0);
this->value[1] = col_type(0, 1);
# endif

View file

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 3, T, Q>::mat()
# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
: value{col_type(1, 0, 0), col_type(0, 1, 0)}
# endif
{
# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
this->value[0] = col_type(1, 0, 0);
this->value[1] = col_type(0, 1, 0);
# endif

View file

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 4, T, Q>::mat()
# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
: value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0)}
# endif
{
# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
this->value[0] = col_type(1, 0, 0, 0);
this->value[1] = col_type(0, 1, 0, 0);
# endif

View file

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 2, T, Q>::mat()
# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
: value{col_type(1, 0), col_type(0, 1), col_type(0, 0)}
# endif
{
# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
this->value[0] = col_type(1, 0);
this->value[1] = col_type(0, 1);
this->value[2] = col_type(0, 0);

View file

@ -7,15 +7,15 @@ namespace glm
{
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q>::mat()
# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
: value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1)}
# endif
{
# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(1, 0, 0);
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
this->value[0] = col_type(1, 0, 0);
this->value[1] = col_type(0, 1, 0);
this->value[2] = col_type(0, 0, 1);
# endif

View file

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 4, T, Q>::mat()
# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
: value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0)}
# endif
{
# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
this->value[0] = col_type(1, 0, 0, 0);
this->value[1] = col_type(0, 1, 0, 0);
this->value[2] = col_type(0, 0, 1, 0);

View file

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 2, T, Q>::mat()
# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
: value{col_type(1, 0), col_type(0, 1), col_type(0, 0), col_type(0, 0)}
# endif
{
# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
this->value[0] = col_type(1, 0);
this->value[1] = col_type(0, 1);
this->value[2] = col_type(0, 0);

View file

@ -5,14 +5,14 @@ namespace glm
{
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 3, T, Q>::mat()
# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
: value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1), col_type(0, 0, 0)}
# endif
{
# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
this->value[0] = col_type(1, 0, 0);
this->value[1] = col_type(0, 1, 0);
this->value[2] = col_type(0, 0, 1);

View file

@ -7,14 +7,14 @@ namespace glm
{
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 4, T, Q>::mat()
# if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
: value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)}
# endif
{
# if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
# if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
this->value[0] = col_type(1, 0, 0, 0);
this->value[1] = col_type(0, 1, 0, 0);
this->value[2] = col_type(0, 0, 1, 0);
@ -704,6 +704,6 @@ namespace glm
}
}//namespace glm
#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
#if GLM_USE_SIMD == GLM_ENABLE
# include "type_mat4x4_simd.inl"
#endif

View file

@ -8,7 +8,7 @@ namespace glm
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<1, T, Q>::vec()
# ifdef GLM_FORCE_CTOR_INIT
# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
: x(0)
# endif
{}

View file

@ -10,7 +10,7 @@ namespace glm
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<2, T, Q>::vec()
# ifdef GLM_FORCE_CTOR_INIT
# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
: x(0), y(0)
# endif
{}

View file

@ -8,7 +8,7 @@ namespace glm
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<3, T, Q>::vec()
# ifdef GLM_FORCE_CTOR_INIT
# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
: x(0), y(0), z(0)
# endif
{}

View file

@ -161,7 +161,7 @@ namespace detail
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<4, T, Q>::vec()
# ifdef GLM_FORCE_CTOR_INIT
# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
: x(0), y(0), z(0), w(0)
# endif
{}
@ -1142,6 +1142,6 @@ namespace detail
}
}//namespace glm
#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
#if GLM_USE_SIMD == GLM_ENABLE
# include "type_vec4_simd.inl"
#endif

View file

@ -147,6 +147,7 @@ namespace detail
};
# endif
# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE
template<>
struct compute_vec4_div<float, aligned_lowp, true>
{
@ -157,6 +158,7 @@ namespace detail
return Result;
}
};
# endif
template<typename T, qualifier Q>
struct compute_vec4_and<T, Q, true, 32, true>
@ -343,6 +345,7 @@ namespace detail
};
}//namespace detail
# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<4, float, aligned_lowp>::vec(float _s) :
data(_mm_set1_ps(_s))
@ -457,6 +460,7 @@ namespace detail
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<4, float, aligned_highp>::vec(int32 _x, int32 _y, int32 _z, int32 _w) :
data(_mm_castsi128_ps(_mm_set_epi32(_w, _z, _y, _x)))
{}
#endif// GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE
}//namespace glm
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT

View file

@ -31,12 +31,11 @@
#include "./gtc/random.hpp"
#include "./gtc/reciprocal.hpp"
#include "./gtc/round.hpp"
//#include "./gtc/type_aligned.hpp"
#include "./gtc/type_precision.hpp"
#include "./gtc/type_ptr.hpp"
#include "./gtc/ulp.hpp"
#include "./gtc/vec1.hpp"
#if GLM_HAS_ANONYMOUS_STRUCT
#if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE
# include "./gtc/type_aligned.hpp"
#endif

View file

@ -98,11 +98,6 @@
#include <cassert>
#include "fwd.hpp"
#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED)
# define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED
# pragma message("GLM: Core library included")
#endif//GLM_MESSAGES
#include "vec2.hpp"
#include "vec3.hpp"
#include "vec4.hpp"

View file

@ -87,7 +87,7 @@ namespace detail
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 tquat<T, Q>::tquat()
# ifdef GLM_FORCE_CTOR_INIT
# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
: x(0), y(0), z(0), w(1)
# endif
{}
@ -799,7 +799,7 @@ namespace detail
}
}//namespace glm
#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
#if GLM_USE_SIMD == GLM_ENABLE
# include "quaternion_simd.inl"
#endif

View file

@ -26,8 +26,8 @@ namespace glm
# if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 tdualquat<T, Q>::tdualquat()
# ifdef GLM_FORCE_CTOR_INIT
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 tdualquat<T, Q>::tdualquat()
# if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
: real(tquat<T, Q>())
, dual(tquat<T, Q>(0, 0, 0, 0))
# endif

View file

@ -91,33 +91,6 @@ namespace glm
return true;
}
/*
typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon();
if(a < Epsilon && a > -Epsilon)
return false;
typename genType::value_type f = typename genType::value_type(1.0f) / a;
genType s = orig - v0;
baryPosition.x = f * glm::dot(s, p);
if(baryPosition.x < typename genType::value_type(0.0f))
return false;
if(baryPosition.x > typename genType::value_type(1.0f))
return false;
genType q = glm::cross(s, e1);
baryPosition.y = f * glm::dot(dir, q);
if(baryPosition.y < typename genType::value_type(0.0f))
return false;
if(baryPosition.y + baryPosition.x > typename genType::value_type(1.0f))
return false;
baryPosition.z = f * glm::dot(e2, q);
return baryPosition.z >= typename genType::value_type(0.0f);
}
*/
template<typename genType>
GLM_FUNC_QUALIFIER bool intersectLineTriangle
(

View file

@ -1,6 +1,6 @@
#include <glm/glm.hpp>
#if GLM_HAS_ANONYMOUS_STRUCT
#if GLM_USE_ANONYMOUS_STRUCT == GLM_ENABLE
struct vec2;
struct _swizzle

View file

@ -1,3 +1,7 @@
glmCreateTestGTC(core_force_aligned_gentypes)
glmCreateTestGTC(core_force_ctor_init)
glmCreateTestGTC(core_force_explicit_ctor)
glmCreateTestGTC(core_force_inline)
glmCreateTestGTC(core_force_pure)
glmCreateTestGTC(core_force_unrestricted_gentype)
glmCreateTestGTC(core_type_aligned)

View file

@ -0,0 +1,12 @@
#define GLM_FORCE_ALIGNED_GENTYPES
#include <glm/glm.hpp>
#include <glm/ext.hpp>
int main()
{
int Error = 0;
return Error;
}

View file

@ -0,0 +1,12 @@
#define GLM_FORCE_CTOR_INIT
#include <glm/glm.hpp>
#include <glm/ext.hpp>
int main()
{
int Error = 0;
return Error;
}

View file

@ -0,0 +1,17 @@
#define GLM_FORCE_EXPLICIT_CTOR
#include <glm/glm.hpp>
#include <glm/ext.hpp>
int main()
{
int Error = 0;
glm::ivec4 B(1);
Error += B == glm::ivec4(1) ? 0 : 1;
//glm::vec4 A = B;
return Error;
}

View file

@ -0,0 +1,12 @@
#define GLM_FORCE_INLINE
#include <glm/glm.hpp>
#include <glm/ext.hpp>
int main()
{
int Error = 0;
return Error;
}

View file

@ -1,6 +1,7 @@
#define GLM_FORCE_UNRESTRICTED_GENTYPE
#include <glm/glm.hpp>
#include <glm/ext.hpp>
int main()
{

View file

@ -1,4 +1,3 @@
#define GLM_FORCE_MESSAGES
#define GLM_FORCE_SWIZZLE
#include <glm/glm.hpp>

View file

@ -1,4 +1,3 @@
#define GLM_FORCE_MESSAGES
#include <glm/vec3.hpp>
#include <cstdio>

View file

@ -1,4 +1,3 @@
#define GLM_FORCE_MESSAGES
#define GLM_FORCE_ALIGNED_GENTYPES
#include <glm/glm.hpp>

View file

@ -24,11 +24,31 @@ int test_intersectRayTriangle()
return Error;
}
int test_intersectLineTriangle()
{
int Error = 0;
glm::vec3 const Orig(0, 0, 2);
glm::vec3 const Dir(0, 0, -1);
glm::vec3 const Vert0(0, 0, 0);
glm::vec3 const Vert1(-1, -1, 0);
glm::vec3 const Vert2(1, -1, 0);
glm::vec3 Position(2.0f, 0.0f, 0.0f);
bool const Result = glm::intersectLineTriangle(Orig, Dir, Vert0, Vert1, Vert2, Position);
Error += glm::all(glm::epsilonEqual(Position, glm::vec3(2.0f, 0.0f, 0.0f), std::numeric_limits<float>::epsilon())) ? 0 : 1;
Error += Result ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_intersectRayTriangle();
Error += test_intersectLineTriangle();
return Error;
}

View file

@ -20,7 +20,7 @@ namespace
case glm::highp: os << "uhi"; break;
case glm::mediump: os << "umd"; break;
case glm::lowp: os << "ulo"; break;
# if GLM_HAS_ANONYMOUS_STRUCT
# if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE
case glm::aligned_highp: os << "ahi"; break;
case glm::aligned_mediump: os << "amd"; break;
case glm::aligned_lowp: os << "alo"; break;