Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ACGL
acgl
Commits
b41d0668
Commit
b41d0668
authored
Oct 21, 2015
by
Robert Menzel
Browse files
updated GLM to 0.9.7.1
parent
7ae41f65
Changes
266
Expand all
Hide whitespace changes
Inline
Side-by-side
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
}
${
ROOT_SOURCE
}
${
ROOT_INLINE
}
${
ROOT_HEADER
}
${
CORE_SOURCE
}
${
CORE_INLINE
}
${
CORE_HEADER
}
${
GTC_SOURCE
}
${
GTC_INLINE
}
${
GTC_HEADER
}
${
GTX_SOURCE
}
${
GTX_INLINE
}
${
GTX_HEADER
}
)
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
));
\
}
#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
));
\
}
#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
));
\
}
#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
));
\
}
#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
));
\
}
#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
));
\
}
#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
));
\
}
#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
));
\
}
#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
));
\
}
#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
));
\
}
#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
));
\
}
#define VECTORIZE_VEC_VEC(func) \
VECTORIZE2_VEC_VEC
(
func
)
\
VECTORIZE3_VEC_VEC
(
func
)
\
VECTORIZE4_VEC_VEC
(
func
)
namespace
glm
{
namespace
detail
{
template
<
bool
C
>
struct
If
template
<
typename
R
,
typename
T
,
precision
P
,
template
<
typename
,
precision
>
class
vecType
>
struct
functor1
{};
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
));
}
};
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
));
}
};
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
));
}
};
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
));
}
};
template
<
typename
T
,
precision
P
,
template
<
typename
,
precision
>
class
vecType
>
struct
functor2
{};
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
));
}
};
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
));
}
};
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
));
}
};
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
));
}
};
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
));
}
};
template
<
typename
T
,
precision
P
>
struct
functor2_vec_sca
<
T
,
P
,
tvec2
>
{
template
<
typename
F
,
typename
T
>
static
GLM_FUNC_QUALIFIER
T
apply
(
F
functor
,
const
T
&
val
)
GLM_FUNC_QUALIFIER
static
tvec2
<
T
,
P
>
call
(
T
(
*
Func
)
(
T
x
,
T
y
),
tvec2
<
T
,
P
>
const
&
a
,
T
b
)
{
return
functor
(
val
);
return
tvec2
<
T
,
P
>
(
Func
(
a
.
x
,
b
),
Func
(
a
.
y
,
b
)
);
}
};
template
<
>
struct
If
<
false
>
template
<
typename
T
,
precision
P
>
struct
functor2_vec_sca
<
T
,
P
,
tvec3
>
{
template
<
typename
F
,
typename
T
>
static
GLM_FUNC_QUALIFIER
T
apply
(
F
,
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
val
;
return
tvec3
<
T
,
P
>
(
Func
(
a
.
x
,
b
),
Func
(
a
.
y
,
b
),
Func
(
a
.
z
,
b
));
}
};
template
<
typename
T
,
precision
P
>
struct
functor2_vec_sca
<
T
,
P
,
tvec4
>
{
GLM_FUNC_QUALIFIER
static
tvec4
<
T
,
P
>
call
(
T
(
*
Func
)
(
T
x
,
T
y
),
tvec4
<
T
,
P
>
const
&
a
,
T
b
)
{
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
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 201
4
G-Truc Creation (www.g-truc.net)