Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ACGL
acgl
Commits
b41d0668
Commit
b41d0668
authored
Oct 21, 2015
by
Robert Menzel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated GLM to 0.9.7.1
parent
7ae41f65
Changes
266
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
6191 additions
and
8096 deletions
+6191
-8096
include/glm/CMakeLists.txt
include/glm/CMakeLists.txt
+10
-6
include/glm/common.hpp
include/glm/common.hpp
+6
-5
include/glm/detail/_features.hpp
include/glm/detail/_features.hpp
+9
-8
include/glm/detail/_fixes.hpp
include/glm/detail/_fixes.hpp
+6
-2
include/glm/detail/_noise.hpp
include/glm/detail/_noise.hpp
+17
-11
include/glm/detail/_swizzle.hpp
include/glm/detail/_swizzle.hpp
+493
-500
include/glm/detail/_swizzle_func.hpp
include/glm/detail/_swizzle_func.hpp
+7
-6
include/glm/detail/_vectorize.hpp
include/glm/detail/_vectorize.hpp
+114
-171
include/glm/detail/dummy.cpp
include/glm/detail/dummy.cpp
+47
-5
include/glm/detail/func_common.hpp
include/glm/detail/func_common.hpp
+77
-93
include/glm/detail/func_common.inl
include/glm/detail/func_common.inl
+314
-592
include/glm/detail/func_exponential.hpp
include/glm/detail/func_exponential.hpp
+32
-32
include/glm/detail/func_exponential.inl
include/glm/detail/func_exponential.inl
+51
-137
include/glm/detail/func_geometric.hpp
include/glm/detail/func_geometric.hpp
+27
-36
include/glm/detail/func_geometric.inl
include/glm/detail/func_geometric.inl
+52
-191
include/glm/detail/func_integer.hpp
include/glm/detail/func_integer.hpp
+86
-57
include/glm/detail/func_integer.inl
include/glm/detail/func_integer.inl
+247
-512
include/glm/detail/func_matrix.hpp
include/glm/detail/func_matrix.hpp
+8
-9
include/glm/detail/func_matrix.inl
include/glm/detail/func_matrix.inl
+48
-198
include/glm/detail/func_noise.inl
include/glm/detail/func_noise.inl
+0
-384
include/glm/detail/func_packing.hpp
include/glm/detail/func_packing.hpp
+14
-12
include/glm/detail/func_packing.inl
include/glm/detail/func_packing.inl
+138
-39
include/glm/detail/func_trigonometric.hpp
include/glm/detail/func_trigonometric.hpp
+40
-38
include/glm/detail/func_trigonometric.inl
include/glm/detail/func_trigonometric.inl
+121
-143
include/glm/detail/func_vector_relational.hpp
include/glm/detail/func_vector_relational.hpp
+15
-20
include/glm/detail/func_vector_relational.inl
include/glm/detail/func_vector_relational.inl
+34
-62
include/glm/detail/glm.cpp
include/glm/detail/glm.cpp
+7
-9
include/glm/detail/intrinsic_common.hpp
include/glm/detail/intrinsic_common.hpp
+3
-5
include/glm/detail/intrinsic_common.inl
include/glm/detail/intrinsic_common.inl
+8
-8
include/glm/detail/intrinsic_exponential.hpp
include/glm/detail/intrinsic_exponential.hpp
+3
-5
include/glm/detail/intrinsic_exponential.inl
include/glm/detail/intrinsic_exponential.inl
+2
-2
include/glm/detail/intrinsic_geometric.hpp
include/glm/detail/intrinsic_geometric.hpp
+3
-5
include/glm/detail/intrinsic_geometric.inl
include/glm/detail/intrinsic_geometric.inl
+17
-16
include/glm/detail/intrinsic_integer.hpp
include/glm/detail/intrinsic_integer.hpp
+2
-4
include/glm/detail/intrinsic_integer.inl
include/glm/detail/intrinsic_integer.inl
+1
-1
include/glm/detail/intrinsic_matrix.hpp
include/glm/detail/intrinsic_matrix.hpp
+3
-5
include/glm/detail/intrinsic_matrix.inl
include/glm/detail/intrinsic_matrix.inl
+6
-6
include/glm/detail/intrinsic_trigonometric.hpp
include/glm/detail/intrinsic_trigonometric.hpp
+3
-5
include/glm/detail/intrinsic_trigonometric.inl
include/glm/detail/intrinsic_trigonometric.inl
+2
-2
include/glm/detail/intrinsic_vector_relational.hpp
include/glm/detail/intrinsic_vector_relational.hpp
+3
-5
include/glm/detail/intrinsic_vector_relational.inl
include/glm/detail/intrinsic_vector_relational.inl
+89
-89
include/glm/detail/precision.hpp
include/glm/detail/precision.hpp
+8
-6
include/glm/detail/precision.inl
include/glm/detail/precision.inl
+0
-0
include/glm/detail/setup.hpp
include/glm/detail/setup.hpp
+658
-405
include/glm/detail/type_float.hpp
include/glm/detail/type_float.hpp
+7
-6
include/glm/detail/type_gentype.hpp
include/glm/detail/type_gentype.hpp
+7
-6
include/glm/detail/type_gentype.inl
include/glm/detail/type_gentype.inl
+6
-2
include/glm/detail/type_half.hpp
include/glm/detail/type_half.hpp
+7
-10
include/glm/detail/type_half.inl
include/glm/detail/type_half.inl
+7
-4
include/glm/detail/type_int.hpp
include/glm/detail/type_int.hpp
+146
-11
include/glm/detail/type_mat.hpp
include/glm/detail/type_mat.hpp
+83
-85
include/glm/detail/type_mat.inl
include/glm/detail/type_mat.inl
+7
-2
include/glm/detail/type_mat2x2.hpp
include/glm/detail/type_mat2x2.hpp
+93
-113
include/glm/detail/type_mat2x2.inl
include/glm/detail/type_mat2x2.inl
+152
-255
include/glm/detail/type_mat2x3.hpp
include/glm/detail/type_mat2x3.hpp
+92
-97
include/glm/detail/type_mat2x3.inl
include/glm/detail/type_mat2x3.inl
+157
-236
include/glm/detail/type_mat2x4.hpp
include/glm/detail/type_mat2x4.hpp
+94
-99
include/glm/detail/type_mat2x4.inl
include/glm/detail/type_mat2x4.inl
+148
-237
include/glm/detail/type_mat3x2.hpp
include/glm/detail/type_mat3x2.hpp
+94
-97
include/glm/detail/type_mat3x2.inl
include/glm/detail/type_mat3x2.inl
+142
-220
include/glm/detail/type_mat3x3.hpp
include/glm/detail/type_mat3x3.hpp
+93
-110
include/glm/detail/type_mat3x3.inl
include/glm/detail/type_mat3x3.inl
+174
-324
include/glm/detail/type_mat3x4.hpp
include/glm/detail/type_mat3x4.hpp
+98
-101
include/glm/detail/type_mat3x4.inl
include/glm/detail/type_mat3x4.inl
+165
-235
include/glm/detail/type_mat4x2.hpp
include/glm/detail/type_mat4x2.hpp
+95
-99
include/glm/detail/type_mat4x2.inl
include/glm/detail/type_mat4x2.inl
+159
-242
include/glm/detail/type_mat4x3.hpp
include/glm/detail/type_mat4x3.hpp
+86
-90
include/glm/detail/type_mat4x3.inl
include/glm/detail/type_mat4x3.inl
+181
-272
include/glm/detail/type_mat4x4.hpp
include/glm/detail/type_mat4x4.hpp
+93
-111
include/glm/detail/type_mat4x4.inl
include/glm/detail/type_mat4x4.inl
+233
-359
include/glm/detail/type_vec.hpp
include/glm/detail/type_vec.hpp
+149
-153
include/glm/detail/type_vec.inl
include/glm/detail/type_vec.inl
+6
-2
include/glm/detail/type_vec1.hpp
include/glm/detail/type_vec1.hpp
+160
-121
include/glm/detail/type_vec1.inl
include/glm/detail/type_vec1.inl
+198
-412
include/glm/detail/type_vec2.hpp
include/glm/detail/type_vec2.hpp
+228
-138
No files found.
include/glm/CMakeLists.txt
View file @
b41d0668
...
...
@@ -4,6 +4,8 @@ file(GLOB ROOT_SOURCE *.cpp)
file
(
GLOB ROOT_INLINE *.inl
)
file
(
GLOB ROOT_HEADER *.hpp
)
file
(
GLOB ROOT_TEXT ../*.txt
)
file
(
GLOB ROOT_MD ../*.md
)
file
(
GLOB ROOT_NAT ../util/glm.natvis
)
file
(
GLOB_RECURSE CORE_SOURCE ./detail/*.cpp
)
file
(
GLOB_RECURSE CORE_INLINE ./detail/*.inl
)
...
...
@@ -17,7 +19,7 @@ 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
(
"Text Files"
FILES
${
ROOT_TEXT
}
${
ROOT_MD
}
)
source_group
(
"Core Files"
FILES
${
CORE_SOURCE
}
)
source_group
(
"Core Files"
FILES
${
CORE_INLINE
}
)
source_group
(
"Core Files"
FILES
${
CORE_HEADER
}
)
...
...
@@ -30,11 +32,13 @@ source_group("GTX Files" FILES ${GTX_HEADER})
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/..
)
add_executable
(
${
NAME
}
${
ROOT_TEXT
}
if
(
GLM_TEST_ENABLE
)
add_executable
(
${
NAME
}
${
ROOT_TEXT
}
${
ROOT_MD
}
${
ROOT_NAT
}
${
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)
include/glm/common.hpp
View file @
b41d0668
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 201
4
G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 201
5
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
...
...
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// 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
...
...
@@ -26,9 +30,6 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_COMMON_INCLUDED
#define GLM_COMMON_INCLUDED
#pragma once
#include "detail/func_common.hpp"
#endif//GLM_COMMON_INCLUDED
include/glm/detail/_features.hpp
View file @
b41d0668
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 201
4
G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 201
5
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
...
...
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// 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
...
...
@@ -21,13 +25,12 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/
core
/_features.hpp
/// @file glm/
detail
/_features.hpp
/// @date 2013-02-20 / 2013-02-20
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_features
#define glm_core_features
#pragma once
// #define GLM_CXX98_EXCEPTIONS
// #define GLM_CXX98_RTTI
...
...
@@ -281,7 +284,7 @@
# define GLM_CXX11_STATIC_ASSERT
# endif
#elif(GLM_COMPILER & GLM_COMPILER_
CLANG
)
#elif(GLM_COMPILER &
(
GLM_COMPILER_
APPLE_CLANG | GLM_COMPILER_LLVM)
)
# if(__has_feature(cxx_exceptions))
# define GLM_CXX98_EXCEPTIONS
# endif
...
...
@@ -422,6 +425,4 @@
# define GLM_CXX11_VARIADIC_TEMPLATES
# endif
#endif//(GLM_COMPILER & GLM_COMPILER_CLANG)
#endif//glm_core_features
#endif//(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
include/glm/detail/_fixes.hpp
View file @
b41d0668
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 201
4
G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 201
5
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
...
...
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// 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
...
...
@@ -21,7 +25,7 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/
core
/_fixes.hpp
/// @file glm/
detail
/_fixes.hpp
/// @date 2011-02-21 / 2011-11-22
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
...
...
include/glm/detail/_noise.hpp
View file @
b41d0668
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 201
4
G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 201
5
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
...
...
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// 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
...
...
@@ -26,8 +30,12 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_DETAIL_NOISE_INCLUDED
#define GLM_DETAIL_NOISE_INCLUDED
#pragma once
#include "../vec2.hpp"
#include "../vec3.hpp"
#include "../vec4.hpp"
#include "../common.hpp"
namespace
glm
{
namespace
detail
...
...
@@ -75,19 +83,19 @@ namespace detail
}
template
<
typename
T
,
precision
P
>
GLM_FUNC_QUALIFIER
detail
::
tvec2
<
T
,
P
>
taylorInvSqrt
(
detail
::
tvec2
<
T
,
P
>
const
&
r
)
GLM_FUNC_QUALIFIER
tvec2
<
T
,
P
>
taylorInvSqrt
(
tvec2
<
T
,
P
>
const
&
r
)
{
return
T
(
1.79284291400159
)
-
T
(
0.85373472095314
)
*
r
;
}
template
<
typename
T
,
precision
P
>
GLM_FUNC_QUALIFIER
detail
::
tvec3
<
T
,
P
>
taylorInvSqrt
(
detail
::
tvec3
<
T
,
P
>
const
&
r
)
GLM_FUNC_QUALIFIER
tvec3
<
T
,
P
>
taylorInvSqrt
(
tvec3
<
T
,
P
>
const
&
r
)
{
return
T
(
1.79284291400159
)
-
T
(
0.85373472095314
)
*
r
;
}
template
<
typename
T
,
precision
P
>
GLM_FUNC_QUALIFIER
detail
::
tvec4
<
T
,
P
>
taylorInvSqrt
(
detail
::
tvec4
<
T
,
P
>
const
&
r
)
GLM_FUNC_QUALIFIER
tvec4
<
T
,
P
>
taylorInvSqrt
(
tvec4
<
T
,
P
>
const
&
r
)
{
return
T
(
1.79284291400159
)
-
T
(
0.85373472095314
)
*
r
;
}
...
...
@@ -100,19 +108,19 @@ namespace detail
*/
template
<
typename
T
,
precision
P
>
GLM_FUNC_QUALIFIER
detail
::
tvec2
<
T
,
P
>
fade
(
detail
::
tvec2
<
T
,
P
>
const
&
t
)
GLM_FUNC_QUALIFIER
tvec2
<
T
,
P
>
fade
(
tvec2
<
T
,
P
>
const
&
t
)
{
return
(
t
*
t
*
t
)
*
(
t
*
(
t
*
T
(
6
)
-
T
(
15
))
+
T
(
10
));
}
template
<
typename
T
,
precision
P
>
GLM_FUNC_QUALIFIER
detail
::
tvec3
<
T
,
P
>
fade
(
detail
::
tvec3
<
T
,
P
>
const
&
t
)
GLM_FUNC_QUALIFIER
tvec3
<
T
,
P
>
fade
(
tvec3
<
T
,
P
>
const
&
t
)
{
return
(
t
*
t
*
t
)
*
(
t
*
(
t
*
T
(
6
)
-
T
(
15
))
+
T
(
10
));
}
template
<
typename
T
,
precision
P
>
GLM_FUNC_QUALIFIER
detail
::
tvec4
<
T
,
P
>
fade
(
detail
::
tvec4
<
T
,
P
>
const
&
t
)
GLM_FUNC_QUALIFIER
tvec4
<
T
,
P
>
fade
(
tvec4
<
T
,
P
>
const
&
t
)
{
return
(
t
*
t
*
t
)
*
(
t
*
(
t
*
T
(
6
)
-
T
(
15
))
+
T
(
10
));
}
...
...
@@ -126,5 +134,3 @@ namespace detail
}
//namespace detail
}
//namespace glm
#endif//GLM_DETAIL_NOISE_INCLUDED
include/glm/detail/_swizzle.hpp
View file @
b41d0668
This diff is collapsed.
Click to expand it.
include/glm/detail/_swizzle_func.hpp
View file @
b41d0668
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 201
4
G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 201
5
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
...
...
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// 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
...
...
@@ -21,13 +25,12 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/
core
/_swizzle_func.hpp
/// @file glm/
detail
/_swizzle_func.hpp
/// @date 2011-10-16 / 2011-10-16
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_swizzle_func
#define glm_core_swizzle_func
#pragma once
#define GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \
SWIZZLED_TYPE
<
TMPL_TYPE
,
PRECISION
>
A
##
B
()
CONST
\
...
...
@@ -720,5 +723,3 @@
GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP
(
TMPL_TYPE
,
PRECISION
,
CLASS_TYPE
,
SWIZZLED_VEC2_TYPE
,
SWIZZLED_VEC3_TYPE
,
SWIZZLED_VEC4_TYPE
,
s
,
t
,
p
,
q
)
//GLM_SWIZZLE_GEN_VEC_FROM_VEC4(valType, detail::vec4, detail::vec2, detail::vec3, detail::vec4)
#endif//glm_core_swizzle_func
include/glm/detail/_vectorize.hpp
View file @
b41d0668
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 201
4
G-Truc Creation (www.g-truc.net)
/// Copyright (c) 2005 - 201
5
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
...
...
@@ -12,6 +12,10 @@
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// 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
...
...
@@ -21,197 +25,136 @@
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/
core
/_vectorize.hpp
/// @file glm/
detail
/_vectorize.hpp
/// @date 2011-10-14 / 2011-10-14
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_CORE_DETAIL_INCLUDED
#define GLM_CORE_DETAIL_INCLUDED
#pragma once
#include "type_vec1.hpp"
#include "type_vec2.hpp"
#include "type_vec3.hpp"
#include "type_vec4.hpp"
#define VECTORIZE1_VEC(func) \
template
<
typename
T
,
precision
P
>
\
GLM_FUNC_QUALIFIER
detail
::
tvec1
<
T
,
P
>
func
(
\
detail
::
tvec1
<
T
,
P
>
const
&
v
)
\
{
\
return
detail
::
tvec1
<
T
,
P
>
(
\
func
(
v
.
x
));
\
}
namespace
glm
{
namespace
detail
{
template
<
typename
R
,
typename
T
,
precision
P
,
template
<
typename
,
precision
>
class
vecType
>
struct
functor1
{};
#define VECTORIZE2_VEC(func) \
template
<
typename
T
,
precision
P
>
\
GLM_FUNC_QUALIFIER
detail
::
tvec2
<
T
,
P
>
func
(
\
detail
::
tvec2
<
T
,
P
>
const
&
v
)
\
{
\
return
detail
::
tvec2
<
T
,
P
>
(
\
func
(
v
.
x
),
\
func
(
v
.
y
));
\
template
<
typename
R
,
typename
T
,
precision
P
>
struct
functor1
<
R
,
T
,
P
,
tvec1
>
{
GLM_FUNC_QUALIFIER
static
tvec1
<
R
,
P
>
call
(
R
(
*
Func
)
(
T
x
),
tvec1
<
T
,
P
>
const
&
v
)
{
return
tvec1
<
R
,
P
>
(
Func
(
v
.
x
));
}
};
#define VECTORIZE3_VEC(func) \
template
<
typename
T
,
precision
P
>
\
GLM_FUNC_QUALIFIER
detail
::
tvec3
<
T
,
P
>
func
(
\
detail
::
tvec3
<
T
,
P
>
const
&
v
)
\
{
\
return
detail
::
tvec3
<
T
,
P
>
(
\
func
(
v
.
x
),
\
func
(
v
.
y
),
\
func
(
v
.
z
));
\
template
<
typename
R
,
typename
T
,
precision
P
>
struct
functor1
<
R
,
T
,
P
,
tvec2
>
{
GLM_FUNC_QUALIFIER
static
tvec2
<
R
,
P
>
call
(
R
(
*
Func
)
(
T
x
),
tvec2
<
T
,
P
>
const
&
v
)
{
return
tvec2
<
R
,
P
>
(
Func
(
v
.
x
),
Func
(
v
.
y
));
}
};
#define VECTORIZE4_VEC(func) \
template
<
typename
T
,
precision
P
>
\
GLM_FUNC_QUALIFIER
detail
::
tvec4
<
T
,
P
>
func
(
\
detail
::
tvec4
<
T
,
P
>
const
&
v
)
\
{
\
return
detail
::
tvec4
<
T
,
P
>
(
\
func
(
v
.
x
),
\
func
(
v
.
y
),
\
func
(
v
.
z
),
\
func
(
v
.
w
));
\
template
<
typename
R
,
typename
T
,
precision
P
>
struct
functor1
<
R
,
T
,
P
,
tvec3
>
{
GLM_FUNC_QUALIFIER
static
tvec3
<
R
,
P
>
call
(
R
(
*
Func
)
(
T
x
),
tvec3
<
T
,
P
>
const
&
v
)
{
return
tvec3
<
R
,
P
>
(
Func
(
v
.
x
),
Func
(
v
.
y
),
Func
(
v
.
z
));
}
};
#define VECTORIZE_VEC(func) \
VECTORIZE1_VEC
(
func
)
\
VECTORIZE2_VEC
(
func
)
\
VECTORIZE3_VEC
(
func
)
\
VECTORIZE4_VEC
(
func
)
#define VECTORIZE1_VEC_SCA(func) \
template
<
typename
T
,
precision
P
>
\
GLM_FUNC_QUALIFIER
detail
::
tvec1
<
T
,
P
>
func
\
(
\
detail
::
tvec1
<
T
,
P
>
const
&
x
,
\
T
const
&
y
\
)
\
{
\
return
detail
::
tvec1
<
T
,
P
>
(
\
func
(
x
.
x
,
y
));
\
template
<
typename
R
,
typename
T
,
precision
P
>
struct
functor1
<
R
,
T
,
P
,
tvec4
>
{
GLM_FUNC_QUALIFIER
static
tvec4
<
R
,
P
>
call
(
R
(
*
Func
)
(
T
x
),
tvec4
<
T
,
P
>
const
&
v
)
{
return
tvec4
<
R
,
P
>
(
Func
(
v
.
x
),
Func
(
v
.
y
),
Func
(
v
.
z
),
Func
(
v
.
w
));
}
};
#define VECTORIZE2_VEC_SCA(func) \
template
<
typename
T
,
precision
P
>
\
GLM_FUNC_QUALIFIER
detail
::
tvec2
<
T
,
P
>
func
\
(
\
detail
::
tvec2
<
T
,
P
>
const
&
x
,
\
T
const
&
y
\
)
\
{
\
return
detail
::
tvec2
<
T
,
P
>
(
\
func
(
x
.
x
,
y
),
\
func
(
x
.
y
,
y
));
\
}
template
<
typename
T
,
precision
P
,
template
<
typename
,
precision
>
class
vecType
>
struct
functor2
{};
#define VECTORIZE3_VEC_SCA(func) \
template
<
typename
T
,
precision
P
>
\
GLM_FUNC_QUALIFIER
detail
::
tvec3
<
T
,
P
>
func
\
(
\
detail
::
tvec3
<
T
,
P
>
const
&
x
,
\
T
const
&
y
\
)
\
{
\
return
detail
::
tvec3
<
T
,
P
>
(
\
func
(
x
.
x
,
y
),
\
func
(
x
.
y
,
y
),
\
func
(
x
.
z
,
y
));
\
template
<
typename
T
,
precision
P
>
struct
functor2
<
T
,
P
,
tvec1
>
{
GLM_FUNC_QUALIFIER
static
tvec1
<
T
,
P
>
call
(
T
(
*
Func
)
(
T
x
,
T
y
),
tvec1
<
T
,
P
>
const
&
a
,
tvec1
<
T
,
P
>
const
&
b
)
{
return
tvec1
<
T
,
P
>
(
Func
(
a
.
x
,
b
.
x
));
}
};
#define VECTORIZE4_VEC_SCA(func) \
template
<
typename
T
,
precision
P
>
\
GLM_FUNC_QUALIFIER
detail
::
tvec4
<
T
,
P
>
func
\
(
\
detail
::
tvec4
<
T
,
P
>
const
&
x
,
\
T
const
&
y
\
)
\
{
\
return
detail
::
tvec4
<
T
,
P
>
(
\
func
(
x
.
x
,
y
),
\
func
(
x
.
y
,
y
),
\
func
(
x
.
z
,
y
),
\
func
(
x
.
w
,
y
));
\
template
<
typename
T
,
precision
P
>
struct
functor2
<
T
,
P
,
tvec2
>
{
GLM_FUNC_QUALIFIER
static
tvec2
<
T
,
P
>
call
(
T
(
*
Func
)
(
T
x
,
T
y
),
tvec2
<
T
,
P
>
const
&
a
,
tvec2
<
T
,
P
>
const
&
b
)
{
return
tvec2
<
T
,
P
>
(
Func
(
a
.
x
,
b
.
x
),
Func
(
a
.
y
,
b
.
y
));
}
};
#define VECTORIZE_VEC_SCA(func) \
VECTORIZE1_VEC_SCA
(
func
)
\
VECTORIZE2_VEC_SCA
(
func
)
\
VECTORIZE3_VEC_SCA
(
func
)
\
VECTORIZE4_VEC_SCA
(
func
)
#define VECTORIZE2_VEC_VEC(func) \
template
<
typename
T
,
precision
P
>
\
GLM_FUNC_QUALIFIER
detail
::
tvec2
<
T
,
P
>
func
\
(
\
detail
::
tvec2
<
T
,
P
>
const
&
x
,
\
detail
::
tvec2
<
T
,
P
>
const
&
y
\
)
\
{
\
return
detail
::
tvec2
<
T
,
P
>
(
\
func
(
x
.
x
,
y
.
x
),
\
func
(
x
.
y
,
y
.
y
));
\
template
<
typename
T
,
precision
P
>
struct
functor2
<
T
,
P
,
tvec3
>
{
GLM_FUNC_QUALIFIER
static
tvec3
<
T
,
P
>
call
(
T
(
*
Func
)
(
T
x
,
T
y
),
tvec3
<
T
,
P
>
const
&
a
,
tvec3
<
T
,
P
>
const
&
b
)
{
return
tvec3
<
T
,
P
>
(
Func
(
a
.
x
,
b
.
x
),
Func
(
a
.
y
,
b
.
y
),
Func
(
a
.
z
,
b
.
z
));
}
};
#define VECTORIZE3_VEC_VEC(func) \
template
<
typename
T
,
precision
P
>
\
GLM_FUNC_QUALIFIER
detail
::
tvec3
<
T
,
P
>
func
\
(
\
detail
::
tvec3
<
T
,
P
>
const
&
x
,
\
detail
::
tvec3
<
T
,
P
>
const
&
y
\
)
\
{
\
return
detail
::
tvec3
<
T
,
P
>
(
\
func
(
x
.
x
,
y
.
x
),
\
func
(
x
.
y
,
y
.
y
),
\
func
(
x
.
z
,
y
.
z
));
\
template
<
typename
T
,
precision
P
>
struct
functor2
<
T
,
P
,
tvec4
>
{
GLM_FUNC_QUALIFIER
static
tvec4
<
T
,
P
>
call
(
T
(
*
Func
)
(
T
x
,
T
y
),
tvec4
<
T
,
P
>
const
&
a
,
tvec4
<
T
,
P
>
const
&
b
)
{
return
tvec4
<
T
,
P
>
(
Func
(
a
.
x
,
b
.
x
),
Func
(
a
.
y
,
b
.
y
),
Func
(
a
.
z
,
b
.
z
),
Func
(
a
.
w
,
b
.
w
));
}
};
#define VECTORIZE4_VEC_VEC(func) \
template
<
typename
T
,
precision
P
>
\
GLM_FUNC_QUALIFIER
detail
::
tvec4
<
T
,
P
>
func
\
(
\
detail
::
tvec4
<
T
,
P
>
const
&
x
,
\
detail
::
tvec4
<
T
,
P
>
const
&
y
\
)
\
{
\
return
detail
::
tvec4
<
T
,
P
>
(
\
func
(
x
.
x
,
y
.
x
),
\
func
(
x
.
y
,
y
.
y
),
\
func
(
x
.
z
,
y
.
z
),
\
func
(
x
.
w
,
y
.
w
));
\
template
<
typename
T
,
precision
P
,
template
<
typename
,
precision
>
class
vecType
>
struct
functor2_vec_sca
{};
template
<
typename
T
,
precision
P
>
struct
functor2_vec_sca
<
T
,
P
,
tvec1
>
{
GLM_FUNC_QUALIFIER
static
tvec1
<
T
,
P
>
call
(
T
(
*
Func
)
(
T
x
,
T
y
),
tvec1
<
T
,
P
>
const
&
a
,
T
b
)
{
return
tvec1
<
T
,
P
>
(
Func
(
a
.
x
,
b
));
}
};
#define VECTORIZE_VEC_VEC(func) \
VECTORIZE2_VEC_VEC
(
func
)
\
VECTORIZE3_VEC_VEC
(
func
)
\
VECTORIZE4_VEC_VEC
(
func
)
template
<
typename
T
,
precision
P
>
struct
functor2_vec_sca
<
T
,
P
,
tvec2
>
{
GLM_FUNC_QUALIFIER
static
tvec2
<
T
,
P
>
call
(
T
(
*
Func
)
(
T
x
,
T
y
),
tvec2
<
T
,
P
>
const
&
a
,
T
b
)
{
return
tvec2
<
T
,
P
>
(
Func
(
a
.
x
,
b
),
Func
(
a
.
y
,
b
));
}
};
namespace
glm
{
namespace
detail
{
template
<
bool
C
>
struct
If
template
<
typename
T
,
precision
P
>
struct
functor2_vec_sca
<
T
,
P
,
tvec3
>
{
template
<
typename
F
,
typename
T
>
static
GLM_FUNC_QUALIFIER
T
apply
(
F
functor
,
const
T
&
val
)
GLM_FUNC_QUALIFIER
static
tvec3
<
T
,
P
>
call
(
T
(
*
Func
)
(
T
x
,
T
y
),
tvec3
<
T
,
P
>
const
&
a
,
T
b
)
{
return
functor
(
val
);
return
tvec3
<
T
,
P
>
(
Func
(
a
.
x
,
b
),
Func
(
a
.
y
,
b
),
Func
(
a
.
z
,
b
)
);
}
};
template
<
>
struct
If
<
false
>
template
<
typename
T
,
precision
P
>
struct
functor2_vec_sca
<
T
,
P
,
tvec4
>
{
template
<
typename
F
,
typename
T
>
static
GLM_FUNC_QUALIFIER
T
apply
(
F
,
const
T
&
val
)
GLM_FUNC_QUALIFIER
static
tvec4
<
T
,
P
>
call
(
T
(
*
Func
)
(
T
x
,
T
y
),
tvec4
<
T
,
P
>
const
&
a
,
T
b
)
{
return
val
;
return
tvec4
<
T
,
P
>
(
Func
(
a
.
x
,
b
),
Func
(
a
.
y
,
b
),
Func
(
a
.
z
,
b
),
Func
(
a
.
w
,
b
))
;
}
};
}
//namespace detail
}
//namespace glm
#endif//GLM_CORE_DETAIL_INCLUDED
include/glm/detail/dummy.cpp
View file @
b41d0668
///////////////////////////////////////////////////////////////////////////////////