mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Merge fix
This commit is contained in:
commit
de777fc90f
@ -13,7 +13,7 @@
|
||||
* Hundreds of Quests/events created and maintained by Project EQ
|
||||
|
||||
## Server Installs
|
||||
||Windows|Linux|
|
||||
| |Windows|Linux|
|
||||
|:---:|:---:|:---:|
|
||||
|**Install Count**|||
|
||||
### > Windows
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||
-------------------------------------------------------
|
||||
== 03/25/2017 ==
|
||||
Akkadius: Reduced CPU footprint in non-combat zones doing constant checks for combat related activities
|
||||
Akkadius: Reduced CPU footprint in cases where a client is checking for aggro excessively every 750 millseconds. This has
|
||||
been adjusted to 6 seconds per new rule RULE_INT(Aggro, ClientAggroCheckInterval)
|
||||
- When zones have many players, with many NPC's, this adds up quickly
|
||||
|
||||
== 03/12/2017 ==
|
||||
Akkadius:
|
||||
- Implemented range rules for packets and other functions
|
||||
|
||||
@ -2054,6 +2054,8 @@ uint32 Database::GetGuildIDByCharID(uint32 character_id)
|
||||
|
||||
void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings)
|
||||
{
|
||||
// log_settings previously initialized to '0' by EQEmuLogSys::LoadLogSettingsDefaults()
|
||||
|
||||
std::string query =
|
||||
"SELECT "
|
||||
"log_category_id, "
|
||||
@ -2071,6 +2073,9 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings)
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
log_category = atoi(row[0]);
|
||||
if (log_category <= Logs::None || log_category >= Logs::MaxCategoryID)
|
||||
continue;
|
||||
|
||||
log_settings[log_category].log_to_console = atoi(row[2]);
|
||||
log_settings[log_category].log_to_file = atoi(row[3]);
|
||||
log_settings[log_category].log_to_gmsay = atoi(row[4]);
|
||||
|
||||
@ -157,7 +157,7 @@ enum { //timer settings, all in milliseconds
|
||||
AIscanarea_delay = 6000,
|
||||
AIfeignremember_delay = 500,
|
||||
AItarget_check_duration = 500,
|
||||
AIClientScanarea_delay = 750, //used in REVERSE_AGGRO
|
||||
// AIClientScanarea_delay = 750, //used in REVERSE_AGGRO
|
||||
AIassistcheck_delay = 3000, //now often a fighting NPC will yell for help
|
||||
AI_check_signal_timer_delay = 500, // How often EVENT_SIGNAL checks are processed
|
||||
ClientProximity_interval = 150,
|
||||
|
||||
@ -1,6 +1,39 @@
|
||||
The MIT License
|
||||
================================================================================
|
||||
OpenGL Mathematics (GLM)
|
||||
--------------------------------------------------------------------------------
|
||||
GLM can be distributed and/or modified under the terms of either
|
||||
a) The Happy Bunny License, or b) the MIT License.
|
||||
|
||||
Copyright (c) 2005 - 2013 G-Truc Creation
|
||||
================================================================================
|
||||
The Happy Bunny License (Modified MIT License)
|
||||
--------------------------------------------------------------------------------
|
||||
Copyright (c) 2005 - 2016 G-Truc Creation
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
================================================================================
|
||||
The MIT License
|
||||
--------------------------------------------------------------------------------
|
||||
Copyright (c) 2005 - 2016 G-Truc Creation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
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 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 +17,11 @@ 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})
|
||||
file(GLOB_RECURSE SIMD_SOURCE ./simd/*.cpp)
|
||||
file(GLOB_RECURSE SIMD_INLINE ./simd/*.inl)
|
||||
file(GLOB_RECURSE SIMD_HEADER ./simd/*.h)
|
||||
|
||||
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})
|
||||
@ -27,16 +31,37 @@ 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})
|
||||
source_group("SIMD Files" FILES ${SIMD_SOURCE})
|
||||
source_group("SIMD Files" FILES ${SIMD_INLINE})
|
||||
source_group("SIMD Files" FILES ${SIMD_HEADER})
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
|
||||
if(GLM_TEST_ENABLE)
|
||||
add_executable(${NAME} ${ROOT_TEXT}
|
||||
if(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)
|
||||
if(GLM_STATIC_LIBRARY_ENABLE)
|
||||
add_library(glm_static STATIC ${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}
|
||||
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
|
||||
endif(GLM_STATIC_LIBRARY_ENABLE)
|
||||
|
||||
if(GLM_DYNAMIC_LIBRARY_ENABLE)
|
||||
add_library(glm_shared SHARED ${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}
|
||||
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
|
||||
endif(GLM_DYNAMIC_LIBRARY_ENABLE)
|
||||
|
||||
else(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)
|
||||
add_executable(glm_dummy ${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)
|
||||
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
|
||||
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
|
||||
|
||||
#add_library(glm STATIC glm.cpp)
|
||||
#add_library(glm_shared SHARED glm.cpp)
|
||||
endif(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/_features.hpp
|
||||
/// @date 2013-02-20 / 2013-02-20
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -284,7 +255,7 @@
|
||||
# define GLM_CXX11_STATIC_ASSERT
|
||||
# endif
|
||||
|
||||
#elif(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
|
||||
#elif(GLM_COMPILER & GLM_COMPILER_CLANG)
|
||||
# if(__has_feature(cxx_exceptions))
|
||||
# define GLM_CXX98_EXCEPTIONS
|
||||
# endif
|
||||
@ -425,4 +396,4 @@
|
||||
# define GLM_CXX11_VARIADIC_TEMPLATES
|
||||
# endif
|
||||
|
||||
#endif//(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
|
||||
#endif//(GLM_COMPILER & GLM_COMPILER_CLANG)
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/_fixes.hpp
|
||||
/// @date 2011-02-21 / 2011-11-22
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmath>
|
||||
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/_noise.hpp
|
||||
/// @date 2013-12-24 / 2013-12-24
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/_swizzle_func.hpp
|
||||
/// @date 2011-10-16 / 2011-10-16
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/_vectorize.hpp
|
||||
/// @date 2011-10-14 / 2011-10-14
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,40 +1,13 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/core/dummy.cpp
|
||||
/// @date 2011-01-19 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// GLM is a header only library. There is nothing to compile.
|
||||
/// dummy.cpp exist only a wordaround for CMake file.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
#define GLM_MESSAGES
|
||||
#include "../glm.hpp"
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/ext.hpp>
|
||||
#include <limits>
|
||||
|
||||
struct material
|
||||
@ -148,6 +121,8 @@ struct intersection
|
||||
glm::vec4 position;
|
||||
glm::vec3 normal;
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
// Sample 4
|
||||
@ -190,7 +165,7 @@ glm::vec3 lighting
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
template <typename T, glm::precision P, template<typename, glm::precision> class vecType>
|
||||
T normalizeDotA(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||
{
|
||||
@ -210,13 +185,23 @@ typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b)
|
||||
{
|
||||
return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b));
|
||||
}
|
||||
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
glm::vec4 v(1);
|
||||
float a = normalizeDotA(v, v);
|
||||
float b = normalizeDotB(v, v);
|
||||
float c = normalizeDotC(v, v);
|
||||
/*
|
||||
glm::vec1 o(1);
|
||||
glm::vec2 a(1);
|
||||
glm::vec3 b(1);
|
||||
glm::vec4 c(1);
|
||||
|
||||
glm::quat q;
|
||||
glm::dualquat p;
|
||||
|
||||
glm::mat4 m(1);
|
||||
|
||||
float a0 = normalizeDotA(a, a);
|
||||
float b0 = normalizeDotB(b, b);
|
||||
float c0 = normalizeDotC(c, c);
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,33 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_common.hpp
|
||||
/// @date 2008-03-08 / 2010-01-26
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||
///
|
||||
@ -35,7 +7,6 @@
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These all operate component-wise. The description is per component.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_common.inl
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "func_vector_relational.hpp"
|
||||
#include "type_vec2.hpp"
|
||||
@ -37,142 +8,24 @@
|
||||
#include "_vectorize.hpp"
|
||||
#include <limits>
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
namespace glm
|
||||
{
|
||||
template <typename genFIType, bool /*signed*/>
|
||||
struct compute_abs
|
||||
{};
|
||||
|
||||
template <typename genFIType>
|
||||
struct compute_abs<genFIType, true>
|
||||
// min
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType min(genType x, genType y)
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static genFIType call(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::is_signed,
|
||||
"'abs' only accept floating-point and integer scalar or vector inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs");
|
||||
return x < y ? x : y;
|
||||
}
|
||||
|
||||
return x >= genFIType(0) ? x : -x;
|
||||
// TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename genFIType>
|
||||
struct compute_abs<genFIType, false>
|
||||
// max
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType max(genType x, genType y)
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static genFIType call(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
!std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
|
||||
"'abs' only accept floating-point and integer scalar or vector inputs");
|
||||
return x;
|
||||
}
|
||||
};
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs");
|
||||
|
||||
template <typename T, typename U, precision P, template <class, precision> class vecType>
|
||||
struct compute_mix_vector
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
|
||||
return vecType<T, P>(vecType<U, P>(x) + a * vecType<U, P>(y - x));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <class, precision> class vecType>
|
||||
struct compute_mix_vector<T, bool, P, vecType>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<bool, P> const & a)
|
||||
{
|
||||
vecType<T, P> Result(uninitialize);
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
|
||||
Result[i] = a[i] ? y[i] : x[i];
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename U, precision P, template <class, precision> class vecType>
|
||||
struct compute_mix_scalar
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, U const & a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
|
||||
return vecType<T, P>(vecType<U, P>(x) + a * vecType<U, P>(y - x));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <class, precision> class vecType>
|
||||
struct compute_mix_scalar<T, bool, P, vecType>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, bool const & a)
|
||||
{
|
||||
return a ? y : x;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename U>
|
||||
struct compute_mix
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
|
||||
return static_cast<T>(static_cast<U>(x) + a * static_cast<U>(y - x));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct compute_mix<T, bool>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, bool const & a)
|
||||
{
|
||||
return a ? y : x;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <class, precision> class vecType, bool isFloat = true, bool isSigned = true>
|
||||
struct compute_sign
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return vecType<T, P>(glm::lessThan(vecType<T, P>(0), x)) - vecType<T, P>(glm::lessThan(x, vecType<T, P>(0)));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <class, precision> class vecType>
|
||||
struct compute_sign<T, P, vecType, false, false>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return vecType<T, P>(glm::greaterThan(x , vecType<T, P>(0)));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <class, precision> class vecType>
|
||||
struct compute_sign<T, P, vecType, false, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
T const Shift(static_cast<T>(sizeof(T) * 8 - 1));
|
||||
vecType<T, P> const y(vecType<typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift));
|
||||
|
||||
return (x >> Shift) | y;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <class, precision> class vecType, typename genType, bool isFloat = true>
|
||||
struct compute_mod
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & a, genType const & b)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'mod' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");
|
||||
return a - b * floor(a / b);
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
return x > y ? x : y;
|
||||
}
|
||||
|
||||
// abs
|
||||
template <>
|
||||
@ -182,67 +35,6 @@ namespace detail
|
||||
return (x ^ y) - y;
|
||||
}
|
||||
|
||||
template <typename genFIType>
|
||||
GLM_FUNC_QUALIFIER genFIType abs(genFIType x)
|
||||
{
|
||||
return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> abs(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(abs, x);
|
||||
}
|
||||
|
||||
// sign
|
||||
// fast and works for any type
|
||||
template <typename genFIType>
|
||||
GLM_FUNC_QUALIFIER genFIType sign(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
std::numeric_limits<genFIType>::is_iec559 || (std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer),
|
||||
"'sign' only accept signed inputs");
|
||||
|
||||
return detail::compute_sign<genFIType, defaultp, tvec1, std::numeric_limits<genFIType>::is_iec559>::call(tvec1<genFIType>(x)).x;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> sign(vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
std::numeric_limits<T>::is_iec559 || (std::numeric_limits<T>::is_signed && std::numeric_limits<T>::is_integer),
|
||||
"'sign' only accept signed inputs");
|
||||
|
||||
return detail::compute_sign<T, P, vecType, std::numeric_limits<T>::is_iec559>::call(x);
|
||||
}
|
||||
|
||||
// floor
|
||||
using ::std::floor;
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> floor(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(floor, x);
|
||||
}
|
||||
|
||||
// trunc
|
||||
# if GLM_HAS_CXX11_STL
|
||||
using ::std::trunc;
|
||||
# else
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType trunc(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'trunc' only accept floating-point inputs");
|
||||
|
||||
return x < static_cast<genType>(0) ? -floor(-x) : floor(x);
|
||||
}
|
||||
# endif
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> trunc(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(trunc, x);
|
||||
}
|
||||
|
||||
// round
|
||||
# if GLM_HAS_CXX11_STL
|
||||
using ::std::round;
|
||||
@ -256,10 +48,318 @@ namespace detail
|
||||
}
|
||||
# endif
|
||||
|
||||
// trunc
|
||||
# if GLM_HAS_CXX11_STL
|
||||
using ::std::trunc;
|
||||
# else
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType trunc(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'trunc' only accept floating-point inputs");
|
||||
|
||||
return x < static_cast<genType>(0) ? -std::floor(-x) : std::floor(x);
|
||||
}
|
||||
# endif
|
||||
|
||||
}//namespace glm
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <typename genFIType, bool /*signed*/>
|
||||
struct compute_abs
|
||||
{};
|
||||
|
||||
template <typename genFIType>
|
||||
struct compute_abs<genFIType, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static genFIType call(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::is_signed || GLM_UNRESTRICTED_GENTYPE,
|
||||
"'abs' only accept floating-point and integer scalar or vector inputs");
|
||||
|
||||
return x >= genFIType(0) ? x : -x;
|
||||
// TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff;
|
||||
}
|
||||
};
|
||||
|
||||
#if GLM_COMPILER & GLM_COMPILER_CUDA
|
||||
template <>
|
||||
struct compute_abs<float, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(float x)
|
||||
{
|
||||
return fabsf(x);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename genFIType>
|
||||
struct compute_abs<genFIType, false>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static genFIType call(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
(!std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer) || GLM_UNRESTRICTED_GENTYPE,
|
||||
"'abs' only accept floating-point and integer scalar or vector inputs");
|
||||
return x;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_abs_vector
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(abs, x);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename U, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_mix_vector
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
|
||||
return vecType<T, P>(vecType<U, P>(x) + a * vecType<U, P>(y - x));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_mix_vector<T, bool, P, vecType, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<bool, P> const & a)
|
||||
{
|
||||
vecType<T, P> Result(uninitialize);
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
Result[i] = a[i] ? y[i] : x[i];
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename U, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_mix_scalar
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, U const & a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
|
||||
return vecType<T, P>(vecType<U, P>(x) + a * vecType<U, P>(y - x));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_mix_scalar<T, bool, P, vecType, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, bool const & a)
|
||||
{
|
||||
return a ? y : x;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename U>
|
||||
struct compute_mix
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
|
||||
return static_cast<T>(static_cast<U>(x) + a * static_cast<U>(y - x));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct compute_mix<T, bool>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, bool const & a)
|
||||
{
|
||||
return a ? y : x;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool isFloat, bool Aligned>
|
||||
struct compute_sign
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return vecType<T, P>(glm::lessThan(vecType<T, P>(0), x)) - vecType<T, P>(glm::lessThan(x, vecType<T, P>(0)));
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH == GLM_ARCH_X86
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_sign<T, P, vecType, false, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
T const Shift(static_cast<T>(sizeof(T) * 8 - 1));
|
||||
vecType<T, P> const y(vecType<typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift));
|
||||
|
||||
return (x >> Shift) | y;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_floor
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(std::floor, x);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_ceil
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(std::ceil, x);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_fract
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return x - floor(x);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_trunc
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(trunc, x);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_round
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(round, x);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_mod
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & a, vecType<T, P> const & b)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'mod' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");
|
||||
return a - b * floor(a / b);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_min_vector
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||
{
|
||||
return detail::functor2<T, P, vecType>::call(min, x, y);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_max_vector
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||
{
|
||||
return detail::functor2<T, P, vecType>::call(max, x, y);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_clamp_vector
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & minVal, vecType<T, P> const & maxVal)
|
||||
{
|
||||
return min(max(x, minVal), maxVal);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_step_vector
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & edge, vecType<T, P> const & x)
|
||||
{
|
||||
return mix(vecType<T, P>(1), vecType<T, P>(0), glm::lessThan(x, edge));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_smoothstep_vector
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs");
|
||||
vecType<T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1)));
|
||||
return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp);
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
template <typename genFIType>
|
||||
GLM_FUNC_QUALIFIER genFIType abs(genFIType x)
|
||||
{
|
||||
return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> abs(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::compute_abs_vector<T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
|
||||
// sign
|
||||
// fast and works for any type
|
||||
template <typename genFIType>
|
||||
GLM_FUNC_QUALIFIER genFIType sign(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
std::numeric_limits<genFIType>::is_iec559 || (std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer),
|
||||
"'sign' only accept signed inputs");
|
||||
|
||||
return detail::compute_sign<genFIType, defaultp, tvec1, std::numeric_limits<genFIType>::is_iec559, highp>::call(tvec1<genFIType>(x)).x;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> sign(vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
std::numeric_limits<T>::is_iec559 || (std::numeric_limits<T>::is_signed && std::numeric_limits<T>::is_integer),
|
||||
"'sign' only accept signed inputs");
|
||||
|
||||
return detail::compute_sign<T, P, vecType, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
|
||||
// floor
|
||||
using ::std::floor;
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> floor(vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'floor' only accept floating-point inputs.");
|
||||
return detail::compute_floor<T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> trunc(vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'trunc' only accept floating-point inputs");
|
||||
return detail::compute_trunc<T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> round(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(round, x);
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'round' only accept floating-point inputs");
|
||||
return detail::compute_round<T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -308,6 +408,7 @@ namespace detail
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> roundEven(vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'roundEven' only accept floating-point inputs");
|
||||
return detail::functor1<T, T, P, vecType>::call(roundEven, x);
|
||||
}
|
||||
|
||||
@ -316,41 +417,47 @@ namespace detail
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> ceil(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(ceil, x);
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ceil' only accept floating-point inputs");
|
||||
return detail::compute_ceil<T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
|
||||
// fract
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType fract(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'fract' only accept floating-point inputs");
|
||||
|
||||
return fract(tvec1<genType>(x)).x;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> fract(vecType<T, P> const & x)
|
||||
{
|
||||
return x - floor(x);
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fract' only accept floating-point inputs");
|
||||
return detail::compute_fract<T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
|
||||
// mod
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType mod(genType x, genType y)
|
||||
{
|
||||
return mod(tvec1<genType>(x), y).x;
|
||||
# if GLM_COMPILER & GLM_COMPILER_CUDA
|
||||
// Another Cuda compiler bug https://github.com/g-truc/glm/issues/530
|
||||
tvec1<genType, defaultp> Result(mod(tvec1<genType, defaultp>(x), y));
|
||||
return Result.x;
|
||||
# else
|
||||
return mod(tvec1<genType, defaultp>(x), y).x;
|
||||
# endif
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> mod(vecType<T, P> const & x, T y)
|
||||
{
|
||||
return detail::compute_mod<T, P, vecType, T, std::numeric_limits<T>::is_iec559>::call(x, y);
|
||||
return detail::compute_mod<T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<T, P>(y));
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||
{
|
||||
return detail::compute_mod<T, P, vecType, vecType<T, P>, std::numeric_limits<T>::is_iec559>::call(x, y);
|
||||
return detail::compute_mod<T, P, vecType, detail::is_aligned<P>::value>::call(x, y);
|
||||
}
|
||||
|
||||
// modf
|
||||
@ -358,7 +465,6 @@ namespace detail
|
||||
GLM_FUNC_QUALIFIER genType modf(genType x, genType & i)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'modf' only accept floating-point inputs");
|
||||
|
||||
return std::modf(x, &i);
|
||||
}
|
||||
|
||||
@ -405,70 +511,53 @@ namespace detail
|
||||
//CHAR_BIT - 1)));
|
||||
|
||||
// min
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType min(genType x, genType y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'min' only accept floating-point or integer inputs");
|
||||
|
||||
return x < y ? x : y;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> min(vecType<T, P> const & a, T b)
|
||||
{
|
||||
return detail::functor2_vec_sca<T, P, vecType>::call(min, a, b);
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point inputs for the interpolator a");
|
||||
return detail::compute_min_vector<T, P, vecType, detail::is_aligned<P>::value>::call(a, vecType<T, P>(b));
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> min(vecType<T, P> const & a, vecType<T, P> const & b)
|
||||
{
|
||||
return detail::functor2<T, P, vecType>::call(min, a, b);
|
||||
return detail::compute_min_vector<T, P, vecType, detail::is_aligned<P>::value>::call(a, b);
|
||||
}
|
||||
|
||||
// max
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType max(genType x, genType y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'max' only accept floating-point or integer inputs");
|
||||
|
||||
return x > y ? x : y;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> max(vecType<T, P> const & a, T b)
|
||||
{
|
||||
return detail::functor2_vec_sca<T, P, vecType>::call(max, a, b);
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point inputs for the interpolator a");
|
||||
return detail::compute_max_vector<T, P, vecType, detail::is_aligned<P>::value>::call(a, vecType<T, P>(b));
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> max(vecType<T, P> const & a, vecType<T, P> const & b)
|
||||
{
|
||||
return detail::functor2<T, P, vecType>::call(max, a, b);
|
||||
return detail::compute_max_vector<T, P, vecType, detail::is_aligned<P>::value>::call(a, b);
|
||||
}
|
||||
|
||||
// clamp
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'clamp' only accept floating-point or integer inputs");
|
||||
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
|
||||
return min(max(x, minVal), maxVal);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> clamp(vecType<T, P> const & x, T minVal, T maxVal)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
|
||||
|
||||
return min(max(x, minVal), maxVal);
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
|
||||
return detail::compute_clamp_vector<T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<T, P>(minVal), vecType<T, P>(maxVal));
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> clamp(vecType<T, P> const & x, vecType<T, P> const & minVal, vecType<T, P> const & maxVal)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
|
||||
|
||||
return min(max(x, minVal), maxVal);
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
|
||||
return detail::compute_clamp_vector<T, P, vecType, detail::is_aligned<P>::value>::call(x, minVal, maxVal);
|
||||
}
|
||||
|
||||
template <typename genTypeT, typename genTypeU>
|
||||
@ -480,13 +569,13 @@ namespace detail
|
||||
template <typename T, typename U, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, U a)
|
||||
{
|
||||
return detail::compute_mix_scalar<T, U, P, vecType>::call(x, y, a);
|
||||
return detail::compute_mix_scalar<T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a);
|
||||
}
|
||||
|
||||
template <typename T, typename U, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a)
|
||||
{
|
||||
return detail::compute_mix_vector<T, U, P, vecType>::call(x, y, a);
|
||||
return detail::compute_mix_vector<T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a);
|
||||
}
|
||||
|
||||
// step
|
||||
@ -499,22 +588,20 @@ namespace detail
|
||||
template <template <typename, precision> class vecType, typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> step(T edge, vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'step' only accept floating-point inputs");
|
||||
|
||||
return mix(vecType<T, P>(1), vecType<T, P>(0), glm::lessThan(x, vecType<T, P>(edge)));
|
||||
return detail::compute_step_vector<T, P, vecType, detail::is_aligned<P>::value>::call(vecType<T, P>(edge), x);
|
||||
}
|
||||
|
||||
template <template <typename, precision> class vecType, typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> step(vecType<T, P> const & edge, vecType<T, P> const & x)
|
||||
{
|
||||
return mix(vecType<T, P>(1), vecType<T, P>(0), glm::lessThan(x, edge));
|
||||
return detail::compute_step_vector<T, P, vecType, detail::is_aligned<P>::value>::call(edge, x);
|
||||
}
|
||||
|
||||
// smoothstep
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'smoothstep' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs");
|
||||
|
||||
genType const tmp(clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1)));
|
||||
return tmp * tmp * (genType(3) - genType(2) * tmp);
|
||||
@ -523,19 +610,13 @@ namespace detail
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> smoothstep(T edge0, T edge1, vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
|
||||
|
||||
vecType<T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1)));
|
||||
return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp);
|
||||
return detail::compute_smoothstep_vector<T, P, vecType, detail::is_aligned<P>::value>::call(vecType<T, P>(edge0), vecType<T, P>(edge1), x);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> smoothstep(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
|
||||
|
||||
vecType<T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1)));
|
||||
return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp);
|
||||
return detail::compute_smoothstep_vector<T, P, vecType, detail::is_aligned<P>::value>::call(edge0, edge1, x);
|
||||
}
|
||||
|
||||
# if GLM_HAS_CXX11_STL
|
||||
@ -548,14 +629,16 @@ namespace detail
|
||||
|
||||
# if GLM_HAS_CXX11_STL
|
||||
return std::isnan(x);
|
||||
# elif GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL)
|
||||
# elif GLM_COMPILER & GLM_COMPILER_VC
|
||||
return _isnan(x) != 0;
|
||||
# elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
|
||||
# if GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L
|
||||
# elif GLM_COMPILER & GLM_COMPILER_INTEL
|
||||
# if GLM_PLATFORM & GLM_PLATFORM_WINDOWS
|
||||
return _isnan(x) != 0;
|
||||
# else
|
||||
return std::isnan(x);
|
||||
return ::isnan(x) != 0;
|
||||
# endif
|
||||
# elif (GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L
|
||||
return _isnan(x) != 0;
|
||||
# elif GLM_COMPILER & GLM_COMPILER_CUDA
|
||||
return isnan(x) != 0;
|
||||
# else
|
||||
@ -583,8 +666,12 @@ namespace detail
|
||||
# if GLM_HAS_CXX11_STL
|
||||
return std::isinf(x);
|
||||
# elif GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC)
|
||||
return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF;
|
||||
# elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
|
||||
# if(GLM_PLATFORM & GLM_PLATFORM_WINDOWS)
|
||||
return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF;
|
||||
# else
|
||||
return ::isinf(x);
|
||||
# endif
|
||||
# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)
|
||||
# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L)
|
||||
return _isinf(x) != 0;
|
||||
# else
|
||||
@ -660,23 +747,23 @@ namespace detail
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType frexp(genType x, int & exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'frexp' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
|
||||
|
||||
return std::frexp(x, exp);
|
||||
return std::frexp(x, &exp);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> frexp(tvec1<T, P> const & x, tvec1<int, P> & exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
|
||||
|
||||
return tvec1<T, P>(std::frexp(x.x, exp.x));
|
||||
return tvec1<T, P>(std::frexp(x.x, &exp.x));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> frexp(tvec2<T, P> const & x, tvec2<int, P> & exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
|
||||
|
||||
return tvec2<T, P>(
|
||||
frexp(x.x, exp.x),
|
||||
@ -686,7 +773,7 @@ namespace detail
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> frexp(tvec3<T, P> const & x, tvec3<int, P> & exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
|
||||
|
||||
return tvec3<T, P>(
|
||||
frexp(x.x, exp.x),
|
||||
@ -697,7 +784,7 @@ namespace detail
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec4<T, P> frexp(tvec4<T, P> const & x, tvec4<int, P> & exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
|
||||
|
||||
return tvec4<T, P>(
|
||||
frexp(x.x, exp.x),
|
||||
@ -706,10 +793,10 @@ namespace detail
|
||||
frexp(x.w, exp.w));
|
||||
}
|
||||
|
||||
template <typename genType, precision P>
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType ldexp(genType const & x, int const & exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'ldexp' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
|
||||
|
||||
return std::ldexp(x, exp);
|
||||
}
|
||||
@ -717,7 +804,7 @@ namespace detail
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> ldexp(tvec1<T, P> const & x, tvec1<int, P> const & exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
|
||||
|
||||
return tvec1<T, P>(
|
||||
ldexp(x.x, exp.x));
|
||||
@ -726,7 +813,7 @@ namespace detail
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> ldexp(tvec2<T, P> const & x, tvec2<int, P> const & exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
|
||||
|
||||
return tvec2<T, P>(
|
||||
ldexp(x.x, exp.x),
|
||||
@ -736,7 +823,7 @@ namespace detail
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> ldexp(tvec3<T, P> const & x, tvec3<int, P> const & exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
|
||||
|
||||
return tvec3<T, P>(
|
||||
ldexp(x.x, exp.x),
|
||||
@ -747,7 +834,7 @@ namespace detail
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec4<T, P> ldexp(tvec4<T, P> const & x, tvec4<int, P> const & exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
|
||||
|
||||
return tvec4<T, P>(
|
||||
ldexp(x.x, exp.x),
|
||||
@ -756,3 +843,7 @@ namespace detail
|
||||
ldexp(x.w, exp.w));
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "func_common_simd.inl"
|
||||
#endif
|
||||
|
||||
231
common/glm/glm/detail/func_common_simd.inl
Normal file
231
common/glm/glm/detail/func_common_simd.inl
Normal file
@ -0,0 +1,231 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_common_simd.inl
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
#include "../simd/common.h"
|
||||
|
||||
#include <immintrin.h>
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <precision P>
|
||||
struct compute_abs_vector<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_abs(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_abs_vector<int, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & v)
|
||||
{
|
||||
tvec4<int, P> result(uninitialize);
|
||||
result.data = glm_ivec4_abs(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_floor<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_floor(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_ceil<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_ceil(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_fract<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_fract(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_round<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_round(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_mod<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & y)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_mod(x.data, y.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_min_vector<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = _mm_min_ps(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_min_vector<int32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
|
||||
{
|
||||
tvec4<int32, P> result(uninitialize);
|
||||
result.data = _mm_min_epi32(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_min_vector<uint32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<uint32, P> const & v1, tvec4<uint32, P> const & v2)
|
||||
{
|
||||
tvec4<uint32, P> result(uninitialize);
|
||||
result.data = _mm_min_epu32(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_max_vector<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = _mm_max_ps(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_max_vector<int32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
|
||||
{
|
||||
tvec4<int32, P> result(uninitialize);
|
||||
result.data = _mm_max_epi32(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_max_vector<uint32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v1, tvec4<uint32, P> const & v2)
|
||||
{
|
||||
tvec4<uint32, P> result(uninitialize);
|
||||
result.data = _mm_max_epu32(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_clamp_vector<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & minVal, tvec4<float, P> const & maxVal)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_clamp_vector<int32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & x, tvec4<int32, P> const & minVal, tvec4<int32, P> const & maxVal)
|
||||
{
|
||||
tvec4<int32, P> result(uninitialize);
|
||||
result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_clamp_vector<uint32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & x, tvec4<uint32, P> const & minVal, tvec4<uint32, P> const & maxVal)
|
||||
{
|
||||
tvec4<uint32, P> result(uninitialize);
|
||||
result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_mix_vector<float, bool, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & y, tvec4<bool, P> const & a)
|
||||
{
|
||||
__m128i const Load = _mm_set_epi32(-(int)a.w, -(int)a.z, -(int)a.y, -(int)a.x);
|
||||
__m128 const Mask = _mm_castsi128_ps(Load);
|
||||
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
# if 0 && GLM_ARCH & GLM_ARCH_AVX
|
||||
Result.data = _mm_blendv_ps(x.data, y.data, Mask);
|
||||
# else
|
||||
Result.data = _mm_or_ps(_mm_and_ps(Mask, y.data), _mm_andnot_ps(Mask, x.data));
|
||||
# endif
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
/* FIXME
|
||||
template <precision P>
|
||||
struct compute_step_vector<float, P, tvec4>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& edge, tvec4<float, P> const& x)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_step(edge.data, x.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
*/
|
||||
template <precision P>
|
||||
struct compute_smoothstep_vector<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& edge0, tvec4<float, P> const& edge1, tvec4<float, P> const& x)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
@ -1,33 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_exponential.hpp
|
||||
/// @date 2008-08-08 / 2011-06-14
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
///
|
||||
@ -35,7 +7,6 @@
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These all operate component-wise. The description is per component.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_exponential.inl
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "func_vector_relational.hpp"
|
||||
#include "_vectorize.hpp"
|
||||
@ -49,7 +20,7 @@ namespace detail
|
||||
}
|
||||
# endif
|
||||
|
||||
template <typename T, precision P, template <class, precision> class vecType, bool isFloat = true>
|
||||
template <typename T, precision P, template <class, precision> class vecType, bool isFloat, bool Aligned>
|
||||
struct compute_log2
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & vec)
|
||||
@ -58,7 +29,16 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class vecType, typename T, precision P>
|
||||
template <template <class, precision> class vecType, typename T, precision P, bool Aligned>
|
||||
struct compute_sqrt
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(std::sqrt, x);
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class vecType, typename T, precision P, bool Aligned>
|
||||
struct compute_inversesqrt
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
|
||||
@ -67,8 +47,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class vecType>
|
||||
struct compute_inversesqrt<vecType, float, lowp>
|
||||
template <template <class, precision> class vecType, bool Aligned>
|
||||
struct compute_inversesqrt<vecType, float, lowp, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<float, lowp> call(vecType<float, lowp> const & x)
|
||||
{
|
||||
@ -133,7 +113,7 @@ namespace detail
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> log2(vecType<T, P> const & x)
|
||||
{
|
||||
return detail::compute_log2<T, P, vecType, std::numeric_limits<T>::is_iec559>::call(x);
|
||||
return detail::compute_log2<T, P, vecType, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
|
||||
// sqrt
|
||||
@ -142,7 +122,7 @@ namespace detail
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> sqrt(vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sqrt' only accept floating-point inputs");
|
||||
return detail::functor1<T, T, P, vecType>::call(sqrt, x);
|
||||
return detail::compute_sqrt<vecType, T, P, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
|
||||
// inversesqrt
|
||||
@ -156,6 +136,11 @@ namespace detail
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> inversesqrt(vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inversesqrt' only accept floating-point inputs");
|
||||
return detail::compute_inversesqrt<vecType, T, P>::call(x);
|
||||
return detail::compute_inversesqrt<vecType, T, P, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "func_exponential_simd.inl"
|
||||
#endif
|
||||
|
||||
|
||||
35
common/glm/glm/detail/func_exponential_simd.inl
Normal file
35
common/glm/glm/detail/func_exponential_simd.inl
Normal file
@ -0,0 +1,35 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_exponential_simd.inl
|
||||
|
||||
#include "../simd/exponential.h"
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <precision P>
|
||||
struct compute_sqrt<tvec4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = _mm_sqrt_ps(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct compute_sqrt<tvec4, float, aligned_lowp, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, aligned_lowp> call(tvec4<float, aligned_lowp> const & v)
|
||||
{
|
||||
tvec4<float, aligned_lowp> result(uninitialize);
|
||||
result.data = glm_vec4_sqrt_lowp(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
@ -1,33 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_geometric.hpp
|
||||
/// @date 2008-08-03 / 2011-06-14
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
///
|
||||
@ -35,7 +7,6 @@
|
||||
/// @ingroup core
|
||||
///
|
||||
/// These operate on vectors as vectors, not component-wise.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -104,11 +75,11 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL genType faceforward(
|
||||
genType const & N,
|
||||
genType const & I,
|
||||
genType const & Nref);
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> faceforward(
|
||||
vecType<T, P> const & N,
|
||||
vecType<T, P> const & I,
|
||||
vecType<T, P> const & Nref);
|
||||
|
||||
/// For the incident vector I and surface orientation N,
|
||||
/// returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_geometric.inl
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "func_exponential.hpp"
|
||||
#include "func_common.hpp"
|
||||
@ -39,11 +10,29 @@
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <template <class, precision> class vecType, typename T, precision P>
|
||||
template <template <typename, precision> class vecType, typename T, precision P, bool Aligned>
|
||||
struct compute_length
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(vecType<T, P> const & v)
|
||||
{
|
||||
return sqrt(dot(v, v));
|
||||
}
|
||||
};
|
||||
|
||||
template <template <typename, precision> class vecType, typename T, precision P, bool Aligned>
|
||||
struct compute_distance
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(vecType<T, P> const & p0, vecType<T, P> const & p1)
|
||||
{
|
||||
return length(p1 - p0);
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class vecType, typename T, precision P, bool Aligned>
|
||||
struct compute_dot{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<tvec1, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_dot<tvec1, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(tvec1<T, P> const & a, tvec1<T, P> const & b)
|
||||
{
|
||||
@ -51,8 +40,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<tvec2, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_dot<tvec2, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(tvec2<T, P> const & x, tvec2<T, P> const & y)
|
||||
{
|
||||
@ -61,8 +50,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<tvec3, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_dot<tvec3, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(tvec3<T, P> const & x, tvec3<T, P> const & y)
|
||||
{
|
||||
@ -71,8 +60,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_dot<tvec4, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_dot<tvec4, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(tvec4<T, P> const & x, tvec4<T, P> const & y)
|
||||
{
|
||||
@ -80,13 +69,69 @@ namespace detail
|
||||
return (tmp.x + tmp.y) + (tmp.z + tmp.w);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_cross
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec3<T, P> call(tvec3<T, P> const & x, tvec3<T, P> const & y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' accepts only floating-point inputs");
|
||||
|
||||
return tvec3<T, P>(
|
||||
x.y * y.z - y.y * x.z,
|
||||
x.z * y.x - y.z * x.x,
|
||||
x.x * y.y - y.x * x.y);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_normalize
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
|
||||
return v * inversesqrt(dot(v, v));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_faceforward
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & N, vecType<T, P> const & I, vecType<T, P> const & Nref)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
|
||||
return dot(Nref, I) < static_cast<T>(0) ? N : -N;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_reflect
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & I, vecType<T, P> const & N)
|
||||
{
|
||||
return I - N * dot(N, I) * static_cast<T>(2);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType, bool Aligned>
|
||||
struct compute_refract
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & I, vecType<T, P> const & N, T eta)
|
||||
{
|
||||
T const dotValue(dot(N, I));
|
||||
T const k(static_cast<T>(1) - eta * eta * (static_cast<T>(1) - dotValue * dotValue));
|
||||
return (eta * I - (eta * dotValue + std::sqrt(k)) * N) * static_cast<T>(k >= static_cast<T>(0));
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
// length
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType length(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'length' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'length' accepts only floating-point inputs");
|
||||
|
||||
return abs(x);
|
||||
}
|
||||
@ -94,16 +139,16 @@ namespace detail
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER T length(vecType<T, P> const & v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' accepts only floating-point inputs");
|
||||
|
||||
return sqrt(dot(v, v));
|
||||
return detail::compute_length<vecType, T, P, detail::is_aligned<P>::value>::call(v);
|
||||
}
|
||||
|
||||
// distance
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType distance(genType const & p0, genType const & p1)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'distance' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'distance' accepts only floating-point inputs");
|
||||
|
||||
return length(p1 - p0);
|
||||
}
|
||||
@ -111,41 +156,36 @@ namespace detail
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER T distance(vecType<T, P> const & p0, vecType<T, P> const & p1)
|
||||
{
|
||||
return length(p1 - p0);
|
||||
return detail::compute_distance<vecType, T, P, detail::is_aligned<P>::value>::call(p0, p1);
|
||||
}
|
||||
|
||||
// dot
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T dot(T x, T y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
|
||||
return x * y;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER T dot(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs");
|
||||
return detail::compute_dot<vecType, T, P>::call(x, y);
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
|
||||
return detail::compute_dot<vecType, T, P, detail::is_aligned<P>::value>::call(x, y);
|
||||
}
|
||||
|
||||
// cross
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> cross(tvec3<T, P> const & x, tvec3<T, P> const & y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' only accept floating-point inputs");
|
||||
|
||||
return tvec3<T, P>(
|
||||
x.y * y.z - y.y * x.z,
|
||||
x.z * y.x - y.z * x.x,
|
||||
x.x * y.y - y.x * x.y);
|
||||
return detail::compute_cross<T, P, detail::is_aligned<P>::value>::call(x, y);
|
||||
}
|
||||
|
||||
// normalize
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType normalize(genType const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'normalize' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
|
||||
return x < genType(0) ? genType(-1) : genType(1);
|
||||
}
|
||||
@ -153,9 +193,9 @@ namespace detail
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> normalize(vecType<T, P> const & x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
|
||||
return x * inversesqrt(dot(x, x));
|
||||
return detail::compute_normalize<T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
|
||||
// faceforward
|
||||
@ -165,19 +205,30 @@ namespace detail
|
||||
return dot(Nref, I) < static_cast<genType>(0) ? N : -N;
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> faceforward(vecType<T, P> const & N, vecType<T, P> const & I, vecType<T, P> const & Nref)
|
||||
{
|
||||
return detail::compute_faceforward<T, P, vecType, detail::is_aligned<P>::value>::call(N, I, Nref);
|
||||
}
|
||||
|
||||
// reflect
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType reflect(genType const & I, genType const & N)
|
||||
{
|
||||
return I - N * dot(N, I) * static_cast<genType>(2);
|
||||
return I - N * dot(N, I) * genType(2);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> reflect(vecType<T, P> const & I, vecType<T, P> const & N)
|
||||
{
|
||||
return detail::compute_reflect<T, P, vecType, detail::is_aligned<P>::value>::call(I, N);
|
||||
}
|
||||
|
||||
// refract
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType refract(genType const & I, genType const & N, genType const & eta)
|
||||
GLM_FUNC_QUALIFIER genType refract(genType const & I, genType const & N, genType eta)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' only accept floating-point inputs");
|
||||
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' accepts only floating-point inputs");
|
||||
genType const dotValue(dot(N, I));
|
||||
genType const k(static_cast<genType>(1) - eta * eta * (static_cast<genType>(1) - dotValue * dotValue));
|
||||
return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast<genType>(k >= static_cast<genType>(0));
|
||||
@ -186,10 +237,11 @@ namespace detail
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> refract(vecType<T, P> const & I, vecType<T, P> const & N, T eta)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' only accept floating-point inputs");
|
||||
|
||||
T const dotValue(dot(N, I));
|
||||
T const k(static_cast<T>(1) - eta * eta * (static_cast<T>(1) - dotValue * dotValue));
|
||||
return (eta * I - (eta * dotValue + std::sqrt(k)) * N) * static_cast<T>(k >= static_cast<T>(0));
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' accepts only floating-point inputs");
|
||||
return detail::compute_refract<T, P, vecType, detail::is_aligned<P>::value>::call(I, N, eta);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "func_geometric_simd.inl"
|
||||
#endif
|
||||
|
||||
99
common/glm/glm/detail/func_geometric_simd.inl
Normal file
99
common/glm/glm/detail/func_geometric_simd.inl
Normal file
@ -0,0 +1,99 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_geometric_simd.inl
|
||||
|
||||
#include "../simd/geometric.h"
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <precision P>
|
||||
struct compute_length<tvec4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const & v)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_vec4_length(v.data));
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_distance<tvec4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const & p0, tvec4<float, P> const & p1)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_vec4_distance(p0.data, p1.data));
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_dot<tvec4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const& x, tvec4<float, P> const& y)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data));
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_cross<float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec3<float, P> call(tvec3<float, P> const & a, tvec3<float, P> const & b)
|
||||
{
|
||||
__m128 const set0 = _mm_set_ps(0.0f, a.z, a.y, a.x);
|
||||
__m128 const set1 = _mm_set_ps(0.0f, b.z, b.y, b.x);
|
||||
__m128 const xpd0 = glm_vec4_cross(set0, set1);
|
||||
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = xpd0;
|
||||
return tvec3<float, P>(result);
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_normalize<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_normalize(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_faceforward<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& N, tvec4<float, P> const& I, tvec4<float, P> const& Nref)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_faceforward(N.data, I.data, Nref.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_reflect<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& I, tvec4<float, P> const& N)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_reflect(I.data, N.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_refract<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& I, tvec4<float, P> const& N, float eta)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_refract(I.data, N.data, _mm_set1_ps(eta));
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
@ -1,33 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_integer.hpp
|
||||
/// @date 2010-03-17 / 2011-06-18
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
///
|
||||
@ -37,7 +9,6 @@
|
||||
/// These all operate component-wise. The description is per component.
|
||||
/// The notation [a, b] means the set of bits from bit-number a through bit-number
|
||||
/// b, inclusive. The lowest-order bit is bit 0.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,48 +1,26 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_integer.inl
|
||||
/// @date 2010-03-17 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec3.hpp"
|
||||
#include "type_vec4.hpp"
|
||||
#include "type_int.hpp"
|
||||
#include "_vectorize.hpp"
|
||||
#if(GLM_ARCH != GLM_ARCH_PURE)
|
||||
#if(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
#if(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC)
|
||||
# include <intrin.h>
|
||||
# pragma intrinsic(_BitScanReverse)
|
||||
#endif//(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
#endif//(GLM_ARCH != GLM_ARCH_PURE)
|
||||
#endif//(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC)
|
||||
#include <limits>
|
||||
|
||||
#if !GLM_HAS_EXTENDED_INTEGER_TYPE
|
||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
# if (GLM_COMPILER & GLM_COMPILER_CLANG)
|
||||
# pragma clang diagnostic ignored "-Wc++11-long-long"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
@ -52,40 +30,36 @@ namespace detail
|
||||
return Bits >= sizeof(T) * 8 ? ~static_cast<T>(0) : (static_cast<T>(1) << Bits) - static_cast<T>(1);
|
||||
}
|
||||
|
||||
template <bool EXEC = false>
|
||||
template <typename T, glm::precision P, template <typename, glm::precision> class vecType, bool Aligned, bool EXEC>
|
||||
struct compute_bitfieldReverseStep
|
||||
{
|
||||
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T, T)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct compute_bitfieldReverseStep<true>
|
||||
template <typename T, glm::precision P, template <typename, glm::precision> class vecType, bool Aligned>
|
||||
struct compute_bitfieldReverseStep<T, P, vecType, Aligned, true>
|
||||
{
|
||||
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T Mask, T Shift)
|
||||
{
|
||||
return (v & Mask) << Shift | (v & (~Mask)) >> Shift;
|
||||
}
|
||||
};
|
||||
|
||||
template <bool EXEC = false>
|
||||
template <typename T, glm::precision P, template <typename, glm::precision> class vecType, bool Aligned, bool EXEC>
|
||||
struct compute_bitfieldBitCountStep
|
||||
{
|
||||
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T, T)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct compute_bitfieldBitCountStep<true>
|
||||
template <typename T, glm::precision P, template <typename, glm::precision> class vecType, bool Aligned>
|
||||
struct compute_bitfieldBitCountStep<T, P, vecType, Aligned, true>
|
||||
{
|
||||
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T Mask, T Shift)
|
||||
{
|
||||
return (v & Mask) + ((v >> Shift) & Mask);
|
||||
@ -173,7 +147,7 @@ namespace detail
|
||||
return IsNotNull ? int(Result) : -1;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P, template <class, glm::precision> class vecType>
|
||||
template <typename T, glm::precision P, template<typename, glm::precision> class vecType>
|
||||
struct compute_findMSB_vec<T, P, vecType, 32>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<int, P> call(vecType<T, P> const & x)
|
||||
@ -208,7 +182,7 @@ namespace detail
|
||||
{
|
||||
uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y));
|
||||
uint64 const Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
|
||||
Carry = Value64 > Max32 ? 1 : 0;
|
||||
Carry = Value64 > Max32 ? 1u : 0u;
|
||||
return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
|
||||
}
|
||||
|
||||
@ -248,10 +222,8 @@ namespace detail
|
||||
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
|
||||
|
||||
uint64 Value64 = static_cast<uint64>(x) * static_cast<uint64>(y);
|
||||
uint32* PointerMSB = (reinterpret_cast<uint32*>(&Value64) + 1);
|
||||
msb = *PointerMSB;
|
||||
uint32* PointerLSB = (reinterpret_cast<uint32*>(&Value64) + 0);
|
||||
lsb = *PointerLSB;
|
||||
msb = static_cast<uint>(Value64 >> static_cast<uint64>(32));
|
||||
lsb = static_cast<uint>(Value64);
|
||||
}
|
||||
|
||||
template <precision P, template <typename, precision> class vecType>
|
||||
@ -270,10 +242,8 @@ namespace detail
|
||||
GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
|
||||
|
||||
int64 Value64 = static_cast<int64>(x) * static_cast<int64>(y);
|
||||
int32* PointerMSB = (reinterpret_cast<int32*>(&Value64) + 1);
|
||||
msb = *PointerMSB;
|
||||
int32* PointerLSB = (reinterpret_cast<int32*>(&Value64));
|
||||
lsb = *PointerLSB;
|
||||
msb = static_cast<int>(Value64 >> static_cast<int64>(32));
|
||||
lsb = static_cast<int>(Value64);
|
||||
}
|
||||
|
||||
template <precision P, template <typename, precision> class vecType>
|
||||
@ -328,12 +298,12 @@ namespace detail
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldReverse(vecType<T, P> const & v)
|
||||
{
|
||||
vecType<T, P> x(v);
|
||||
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 2>::call(x, T(0x5555555555555555ull), static_cast<T>( 1));
|
||||
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 4>::call(x, T(0x3333333333333333ull), static_cast<T>( 2));
|
||||
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 8>::call(x, T(0x0F0F0F0F0F0F0F0Full), static_cast<T>( 4));
|
||||
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 16>::call(x, T(0x00FF00FF00FF00FFull), static_cast<T>( 8));
|
||||
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 32>::call(x, T(0x0000FFFF0000FFFFull), static_cast<T>(16));
|
||||
x = detail::compute_bitfieldReverseStep<sizeof(T) * 8 >= 64>::call(x, T(0x00000000FFFFFFFFull), static_cast<T>(32));
|
||||
x = detail::compute_bitfieldReverseStep<T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 2>::call(x, T(0x5555555555555555ull), static_cast<T>( 1));
|
||||
x = detail::compute_bitfieldReverseStep<T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 4>::call(x, T(0x3333333333333333ull), static_cast<T>( 2));
|
||||
x = detail::compute_bitfieldReverseStep<T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 8>::call(x, T(0x0F0F0F0F0F0F0F0Full), static_cast<T>( 4));
|
||||
x = detail::compute_bitfieldReverseStep<T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 16>::call(x, T(0x00FF00FF00FF00FFull), static_cast<T>( 8));
|
||||
x = detail::compute_bitfieldReverseStep<T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 32>::call(x, T(0x0000FFFF0000FFFFull), static_cast<T>(16));
|
||||
x = detail::compute_bitfieldReverseStep<T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 64>::call(x, T(0x00000000FFFFFFFFull), static_cast<T>(32));
|
||||
return x;
|
||||
}
|
||||
|
||||
@ -348,12 +318,12 @@ namespace detail
|
||||
GLM_FUNC_QUALIFIER vecType<int, P> bitCount(vecType<T, P> const & v)
|
||||
{
|
||||
vecType<typename detail::make_unsigned<T>::type, P> x(*reinterpret_cast<vecType<typename detail::make_unsigned<T>::type, P> const *>(&v));
|
||||
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 2>::call(x, typename detail::make_unsigned<T>::type(0x5555555555555555ull), typename detail::make_unsigned<T>::type( 1));
|
||||
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 4>::call(x, typename detail::make_unsigned<T>::type(0x3333333333333333ull), typename detail::make_unsigned<T>::type( 2));
|
||||
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 8>::call(x, typename detail::make_unsigned<T>::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned<T>::type( 4));
|
||||
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 16>::call(x, typename detail::make_unsigned<T>::type(0x00FF00FF00FF00FFull), typename detail::make_unsigned<T>::type( 8));
|
||||
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 32>::call(x, typename detail::make_unsigned<T>::type(0x0000FFFF0000FFFFull), typename detail::make_unsigned<T>::type(16));
|
||||
x = detail::compute_bitfieldBitCountStep<sizeof(T) * 8 >= 64>::call(x, typename detail::make_unsigned<T>::type(0x00000000FFFFFFFFull), typename detail::make_unsigned<T>::type(32));
|
||||
x = detail::compute_bitfieldBitCountStep<typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 2>::call(x, typename detail::make_unsigned<T>::type(0x5555555555555555ull), typename detail::make_unsigned<T>::type( 1));
|
||||
x = detail::compute_bitfieldBitCountStep<typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 4>::call(x, typename detail::make_unsigned<T>::type(0x3333333333333333ull), typename detail::make_unsigned<T>::type( 2));
|
||||
x = detail::compute_bitfieldBitCountStep<typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 8>::call(x, typename detail::make_unsigned<T>::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned<T>::type( 4));
|
||||
x = detail::compute_bitfieldBitCountStep<typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 16>::call(x, typename detail::make_unsigned<T>::type(0x00FF00FF00FF00FFull), typename detail::make_unsigned<T>::type( 8));
|
||||
x = detail::compute_bitfieldBitCountStep<typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 32>::call(x, typename detail::make_unsigned<T>::type(0x0000FFFF0000FFFFull), typename detail::make_unsigned<T>::type(16));
|
||||
x = detail::compute_bitfieldBitCountStep<typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 64>::call(x, typename detail::make_unsigned<T>::type(0x00000000FFFFFFFFull), typename detail::make_unsigned<T>::type(32));
|
||||
return vecType<int, P>(x);
|
||||
}
|
||||
|
||||
@ -391,3 +361,8 @@ namespace detail
|
||||
return detail::compute_findMSB_vec<T, P, vecType, sizeof(T) * 8>::call(x);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "func_integer_simd.inl"
|
||||
#endif
|
||||
|
||||
|
||||
68
common/glm/glm/detail/func_integer_simd.inl
Normal file
68
common/glm/glm/detail/func_integer_simd.inl
Normal file
@ -0,0 +1,68 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_integer_simd.inl
|
||||
|
||||
#include "../simd/integer.h"
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <glm::precision P>
|
||||
struct compute_bitfieldReverseStep<uint32, P, tvec4, true, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v, uint32 Mask, uint32 Shift)
|
||||
{
|
||||
__m128i const set0 = v.data;
|
||||
|
||||
__m128i const set1 = _mm_set1_epi32(Mask);
|
||||
__m128i const and1 = _mm_and_si128(set0, set1);
|
||||
__m128i const sft1 = _mm_slli_epi32(and1, Shift);
|
||||
|
||||
__m128i const set2 = _mm_andnot_si128(set0, _mm_set1_epi32(-1));
|
||||
__m128i const and2 = _mm_and_si128(set0, set2);
|
||||
__m128i const sft2 = _mm_srai_epi32(and2, Shift);
|
||||
|
||||
__m128i const or0 = _mm_or_si128(sft1, sft2);
|
||||
|
||||
return or0;
|
||||
}
|
||||
};
|
||||
|
||||
template <glm::precision P>
|
||||
struct compute_bitfieldBitCountStep<uint32, P, tvec4, true, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v, uint32 Mask, uint32 Shift)
|
||||
{
|
||||
__m128i const set0 = v.data;
|
||||
|
||||
__m128i const set1 = _mm_set1_epi32(Mask);
|
||||
__m128i const and0 = _mm_and_si128(set0, set1);
|
||||
__m128i const sft0 = _mm_slli_epi32(set0, Shift);
|
||||
__m128i const and1 = _mm_and_si128(sft0, set1);
|
||||
__m128i const add0 = _mm_add_epi32(and0, and1);
|
||||
|
||||
return add0;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER int bitCount(uint32 x)
|
||||
{
|
||||
return _mm_popcnt_u32(x);
|
||||
}
|
||||
|
||||
# if(GLM_MODEL == GLM_MODEL_64)
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER int bitCount(uint64 x)
|
||||
{
|
||||
return static_cast<int>(_mm_popcnt_u64(x));
|
||||
}
|
||||
# endif//GLM_MODEL
|
||||
# endif//GLM_ARCH
|
||||
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
@ -1,33 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_matrix.hpp
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
///
|
||||
@ -39,7 +11,6 @@
|
||||
/// are single precision, and a double-precision floating version, where all
|
||||
/// arguments and return values are double precision. Only the single-precision
|
||||
/// floating point version is shown.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -72,19 +43,19 @@ namespace detail
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec2, tvec3>
|
||||
{
|
||||
typedef tmat2x3<T, P> type;
|
||||
typedef tmat3x2<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec2, tvec4>
|
||||
{
|
||||
typedef tmat2x4<T, P> type;
|
||||
typedef tmat4x2<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec3, tvec2>
|
||||
{
|
||||
typedef tmat3x2<T, P> type;
|
||||
typedef tmat2x3<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -96,19 +67,19 @@ namespace detail
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec3, tvec4>
|
||||
{
|
||||
typedef tmat3x4<T, P> type;
|
||||
typedef tmat4x3<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec4, tvec2>
|
||||
{
|
||||
typedef tmat4x2<T, P> type;
|
||||
typedef tmat2x4<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct outerProduct_trait<T, P, tvec4, tvec3>
|
||||
{
|
||||
typedef tmat4x3<T, P> type;
|
||||
typedef tmat3x4<T, P> type;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -149,7 +120,7 @@ namespace detail
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012))
|
||||
# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11))
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const & x);
|
||||
# endif
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_matrix.inl
|
||||
/// @date 2008-03-08 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../geometric.hpp"
|
||||
#include <limits>
|
||||
@ -36,11 +7,23 @@
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <template <class, precision> class matType, typename T, precision P>
|
||||
template <template <typename, precision> class matType, typename T, precision P, bool Aligned>
|
||||
struct compute_matrixCompMult
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static matType<T, P> call(matType<T, P> const& x, matType<T, P> const& y)
|
||||
{
|
||||
matType<T, P> result(uninitialize);
|
||||
for(length_t i = 0; i < result.length(); ++i)
|
||||
result[i] = x[i] * y[i];
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class matType, typename T, precision P, bool Aligned>
|
||||
struct compute_transpose{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<tmat2x2, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_transpose<tmat2x2, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat2x2<T, P> call(tmat2x2<T, P> const & m)
|
||||
{
|
||||
@ -53,8 +36,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<tmat2x3, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_transpose<tmat2x3, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat3x2<T, P> call(tmat2x3<T, P> const & m)
|
||||
{
|
||||
@ -69,8 +52,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<tmat2x4, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_transpose<tmat2x4, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat4x2<T, P> call(tmat2x4<T, P> const & m)
|
||||
{
|
||||
@ -87,8 +70,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<tmat3x2, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_transpose<tmat3x2, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat2x3<T, P> call(tmat3x2<T, P> const & m)
|
||||
{
|
||||
@ -103,8 +86,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<tmat3x3, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_transpose<tmat3x3, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat3x3<T, P> call(tmat3x3<T, P> const & m)
|
||||
{
|
||||
@ -124,8 +107,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<tmat3x4, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_transpose<tmat3x4, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat4x3<T, P> call(tmat3x4<T, P> const & m)
|
||||
{
|
||||
@ -146,8 +129,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<tmat4x2, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_transpose<tmat4x2, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat2x4<T, P> call(tmat4x2<T, P> const & m)
|
||||
{
|
||||
@ -164,8 +147,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<tmat4x3, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_transpose<tmat4x3, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat3x4<T, P> call(tmat4x3<T, P> const & m)
|
||||
{
|
||||
@ -186,8 +169,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_transpose<tmat4x4, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_transpose<tmat4x4, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat4x4<T, P> call(tmat4x4<T, P> const & m)
|
||||
{
|
||||
@ -215,11 +198,11 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <template <class, precision> class matType, typename T, precision P>
|
||||
template <template <typename, precision> class matType, typename T, precision P, bool Aligned>
|
||||
struct compute_determinant{};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_determinant<tmat2x2, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_determinant<tmat2x2, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(tmat2x2<T, P> const & m)
|
||||
{
|
||||
@ -227,8 +210,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_determinant<tmat3x3, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_determinant<tmat3x3, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(tmat3x3<T, P> const & m)
|
||||
{
|
||||
@ -239,8 +222,8 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_determinant<tmat4x4, T, P>
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_determinant<tmat4x4, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(tmat4x4<T, P> const & m)
|
||||
{
|
||||
@ -262,26 +245,130 @@ namespace detail
|
||||
m[0][2] * DetCof[2] + m[0][3] * DetCof[3];
|
||||
}
|
||||
};
|
||||
|
||||
template <template <typename, precision> class matType, typename T, precision P, bool Aligned>
|
||||
struct compute_inverse{};
|
||||
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_inverse<tmat2x2, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat2x2<T, P> call(tmat2x2<T, P> const& m)
|
||||
{
|
||||
T OneOverDeterminant = static_cast<T>(1) / (
|
||||
+ m[0][0] * m[1][1]
|
||||
- m[1][0] * m[0][1]);
|
||||
|
||||
tmat2x2<T, P> Inverse(
|
||||
+ m[1][1] * OneOverDeterminant,
|
||||
- m[0][1] * OneOverDeterminant,
|
||||
- m[1][0] * OneOverDeterminant,
|
||||
+ m[0][0] * OneOverDeterminant);
|
||||
|
||||
return Inverse;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_inverse<tmat3x3, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat3x3<T, P> call(tmat3x3<T, P> const& m)
|
||||
{
|
||||
T OneOverDeterminant = static_cast<T>(1) / (
|
||||
+ m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])
|
||||
- m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2])
|
||||
+ m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]));
|
||||
|
||||
tmat3x3<T, P> Inverse(uninitialize);
|
||||
Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * OneOverDeterminant;
|
||||
Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * OneOverDeterminant;
|
||||
Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * OneOverDeterminant;
|
||||
Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]) * OneOverDeterminant;
|
||||
Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]) * OneOverDeterminant;
|
||||
Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]) * OneOverDeterminant;
|
||||
Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]) * OneOverDeterminant;
|
||||
Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]) * OneOverDeterminant;
|
||||
Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]) * OneOverDeterminant;
|
||||
|
||||
return Inverse;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, bool Aligned>
|
||||
struct compute_inverse<tmat4x4, T, P, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat4x4<T, P> call(tmat4x4<T, P> const& m)
|
||||
{
|
||||
T Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
|
||||
T Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3];
|
||||
T Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3];
|
||||
|
||||
T Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
|
||||
T Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3];
|
||||
T Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3];
|
||||
|
||||
T Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2];
|
||||
T Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2];
|
||||
T Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2];
|
||||
|
||||
T Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3];
|
||||
T Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3];
|
||||
T Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3];
|
||||
|
||||
T Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2];
|
||||
T Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2];
|
||||
T Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2];
|
||||
|
||||
T Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1];
|
||||
T Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1];
|
||||
T Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1];
|
||||
|
||||
tvec4<T, P> Fac0(Coef00, Coef00, Coef02, Coef03);
|
||||
tvec4<T, P> Fac1(Coef04, Coef04, Coef06, Coef07);
|
||||
tvec4<T, P> Fac2(Coef08, Coef08, Coef10, Coef11);
|
||||
tvec4<T, P> Fac3(Coef12, Coef12, Coef14, Coef15);
|
||||
tvec4<T, P> Fac4(Coef16, Coef16, Coef18, Coef19);
|
||||
tvec4<T, P> Fac5(Coef20, Coef20, Coef22, Coef23);
|
||||
|
||||
tvec4<T, P> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]);
|
||||
tvec4<T, P> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]);
|
||||
tvec4<T, P> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]);
|
||||
tvec4<T, P> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]);
|
||||
|
||||
tvec4<T, P> Inv0(Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);
|
||||
tvec4<T, P> Inv1(Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);
|
||||
tvec4<T, P> Inv2(Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);
|
||||
tvec4<T, P> Inv3(Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);
|
||||
|
||||
tvec4<T, P> SignA(+1, -1, +1, -1);
|
||||
tvec4<T, P> SignB(-1, +1, -1, +1);
|
||||
tmat4x4<T, P> Inverse(Inv0 * SignA, Inv1 * SignB, Inv2 * SignA, Inv3 * SignB);
|
||||
|
||||
tvec4<T, P> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);
|
||||
|
||||
tvec4<T, P> Dot0(m[0] * Row0);
|
||||
T Dot1 = (Dot0.x + Dot0.y) + (Dot0.z + Dot0.w);
|
||||
|
||||
T OneOverDeterminant = static_cast<T>(1) / Dot1;
|
||||
|
||||
return Inverse * OneOverDeterminant;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_QUALIFIER matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'matrixCompMult' only accept floating-point inputs");
|
||||
|
||||
matType<T, P> result(uninitialize);
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(result); ++i)
|
||||
result[i] = x[i] * y[i];
|
||||
return result;
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'matrixCompMult' only accept floating-point inputs");
|
||||
return detail::compute_matrixCompMult<matType, T, P, detail::is_aligned<P>::value>::call(x, y);
|
||||
}
|
||||
|
||||
template<typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB>
|
||||
GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'outerProduct' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs");
|
||||
|
||||
typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type m(uninitialize);
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(m); ++i)
|
||||
for(length_t i = 0; i < m.length(); ++i)
|
||||
m[i] = c * r[i];
|
||||
return m;
|
||||
}
|
||||
@ -289,22 +376,26 @@ namespace detail
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_QUALIFIER typename matType<T, P>::transpose_type transpose(matType<T, P> const & m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'transpose' only accept floating-point inputs");
|
||||
return detail::compute_transpose<matType, T, P>::call(m);
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'transpose' only accept floating-point inputs");
|
||||
return detail::compute_transpose<matType, T, P, detail::is_aligned<P>::value>::call(m);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_QUALIFIER T determinant(matType<T, P> const & m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'determinant' only accept floating-point inputs");
|
||||
return detail::compute_determinant<matType, T, P>::call(m);
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'determinant' only accept floating-point inputs");
|
||||
return detail::compute_determinant<matType, T, P, detail::is_aligned<P>::value>::call(m);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_QUALIFIER matType<T, P> inverse(matType<T, P> const & m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inverse' only accept floating-point inputs");
|
||||
return detail::compute_inverse(m);
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs");
|
||||
return detail::compute_inverse<matType, T, P, detail::is_aligned<P>::value>::call(m);
|
||||
}
|
||||
|
||||
}//namespace glm
|
||||
|
||||
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "func_matrix_simd.inl"
|
||||
#endif
|
||||
|
||||
|
||||
88
common/glm/glm/detail/func_matrix_simd.inl
Normal file
88
common/glm/glm/detail/func_matrix_simd.inl
Normal file
@ -0,0 +1,88 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_matrix_simd.inl
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
#include "type_mat4x4.hpp"
|
||||
#include "func_geometric.hpp"
|
||||
#include "../simd/matrix.h"
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <precision P>
|
||||
struct compute_matrixCompMult<tmat4x4, float, P, true>
|
||||
{
|
||||
GLM_STATIC_ASSERT(detail::is_aligned<P>::value, "Specialization requires aligned");
|
||||
|
||||
GLM_FUNC_QUALIFIER static tmat4x4<float, P> call(tmat4x4<float, P> const & x, tmat4x4<float, P> const & y)
|
||||
{
|
||||
tmat4x4<float, P> result(uninitialize);
|
||||
glm_mat4_matrixCompMult(
|
||||
*(glm_vec4 const (*)[4])&x[0].data,
|
||||
*(glm_vec4 const (*)[4])&y[0].data,
|
||||
*(glm_vec4(*)[4])&result[0].data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_transpose<tmat4x4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat4x4<float, P> call(tmat4x4<float, P> const & m)
|
||||
{
|
||||
tmat4x4<float, P> result(uninitialize);
|
||||
glm_mat4_transpose(
|
||||
*(glm_vec4 const (*)[4])&m[0].data,
|
||||
*(glm_vec4(*)[4])&result[0].data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_determinant<tmat4x4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(tmat4x4<float, P> const& m)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_mat4_determinant(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data)));
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_inverse<tmat4x4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat4x4<float, P> call(tmat4x4<float, P> const& m)
|
||||
{
|
||||
tmat4x4<float, P> Result(uninitialize);
|
||||
glm_mat4_inverse(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data), *reinterpret_cast<__m128(*)[4]>(&Result[0].data));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_lowp> outerProduct<float, aligned_lowp, tvec4, tvec4>(tvec4<float, aligned_lowp> const & c, tvec4<float, aligned_lowp> const & r)
|
||||
{
|
||||
tmat4x4<float, aligned_lowp> m(uninitialize);
|
||||
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));
|
||||
return m;
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_mediump> outerProduct<float, aligned_mediump, tvec4, tvec4>(tvec4<float, aligned_mediump> const & c, tvec4<float, aligned_mediump> const & r)
|
||||
{
|
||||
tmat4x4<float, aligned_mediump> m(uninitialize);
|
||||
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));
|
||||
return m;
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_highp> outerProduct<float, aligned_highp, tvec4, tvec4>(tvec4<float, aligned_highp> const & c, tvec4<float, aligned_highp> const & r)
|
||||
{
|
||||
tmat4x4<float, aligned_highp> m(uninitialize);
|
||||
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));
|
||||
return m;
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
#endif
|
||||
@ -1,93 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_noise.hpp
|
||||
/// @date 2008-08-01 / 2011-06-18
|
||||
/// @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>
|
||||
///
|
||||
/// @defgroup core_func_noise Noise functions
|
||||
/// @ingroup core
|
||||
///
|
||||
/// Noise functions are stochastic functions that can be used to increase visual
|
||||
/// complexity. Values returned by the following noise functions give the
|
||||
/// appearance of randomness, but are not truly random.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "type_vec1.hpp"
|
||||
#include "type_vec2.hpp"
|
||||
#include "type_vec3.hpp"
|
||||
#include "setup.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup core_func_noise
|
||||
/// @{
|
||||
|
||||
/// Returns a 1D noise value based on the input value x.
|
||||
///
|
||||
/// @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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL typename genType::value_type noise1(genType const & x);
|
||||
|
||||
/// Returns a 2D noise value based on the input value x.
|
||||
///
|
||||
/// @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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL tvec2<typename genType::value_type, defaultp> noise2(genType const & x);
|
||||
|
||||
/// Returns a 3D noise value based on the input value x.
|
||||
///
|
||||
/// @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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL tvec3<typename genType::value_type, defaultp> noise3(genType const & x);
|
||||
|
||||
/// Returns a 4D noise value based on the input value x.
|
||||
///
|
||||
/// @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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
|
||||
template <typename genType>
|
||||
GLM_FUNC_DECL tvec4<typename genType::value_type, defaultp> noise4(genType const & x);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "func_noise.inl"
|
||||
@ -1,388 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_noise.inl
|
||||
/// @date 2008-08-01 / 2011-09-27
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../detail/_noise.hpp"
|
||||
#include "./func_common.hpp"
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec4<T, P> grad4(T const & j, tvec4<T, P> const & ip)
|
||||
{
|
||||
tvec3<T, P> pXYZ = floor(fract(tvec3<T, P>(j) * tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1);
|
||||
T pW = static_cast<T>(1.5) - dot(abs(pXYZ), tvec3<T, P>(1));
|
||||
tvec4<T, P> s = tvec4<T, P>(lessThan(tvec4<T, P>(pXYZ, pW), tvec4<T, P>(0.0)));
|
||||
pXYZ = pXYZ + (tvec3<T, P>(s) * T(2) - T(1)) * s.w;
|
||||
return tvec4<T, P>(pXYZ, pW);
|
||||
}
|
||||
}//namespace detail
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T noise1(T const & x)
|
||||
{
|
||||
return noise1(tvec2<T, defaultp>(x, T(0)));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, defaultp> noise2(T const & x)
|
||||
{
|
||||
return tvec2<T, defaultp>(
|
||||
noise1(x + T(0.0)),
|
||||
noise1(x + T(1.0)));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, defaultp> noise3(T const & x)
|
||||
{
|
||||
return tvec3<T, defaultp>(
|
||||
noise1(x - T(1.0)),
|
||||
noise1(x + T(0.0)),
|
||||
noise1(x + T(1.0)));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER tvec4<T, defaultp> noise4(T const & x)
|
||||
{
|
||||
return tvec4<T, defaultp>(
|
||||
noise1(x - T(1.0)),
|
||||
noise1(x + T(0.0)),
|
||||
noise1(x + T(1.0)),
|
||||
noise1(x + T(2.0)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T noise1(tvec2<T, P> const & v)
|
||||
{
|
||||
tvec4<T, P> const C = tvec4<T, P>(
|
||||
T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0
|
||||
T( 0.366025403784439), // 0.5 * (sqrt(3.0) - 1.0)
|
||||
T(-0.577350269189626), // -1.0 + 2.0 * C.x
|
||||
T( 0.024390243902439)); // 1.0 / 41.0
|
||||
|
||||
// First corner
|
||||
tvec2<T, P> i = floor(v + dot(v, tvec2<T, P>(C[1])));
|
||||
tvec2<T, P> x0 = v - i + dot(i, tvec2<T, P>(C[0]));
|
||||
|
||||
// Other corners
|
||||
//i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0
|
||||
//i1.y = 1.0 - i1.x;
|
||||
tvec2<T, P> i1 = (x0.x > x0.y) ? tvec2<T, P>(1, 0) : tvec2<T, P>(0, 1);
|
||||
|
||||
// x0 = x0 - 0.0 + 0.0 * C.xx ;
|
||||
// x1 = x0 - i1 + 1.0 * C.xx ;
|
||||
// x2 = x0 - 1.0 + 2.0 * C.xx ;
|
||||
tvec4<T, P> x12 = tvec4<T, P>(x0.x, x0.y, x0.x, x0.y) + tvec4<T, P>(C.x, C.x, C.z, C.z);
|
||||
x12 = tvec4<T, P>(tvec2<T, P>(x12) - i1, x12.z, x12.w);
|
||||
|
||||
// Permutations
|
||||
i = mod(i, T(289)); // Avoid truncation effects in permutation
|
||||
tvec3<T, P> p = detail::permute(
|
||||
detail::permute(i.y + tvec3<T, P>(T(0), i1.y, T(1))) + i.x + tvec3<T, P>(T(0), i1.x, T(1)));
|
||||
|
||||
tvec3<T, P> m = max(T(0.5) - tvec3<T, P>(
|
||||
dot(x0, x0),
|
||||
dot(tvec2<T, P>(x12.x, x12.y), tvec2<T, P>(x12.x, x12.y)),
|
||||
dot(tvec2<T, P>(x12.z, x12.w), tvec2<T, P>(x12.z, x12.w))), T(0));
|
||||
|
||||
m = m * m;
|
||||
m = m * m;
|
||||
|
||||
// Gradients: 41 points uniformly over a line, mapped onto a diamond.
|
||||
// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)
|
||||
|
||||
tvec3<T, P> x = static_cast<T>(2) * fract(p * C.w) - T(1);
|
||||
tvec3<T, P> h = abs(x) - T(0.5);
|
||||
tvec3<T, P> ox = floor(x + T(0.5));
|
||||
tvec3<T, P> a0 = x - ox;
|
||||
|
||||
// Normalise gradients implicitly by scaling m
|
||||
// Inlined for speed: m *= taylorInvSqrt( a0*a0 + h*h );
|
||||
m *= static_cast<T>(1.79284291400159) - T(0.85373472095314) * (a0 * a0 + h * h);
|
||||
|
||||
// Compute final noise value at P
|
||||
tvec3<T, P> g;
|
||||
g.x = a0.x * x0.x + h.x * x0.y;
|
||||
//g.yz = a0.yz * x12.xz + h.yz * x12.yw;
|
||||
g.y = a0.y * x12.x + h.y * x12.y;
|
||||
g.z = a0.z * x12.z + h.z * x12.w;
|
||||
return T(130) * dot(m, g);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T noise1(tvec3<T, P> const & v)
|
||||
{
|
||||
tvec2<T, P> const C(1.0 / 6.0, 1.0 / 3.0);
|
||||
tvec4<T, P> const D(0.0, 0.5, 1.0, 2.0);
|
||||
|
||||
// First corner
|
||||
tvec3<T, P> i(floor(v + dot(v, tvec3<T, P>(C.y))));
|
||||
tvec3<T, P> x0(v - i + dot(i, tvec3<T, P>(C.x)));
|
||||
|
||||
// Other corners
|
||||
tvec3<T, P> g(step(tvec3<T, P>(x0.y, x0.z, x0.x), x0));
|
||||
tvec3<T, P> l(T(1) - g);
|
||||
tvec3<T, P> i1(min(g, tvec3<T, P>(l.z, l.x, l.y)));
|
||||
tvec3<T, P> i2(max(g, tvec3<T, P>(l.z, l.x, l.y)));
|
||||
|
||||
// x0 = x0 - 0.0 + 0.0 * C.xxx;
|
||||
// x1 = x0 - i1 + 1.0 * C.xxx;
|
||||
// x2 = x0 - i2 + 2.0 * C.xxx;
|
||||
// x3 = x0 - 1.0 + 3.0 * C.xxx;
|
||||
tvec3<T, P> x1(x0 - i1 + C.x);
|
||||
tvec3<T, P> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y
|
||||
tvec3<T, P> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y
|
||||
|
||||
// Permutations
|
||||
i = mod289(i);
|
||||
tvec4<T, P> p(detail::permute(detail::permute(detail::permute(
|
||||
i.z + tvec4<T, P>(T(0), i1.z, i2.z, T(1))) +
|
||||
i.y + tvec4<T, P>(T(0), i1.y, i2.y, T(1))) +
|
||||
i.x + tvec4<T, P>(T(0), i1.x, i2.x, T(1))));
|
||||
|
||||
// Gradients: 7x7 points over a square, mapped onto an octahedron.
|
||||
// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)
|
||||
T n_ = static_cast<T>(0.142857142857); // 1.0/7.0
|
||||
tvec3<T, P> ns(n_ * tvec3<T, P>(D.w, D.y, D.z) - tvec3<T, P>(D.x, D.z, D.x));
|
||||
|
||||
tvec4<T, P> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7)
|
||||
|
||||
tvec4<T, P> x_(floor(j * ns.z));
|
||||
tvec4<T, P> y_(floor(j - T(7) * x_)); // mod(j,N)
|
||||
|
||||
tvec4<T, P> x(x_ * ns.x + ns.y);
|
||||
tvec4<T, P> y(y_ * ns.x + ns.y);
|
||||
tvec4<T, P> h(T(1) - abs(x) - abs(y));
|
||||
|
||||
tvec4<T, P> b0(x.x, x.y, y.x, y.y);
|
||||
tvec4<T, P> b1(x.z, x.w, y.z, y.w);
|
||||
|
||||
// vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;
|
||||
// vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;
|
||||
tvec4<T, P> s0(floor(b0) * T(2) + T(1));
|
||||
tvec4<T, P> s1(floor(b1) * T(2) + T(1));
|
||||
tvec4<T, P> sh(-step(h, tvec4<T, P>(0.0)));
|
||||
|
||||
tvec4<T, P> a0 = tvec4<T, P>(b0.x, b0.z, b0.y, b0.w) + tvec4<T, P>(s0.x, s0.z, s0.y, s0.w) * tvec4<T, P>(sh.x, sh.x, sh.y, sh.y);
|
||||
tvec4<T, P> a1 = tvec4<T, P>(b1.x, b1.z, b1.y, b1.w) + tvec4<T, P>(s1.x, s1.z, s1.y, s1.w) * tvec4<T, P>(sh.z, sh.z, sh.w, sh.w);
|
||||
|
||||
tvec3<T, P> p0(a0.x, a0.y, h.x);
|
||||
tvec3<T, P> p1(a0.z, a0.w, h.y);
|
||||
tvec3<T, P> p2(a1.x, a1.y, h.z);
|
||||
tvec3<T, P> p3(a1.z, a1.w, h.w);
|
||||
|
||||
// Normalise gradients
|
||||
tvec4<T, P> norm = taylorInvSqrt(tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
|
||||
p0 *= norm.x;
|
||||
p1 *= norm.y;
|
||||
p2 *= norm.z;
|
||||
p3 *= norm.w;
|
||||
|
||||
// Mix final noise value
|
||||
tvec4<T, P> m = max(T(0.6) - tvec4<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), T(0));
|
||||
m = m * m;
|
||||
return T(42) * dot(m * m, tvec4<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T noise1(tvec4<T, P> const & v)
|
||||
{
|
||||
tvec4<T, P> const C(
|
||||
0.138196601125011, // (5 - sqrt(5))/20 G4
|
||||
0.276393202250021, // 2 * G4
|
||||
0.414589803375032, // 3 * G4
|
||||
-0.447213595499958); // -1 + 4 * G4
|
||||
|
||||
// (sqrt(5) - 1)/4 = F4, used once below
|
||||
T const F4 = static_cast<T>(0.309016994374947451);
|
||||
|
||||
// First corner
|
||||
tvec4<T, P> i = floor(v + dot(v, tvec4<T, P>(F4)));
|
||||
tvec4<T, P> x0 = v - i + dot(i, tvec4<T, P>(C.x));
|
||||
|
||||
// Other corners
|
||||
|
||||
// Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)
|
||||
tvec4<T, P> i0;
|
||||
tvec3<T, P> isX = step(tvec3<T, P>(x0.y, x0.z, x0.w), tvec3<T, P>(x0.x));
|
||||
tvec3<T, P> isYZ = step(tvec3<T, P>(x0.z, x0.w, x0.w), tvec3<T, P>(x0.y, x0.y, x0.z));
|
||||
|
||||
// i0.x = dot(isX, vec3(1.0));
|
||||
//i0.x = isX.x + isX.y + isX.z;
|
||||
//i0.yzw = static_cast<T>(1) - isX;
|
||||
i0 = tvec4<T, P>(isX.x + isX.y + isX.z, T(1) - isX);
|
||||
|
||||
// i0.y += dot(isYZ.xy, vec2(1.0));
|
||||
i0.y += isYZ.x + isYZ.y;
|
||||
|
||||
//i0.zw += 1.0 - tvec2<T, P>(isYZ.x, isYZ.y);
|
||||
i0.z += static_cast<T>(1) - isYZ.x;
|
||||
i0.w += static_cast<T>(1) - isYZ.y;
|
||||
i0.z += isYZ.z;
|
||||
i0.w += static_cast<T>(1) - isYZ.z;
|
||||
|
||||
// i0 now contains the unique values 0,1,2,3 in each channel
|
||||
tvec4<T, P> i3 = clamp(i0, T(0), T(1));
|
||||
tvec4<T, P> i2 = clamp(i0 - T(1), T(0), T(1));
|
||||
tvec4<T, P> i1 = clamp(i0 - T(2), T(0), T(1));
|
||||
|
||||
// x0 = x0 - 0.0 + 0.0 * C.xxxx
|
||||
// x1 = x0 - i1 + 0.0 * C.xxxx
|
||||
// x2 = x0 - i2 + 0.0 * C.xxxx
|
||||
// x3 = x0 - i3 + 0.0 * C.xxxx
|
||||
// x4 = x0 - 1.0 + 4.0 * C.xxxx
|
||||
tvec4<T, P> x1 = x0 - i1 + C.x;
|
||||
tvec4<T, P> x2 = x0 - i2 + C.y;
|
||||
tvec4<T, P> x3 = x0 - i3 + C.z;
|
||||
tvec4<T, P> x4 = x0 + C.w;
|
||||
|
||||
// Permutations
|
||||
i = mod(i, T(289));
|
||||
T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x);
|
||||
tvec4<T, P> j1 = detail::permute(detail::permute(detail::permute(detail::permute(
|
||||
i.w + tvec4<T, P>(i1.w, i2.w, i3.w, T(1))) +
|
||||
i.z + tvec4<T, P>(i1.z, i2.z, i3.z, T(1))) +
|
||||
i.y + tvec4<T, P>(i1.y, i2.y, i3.y, T(1))) +
|
||||
i.x + tvec4<T, P>(i1.x, i2.x, i3.x, T(1)));
|
||||
|
||||
// Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope
|
||||
// 7*7*6 = 294, which is close to the ring size 17*17 = 289.
|
||||
tvec4<T, P> ip = tvec4<T, P>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0));
|
||||
|
||||
tvec4<T, P> p0 = detail::grad4(j0, ip);
|
||||
tvec4<T, P> p1 = detail::grad4(j1.x, ip);
|
||||
tvec4<T, P> p2 = detail::grad4(j1.y, ip);
|
||||
tvec4<T, P> p3 = detail::grad4(j1.z, ip);
|
||||
tvec4<T, P> p4 = detail::grad4(j1.w, ip);
|
||||
|
||||
// Normalise gradients
|
||||
tvec4<T, P> norm = detail::taylorInvSqrt(tvec4<T, P>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));
|
||||
p0 *= norm.x;
|
||||
p1 *= norm.y;
|
||||
p2 *= norm.z;
|
||||
p3 *= norm.w;
|
||||
p4 *= taylorInvSqrt(dot(p4, p4));
|
||||
|
||||
// Mix contributions from the five corners
|
||||
tvec3<T, P> m0 = max(T(0.6) - tvec3<T, P>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), T(0));
|
||||
tvec2<T, P> m1 = max(T(0.6) - tvec2<T, P>(dot(x3, x3), dot(x4, x4) ), T(0));
|
||||
m0 = m0 * m0;
|
||||
m1 = m1 * m1;
|
||||
|
||||
return T(49) * (
|
||||
dot(m0 * m0, tvec3<T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) +
|
||||
dot(m1 * m1, tvec2<T, P>(dot(p3, x3), dot(p4, x4))));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec2<T, P> const & x)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
noise1(x + tvec2<T, P>(0.0)),
|
||||
noise1(tvec2<T, P>(0.0) - x));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec3<T, P> const & x)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
noise1(x + tvec3<T, P>(0.0)),
|
||||
noise1(tvec3<T, P>(0.0) - x));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec4<T, P> const & x)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
noise1(x + tvec4<T, P>(0)),
|
||||
noise1(tvec4<T, P>(0) - x));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec2<T, P> const & x)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
noise1(x - tvec2<T, P>(1.0)),
|
||||
noise1(x + tvec2<T, P>(0.0)),
|
||||
noise1(x + tvec2<T, P>(1.0)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec3<T, P> const & x)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
noise1(x - tvec3<T, P>(1.0)),
|
||||
noise1(x + tvec3<T, P>(0.0)),
|
||||
noise1(x + tvec3<T, P>(1.0)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec4<T, P> const & x)
|
||||
{
|
||||
return tvec3<T, P>(
|
||||
noise1(x - tvec4<T, P>(1)),
|
||||
noise1(x + tvec4<T, P>(0)),
|
||||
noise1(x + tvec4<T, P>(1)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec2<T, P> const & x)
|
||||
{
|
||||
return tvec4<T, P>(
|
||||
noise1(x - tvec2<T, P>(1)),
|
||||
noise1(x + tvec2<T, P>(0)),
|
||||
noise1(x + tvec2<T, P>(1)),
|
||||
noise1(x + tvec2<T, P>(2)));
|
||||
}
|
||||
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec3<T, P> const & x)
|
||||
{
|
||||
return tvec4<T, P>(
|
||||
noise1(x - tvec3<T, P>(1)),
|
||||
noise1(x + tvec3<T, P>(0)),
|
||||
noise1(x + tvec3<T, P>(1)),
|
||||
noise1(x + tvec3<T, P>(2)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec4<T, P> const & x)
|
||||
{
|
||||
return tvec4<T, P>(
|
||||
noise1(x - tvec4<T, P>(1)),
|
||||
noise1(x + tvec4<T, P>(0)),
|
||||
noise1(x + tvec4<T, P>(1)),
|
||||
noise1(x + tvec4<T, P>(2)));
|
||||
}
|
||||
|
||||
}//namespace glm
|
||||
@ -1,42 +1,13 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_packing.hpp
|
||||
/// @date 2010-03-17 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
/// @see gtc_packing
|
||||
///
|
||||
///
|
||||
/// @defgroup core_func_packing Floating-Point Pack and Unpack Functions
|
||||
/// @ingroup core
|
||||
///
|
||||
///
|
||||
/// These functions do not operate component-wise, rather as described in each case.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -111,7 +82,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec2 unpackUnorm2x16(uint const & p);
|
||||
GLM_FUNC_DECL vec2 unpackUnorm2x16(uint p);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
@ -124,7 +95,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec2 unpackSnorm2x16(uint const & p);
|
||||
GLM_FUNC_DECL vec2 unpackSnorm2x16(uint p);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
@ -137,7 +108,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec4 unpackUnorm4x8(uint const & p);
|
||||
GLM_FUNC_DECL vec4 unpackUnorm4x8(uint p);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
@ -150,7 +121,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec4 unpackSnorm4x8(uint const & p);
|
||||
GLM_FUNC_DECL vec4 unpackSnorm4x8(uint p);
|
||||
|
||||
/// Returns a double-precision value obtained by packing the components of v into a 64-bit value.
|
||||
/// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified.
|
||||
@ -169,7 +140,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uvec2 unpackDouble2x32(double const & v);
|
||||
GLM_FUNC_DECL uvec2 unpackDouble2x32(double v);
|
||||
|
||||
/// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector
|
||||
/// to the 16-bit floating-point representation found in the OpenGL Specification,
|
||||
@ -189,7 +160,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec2 unpackHalf2x16(uint const & v);
|
||||
GLM_FUNC_DECL vec2 unpackHalf2x16(uint v);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_packing.inl
|
||||
/// @date 2010-03-17 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "func_common.hpp"
|
||||
#include "type_half.hpp"
|
||||
@ -38,87 +9,182 @@ namespace glm
|
||||
{
|
||||
GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const & v)
|
||||
{
|
||||
u16vec2 Topack(round(clamp(v, 0.0f, 1.0f) * 65535.0f));
|
||||
// return reinterpret_cast<uint&>(Topack);
|
||||
uint* ptr(reinterpret_cast<uint*>(&Topack));
|
||||
return *ptr;
|
||||
union
|
||||
{
|
||||
u16 in[2];
|
||||
uint out;
|
||||
} u;
|
||||
|
||||
u16vec2 result(round(clamp(v, 0.0f, 1.0f) * 65535.0f));
|
||||
|
||||
u.in[0] = result[0];
|
||||
u.in[1] = result[1];
|
||||
|
||||
return u.out;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint const & p)
|
||||
GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint p)
|
||||
{
|
||||
vec2 Unpack(reinterpret_cast<u16vec2 const &>(p));
|
||||
return Unpack * float(1.5259021896696421759365224689097e-5); // 1.0 / 65535.0
|
||||
union
|
||||
{
|
||||
uint in;
|
||||
u16 out[2];
|
||||
} u;
|
||||
|
||||
u.in = p;
|
||||
|
||||
return vec2(u.out[0], u.out[1]) * 1.5259021896696421759365224689097e-5f;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const & v)
|
||||
{
|
||||
i16vec2 Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f));
|
||||
// return reinterpret_cast<uint32&>(Topack);
|
||||
uint* ptr(reinterpret_cast<uint*>(&Topack));
|
||||
return *ptr;
|
||||
union
|
||||
{
|
||||
i16 in[2];
|
||||
uint out;
|
||||
} u;
|
||||
|
||||
i16vec2 result(round(clamp(v, -1.0f, 1.0f) * 32767.0f));
|
||||
|
||||
u.in[0] = result[0];
|
||||
u.in[1] = result[1];
|
||||
|
||||
return u.out;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint const & p)
|
||||
GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint p)
|
||||
{
|
||||
vec2 Unpack(reinterpret_cast<i16vec2 const &>(p));
|
||||
return clamp(
|
||||
Unpack * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f,
|
||||
-1.0f, 1.0f);
|
||||
union
|
||||
{
|
||||
uint in;
|
||||
i16 out[2];
|
||||
} u;
|
||||
|
||||
u.in = p;
|
||||
|
||||
return clamp(vec2(u.out[0], u.out[1]) * 3.0518509475997192297128208258309e-5f, -1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const & v)
|
||||
{
|
||||
u8vec4 Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f));
|
||||
return reinterpret_cast<uint&>(Topack);
|
||||
union
|
||||
{
|
||||
u8 in[4];
|
||||
uint out;
|
||||
} u;
|
||||
|
||||
u8vec4 result(round(clamp(v, 0.0f, 1.0f) * 255.0f));
|
||||
|
||||
u.in[0] = result[0];
|
||||
u.in[1] = result[1];
|
||||
u.in[2] = result[2];
|
||||
u.in[3] = result[3];
|
||||
|
||||
return u.out;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint const & p)
|
||||
GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint p)
|
||||
{
|
||||
vec4 Unpack(reinterpret_cast<u8vec4 const&>(p));
|
||||
return Unpack * float(0.0039215686274509803921568627451); // 1 / 255
|
||||
union
|
||||
{
|
||||
uint in;
|
||||
u8 out[4];
|
||||
} u;
|
||||
|
||||
u.in = p;
|
||||
|
||||
return vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0039215686274509803921568627451f;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const & v)
|
||||
{
|
||||
i8vec4 Topack(round(clamp(v ,-1.0f, 1.0f) * 127.0f));
|
||||
return reinterpret_cast<uint&>(Topack);
|
||||
union
|
||||
{
|
||||
i8 in[4];
|
||||
uint out;
|
||||
} u;
|
||||
|
||||
i8vec4 result(round(clamp(v, -1.0f, 1.0f) * 127.0f));
|
||||
|
||||
u.in[0] = result[0];
|
||||
u.in[1] = result[1];
|
||||
u.in[2] = result[2];
|
||||
u.in[3] = result[3];
|
||||
|
||||
return u.out;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint const & p)
|
||||
GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint p)
|
||||
{
|
||||
vec4 Unpack(reinterpret_cast<i8vec4 const &>(p));
|
||||
return clamp(
|
||||
Unpack * 0.0078740157480315f, // 1.0f / 127.0f
|
||||
-1.0f, 1.0f);
|
||||
union
|
||||
{
|
||||
uint in;
|
||||
i8 out[4];
|
||||
} u;
|
||||
|
||||
u.in = p;
|
||||
|
||||
return clamp(vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0078740157480315f, -1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const & v)
|
||||
{
|
||||
return reinterpret_cast<double const &>(v);
|
||||
union
|
||||
{
|
||||
uint in[2];
|
||||
double out;
|
||||
} u;
|
||||
|
||||
u.in[0] = v[0];
|
||||
u.in[1] = v[1];
|
||||
|
||||
return u.out;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double const & v)
|
||||
GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double v)
|
||||
{
|
||||
return reinterpret_cast<uvec2 const &>(v);
|
||||
union
|
||||
{
|
||||
double in;
|
||||
uint out[2];
|
||||
} u;
|
||||
|
||||
u.in = v;
|
||||
|
||||
return uvec2(u.out[0], u.out[1]);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const & v)
|
||||
{
|
||||
i16vec2 Unpack(
|
||||
detail::toFloat16(v.x),
|
||||
detail::toFloat16(v.y));
|
||||
union
|
||||
{
|
||||
i16 in[2];
|
||||
uint out;
|
||||
} u;
|
||||
|
||||
uint * Result = reinterpret_cast<uint*>(&Unpack);
|
||||
return *Result;
|
||||
u.in[0] = detail::toFloat16(v.x);
|
||||
u.in[1] = detail::toFloat16(v.y);
|
||||
|
||||
return u.out;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint const & v)
|
||||
GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint v)
|
||||
{
|
||||
i16vec2 Unpack(reinterpret_cast<i16vec2 const &>(v));
|
||||
|
||||
union
|
||||
{
|
||||
uint in;
|
||||
i16 out[2];
|
||||
} u;
|
||||
|
||||
u.in = v;
|
||||
|
||||
return vec2(
|
||||
detail::toFloat32(Unpack.x),
|
||||
detail::toFloat32(Unpack.y));
|
||||
detail::toFloat32(u.out[0]),
|
||||
detail::toFloat32(u.out[1]));
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "func_packing_simd.inl"
|
||||
#endif
|
||||
|
||||
|
||||
9
common/glm/glm/detail/func_packing_simd.inl
Normal file
9
common/glm/glm/detail/func_packing_simd.inl
Normal file
@ -0,0 +1,9 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_packing_simd.inl
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
@ -1,33 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_trigonometric.hpp
|
||||
/// @date 2008-08-01 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
///
|
||||
@ -39,7 +11,6 @@
|
||||
/// the divisor of a ratio is 0, then results will be undefined.
|
||||
///
|
||||
/// These all operate component-wise. The description is per component.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -58,7 +29,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> radians(vecType<T, P> const & degrees);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vecType<T, P> radians(vecType<T, P> const & degrees);
|
||||
|
||||
/// Converts radians to degrees and returns the result.
|
||||
///
|
||||
@ -67,7 +38,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> degrees(vecType<T, P> const & radians);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vecType<T, P> degrees(vecType<T, P> const & radians);
|
||||
|
||||
/// The standard trigonometric sine function.
|
||||
/// The values returned by this function will range from [-1, 1].
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_trigonometric.inl
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "_vectorize.hpp"
|
||||
#include <cmath>
|
||||
@ -38,7 +9,7 @@ namespace glm
|
||||
{
|
||||
// radians
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType radians(genType degrees)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'radians' only accept floating-point input");
|
||||
|
||||
@ -46,14 +17,14 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> radians(vecType<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<T, P> radians(vecType<T, P> const & v)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(radians, v);
|
||||
}
|
||||
|
||||
// degrees
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType degrees(genType radians)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType degrees(genType radians)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'degrees' only accept floating-point input");
|
||||
|
||||
@ -61,7 +32,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> degrees(vecType<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<T, P> degrees(vecType<T, P> const & v)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(degrees, v);
|
||||
}
|
||||
@ -113,7 +84,7 @@ namespace glm
|
||||
|
||||
// atan
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType atan(genType const & y, genType const & x)
|
||||
GLM_FUNC_QUALIFIER genType atan(genType y, genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atan' only accept floating-point input");
|
||||
|
||||
@ -123,7 +94,7 @@ namespace glm
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> atan(vecType<T, P> const & a, vecType<T, P> const & b)
|
||||
{
|
||||
return detail::functor2<T, P, vecType>::call(atan2, a, b);
|
||||
return detail::functor2<T, P, vecType>::call(::std::atan2, a, b);
|
||||
}
|
||||
|
||||
using std::atan;
|
||||
@ -165,12 +136,12 @@ namespace glm
|
||||
# if GLM_HAS_CXX11_STL
|
||||
using std::asinh;
|
||||
# else
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType asinh(genType const & x)
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType asinh(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asinh' only accept floating-point input");
|
||||
|
||||
return (x < static_cast<genType>(0) ? static_cast<genType>(-1) : (x > static_cast<genType>(0) ? static_cast<genType>(1) : static_cast<genType>(0))) * log(abs(x) + sqrt(static_cast<genType>(1) + x * x));
|
||||
return (x < static_cast<genType>(0) ? static_cast<genType>(-1) : (x > static_cast<genType>(0) ? static_cast<genType>(1) : static_cast<genType>(0))) * log(std::abs(x) + sqrt(static_cast<genType>(1) + x * x));
|
||||
}
|
||||
# endif
|
||||
|
||||
@ -185,7 +156,7 @@ namespace glm
|
||||
using std::acosh;
|
||||
# else
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType acosh(genType const & x)
|
||||
GLM_FUNC_QUALIFIER genType acosh(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acosh' only accept floating-point input");
|
||||
|
||||
@ -206,11 +177,11 @@ namespace glm
|
||||
using std::atanh;
|
||||
# else
|
||||
template <typename genType>
|
||||
GLM_FUNC_QUALIFIER genType atanh(genType const & x)
|
||||
GLM_FUNC_QUALIFIER genType atanh(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atanh' only accept floating-point input");
|
||||
|
||||
if(abs(x) >= static_cast<genType>(1))
|
||||
if(std::abs(x) >= static_cast<genType>(1))
|
||||
return 0;
|
||||
return static_cast<genType>(0.5) * log((static_cast<genType>(1) + x) / (static_cast<genType>(1) - x));
|
||||
}
|
||||
@ -222,3 +193,8 @@ namespace glm
|
||||
return detail::functor1<T, T, P, vecType>::call(atanh, v);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "func_trigonometric_simd.inl"
|
||||
#endif
|
||||
|
||||
|
||||
0
common/glm/glm/detail/func_trigonometric_simd.inl
Normal file
0
common/glm/glm/detail/func_trigonometric_simd.inl
Normal file
@ -1,33 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_vector_relational.hpp
|
||||
/// @date 2008-08-03 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
|
||||
///
|
||||
@ -40,7 +12,6 @@
|
||||
///
|
||||
/// In all cases, the sizes of all the input and return vectors for any particular
|
||||
/// call must match.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/func_vector_relational.inl
|
||||
/// @date 2008-08-03 / 2011-09-09
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <limits>
|
||||
|
||||
@ -37,10 +8,10 @@ namespace glm
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<bool, P> lessThan(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||
{
|
||||
assert(detail::component_count(x) == detail::component_count(y));
|
||||
assert(x.length() == y.length());
|
||||
|
||||
vecType<bool, P> Result(uninitialize);
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] < y[i];
|
||||
|
||||
return Result;
|
||||
@ -49,10 +20,10 @@ namespace glm
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<bool, P> lessThanEqual(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||
{
|
||||
assert(detail::component_count(x) == detail::component_count(y));
|
||||
assert(x.length() == y.length());
|
||||
|
||||
vecType<bool, P> Result(uninitialize);
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] <= y[i];
|
||||
return Result;
|
||||
}
|
||||
@ -60,10 +31,10 @@ namespace glm
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<bool, P> greaterThan(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||
{
|
||||
assert(detail::component_count(x) == detail::component_count(y));
|
||||
assert(x.length() == y.length());
|
||||
|
||||
vecType<bool, P> Result(uninitialize);
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] > y[i];
|
||||
return Result;
|
||||
}
|
||||
@ -71,10 +42,10 @@ namespace glm
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<bool, P> greaterThanEqual(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||
{
|
||||
assert(detail::component_count(x) == detail::component_count(y));
|
||||
assert(x.length() == y.length());
|
||||
|
||||
vecType<bool, P> Result(uninitialize);
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] >= y[i];
|
||||
return Result;
|
||||
}
|
||||
@ -82,10 +53,10 @@ namespace glm
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<bool, P> equal(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||
{
|
||||
assert(detail::component_count(x) == detail::component_count(y));
|
||||
assert(x.length() == y.length());
|
||||
|
||||
vecType<bool, P> Result(uninitialize);
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] == y[i];
|
||||
return Result;
|
||||
}
|
||||
@ -93,10 +64,10 @@ namespace glm
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<bool, P> notEqual(vecType<T, P> const & x, vecType<T, P> const & y)
|
||||
{
|
||||
assert(detail::component_count(x) == detail::component_count(y));
|
||||
assert(x.length() == y.length());
|
||||
|
||||
vecType<bool, P> Result(uninitialize);
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
Result[i] = x[i] != y[i];
|
||||
return Result;
|
||||
}
|
||||
@ -105,7 +76,7 @@ namespace glm
|
||||
GLM_FUNC_QUALIFIER bool any(vecType<bool, P> const & v)
|
||||
{
|
||||
bool Result = false;
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(v); ++i)
|
||||
for(length_t i = 0; i < v.length(); ++i)
|
||||
Result = Result || v[i];
|
||||
return Result;
|
||||
}
|
||||
@ -114,7 +85,7 @@ namespace glm
|
||||
GLM_FUNC_QUALIFIER bool all(vecType<bool, P> const & v)
|
||||
{
|
||||
bool Result = true;
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(v); ++i)
|
||||
for(length_t i = 0; i < v.length(); ++i)
|
||||
Result = Result && v[i];
|
||||
return Result;
|
||||
}
|
||||
@ -123,9 +94,12 @@ namespace glm
|
||||
GLM_FUNC_QUALIFIER vecType<bool, P> not_(vecType<bool, P> const & v)
|
||||
{
|
||||
vecType<bool, P> Result(uninitialize);
|
||||
for(detail::component_count_t i = 0; i < detail::component_count(v); ++i)
|
||||
for(length_t i = 0; i < v.length(); ++i)
|
||||
Result[i] = !v[i];
|
||||
return Result;
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "func_vector_relational_simd.inl"
|
||||
#endif
|
||||
|
||||
9
common/glm/glm/detail/func_vector_relational_simd.inl
Normal file
9
common/glm/glm/detail/func_vector_relational_simd.inl
Normal file
@ -0,0 +1,9 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_vector_relational_simd.inl
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/glm.cpp
|
||||
/// @date 2013-04-22 / 2013-04-22
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/quaternion.hpp>
|
||||
|
||||
@ -1,87 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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/detail/intrinsic_common.hpp
|
||||
/// @date 2009-05-11 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "setup.hpp"
|
||||
|
||||
#if(!(GLM_ARCH & GLM_ARCH_SSE2))
|
||||
# error "SSE2 instructions not supported or enabled"
|
||||
#else
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
__m128 sse_abs_ps(__m128 x);
|
||||
|
||||
__m128 sse_sgn_ps(__m128 x);
|
||||
|
||||
//floor
|
||||
__m128 sse_flr_ps(__m128 v);
|
||||
|
||||
//trunc
|
||||
__m128 sse_trc_ps(__m128 v);
|
||||
|
||||
//round
|
||||
__m128 sse_nd_ps(__m128 v);
|
||||
|
||||
//roundEven
|
||||
__m128 sse_rde_ps(__m128 v);
|
||||
|
||||
__m128 sse_rnd_ps(__m128 x);
|
||||
|
||||
__m128 sse_ceil_ps(__m128 v);
|
||||
|
||||
__m128 sse_frc_ps(__m128 x);
|
||||
|
||||
__m128 sse_mod_ps(__m128 x, __m128 y);
|
||||
|
||||
__m128 sse_modf_ps(__m128 x, __m128i & i);
|
||||
|
||||
//GLM_FUNC_QUALIFIER __m128 sse_min_ps(__m128 x, __m128 y)
|
||||
|
||||
//GLM_FUNC_QUALIFIER __m128 sse_max_ps(__m128 x, __m128 y)
|
||||
|
||||
__m128 sse_clp_ps(__m128 v, __m128 minVal, __m128 maxVal);
|
||||
|
||||
__m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a);
|
||||
|
||||
__m128 sse_stp_ps(__m128 edge, __m128 x);
|
||||
|
||||
__m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x);
|
||||
|
||||
__m128 sse_nan_ps(__m128 x);
|
||||
|
||||
__m128 sse_inf_ps(__m128 x);
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#include "intrinsic_common.inl"
|
||||
|
||||
#endif//GLM_ARCH
|
||||
@ -1,313 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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/detail/intrinsic_common.inl
|
||||
/// @date 2009-05-08 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace detail{
|
||||
|
||||
#if(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4510 4512 4610)
|
||||
#endif
|
||||
|
||||
union ieee754_QNAN
|
||||
{
|
||||
const float f;
|
||||
struct i
|
||||
{
|
||||
const unsigned int mantissa:23, exp:8, sign:1;
|
||||
};
|
||||
|
||||
ieee754_QNAN() : f(0.0)/*, mantissa(0x7FFFFF), exp(0xFF), sign(0x0)*/ {}
|
||||
};
|
||||
|
||||
#if(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
static const __m128 GLM_VAR_USED zero = _mm_setzero_ps();
|
||||
static const __m128 GLM_VAR_USED one = _mm_set_ps1(1.0f);
|
||||
static const __m128 GLM_VAR_USED minus_one = _mm_set_ps1(-1.0f);
|
||||
static const __m128 GLM_VAR_USED two = _mm_set_ps1(2.0f);
|
||||
static const __m128 GLM_VAR_USED three = _mm_set_ps1(3.0f);
|
||||
static const __m128 GLM_VAR_USED pi = _mm_set_ps1(3.1415926535897932384626433832795f);
|
||||
static const __m128 GLM_VAR_USED hundred_eighty = _mm_set_ps1(180.f);
|
||||
static const __m128 GLM_VAR_USED pi_over_hundred_eighty = _mm_set_ps1(0.017453292519943295769236907684886f);
|
||||
static const __m128 GLM_VAR_USED hundred_eighty_over_pi = _mm_set_ps1(57.295779513082320876798154814105f);
|
||||
|
||||
static const ieee754_QNAN absMask;
|
||||
static const __m128 GLM_VAR_USED abs4Mask = _mm_set_ps1(absMask.f);
|
||||
|
||||
static const __m128 GLM_VAR_USED _epi32_sign_mask = _mm_castsi128_ps(_mm_set1_epi32(static_cast<int>(0x80000000)));
|
||||
//static const __m128 GLM_VAR_USED _epi32_inv_sign_mask = _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF));
|
||||
//static const __m128 GLM_VAR_USED _epi32_mant_mask = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000));
|
||||
//static const __m128 GLM_VAR_USED _epi32_inv_mant_mask = _mm_castsi128_ps(_mm_set1_epi32(0x807FFFFF));
|
||||
//static const __m128 GLM_VAR_USED _epi32_min_norm_pos = _mm_castsi128_ps(_mm_set1_epi32(0x00800000));
|
||||
static const __m128 GLM_VAR_USED _epi32_0 = _mm_set_ps1(0);
|
||||
static const __m128 GLM_VAR_USED _epi32_1 = _mm_set_ps1(1);
|
||||
static const __m128 GLM_VAR_USED _epi32_2 = _mm_set_ps1(2);
|
||||
static const __m128 GLM_VAR_USED _epi32_3 = _mm_set_ps1(3);
|
||||
static const __m128 GLM_VAR_USED _epi32_4 = _mm_set_ps1(4);
|
||||
static const __m128 GLM_VAR_USED _epi32_5 = _mm_set_ps1(5);
|
||||
static const __m128 GLM_VAR_USED _epi32_6 = _mm_set_ps1(6);
|
||||
static const __m128 GLM_VAR_USED _epi32_7 = _mm_set_ps1(7);
|
||||
static const __m128 GLM_VAR_USED _epi32_8 = _mm_set_ps1(8);
|
||||
static const __m128 GLM_VAR_USED _epi32_9 = _mm_set_ps1(9);
|
||||
static const __m128 GLM_VAR_USED _epi32_127 = _mm_set_ps1(127);
|
||||
//static const __m128 GLM_VAR_USED _epi32_ninf = _mm_castsi128_ps(_mm_set1_epi32(0xFF800000));
|
||||
//static const __m128 GLM_VAR_USED _epi32_pinf = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000));
|
||||
|
||||
static const __m128 GLM_VAR_USED _ps_1_3 = _mm_set_ps1(0.33333333333333333333333333333333f);
|
||||
static const __m128 GLM_VAR_USED _ps_0p5 = _mm_set_ps1(0.5f);
|
||||
static const __m128 GLM_VAR_USED _ps_1 = _mm_set_ps1(1.0f);
|
||||
static const __m128 GLM_VAR_USED _ps_m1 = _mm_set_ps1(-1.0f);
|
||||
static const __m128 GLM_VAR_USED _ps_2 = _mm_set_ps1(2.0f);
|
||||
static const __m128 GLM_VAR_USED _ps_3 = _mm_set_ps1(3.0f);
|
||||
static const __m128 GLM_VAR_USED _ps_127 = _mm_set_ps1(127.0f);
|
||||
static const __m128 GLM_VAR_USED _ps_255 = _mm_set_ps1(255.0f);
|
||||
static const __m128 GLM_VAR_USED _ps_2pow23 = _mm_set_ps1(8388608.0f);
|
||||
|
||||
static const __m128 GLM_VAR_USED _ps_1_0_0_0 = _mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f);
|
||||
static const __m128 GLM_VAR_USED _ps_0_1_0_0 = _mm_set_ps(0.0f, 1.0f, 0.0f, 0.0f);
|
||||
static const __m128 GLM_VAR_USED _ps_0_0_1_0 = _mm_set_ps(0.0f, 0.0f, 1.0f, 0.0f);
|
||||
static const __m128 GLM_VAR_USED _ps_0_0_0_1 = _mm_set_ps(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
static const __m128 GLM_VAR_USED _ps_pi = _mm_set_ps1(3.1415926535897932384626433832795f);
|
||||
static const __m128 GLM_VAR_USED _ps_pi2 = _mm_set_ps1(6.283185307179586476925286766560f);
|
||||
static const __m128 GLM_VAR_USED _ps_2_pi = _mm_set_ps1(0.63661977236758134307553505349006f);
|
||||
static const __m128 GLM_VAR_USED _ps_pi_2 = _mm_set_ps1(1.5707963267948966192313216916398f);
|
||||
static const __m128 GLM_VAR_USED _ps_4_pi = _mm_set_ps1(1.2732395447351626861510701069801f);
|
||||
static const __m128 GLM_VAR_USED _ps_pi_4 = _mm_set_ps1(0.78539816339744830961566084581988f);
|
||||
|
||||
static const __m128 GLM_VAR_USED _ps_sincos_p0 = _mm_set_ps1(0.15707963267948963959e1f);
|
||||
static const __m128 GLM_VAR_USED _ps_sincos_p1 = _mm_set_ps1(-0.64596409750621907082e0f);
|
||||
static const __m128 GLM_VAR_USED _ps_sincos_p2 = _mm_set_ps1(0.7969262624561800806e-1f);
|
||||
static const __m128 GLM_VAR_USED _ps_sincos_p3 = _mm_set_ps1(-0.468175413106023168e-2f);
|
||||
static const __m128 GLM_VAR_USED _ps_tan_p0 = _mm_set_ps1(-1.79565251976484877988e7f);
|
||||
static const __m128 GLM_VAR_USED _ps_tan_p1 = _mm_set_ps1(1.15351664838587416140e6f);
|
||||
static const __m128 GLM_VAR_USED _ps_tan_p2 = _mm_set_ps1(-1.30936939181383777646e4f);
|
||||
static const __m128 GLM_VAR_USED _ps_tan_q0 = _mm_set_ps1(-5.38695755929454629881e7f);
|
||||
static const __m128 GLM_VAR_USED _ps_tan_q1 = _mm_set_ps1(2.50083801823357915839e7f);
|
||||
static const __m128 GLM_VAR_USED _ps_tan_q2 = _mm_set_ps1(-1.32089234440210967447e6f);
|
||||
static const __m128 GLM_VAR_USED _ps_tan_q3 = _mm_set_ps1(1.36812963470692954678e4f);
|
||||
static const __m128 GLM_VAR_USED _ps_tan_poleval = _mm_set_ps1(3.68935e19f);
|
||||
static const __m128 GLM_VAR_USED _ps_atan_t0 = _mm_set_ps1(-0.91646118527267623468e-1f);
|
||||
static const __m128 GLM_VAR_USED _ps_atan_t1 = _mm_set_ps1(-0.13956945682312098640e1f);
|
||||
static const __m128 GLM_VAR_USED _ps_atan_t2 = _mm_set_ps1(-0.94393926122725531747e2f);
|
||||
static const __m128 GLM_VAR_USED _ps_atan_t3 = _mm_set_ps1(0.12888383034157279340e2f);
|
||||
static const __m128 GLM_VAR_USED _ps_atan_s0 = _mm_set_ps1(0.12797564625607904396e1f);
|
||||
static const __m128 GLM_VAR_USED _ps_atan_s1 = _mm_set_ps1(0.21972168858277355914e1f);
|
||||
static const __m128 GLM_VAR_USED _ps_atan_s2 = _mm_set_ps1(0.68193064729268275701e1f);
|
||||
static const __m128 GLM_VAR_USED _ps_atan_s3 = _mm_set_ps1(0.28205206687035841409e2f);
|
||||
|
||||
static const __m128 GLM_VAR_USED _ps_exp_hi = _mm_set_ps1(88.3762626647949f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp_lo = _mm_set_ps1(-88.3762626647949f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp_rln2 = _mm_set_ps1(1.4426950408889634073599f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp_p0 = _mm_set_ps1(1.26177193074810590878e-4f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp_p1 = _mm_set_ps1(3.02994407707441961300e-2f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp_q0 = _mm_set_ps1(3.00198505138664455042e-6f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp_q1 = _mm_set_ps1(2.52448340349684104192e-3f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp_q2 = _mm_set_ps1(2.27265548208155028766e-1f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp_q3 = _mm_set_ps1(2.00000000000000000009e0f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp_c1 = _mm_set_ps1(6.93145751953125e-1f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp_c2 = _mm_set_ps1(1.42860682030941723212e-6f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp2_hi = _mm_set_ps1(127.4999961853f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp2_lo = _mm_set_ps1(-127.4999961853f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp2_p0 = _mm_set_ps1(2.30933477057345225087e-2f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp2_p1 = _mm_set_ps1(2.02020656693165307700e1f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp2_p2 = _mm_set_ps1(1.51390680115615096133e3f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp2_q0 = _mm_set_ps1(2.33184211722314911771e2f);
|
||||
static const __m128 GLM_VAR_USED _ps_exp2_q1 = _mm_set_ps1(4.36821166879210612817e3f);
|
||||
static const __m128 GLM_VAR_USED _ps_log_p0 = _mm_set_ps1(-7.89580278884799154124e-1f);
|
||||
static const __m128 GLM_VAR_USED _ps_log_p1 = _mm_set_ps1(1.63866645699558079767e1f);
|
||||
static const __m128 GLM_VAR_USED _ps_log_p2 = _mm_set_ps1(-6.41409952958715622951e1f);
|
||||
static const __m128 GLM_VAR_USED _ps_log_q0 = _mm_set_ps1(-3.56722798256324312549e1f);
|
||||
static const __m128 GLM_VAR_USED _ps_log_q1 = _mm_set_ps1(3.12093766372244180303e2f);
|
||||
static const __m128 GLM_VAR_USED _ps_log_q2 = _mm_set_ps1(-7.69691943550460008604e2f);
|
||||
static const __m128 GLM_VAR_USED _ps_log_c0 = _mm_set_ps1(0.693147180559945f);
|
||||
static const __m128 GLM_VAR_USED _ps_log2_c0 = _mm_set_ps1(1.44269504088896340735992f);
|
||||
|
||||
GLM_FUNC_QUALIFIER __m128 sse_abs_ps(__m128 x)
|
||||
{
|
||||
return _mm_and_ps(glm::detail::abs4Mask, x);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER __m128 sse_sgn_ps(__m128 x)
|
||||
{
|
||||
__m128 Neg = _mm_set1_ps(-1.0f);
|
||||
__m128 Pos = _mm_set1_ps(1.0f);
|
||||
|
||||
__m128 Cmp0 = _mm_cmplt_ps(x, zero);
|
||||
__m128 Cmp1 = _mm_cmpgt_ps(x, zero);
|
||||
|
||||
__m128 And0 = _mm_and_ps(Cmp0, Neg);
|
||||
__m128 And1 = _mm_and_ps(Cmp1, Pos);
|
||||
|
||||
return _mm_or_ps(And0, And1);
|
||||
}
|
||||
|
||||
//floor
|
||||
GLM_FUNC_QUALIFIER __m128 sse_flr_ps(__m128 x)
|
||||
{
|
||||
__m128 rnd0 = sse_rnd_ps(x);
|
||||
__m128 cmp0 = _mm_cmplt_ps(x, rnd0);
|
||||
__m128 and0 = _mm_and_ps(cmp0, glm::detail::_ps_1);
|
||||
__m128 sub0 = _mm_sub_ps(rnd0, and0);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
//trunc
|
||||
/*
|
||||
GLM_FUNC_QUALIFIER __m128 _mm_trc_ps(__m128 v)
|
||||
{
|
||||
return __m128();
|
||||
}
|
||||
*/
|
||||
//round
|
||||
GLM_FUNC_QUALIFIER __m128 sse_rnd_ps(__m128 x)
|
||||
{
|
||||
__m128 and0 = _mm_and_ps(glm::detail::_epi32_sign_mask, x);
|
||||
__m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23);
|
||||
__m128 add0 = _mm_add_ps(x, or0);
|
||||
__m128 sub0 = _mm_sub_ps(add0, or0);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
//roundEven
|
||||
GLM_FUNC_QUALIFIER __m128 sse_rde_ps(__m128 x)
|
||||
{
|
||||
__m128 and0 = _mm_and_ps(glm::detail::_epi32_sign_mask, x);
|
||||
__m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23);
|
||||
__m128 add0 = _mm_add_ps(x, or0);
|
||||
__m128 sub0 = _mm_sub_ps(add0, or0);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER __m128 sse_ceil_ps(__m128 x)
|
||||
{
|
||||
__m128 rnd0 = sse_rnd_ps(x);
|
||||
__m128 cmp0 = _mm_cmpgt_ps(x, rnd0);
|
||||
__m128 and0 = _mm_and_ps(cmp0, glm::detail::_ps_1);
|
||||
__m128 add0 = _mm_add_ps(rnd0, and0);
|
||||
return add0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER __m128 sse_frc_ps(__m128 x)
|
||||
{
|
||||
__m128 flr0 = sse_flr_ps(x);
|
||||
__m128 sub0 = _mm_sub_ps(x, flr0);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER __m128 sse_mod_ps(__m128 x, __m128 y)
|
||||
{
|
||||
__m128 div0 = _mm_div_ps(x, y);
|
||||
__m128 flr0 = sse_flr_ps(div0);
|
||||
__m128 mul0 = _mm_mul_ps(y, flr0);
|
||||
__m128 sub0 = _mm_sub_ps(x, mul0);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
/// TODO
|
||||
/*
|
||||
GLM_FUNC_QUALIFIER __m128 sse_modf_ps(__m128 x, __m128i & i)
|
||||
{
|
||||
__m128 empty;
|
||||
return empty;
|
||||
}
|
||||
*/
|
||||
|
||||
//GLM_FUNC_QUALIFIER __m128 _mm_min_ps(__m128 x, __m128 y)
|
||||
|
||||
//GLM_FUNC_QUALIFIER __m128 _mm_max_ps(__m128 x, __m128 y)
|
||||
|
||||
GLM_FUNC_QUALIFIER __m128 sse_clp_ps(__m128 v, __m128 minVal, __m128 maxVal)
|
||||
{
|
||||
__m128 min0 = _mm_min_ps(v, maxVal);
|
||||
__m128 max0 = _mm_max_ps(min0, minVal);
|
||||
return max0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER __m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a)
|
||||
{
|
||||
__m128 sub0 = _mm_sub_ps(glm::detail::one, a);
|
||||
__m128 mul0 = _mm_mul_ps(v1, sub0);
|
||||
__m128 mul1 = _mm_mul_ps(v2, a);
|
||||
__m128 add0 = _mm_add_ps(mul0, mul1);
|
||||
return add0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER __m128 sse_stp_ps(__m128 edge, __m128 x)
|
||||
{
|
||||
__m128 cmp = _mm_cmple_ps(x, edge);
|
||||
if(_mm_movemask_ps(cmp) == 0)
|
||||
return glm::detail::one;
|
||||
else
|
||||
return glm::detail::zero;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x)
|
||||
{
|
||||
__m128 sub0 = _mm_sub_ps(x, edge0);
|
||||
__m128 sub1 = _mm_sub_ps(edge1, edge0);
|
||||
__m128 div0 = _mm_sub_ps(sub0, sub1);
|
||||
__m128 clp0 = sse_clp_ps(div0, glm::detail::zero, glm::detail::one);
|
||||
__m128 mul0 = _mm_mul_ps(glm::detail::two, clp0);
|
||||
__m128 sub2 = _mm_sub_ps(glm::detail::three, mul0);
|
||||
__m128 mul1 = _mm_mul_ps(clp0, clp0);
|
||||
__m128 mul2 = _mm_mul_ps(mul1, sub2);
|
||||
return mul2;
|
||||
}
|
||||
|
||||
/// \todo
|
||||
//GLM_FUNC_QUALIFIER __m128 sse_nan_ps(__m128 x)
|
||||
//{
|
||||
// __m128 empty;
|
||||
// return empty;
|
||||
//}
|
||||
|
||||
/// \todo
|
||||
//GLM_FUNC_QUALIFIER __m128 sse_inf_ps(__m128 x)
|
||||
//{
|
||||
// __m128 empty;
|
||||
// return empty;
|
||||
//}
|
||||
|
||||
// SSE scalar reciprocal sqrt using rsqrt op, plus one Newton-Rhaphson iteration
|
||||
// By Elan Ruskin, http://assemblyrequired.crashworks.org/
|
||||
GLM_FUNC_QUALIFIER __m128 sse_sqrt_wip_ss(__m128 const & x)
|
||||
{
|
||||
__m128 recip = _mm_rsqrt_ss(x); // "estimate" opcode
|
||||
const static __m128 three = {3, 3, 3, 3}; // aligned consts for fast load
|
||||
const static __m128 half = {0.5,0.5,0.5,0.5};
|
||||
__m128 halfrecip = _mm_mul_ss(half, recip);
|
||||
__m128 threeminus_xrr = _mm_sub_ss(three, _mm_mul_ss(x, _mm_mul_ss (recip, recip)));
|
||||
return _mm_mul_ss( halfrecip, threeminus_xrr);
|
||||
}
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glms
|
||||
@ -1,77 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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/detail/intrinsic_exponential.hpp
|
||||
/// @date 2009-05-11 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "setup.hpp"
|
||||
|
||||
#if(!(GLM_ARCH & GLM_ARCH_SSE2))
|
||||
# error "SSE2 instructions not supported or enabled"
|
||||
#else
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
/*
|
||||
GLM_FUNC_QUALIFIER __m128 sse_rsqrt_nr_ss(__m128 const x)
|
||||
{
|
||||
__m128 recip = _mm_rsqrt_ss( x ); // "estimate" opcode
|
||||
const static __m128 three = { 3, 3, 3, 3 }; // aligned consts for fast load
|
||||
const static __m128 half = { 0.5,0.5,0.5,0.5 };
|
||||
__m128 halfrecip = _mm_mul_ss( half, recip );
|
||||
__m128 threeminus_xrr = _mm_sub_ss( three, _mm_mul_ss( x, _mm_mul_ss ( recip, recip ) ) );
|
||||
return _mm_mul_ss( halfrecip, threeminus_xrr );
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER __m128 sse_normalize_fast_ps( float * RESTRICT vOut, float * RESTRICT vIn )
|
||||
{
|
||||
__m128 x = _mm_load_ss(&vIn[0]);
|
||||
__m128 y = _mm_load_ss(&vIn[1]);
|
||||
__m128 z = _mm_load_ss(&vIn[2]);
|
||||
|
||||
const __m128 l = // compute x*x + y*y + z*z
|
||||
_mm_add_ss(
|
||||
_mm_add_ss( _mm_mul_ss(x,x),
|
||||
_mm_mul_ss(y,y)
|
||||
),
|
||||
_mm_mul_ss( z, z )
|
||||
);
|
||||
|
||||
|
||||
const __m128 rsqt = _mm_rsqrt_nr_ss( l );
|
||||
_mm_store_ss( &vOut[0] , _mm_mul_ss( rsqt, x ) );
|
||||
_mm_store_ss( &vOut[1] , _mm_mul_ss( rsqt, y ) );
|
||||
_mm_store_ss( &vOut[2] , _mm_mul_ss( rsqt, z ) );
|
||||
|
||||
return _mm_mul_ss( l , rsqt );
|
||||
}
|
||||
*/
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH
|
||||
@ -1,27 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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/detail/intrinsic_exponential.inl
|
||||
/// @date 2011-06-15 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
@ -1,74 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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/detail/intrinsic_geometric.hpp
|
||||
/// @date 2009-05-08 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "setup.hpp"
|
||||
|
||||
#if(!(GLM_ARCH & GLM_ARCH_SSE2))
|
||||
# error "SSE2 instructions not supported or enabled"
|
||||
#else
|
||||
|
||||
#include "intrinsic_common.hpp"
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
//length
|
||||
__m128 sse_len_ps(__m128 x);
|
||||
|
||||
//distance
|
||||
__m128 sse_dst_ps(__m128 p0, __m128 p1);
|
||||
|
||||
//dot
|
||||
__m128 sse_dot_ps(__m128 v1, __m128 v2);
|
||||
|
||||
// SSE1
|
||||
__m128 sse_dot_ss(__m128 v1, __m128 v2);
|
||||
|
||||
//cross
|
||||
__m128 sse_xpd_ps(__m128 v1, __m128 v2);
|
||||
|
||||
//normalize
|
||||
__m128 sse_nrm_ps(__m128 v);
|
||||
|
||||
//faceforward
|
||||
__m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref);
|
||||
|
||||
//reflect
|
||||
__m128 sse_rfe_ps(__m128 I, __m128 N);
|
||||
|
||||
//refract
|
||||
__m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta);
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#include "intrinsic_geometric.inl"
|
||||
|
||||
#endif//GLM_ARCH
|
||||
@ -1,147 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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/detail/intrinsic_geometric.inl
|
||||
/// @date 2009-05-08 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace detail{
|
||||
|
||||
//length
|
||||
GLM_FUNC_QUALIFIER __m128 sse_len_ps(__m128 x)
|
||||
{
|
||||
__m128 dot0 = sse_dot_ps(x, x);
|
||||
__m128 sqt0 = _mm_sqrt_ps(dot0);
|
||||
return sqt0;
|
||||
}
|
||||
|
||||
//distance
|
||||
GLM_FUNC_QUALIFIER __m128 sse_dst_ps(__m128 p0, __m128 p1)
|
||||
{
|
||||
__m128 sub0 = _mm_sub_ps(p0, p1);
|
||||
__m128 len0 = sse_len_ps(sub0);
|
||||
return len0;
|
||||
}
|
||||
|
||||
//dot
|
||||
GLM_FUNC_QUALIFIER __m128 sse_dot_ps(__m128 v1, __m128 v2)
|
||||
{
|
||||
|
||||
# if(GLM_ARCH & GLM_ARCH_AVX)
|
||||
return _mm_dp_ps(v1, v2, 0xff);
|
||||
# else
|
||||
__m128 mul0 = _mm_mul_ps(v1, v2);
|
||||
__m128 swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1));
|
||||
__m128 add0 = _mm_add_ps(mul0, swp0);
|
||||
__m128 swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3));
|
||||
__m128 add1 = _mm_add_ps(add0, swp1);
|
||||
return add1;
|
||||
# endif
|
||||
}
|
||||
|
||||
// SSE1
|
||||
GLM_FUNC_QUALIFIER __m128 sse_dot_ss(__m128 v1, __m128 v2)
|
||||
{
|
||||
__m128 mul0 = _mm_mul_ps(v1, v2);
|
||||
__m128 mov0 = _mm_movehl_ps(mul0, mul0);
|
||||
__m128 add0 = _mm_add_ps(mov0, mul0);
|
||||
__m128 swp1 = _mm_shuffle_ps(add0, add0, 1);
|
||||
__m128 add1 = _mm_add_ss(add0, swp1);
|
||||
return add1;
|
||||
}
|
||||
|
||||
//cross
|
||||
GLM_FUNC_QUALIFIER __m128 sse_xpd_ps(__m128 v1, __m128 v2)
|
||||
{
|
||||
__m128 swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1));
|
||||
__m128 swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2));
|
||||
__m128 swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1));
|
||||
__m128 swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2));
|
||||
__m128 mul0 = _mm_mul_ps(swp0, swp3);
|
||||
__m128 mul1 = _mm_mul_ps(swp1, swp2);
|
||||
__m128 sub0 = _mm_sub_ps(mul0, mul1);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
//normalize
|
||||
GLM_FUNC_QUALIFIER __m128 sse_nrm_ps(__m128 v)
|
||||
{
|
||||
__m128 dot0 = sse_dot_ps(v, v);
|
||||
__m128 isr0 = _mm_rsqrt_ps(dot0);
|
||||
__m128 mul0 = _mm_mul_ps(v, isr0);
|
||||
return mul0;
|
||||
}
|
||||
|
||||
//faceforward
|
||||
GLM_FUNC_QUALIFIER __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref)
|
||||
{
|
||||
//__m128 dot0 = _mm_dot_ps(v, v);
|
||||
//__m128 neg0 = _mm_neg_ps(N);
|
||||
//__m128 sgn0 = _mm_sgn_ps(dot0);
|
||||
//__m128 mix0 = _mm_mix_ps(N, neg0, sgn0);
|
||||
//return mix0;
|
||||
|
||||
__m128 dot0 = sse_dot_ps(Nref, I);
|
||||
__m128 sgn0 = sse_sgn_ps(dot0);
|
||||
__m128 mul0 = _mm_mul_ps(sgn0, glm::detail::minus_one);
|
||||
__m128 mul1 = _mm_mul_ps(N, mul0);
|
||||
return mul1;
|
||||
}
|
||||
|
||||
//reflect
|
||||
GLM_FUNC_QUALIFIER __m128 sse_rfe_ps(__m128 I, __m128 N)
|
||||
{
|
||||
__m128 dot0 = sse_dot_ps(N, I);
|
||||
__m128 mul0 = _mm_mul_ps(N, dot0);
|
||||
__m128 mul1 = _mm_mul_ps(mul0, glm::detail::two);
|
||||
__m128 sub0 = _mm_sub_ps(I, mul1);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
//refract
|
||||
GLM_FUNC_QUALIFIER __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta)
|
||||
{
|
||||
__m128 dot0 = sse_dot_ps(N, I);
|
||||
__m128 mul0 = _mm_mul_ps(eta, eta);
|
||||
__m128 mul1 = _mm_mul_ps(dot0, dot0);
|
||||
__m128 sub0 = _mm_sub_ps(glm::detail::one, mul0);
|
||||
__m128 sub1 = _mm_sub_ps(glm::detail::one, mul1);
|
||||
__m128 mul2 = _mm_mul_ps(sub0, sub1);
|
||||
|
||||
if(_mm_movemask_ps(_mm_cmplt_ss(mul2, glm::detail::zero)) == 0)
|
||||
return glm::detail::zero;
|
||||
|
||||
__m128 sqt0 = _mm_sqrt_ps(mul2);
|
||||
__m128 mul3 = _mm_mul_ps(eta, dot0);
|
||||
__m128 add0 = _mm_add_ps(mul3, sqt0);
|
||||
__m128 mul4 = _mm_mul_ps(add0, N);
|
||||
__m128 mul5 = _mm_mul_ps(eta, I);
|
||||
__m128 sub2 = _mm_sub_ps(mul5, mul4);
|
||||
|
||||
return sub2;
|
||||
}
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
@ -1,48 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.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
|
||||
/// 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/detail/intrinsic_integer.hpp
|
||||
/// @date 2009-05-11 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "glm/glm.hpp"
|
||||
|
||||
#if(!(GLM_ARCH & GLM_ARCH_SSE2))
|
||||
# error "SSE2 instructions not supported or enabled"
|
||||
#else
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
__m128i _mm_bit_interleave_si128(__m128i x);
|
||||
__m128i _mm_bit_interleave_si128(__m128i x, __m128i y);
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#include "intrinsic_integer.inl"
|
||||
|
||||
#endif//GLM_ARCH
|
||||
@ -1,139 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.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
|
||||
/// 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/detail/intrinsic_integer.inl
|
||||
/// @date 2009-05-08 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
inline __m128i _mm_bit_interleave_si128(__m128i x)
|
||||
{
|
||||
__m128i const Mask4 = _mm_set1_epi32(0x0000FFFF);
|
||||
__m128i const Mask3 = _mm_set1_epi32(0x00FF00FF);
|
||||
__m128i const Mask2 = _mm_set1_epi32(0x0F0F0F0F);
|
||||
__m128i const Mask1 = _mm_set1_epi32(0x33333333);
|
||||
__m128i const Mask0 = _mm_set1_epi32(0x55555555);
|
||||
|
||||
__m128i Reg1;
|
||||
__m128i Reg2;
|
||||
|
||||
// REG1 = x;
|
||||
// REG2 = y;
|
||||
//Reg1 = _mm_unpacklo_epi64(x, y);
|
||||
Reg1 = x;
|
||||
|
||||
//REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF);
|
||||
//REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF);
|
||||
Reg2 = _mm_slli_si128(Reg1, 2);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask4);
|
||||
|
||||
//REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF);
|
||||
//REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF);
|
||||
Reg2 = _mm_slli_si128(Reg1, 1);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask3);
|
||||
|
||||
//REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F);
|
||||
//REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 4);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask2);
|
||||
|
||||
//REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333);
|
||||
//REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 2);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask1);
|
||||
|
||||
//REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555);
|
||||
//REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 1);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask0);
|
||||
|
||||
//return REG1 | (REG2 << 1);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 1);
|
||||
Reg2 = _mm_srli_si128(Reg2, 8);
|
||||
Reg1 = _mm_or_si128(Reg1, Reg2);
|
||||
|
||||
return Reg1;
|
||||
}
|
||||
|
||||
inline __m128i _mm_bit_interleave_si128(__m128i x, __m128i y)
|
||||
{
|
||||
__m128i const Mask4 = _mm_set1_epi32(0x0000FFFF);
|
||||
__m128i const Mask3 = _mm_set1_epi32(0x00FF00FF);
|
||||
__m128i const Mask2 = _mm_set1_epi32(0x0F0F0F0F);
|
||||
__m128i const Mask1 = _mm_set1_epi32(0x33333333);
|
||||
__m128i const Mask0 = _mm_set1_epi32(0x55555555);
|
||||
|
||||
__m128i Reg1;
|
||||
__m128i Reg2;
|
||||
|
||||
// REG1 = x;
|
||||
// REG2 = y;
|
||||
Reg1 = _mm_unpacklo_epi64(x, y);
|
||||
|
||||
//REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF);
|
||||
//REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF);
|
||||
Reg2 = _mm_slli_si128(Reg1, 2);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask4);
|
||||
|
||||
//REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF);
|
||||
//REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF);
|
||||
Reg2 = _mm_slli_si128(Reg1, 1);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask3);
|
||||
|
||||
//REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F);
|
||||
//REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 4);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask2);
|
||||
|
||||
//REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333);
|
||||
//REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 2);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask1);
|
||||
|
||||
//REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555);
|
||||
//REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 1);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask0);
|
||||
|
||||
//return REG1 | (REG2 << 1);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 1);
|
||||
Reg2 = _mm_srli_si128(Reg2, 8);
|
||||
Reg1 = _mm_or_si128(Reg1, Reg2);
|
||||
|
||||
return Reg1;
|
||||
}
|
||||
}//namespace detail
|
||||
}//namespace glms
|
||||
@ -1,67 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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/detail/intrinsic_common.hpp
|
||||
/// @date 2009-06-05 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "setup.hpp"
|
||||
|
||||
#if(!(GLM_ARCH & GLM_ARCH_SSE2))
|
||||
# error "SSE2 instructions not supported or enabled"
|
||||
#else
|
||||
|
||||
#include "intrinsic_geometric.hpp"
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
void sse_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]);
|
||||
|
||||
void sse_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]);
|
||||
|
||||
__m128 sse_mul_ps(__m128 m[4], __m128 v);
|
||||
|
||||
__m128 sse_mul_ps(__m128 v, __m128 m[4]);
|
||||
|
||||
void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]);
|
||||
|
||||
void sse_transpose_ps(__m128 const in[4], __m128 out[4]);
|
||||
|
||||
void sse_inverse_ps(__m128 const in[4], __m128 out[4]);
|
||||
|
||||
void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]);
|
||||
|
||||
__m128 sse_det_ps(__m128 const m[4]);
|
||||
|
||||
__m128 sse_slow_det_ps(__m128 const m[4]);
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#include "intrinsic_matrix.inl"
|
||||
|
||||
#endif//GLM_ARCH
|
||||
@ -1,46 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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/detail/intrinsic_trigonometric.hpp
|
||||
/// @date 2009-06-09 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "setup.hpp"
|
||||
|
||||
#if(!(GLM_ARCH & GLM_ARCH_SSE2))
|
||||
# error "SSE2 instructions not supported or enabled"
|
||||
#else
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#include "intrinsic_trigonometric.inl"
|
||||
|
||||
#endif//GLM_ARCH
|
||||
@ -1,27 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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/detail/intrinsic_trigonometric.inl
|
||||
/// @date 2011-06-15 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
@ -1,46 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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/detail/intrinsic_vector_relational.hpp
|
||||
/// @date 2009-06-09 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "setup.hpp"
|
||||
|
||||
#if(!(GLM_ARCH & GLM_ARCH_SSE2))
|
||||
# error "SSE2 instructions not supported or enabled"
|
||||
#else
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#include "intrinsic_vector_relational.inl"
|
||||
|
||||
#endif//GLM_ARCH
|
||||
@ -1,366 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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/detail/intrinsic_vector_relational.inl
|
||||
/// @date 2009-06-09 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//// lessThan
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type lessThan
|
||||
//(
|
||||
// tvec2<T, P> const & x,
|
||||
// tvec2<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec2<bool>::bool_type(x.x < y.x, x.y < y.y);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type lessThan
|
||||
//(
|
||||
// tvec3<T, P> const & x,
|
||||
// tvec3<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec3<bool>::bool_type(x.x < y.x, x.y < y.y, x.z < y.z);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type lessThan
|
||||
//(
|
||||
// tvec4<T, P> const & x,
|
||||
// tvec4<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec4<bool>::bool_type(x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w);
|
||||
//}
|
||||
//
|
||||
//// lessThanEqual
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type lessThanEqual
|
||||
//(
|
||||
// tvec2<T, P> const & x,
|
||||
// tvec2<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec2<bool>::bool_type(x.x <= y.x, x.y <= y.y);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type lessThanEqual
|
||||
//(
|
||||
// tvec3<T, P> const & x,
|
||||
// tvec3<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec3<bool>::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type lessThanEqual
|
||||
//(
|
||||
// tvec4<T, P> const & x,
|
||||
// tvec4<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec4<bool>::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w);
|
||||
//}
|
||||
//
|
||||
//// greaterThan
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type greaterThan
|
||||
//(
|
||||
// tvec2<T, P> const & x,
|
||||
// tvec2<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec2<bool>::bool_type(x.x > y.x, x.y > y.y);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type greaterThan
|
||||
//(
|
||||
// tvec3<T, P> const & x,
|
||||
// tvec3<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec3<bool>::bool_type(x.x > y.x, x.y > y.y, x.z > y.z);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type greaterThan
|
||||
//(
|
||||
// tvec4<T, P> const & x,
|
||||
// tvec4<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec4<bool>::bool_type(x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w);
|
||||
//}
|
||||
//
|
||||
//// greaterThanEqual
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type greaterThanEqual
|
||||
//(
|
||||
// tvec2<T, P> const & x,
|
||||
// tvec2<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec2<bool>::bool_type(x.x >= y.x, x.y >= y.y);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type greaterThanEqual
|
||||
//(
|
||||
// tvec3<T, P> const & x,
|
||||
// tvec3<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec3<bool>::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type greaterThanEqual
|
||||
//(
|
||||
// tvec4<T, P> const & x,
|
||||
// tvec4<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint);
|
||||
//
|
||||
// return typename tvec4<bool>::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w);
|
||||
//}
|
||||
//
|
||||
//// equal
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type equal
|
||||
//(
|
||||
// tvec2<T, P> const & x,
|
||||
// tvec2<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint ||
|
||||
// detail::type<valType>::is_bool);
|
||||
//
|
||||
// return typename tvec2<T, P>::bool_type(x.x == y.x, x.y == y.y);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type equal
|
||||
//(
|
||||
// tvec3<T, P> const & x,
|
||||
// tvec3<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint ||
|
||||
// detail::type<valType>::is_bool);
|
||||
//
|
||||
// return typename tvec3<T, P>::bool_type(x.x == y.x, x.y == y.y, x.z == y.z);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type equal
|
||||
//(
|
||||
// tvec4<T, P> const & x,
|
||||
// tvec4<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint ||
|
||||
// detail::type<valType>::is_bool);
|
||||
//
|
||||
// return typename tvec4<T, P>::bool_type(x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w);
|
||||
//}
|
||||
//
|
||||
//// notEqual
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type notEqual
|
||||
//(
|
||||
// tvec2<T, P> const & x,
|
||||
// tvec2<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint ||
|
||||
// detail::type<valType>::is_bool);
|
||||
//
|
||||
// return typename tvec2<T, P>::bool_type(x.x != y.x, x.y != y.y);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type notEqual
|
||||
//(
|
||||
// tvec3<T, P> const & x,
|
||||
// tvec3<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint ||
|
||||
// detail::type<valType>::is_bool);
|
||||
//
|
||||
// return typename tvec3<T, P>::bool_type(x.x != y.x, x.y != y.y, x.z != y.z);
|
||||
//}
|
||||
//
|
||||
//template <typename valType>
|
||||
//GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type notEqual
|
||||
//(
|
||||
// tvec4<T, P> const & x,
|
||||
// tvec4<T, P> const & y
|
||||
//)
|
||||
//{
|
||||
// GLM_STATIC_ASSERT(
|
||||
// detail::type<valType>::is_float ||
|
||||
// detail::type<valType>::is_int ||
|
||||
// detail::type<valType>::is_uint ||
|
||||
// detail::type<valType>::is_bool);
|
||||
//
|
||||
// return typename tvec4<T, P>::bool_type(x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w);
|
||||
//}
|
||||
//
|
||||
//// any
|
||||
//GLM_FUNC_QUALIFIER bool any(tvec2<bool> const & x)
|
||||
//{
|
||||
// return x.x || x.y;
|
||||
//}
|
||||
//
|
||||
//GLM_FUNC_QUALIFIER bool any(tvec3<bool> const & x)
|
||||
//{
|
||||
// return x.x || x.y || x.z;
|
||||
//}
|
||||
//
|
||||
//GLM_FUNC_QUALIFIER bool any(tvec4<bool> const & x)
|
||||
//{
|
||||
// return x.x || x.y || x.z || x.w;
|
||||
//}
|
||||
//
|
||||
//// all
|
||||
//GLM_FUNC_QUALIFIER bool all(const tvec2<bool>& x)
|
||||
//{
|
||||
// return x.x && x.y;
|
||||
//}
|
||||
//
|
||||
//GLM_FUNC_QUALIFIER bool all(const tvec3<bool>& x)
|
||||
//{
|
||||
// return x.x && x.y && x.z;
|
||||
//}
|
||||
//
|
||||
//GLM_FUNC_QUALIFIER bool all(const tvec4<bool>& x)
|
||||
//{
|
||||
// return x.x && x.y && x.z && x.w;
|
||||
//}
|
||||
//
|
||||
//// not
|
||||
//GLM_FUNC_QUALIFIER tvec2<bool>::bool_type not_
|
||||
//(
|
||||
// tvec2<bool> const & v
|
||||
//)
|
||||
//{
|
||||
// return tvec2<bool>::bool_type(!v.x, !v.y);
|
||||
//}
|
||||
//
|
||||
//GLM_FUNC_QUALIFIER tvec3<bool>::bool_type not_
|
||||
//(
|
||||
// tvec3<bool> const & v
|
||||
//)
|
||||
//{
|
||||
// return tvec3<bool>::bool_type(!v.x, !v.y, !v.z);
|
||||
//}
|
||||
//
|
||||
//GLM_FUNC_QUALIFIER tvec4<bool>::bool_type not_
|
||||
//(
|
||||
// tvec4<bool> const & v
|
||||
//)
|
||||
//{
|
||||
// return tvec4<bool>::bool_type(!v.x, !v.y, !v.z, !v.w);
|
||||
//}
|
||||
@ -1,44 +1,63 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/precision.hpp
|
||||
/// @date 2013-04-01 / 2013-04-01
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "setup.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
enum precision
|
||||
{
|
||||
highp,
|
||||
mediump,
|
||||
lowp,
|
||||
defaultp = highp
|
||||
packed_highp,
|
||||
packed_mediump,
|
||||
packed_lowp,
|
||||
|
||||
# if GLM_HAS_ALIGNED_TYPE
|
||||
aligned_highp,
|
||||
aligned_mediump,
|
||||
aligned_lowp,
|
||||
aligned = aligned_highp,
|
||||
# endif
|
||||
|
||||
highp = packed_highp,
|
||||
mediump = packed_mediump,
|
||||
lowp = packed_lowp,
|
||||
packed = packed_highp,
|
||||
|
||||
# if GLM_HAS_ALIGNED_TYPE && defined(GLM_FORCE_ALIGNED)
|
||||
defaultp = aligned_highp
|
||||
# else
|
||||
defaultp = highp
|
||||
# endif
|
||||
};
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template <glm::precision P>
|
||||
struct is_aligned
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
# if GLM_HAS_ALIGNED_TYPE
|
||||
template<>
|
||||
struct is_aligned<glm::aligned_lowp>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct is_aligned<glm::aligned_mediump>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct is_aligned<glm::aligned_highp>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
# endif
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_float.hpp
|
||||
/// @date 2008-08-22 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_gentype.hpp
|
||||
/// @date 2008-10-05 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_gentype.inl
|
||||
/// @date 2008-10-05 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace detail{
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_half.hpp
|
||||
/// @date 2008-08-17 / 2011-09-20
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,38 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// OpenGL Mathematics (glm.g-truc.net)
|
||||
///
|
||||
/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
|
||||
///
|
||||
/// This half implementation is based on OpenEXR which is Copyright (c) 2002,
|
||||
/// Industrial Light & Magic, a division of Lucas Digital Ltd. LLC
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_half.inl
|
||||
/// @date 2008-08-17 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
@ -52,12 +19,12 @@ namespace detail
|
||||
i(0)
|
||||
{}
|
||||
|
||||
GLM_FUNC_QUALIFIER uif32(float f) :
|
||||
f(f)
|
||||
GLM_FUNC_QUALIFIER uif32(float f_) :
|
||||
f(f_)
|
||||
{}
|
||||
|
||||
GLM_FUNC_QUALIFIER uif32(uint32 i) :
|
||||
i(i)
|
||||
GLM_FUNC_QUALIFIER uif32(uint32 i_) :
|
||||
i(i_)
|
||||
{}
|
||||
|
||||
float f;
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_int.hpp
|
||||
/// @date 2008-08-22 / 2013-03-30
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -58,12 +29,21 @@ namespace detail
|
||||
# if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
|
||||
typedef int64_t sint64;
|
||||
typedef uint64_t uint64;
|
||||
|
||||
# elif GLM_COMPILER & GLM_COMPILER_VC
|
||||
typedef signed __int64 sint64;
|
||||
typedef unsigned __int64 uint64;
|
||||
|
||||
# elif GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
__extension__ typedef signed long long sint64;
|
||||
__extension__ typedef unsigned long long uint64;
|
||||
|
||||
# elif (GLM_COMPILER & GLM_COMPILER_CLANG)
|
||||
# pragma clang diagnostic ignored "-Wc++11-long-long"
|
||||
typedef signed long long sint64;
|
||||
typedef unsigned long long uint64;
|
||||
|
||||
# else//unknown compiler
|
||||
typedef signed long long sint64;
|
||||
typedef unsigned long long uint64;
|
||||
@ -120,13 +100,7 @@ namespace detail
|
||||
{
|
||||
typedef long type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct make_signed<long long>
|
||||
{
|
||||
typedef long long type;
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
struct make_signed<unsigned char>
|
||||
{
|
||||
@ -151,12 +125,6 @@ namespace detail
|
||||
typedef long type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct make_signed<unsigned long long>
|
||||
{
|
||||
typedef long long type;
|
||||
};
|
||||
|
||||
template <typename genType>
|
||||
struct make_unsigned
|
||||
{};
|
||||
@ -185,12 +153,6 @@ namespace detail
|
||||
typedef unsigned long type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct make_unsigned<long long>
|
||||
{
|
||||
typedef unsigned long long type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct make_unsigned<unsigned char>
|
||||
{
|
||||
@ -215,6 +177,24 @@ namespace detail
|
||||
typedef unsigned long type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct make_signed<long long>
|
||||
{
|
||||
typedef long long type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct make_signed<unsigned long long>
|
||||
{
|
||||
typedef long long type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct make_unsigned<long long>
|
||||
{
|
||||
typedef unsigned long long type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct make_unsigned<unsigned long long>
|
||||
{
|
||||
@ -287,7 +267,7 @@ namespace detail
|
||||
#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef lowp_int int_t;
|
||||
#else
|
||||
# error "GLM error: multiple default precision requested for signed interger types"
|
||||
# error "GLM error: multiple default precision requested for signed integer types"
|
||||
#endif
|
||||
|
||||
#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
|
||||
@ -299,7 +279,7 @@ namespace detail
|
||||
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef lowp_uint uint_t;
|
||||
#else
|
||||
# error "GLM error: multiple default precision requested for unsigned interger types"
|
||||
# error "GLM error: multiple default precision requested for unsigned integer types"
|
||||
#endif
|
||||
|
||||
/// Unsigned integer type.
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat.hpp
|
||||
/// @date 2010-01-26 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -54,6 +25,9 @@ namespace detail
|
||||
template <typename T, precision P> struct tmat4x3;
|
||||
template <typename T, precision P> struct tmat4x4;
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class matType>
|
||||
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m);
|
||||
|
||||
/// @addtogroup core_precision
|
||||
/// @{
|
||||
|
||||
|
||||
@ -1,32 +1,3 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat.inl
|
||||
/// @date 2011-06-15 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat2x2.hpp
|
||||
/// @date 2005-01-27 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -49,25 +20,19 @@ namespace glm
|
||||
typedef tmat2x2<T, P> transpose_type;
|
||||
typedef T value_type;
|
||||
|
||||
template <typename U, precision Q>
|
||||
friend tvec2<U, Q> operator/(tmat2x2<U, Q> const & m, tvec2<U, Q> const & v);
|
||||
template <typename U, precision Q>
|
||||
friend tvec2<U, Q> operator/(tvec2<U, Q> const & v, tmat2x2<U, Q> const & m);
|
||||
|
||||
private:
|
||||
/// @cond DETAIL
|
||||
col_type value[2];
|
||||
/// @endcond
|
||||
|
||||
|
||||
public:
|
||||
//////////////////////////////////////
|
||||
// Constructors
|
||||
GLM_FUNC_DECL tmat2x2();
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL tmat2x2() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat2x2(ctor);
|
||||
GLM_FUNC_DECL explicit tmat2x2(T const & x);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat2x2(ctor);
|
||||
GLM_FUNC_DECL explicit tmat2x2(T scalar);
|
||||
GLM_FUNC_DECL tmat2x2(
|
||||
T const & x1, T const & y1,
|
||||
T const & x2, T const & y2);
|
||||
@ -75,8 +40,8 @@ namespace glm
|
||||
col_type const & v1,
|
||||
col_type const & v2);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversions
|
||||
// -- Conversions --
|
||||
|
||||
template <typename U, typename V, typename M, typename N>
|
||||
GLM_FUNC_DECL tmat2x2(
|
||||
U const & x1, V const & y1,
|
||||
@ -87,67 +52,52 @@ namespace glm
|
||||
tvec2<U, P> const & v1,
|
||||
tvec2<V, P> const & v2);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U, Q> const & m);
|
||||
# else
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tmat2x2(tmat2x2<U, Q> const & m);
|
||||
# endif
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x2<U, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x2(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x2(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x2(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x2(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x2(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x2(tmat4x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x3<T, P> const & x);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 2;}
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
||||
# else
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & v) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator+=(U s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator+=(tmat2x2<U, P> const & m);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator-=(U s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator-=(tmat2x2<U, P> const & m);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator*=(U s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator*=(tmat2x2<U, P> const & m);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator/=(U s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator/=(tmat2x2<U, P> const & m);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator++ ();
|
||||
GLM_FUNC_DECL tmat2x2<T, P> & operator-- ();
|
||||
@ -155,30 +105,39 @@ namespace glm
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator--(int);
|
||||
};
|
||||
|
||||
// Binary operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T const & s);
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator+(T const & s, tmat2x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator-(T const & s, tmat2x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator+(T scalar, tmat2x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator*(T const & s, tmat2x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator-(T scalar, tmat2x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator*(T scalar, tmat2x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator*(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v);
|
||||
@ -187,19 +146,19 @@ namespace glm
|
||||
GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator*(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat3x2<T, P> const & m2);
|
||||
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat4x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator/(T const & s, tmat2x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator/(T scalar, tmat2x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator/(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v);
|
||||
@ -210,9 +169,13 @@ namespace glm
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m);
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator==(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||
} //namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@ -1,66 +1,31 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat2x2.inl
|
||||
/// @date 2005-01-16 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
#include "func_matrix.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> compute_inverse(tmat2x2<T, P> const & m)
|
||||
{
|
||||
T OneOverDeterminant = static_cast<T>(1) / (
|
||||
+ m[0][0] * m[1][1]
|
||||
- m[1][0] * m[0][1]);
|
||||
// -- Constructors --
|
||||
|
||||
tmat2x2<T, P> Inverse(
|
||||
+ m[1][1] * OneOverDeterminant,
|
||||
- m[0][1] * OneOverDeterminant,
|
||||
- m[1][0] * OneOverDeterminant,
|
||||
+ m[0][0] * OneOverDeterminant);
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0);
|
||||
this->value[1] = col_type(0, 1);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
return Inverse;
|
||||
}
|
||||
}//namespace detail
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Constructors
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0);
|
||||
this->value[1] = col_type(0, 1);
|
||||
# endif
|
||||
}
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <precision Q>
|
||||
@ -71,14 +36,14 @@ namespace detail
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(ctor)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat2x2<T, P>::tmat2x2(ctor)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(T scalar)
|
||||
{
|
||||
this->value[0] = col_type(s, 0);
|
||||
this->value[1] = col_type(0, s);
|
||||
this->value[0] = col_type(scalar, 0);
|
||||
this->value[1] = col_type(0, scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -99,8 +64,8 @@ namespace detail
|
||||
this->value[1] = v1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion constructors
|
||||
// -- Conversion constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename X1, typename Y1, typename X2, typename Y2>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
|
||||
@ -121,8 +86,7 @@ namespace detail
|
||||
this->value[1] = col_type(v2);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// mat2x2 matrix conversions
|
||||
// -- mat2x2 matrix conversions --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
@ -188,53 +152,33 @@ namespace detail
|
||||
this->value[1] = col_type(m[1]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2<T, P>::size_type tmat2x2<T, P>::size() const
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::size_type i)
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::size_type i) const
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
# else
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2<T, P>::length_type tmat2x2<T, P>::length() const
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
// -- Unary updatable operators --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<T, P> const & m)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Unary updatable operators
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
@ -247,10 +191,10 @@ namespace detail
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=(U s)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=(U scalar)
|
||||
{
|
||||
this->value[0] += s;
|
||||
this->value[1] += s;
|
||||
this->value[0] += scalar;
|
||||
this->value[1] += scalar;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -265,10 +209,10 @@ namespace detail
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=(U s)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=(U scalar)
|
||||
{
|
||||
this->value[0] -= s;
|
||||
this->value[1] -= s;
|
||||
this->value[0] -= scalar;
|
||||
this->value[1] -= scalar;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -283,10 +227,10 @@ namespace detail
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=(U s)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=(U scalar)
|
||||
{
|
||||
this->value[0] *= s;
|
||||
this->value[1] *= s;
|
||||
this->value[0] *= scalar;
|
||||
this->value[1] *= scalar;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -299,10 +243,10 @@ namespace detail
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=(U s)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=(U scalar)
|
||||
{
|
||||
this->value[0] /= s;
|
||||
this->value[1] /= s;
|
||||
this->value[0] /= scalar;
|
||||
this->value[1] /= scalar;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -310,9 +254,11 @@ namespace detail
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=(tmat2x2<U, P> const & m)
|
||||
{
|
||||
return (*this = *this * detail::compute_inverse<T, P>(m));
|
||||
return *this *= inverse(m);
|
||||
}
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator++()
|
||||
{
|
||||
@ -345,23 +291,38 @@ namespace detail
|
||||
return Result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Binary operators
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
m[0] + s,
|
||||
m[1] + s);
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(T const & s, tmat2x2<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
m[0] + s,
|
||||
m[1] + s);
|
||||
-m[0],
|
||||
-m[1]);
|
||||
}
|
||||
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
m[0] + scalar,
|
||||
m[1] + scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(T scalar, tmat2x2<T, P> const & m)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
m[0] + scalar,
|
||||
m[1] + scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -373,19 +334,19 @@ namespace detail
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
m[0] - s,
|
||||
m[1] - s);
|
||||
m[0] - scalar,
|
||||
m[1] - scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(T const & s, tmat2x2<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(T scalar, tmat2x2<T, P> const & m)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
s - m[0],
|
||||
s - m[1]);
|
||||
scalar - m[0],
|
||||
scalar - m[1]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -397,19 +358,19 @@ namespace detail
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(T const & s, tmat2x2<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(T scalar, tmat2x2<T, P> const & m)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -473,31 +434,31 @@ namespace detail
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
m[0] / s,
|
||||
m[1] / s);
|
||||
m[0] / scalar,
|
||||
m[1] / scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(T const & s, tmat2x2<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(T scalar, tmat2x2<T, P> const & m)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
s / m[0],
|
||||
s / m[1]);
|
||||
scalar / m[0],
|
||||
scalar / m[1]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type operator/(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v)
|
||||
{
|
||||
return detail::compute_inverse<T, P>(m) * v;
|
||||
return inverse(m) * v;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::row_type operator/(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m)
|
||||
{
|
||||
return v * detail::compute_inverse<T, P>(m);
|
||||
return v * inverse(m);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -507,17 +468,7 @@ namespace detail
|
||||
return m1_copy /= m2;
|
||||
}
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
-m[0],
|
||||
-m[1]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat2x3.hpp
|
||||
/// @date 2006-10-01 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -51,95 +22,79 @@ namespace glm
|
||||
typedef T value_type;
|
||||
|
||||
private:
|
||||
/// @cond DETAIL
|
||||
col_type value[2];
|
||||
/// @endcond
|
||||
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
GLM_FUNC_DECL tmat2x3();
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL tmat2x3() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat2x3(ctor);
|
||||
GLM_FUNC_DECL explicit tmat2x3(T const & s);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat2x3(ctor);
|
||||
GLM_FUNC_DECL explicit tmat2x3(T scalar);
|
||||
GLM_FUNC_DECL tmat2x3(
|
||||
T const & x0, T const & y0, T const & z0,
|
||||
T const & x1, T const & y1, T const & z1);
|
||||
T x0, T y0, T z0,
|
||||
T x1, T y1, T z1);
|
||||
GLM_FUNC_DECL tmat2x3(
|
||||
col_type const & v0,
|
||||
col_type const & v1);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversions
|
||||
// -- Conversions --
|
||||
|
||||
template <typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2>
|
||||
GLM_FUNC_DECL tmat2x3(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2);
|
||||
|
||||
X1 x1, Y1 y1, Z1 z1,
|
||||
X2 x2, Y2 y2, Z2 z2);
|
||||
|
||||
template <typename U, typename V>
|
||||
GLM_FUNC_DECL tmat2x3(
|
||||
tvec3<U, P> const & v1,
|
||||
tvec3<V, P> const & v2);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix conversion
|
||||
// -- Matrix conversions --
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tmat2x3(tmat2x3<U, Q> const & m);
|
||||
# else
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tmat2x3(tmat2x3<U, Q> const & m);
|
||||
# endif
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x3<U, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat2x3(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x3(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x3(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x3(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x3(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x3(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x3(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x3(tmat4x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x3<T, P> const & x);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 2;}
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
||||
# else
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<T, P> const & m) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator= (tmat2x3<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator+= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator+= (tmat2x3<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator-= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator-= (tmat2x3<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator*= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator/= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator+=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator+=(tmat2x3<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator-=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator-=(tmat2x3<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator*=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator/=(U s);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator++ ();
|
||||
GLM_FUNC_DECL tmat2x3<T, P> & operator-- ();
|
||||
@ -147,77 +102,62 @@ namespace glm
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator--(int);
|
||||
};
|
||||
|
||||
// Binary operators
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator+ (
|
||||
tmat2x3<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator+ (
|
||||
tmat2x3<T, P> const & m1,
|
||||
tmat2x3<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator- (
|
||||
tmat2x3<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator- (
|
||||
tmat2x3<T, P> const & m1,
|
||||
tmat2x3<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator* (
|
||||
tmat2x3<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator* (
|
||||
T const & s,
|
||||
tmat2x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat2x3<T, P>::col_type operator* (
|
||||
tmat2x3<T, P> const & m,
|
||||
typename tmat2x3<T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat2x3<T, P>::row_type operator* (
|
||||
typename tmat2x3<T, P>::col_type const & v,
|
||||
tmat2x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator*(T scalar, tmat2x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator* (
|
||||
tmat2x3<T, P> const & m1,
|
||||
tmat2x2<T, P> const & m2);
|
||||
GLM_FUNC_DECL typename tmat2x3<T, P>::col_type operator*(tmat2x3<T, P> const & m, typename tmat2x3<T, P>::row_type const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator* (
|
||||
tmat2x3<T, P> const & m1,
|
||||
tmat3x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator* (
|
||||
tmat2x3<T, P> const & m1,
|
||||
tmat4x2<T, P> const & m2);
|
||||
GLM_FUNC_DECL typename tmat2x3<T, P>::row_type operator*(typename tmat2x3<T, P>::col_type const & v, tmat2x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator/ (
|
||||
tmat2x3<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator/ (
|
||||
T const & s,
|
||||
tmat2x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2);
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> const operator- (
|
||||
tmat2x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat4x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator/(T scalar, tmat2x3<T, P> const & m);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator==(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@ -1,48 +1,29 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat2x3.inl
|
||||
/// @date 2006-08-05 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm
|
||||
{
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Constructors
|
||||
// -- Constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0, 0);
|
||||
this->value[1] = col_type(0, 1, 0);
|
||||
# endif
|
||||
}
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0, 0);
|
||||
this->value[1] = col_type(0, 1, 0);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <precision Q>
|
||||
@ -53,21 +34,21 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(ctor)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat2x3<T, P>::tmat2x3(ctor)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(T scalar)
|
||||
{
|
||||
this->value[0] = col_type(s, 0, 0);
|
||||
this->value[1] = col_type(0, s, 0);
|
||||
this->value[0] = col_type(scalar, 0, 0);
|
||||
this->value[1] = col_type(0, scalar, 0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
|
||||
(
|
||||
T const & x0, T const & y0, T const & z0,
|
||||
T const & x1, T const & y1, T const & z1
|
||||
T x0, T y0, T z0,
|
||||
T x1, T y1, T z1
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(x0, y0, z0);
|
||||
@ -81,16 +62,16 @@ namespace glm
|
||||
this->value[1] = v1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion constructors
|
||||
// -- Conversion constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <
|
||||
typename X1, typename Y1, typename Z1,
|
||||
typename X2, typename Y2, typename Z2>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
|
||||
(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2
|
||||
X1 x1, Y1 y1, Z1 z1,
|
||||
X2 x2, Y2 y2, Z2 z2
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1));
|
||||
@ -105,8 +86,7 @@ namespace glm
|
||||
this->value[1] = col_type(v2);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
@ -124,7 +104,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x3<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -172,53 +152,33 @@ namespace glm
|
||||
this->value[1] = m[1];
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3<T, P>::size_type tmat2x3<T, P>::size() const
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::size_type i)
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::size_type i) const
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
# else
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3<T, P>::length_type tmat2x3<T, P>::length() const
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
// -- Unary updatable operators --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i)
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<T, P> const & m)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Unary updatable operators
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
@ -283,6 +243,8 @@ namespace glm
|
||||
return *this;
|
||||
}
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator++()
|
||||
{
|
||||
@ -315,15 +277,30 @@ namespace glm
|
||||
return Result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Binary operators
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T const & s)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m)
|
||||
{
|
||||
return tmat2x3<T, P>(
|
||||
m[0] + s,
|
||||
m[1] + s);
|
||||
-m[0],
|
||||
-m[1]);
|
||||
}
|
||||
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x3<T, P>(
|
||||
m[0] + scalar,
|
||||
m[1] + scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -335,11 +312,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x3<T, P>(
|
||||
m[0] - s,
|
||||
m[1] - s);
|
||||
m[0] - scalar,
|
||||
m[1] - scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -351,19 +328,19 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x3<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(T const & s, tmat2x3<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(T scalar, tmat2x3<T, P> const & m)
|
||||
{
|
||||
return tmat2x3<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -432,7 +409,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat4x2<T, P> const & m2)
|
||||
{
|
||||
return tmat4x3<T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
|
||||
@ -450,32 +427,22 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x3<T, P>(
|
||||
m[0] / s,
|
||||
m[1] / s);
|
||||
m[0] / scalar,
|
||||
m[1] / scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(T const & s, tmat2x3<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(T scalar, tmat2x3<T, P> const & m)
|
||||
{
|
||||
return tmat2x3<T, P>(
|
||||
s / m[0],
|
||||
s / m[1]);
|
||||
scalar / m[0],
|
||||
scalar / m[1]);
|
||||
}
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> const operator-(tmat2x3<T, P> const & m)
|
||||
{
|
||||
return tmat2x3<T, P>(
|
||||
-m[0],
|
||||
-m[1]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat2x4.hpp
|
||||
/// @date 2006-08-05 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -51,96 +22,81 @@ namespace glm
|
||||
typedef T value_type;
|
||||
|
||||
private:
|
||||
/// @cond DETAIL
|
||||
col_type value[2];
|
||||
/// @endcond
|
||||
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
GLM_FUNC_DECL tmat2x4();
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL tmat2x4() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat2x4(ctor);
|
||||
GLM_FUNC_DECL explicit tmat2x4(T const & s);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat2x4(ctor);
|
||||
GLM_FUNC_DECL explicit tmat2x4(T scalar);
|
||||
GLM_FUNC_DECL tmat2x4(
|
||||
T const & x0, T const & y0, T const & z0, T const & w0,
|
||||
T const & x1, T const & y1, T const & z1, T const & w1);
|
||||
T x0, T y0, T z0, T w0,
|
||||
T x1, T y1, T z1, T w1);
|
||||
GLM_FUNC_DECL tmat2x4(
|
||||
col_type const & v0,
|
||||
col_type const & v0,
|
||||
col_type const & v1);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversions
|
||||
// -- Conversions --
|
||||
|
||||
template <
|
||||
typename X1, typename Y1, typename Z1, typename W1,
|
||||
typename X2, typename Y2, typename Z2, typename W2>
|
||||
GLM_FUNC_DECL tmat2x4(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2);
|
||||
X1 x1, Y1 y1, Z1 z1, W1 w1,
|
||||
X2 x2, Y2 y2, Z2 z2, W2 w2);
|
||||
|
||||
template <typename U, typename V>
|
||||
GLM_FUNC_DECL tmat2x4(
|
||||
tvec4<U, P> const & v1,
|
||||
tvec4<V, P> const & v2);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tmat2x4(tmat2x4<U, Q> const & m);
|
||||
# else
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tmat2x4(tmat2x4<U, Q> const & m);
|
||||
# endif
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x4<U, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat2x4(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x4(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x4(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x4(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x4(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x4(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x4(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat2x4(tmat4x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x3<T, P> const & x);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 2;}
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
||||
# else
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<T, P> const & m) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P>& operator= (tmat2x4<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P>& operator+= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P>& operator+= (tmat2x4<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P>& operator-= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P>& operator-= (tmat2x4<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P>& operator*= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P>& operator/= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> & operator+=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> & operator+=(tmat2x4<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> & operator-=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> & operator-=(tmat2x4<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> & operator*=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> & operator/=(U s);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tmat2x4<T, P> & operator++ ();
|
||||
GLM_FUNC_DECL tmat2x4<T, P> & operator-- ();
|
||||
@ -148,77 +104,62 @@ namespace glm
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator--(int);
|
||||
};
|
||||
|
||||
// Binary operators
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator+ (
|
||||
tmat2x4<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator+ (
|
||||
tmat2x4<T, P> const & m1,
|
||||
tmat2x4<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator- (
|
||||
tmat2x4<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator- (
|
||||
tmat2x4<T, P> const & m1,
|
||||
tmat2x4<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator* (
|
||||
tmat2x4<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator* (
|
||||
T const & s,
|
||||
tmat2x4<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat2x4<T, P>::col_type operator* (
|
||||
tmat2x4<T, P> const & m,
|
||||
typename tmat2x4<T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat2x4<T, P>::row_type operator* (
|
||||
typename tmat2x4<T, P>::col_type const & v,
|
||||
tmat2x4<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator*(T scalar, tmat2x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator* (
|
||||
tmat2x4<T, P> const & m1,
|
||||
tmat4x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator* (
|
||||
tmat2x4<T, P> const & m1,
|
||||
tmat2x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator* (
|
||||
tmat2x4<T, P> const & m1,
|
||||
tmat3x2<T, P> const & m2);
|
||||
GLM_FUNC_DECL typename tmat2x4<T, P>::col_type operator*(tmat2x4<T, P> const & m, typename tmat2x4<T, P>::row_type const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator/ (
|
||||
tmat2x4<T, P> const & m,
|
||||
T s);
|
||||
GLM_FUNC_DECL typename tmat2x4<T, P>::row_type operator*(typename tmat2x4<T, P>::col_type const & v, tmat2x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator/ (
|
||||
T s,
|
||||
tmat2x4<T, P> const & m);
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> const operator- (
|
||||
tmat2x4<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat4x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat2x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat3x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator/(T scalar, tmat2x4<T, P> const & m);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator==(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@ -1,48 +1,29 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat2x4.inl
|
||||
/// @date 2006-08-05 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm
|
||||
{
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Constructors
|
||||
// -- Constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0, 0, 0);
|
||||
this->value[1] = col_type(0, 1, 0, 0);
|
||||
# endif
|
||||
}
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0, 0, 0);
|
||||
this->value[1] = col_type(0, 1, 0, 0);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, P> const & m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <precision Q>
|
||||
@ -53,22 +34,22 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(ctor)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat2x4<T, P>::tmat2x4(ctor)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(T scalar)
|
||||
{
|
||||
value_type const Zero(0);
|
||||
this->value[0] = col_type(s, Zero, Zero, Zero);
|
||||
this->value[1] = col_type(Zero, s, Zero, Zero);
|
||||
this->value[0] = col_type(scalar, Zero, Zero, Zero);
|
||||
this->value[1] = col_type(Zero, scalar, Zero, Zero);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
|
||||
(
|
||||
T const & x0, T const & y0, T const & z0, T const & w0,
|
||||
T const & x1, T const & y1, T const & z1, T const & w1
|
||||
T x0, T y0, T z0, T w0,
|
||||
T x1, T y1, T z1, T w1
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(x0, y0, z0, w0);
|
||||
@ -82,16 +63,16 @@ namespace glm
|
||||
this->value[1] = v1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion constructors
|
||||
// -- Conversion constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <
|
||||
typename X1, typename Y1, typename Z1, typename W1,
|
||||
typename X2, typename Y2, typename Z2, typename W2>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
|
||||
(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2
|
||||
X1 x1, Y1 y1, Z1 z1, W1 w1,
|
||||
X2 x2, Y2 y2, Z2 z2, W2 w2
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1), value_type(w1));
|
||||
@ -106,8 +87,7 @@ namespace glm
|
||||
this->value[1] = col_type(v2);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
@ -173,53 +153,33 @@ namespace glm
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4<T, P>::size_type tmat2x4<T, P>::size() const
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::size_type i)
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::size_type i) const
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
# else
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4<T, P>::length_type tmat2x4<T, P>::length() const
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
// -- Unary updatable operators --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i)
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<T, P> const & m)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Unary updatable operators
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
@ -284,6 +244,8 @@ namespace glm
|
||||
return *this;
|
||||
}
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator++()
|
||||
{
|
||||
@ -316,15 +278,30 @@ namespace glm
|
||||
return Result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Binary operators
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m)
|
||||
{
|
||||
return tmat2x4<T, P>(
|
||||
m[0] + s,
|
||||
m[1] + s);
|
||||
-m[0],
|
||||
-m[1]);
|
||||
}
|
||||
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x4<T, P>(
|
||||
m[0] + scalar,
|
||||
m[1] + scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -336,11 +313,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x4<T, P>(
|
||||
m[0] - s,
|
||||
m[1] - s);
|
||||
m[0] - scalar,
|
||||
m[1] - scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -352,19 +329,19 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x4<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(T const & s, tmat2x4<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(T scalar, tmat2x4<T, P> const & m)
|
||||
{
|
||||
return tmat2x4<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -459,32 +436,22 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T s)
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat2x4<T, P>(
|
||||
m[0] / s,
|
||||
m[1] / s);
|
||||
m[0] / scalar,
|
||||
m[1] / scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(T s, tmat2x4<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(T scalar, tmat2x4<T, P> const & m)
|
||||
{
|
||||
return tmat2x4<T, P>(
|
||||
s / m[0],
|
||||
s / m[1]);
|
||||
scalar / m[0],
|
||||
scalar / m[1]);
|
||||
}
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> const operator-(tmat2x4<T, P> const & m)
|
||||
{
|
||||
return tmat2x4<T, P>(
|
||||
-m[0],
|
||||
-m[1]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat3x2.hpp
|
||||
/// @date 2006-08-05 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -51,102 +22,86 @@ namespace glm
|
||||
typedef T value_type;
|
||||
|
||||
private:
|
||||
/// @cond DETAIL
|
||||
col_type value[3];
|
||||
/// @endcond
|
||||
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
GLM_FUNC_DECL tmat3x2();
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL tmat3x2() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat3x2(ctor);
|
||||
GLM_FUNC_DECL explicit tmat3x2(T const & s);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat3x2(ctor);
|
||||
GLM_FUNC_DECL explicit tmat3x2(T scalar);
|
||||
GLM_FUNC_DECL tmat3x2(
|
||||
T const & x0, T const & y0,
|
||||
T const & x1, T const & y1,
|
||||
T const & x2, T const & y2);
|
||||
T x0, T y0,
|
||||
T x1, T y1,
|
||||
T x2, T y2);
|
||||
GLM_FUNC_DECL tmat3x2(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversions
|
||||
// -- Conversions --
|
||||
|
||||
template<
|
||||
typename X1, typename Y1,
|
||||
typename X2, typename Y2,
|
||||
typename X3, typename Y3>
|
||||
GLM_FUNC_DECL tmat3x2(
|
||||
X1 const & x1, Y1 const & y1,
|
||||
X2 const & x2, Y2 const & y2,
|
||||
X3 const & x3, Y3 const & y3);
|
||||
|
||||
X1 x1, Y1 y1,
|
||||
X2 x2, Y2 y2,
|
||||
X3 x3, Y3 y3);
|
||||
|
||||
template <typename V1, typename V2, typename V3>
|
||||
GLM_FUNC_DECL tmat3x2(
|
||||
tvec2<V1, P> const & v1,
|
||||
tvec2<V2, P> const & v2,
|
||||
tvec2<V3, P> const & v3);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tmat3x2(tmat3x2<U, Q> const & m);
|
||||
# else
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tmat3x2(tmat3x2<U, Q> const & m);
|
||||
# endif
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x2<U, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat3x2(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x2(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x2(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x2(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x2(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x2(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x2(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x2(tmat4x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat4x3<T, P> const & x);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 3;}
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
||||
# else
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<T, P> const & m) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator= (tmat3x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator+= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator+= (tmat3x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator-= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator-= (tmat3x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator*= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator/= (U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator+=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator+=(tmat3x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator-=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator-=(tmat3x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator*=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator/=(U s);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator++ ();
|
||||
GLM_FUNC_DECL tmat3x2<T, P> & operator-- ();
|
||||
@ -154,76 +109,63 @@ namespace glm
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator--(int);
|
||||
};
|
||||
|
||||
// Binary operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator+ (
|
||||
tmat3x2<T, P> const & m,
|
||||
T const & s);
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator+ (
|
||||
tmat3x2<T, P> const & m1,
|
||||
tmat3x2<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator- (
|
||||
tmat3x2<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator- (
|
||||
tmat3x2<T, P> const & m1,
|
||||
tmat3x2<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator* (
|
||||
tmat3x2<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator* (
|
||||
T const & s,
|
||||
tmat3x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat3x2<T, P>::col_type operator* (
|
||||
tmat3x2<T, P> const & m,
|
||||
typename tmat3x2<T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat3x2<T, P>::row_type operator* (
|
||||
typename tmat3x2<T, P>::col_type const & v,
|
||||
tmat3x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator* (
|
||||
tmat3x2<T, P> const & m1,
|
||||
tmat2x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator* (
|
||||
tmat3x2<T, P> const & m1,
|
||||
tmat3x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator* (
|
||||
tmat3x2<T, P> const & m1,
|
||||
tmat4x3<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator*(T scalar, tmat3x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator/ (
|
||||
tmat3x2<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL typename tmat3x2<T, P>::col_type operator*(tmat3x2<T, P> const & m, typename tmat3x2<T, P>::row_type const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator/ (
|
||||
T const & s,
|
||||
tmat3x2<T, P> const & m);
|
||||
GLM_FUNC_DECL typename tmat3x2<T, P>::row_type operator*(typename tmat3x2<T, P>::col_type const & v, tmat3x2<T, P> const & m);
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> const operator-(
|
||||
tmat3x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat2x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat3x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat4x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator/(T scalar, tmat3x2<T, P> const & m);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator==(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
|
||||
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@ -1,49 +1,31 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat3x2.inl
|
||||
/// @date 2006-08-05 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm
|
||||
{
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Constructors
|
||||
// -- Constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0);
|
||||
this->value[1] = col_type(0, 1);
|
||||
this->value[2] = col_type(0, 0);
|
||||
# endif
|
||||
}
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0);
|
||||
this->value[1] = col_type(0, 1);
|
||||
this->value[2] = col_type(0, 0);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, P> const & m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
this->value[2] = m.value[2];
|
||||
}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <precision Q>
|
||||
@ -55,23 +37,23 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(ctor)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat3x2<T, P>::tmat3x2(ctor)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(T scalar)
|
||||
{
|
||||
this->value[0] = col_type(s, 0);
|
||||
this->value[1] = col_type(0, s);
|
||||
this->value[0] = col_type(scalar, 0);
|
||||
this->value[1] = col_type(0, scalar);
|
||||
this->value[2] = col_type(0, 0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
|
||||
(
|
||||
T const & x0, T const & y0,
|
||||
T const & x1, T const & y1,
|
||||
T const & x2, T const & y2
|
||||
T x0, T y0,
|
||||
T x1, T y1,
|
||||
T x2, T y2
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(x0, y0);
|
||||
@ -92,8 +74,8 @@ namespace glm
|
||||
this->value[2] = v2;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion constructors
|
||||
// -- Conversion constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <
|
||||
typename X1, typename Y1,
|
||||
@ -101,9 +83,9 @@ namespace glm
|
||||
typename X3, typename Y3>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
|
||||
(
|
||||
X1 const & x1, Y1 const & y1,
|
||||
X2 const & x2, Y2 const & y2,
|
||||
X3 const & x3, Y3 const & y3
|
||||
X1 x1, Y1 y1,
|
||||
X2 x2, Y2 y2,
|
||||
X3 x3, Y3 y3
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(static_cast<T>(x1), value_type(y1));
|
||||
@ -125,8 +107,7 @@ namespace glm
|
||||
this->value[2] = col_type(v3);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// mat3x2 matrix conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
@ -169,7 +150,7 @@ namespace glm
|
||||
this->value[2] = col_type(T(0));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x4<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -177,7 +158,7 @@ namespace glm
|
||||
this->value[2] = col_type(T(0));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x4<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -185,7 +166,7 @@ namespace glm
|
||||
this->value[2] = col_type(m[2]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x2<T, P> const & m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
@ -193,7 +174,7 @@ namespace glm
|
||||
this->value[2] = m[2];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -201,53 +182,34 @@ namespace glm
|
||||
this->value[2] = col_type(m[2]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2<T, P>::size_type tmat3x2<T, P>::size() const
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::size_type i)
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::size_type i) const
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
# else
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2<T, P>::length_type tmat3x2<T, P>::length() const
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
// -- Unary updatable operators --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i)
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<T, P> const & m)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
this->value[2] = m[2];
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Unary updatable operators
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
@ -319,6 +281,8 @@ namespace glm
|
||||
return *this;
|
||||
}
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator++()
|
||||
{
|
||||
@ -353,16 +317,32 @@ namespace glm
|
||||
return Result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Binary operators
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m)
|
||||
{
|
||||
return tmat3x2<T, P>(
|
||||
m[0] + s,
|
||||
m[1] + s,
|
||||
m[2] + s);
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2]);
|
||||
}
|
||||
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x2<T, P>(
|
||||
m[0] + scalar,
|
||||
m[1] + scalar,
|
||||
m[2] + scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -375,12 +355,12 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x2<T, P>(
|
||||
m[0] - s,
|
||||
m[1] - s,
|
||||
m[2] - s);
|
||||
m[0] - scalar,
|
||||
m[1] - scalar,
|
||||
m[2] - scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -393,21 +373,21 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x2<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s,
|
||||
m[2] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar,
|
||||
m[2] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(T const & s, tmat3x2<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(T scalar, tmat3x2<T, P> const & m)
|
||||
{
|
||||
return tmat3x2<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s,
|
||||
m[2] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar,
|
||||
m[2] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -479,35 +459,24 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x2<T, P>(
|
||||
m[0] / s,
|
||||
m[1] / s,
|
||||
m[2] / s);
|
||||
m[0] / scalar,
|
||||
m[1] / scalar,
|
||||
m[2] / scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(T const & s, tmat3x2<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(T scalar, tmat3x2<T, P> const & m)
|
||||
{
|
||||
return tmat3x2<T, P>(
|
||||
s / m[0],
|
||||
s / m[1],
|
||||
s / m[2]);
|
||||
scalar / m[0],
|
||||
scalar / m[1],
|
||||
scalar / m[2]);
|
||||
}
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> const operator-(tmat3x2<T, P> const & m)
|
||||
{
|
||||
return tmat3x2<T, P>(
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat3x3.hpp
|
||||
/// @date 2005-01-27 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -49,214 +20,169 @@ namespace glm
|
||||
typedef tmat3x3<T, P> transpose_type;
|
||||
typedef T value_type;
|
||||
|
||||
template <typename U, precision Q>
|
||||
friend tvec3<U, Q> operator/(tmat3x3<U, Q> const & m, tvec3<U, Q> const & v);
|
||||
template <typename U, precision Q>
|
||||
friend tvec3<U, Q> operator/(tvec3<U, Q> const & v, tmat3x3<U, Q> const & m);
|
||||
|
||||
private:
|
||||
/// @cond DETAIL
|
||||
col_type value[3];
|
||||
/// @endcond
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
GLM_FUNC_DECL tmat3x3();
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL tmat3x3() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat3x3(ctor);
|
||||
GLM_FUNC_DECL explicit tmat3x3(T const & s);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat3x3(ctor);
|
||||
GLM_FUNC_DECL explicit tmat3x3(T scalar);
|
||||
GLM_FUNC_DECL tmat3x3(
|
||||
T const & x0, T const & y0, T const & z0,
|
||||
T const & x1, T const & y1, T const & z1,
|
||||
T const & x2, T const & y2, T const & z2);
|
||||
T x0, T y0, T z0,
|
||||
T x1, T y1, T z1,
|
||||
T x2, T y2, T z2);
|
||||
GLM_FUNC_DECL tmat3x3(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversions
|
||||
// -- Conversions --
|
||||
|
||||
template<
|
||||
typename X1, typename Y1, typename Z1,
|
||||
typename X2, typename Y2, typename Z2,
|
||||
typename X3, typename Y3, typename Z3>
|
||||
GLM_FUNC_DECL tmat3x3(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2,
|
||||
X3 const & x3, Y3 const & y3, Z3 const & z3);
|
||||
|
||||
X1 x1, Y1 y1, Z1 z1,
|
||||
X2 x2, Y2 y2, Z2 z2,
|
||||
X3 x3, Y3 y3, Z3 z3);
|
||||
|
||||
template <typename V1, typename V2, typename V3>
|
||||
GLM_FUNC_DECL tmat3x3(
|
||||
tvec3<V1, P> const & v1,
|
||||
tvec3<V2, P> const & v2,
|
||||
tvec3<V3, P> const & v3);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U, Q> const & m);
|
||||
# else
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tmat3x3(tmat3x3<U, Q> const & m);
|
||||
# endif
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x3<U, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x3(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x3(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x3(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x3(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x3(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat4x3<T, P> const & x);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 3;}
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
||||
# else
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<T, P> const & m) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x3<T, P>& operator= (tmat3x3<U, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x3<T, P>& operator+= (U s);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator+=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x3<T, P>& operator+= (tmat3x3<U, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator+=(tmat3x3<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x3<T, P>& operator-= (U s);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator-=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x3<T, P>& operator-= (tmat3x3<U, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator-=(tmat3x3<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x3<T, P>& operator*= (U s);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator*=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x3<T, P>& operator*= (tmat3x3<U, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator*=(tmat3x3<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x3<T, P>& operator/= (U s);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator/=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x3<T, P>& operator/= (tmat3x3<U, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator/=(tmat3x3<U, P> const & m);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator++ ();
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator-- ();
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator++();
|
||||
GLM_FUNC_DECL tmat3x3<T, P> & operator--();
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator++(int);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator--(int);
|
||||
};
|
||||
|
||||
// Binary operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator+ (
|
||||
tmat3x3<T, P> const & m,
|
||||
T const & s);
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator+ (
|
||||
T const & s,
|
||||
tmat3x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator+ (
|
||||
tmat3x3<T, P> const & m1,
|
||||
tmat3x3<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator- (
|
||||
tmat3x3<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator- (
|
||||
T const & s,
|
||||
tmat3x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator+(T scalar, tmat3x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator- (
|
||||
tmat3x3<T, P> const & m1,
|
||||
tmat3x3<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator* (
|
||||
tmat3x3<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator* (
|
||||
T const & s,
|
||||
tmat3x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator-(T scalar, tmat3x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator* (
|
||||
tmat3x3<T, P> const & m,
|
||||
typename tmat3x3<T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator* (
|
||||
typename tmat3x3<T, P>::col_type const & v,
|
||||
tmat3x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator* (
|
||||
tmat3x3<T, P> const & m1,
|
||||
tmat3x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator* (
|
||||
tmat3x3<T, P> const & m1,
|
||||
tmat2x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator* (
|
||||
tmat3x3<T, P> const & m1,
|
||||
tmat4x3<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator*(T scalar, tmat3x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator/ (
|
||||
tmat3x3<T, P> const & m,
|
||||
T const & s);
|
||||
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator*(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator/ (
|
||||
T const & s,
|
||||
tmat3x3<T, P> const & m);
|
||||
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator*(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator/ (
|
||||
tmat3x3<T, P> const & m,
|
||||
typename tmat3x3<T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator/ (
|
||||
typename tmat3x3<T, P>::col_type const & v,
|
||||
tmat3x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat2x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator/ (
|
||||
tmat3x3<T, P> const & m1,
|
||||
tmat3x3<T, P> const & m2);
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat4x3<T, P> const & m2);
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> const operator-(
|
||||
tmat3x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator/(T scalar, tmat3x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator/(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator/(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator==(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@ -1,77 +1,33 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat3x3.inl
|
||||
/// @date 2005-01-27 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
#include "func_matrix.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> compute_inverse(tmat3x3<T, P> const & m)
|
||||
{
|
||||
T OneOverDeterminant = static_cast<T>(1) / (
|
||||
+ m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])
|
||||
- m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2])
|
||||
+ m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]));
|
||||
// -- Constructors --
|
||||
|
||||
tmat3x3<T, P> Inverse(uninitialize);
|
||||
Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * OneOverDeterminant;
|
||||
Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * OneOverDeterminant;
|
||||
Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * OneOverDeterminant;
|
||||
Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]) * OneOverDeterminant;
|
||||
Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]) * OneOverDeterminant;
|
||||
Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]) * OneOverDeterminant;
|
||||
Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]) * OneOverDeterminant;
|
||||
Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]) * OneOverDeterminant;
|
||||
Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]) * OneOverDeterminant;
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
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
|
||||
}
|
||||
# endif
|
||||
|
||||
return Inverse;
|
||||
}
|
||||
}//namespace detail
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Constructors
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
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
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(ctor)
|
||||
{}
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
this->value[2] = m.value[2];
|
||||
}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <precision Q>
|
||||
@ -83,19 +39,23 @@ namespace detail
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(T const & s)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat3x3<T, P>::tmat3x3(ctor)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(T scalar)
|
||||
{
|
||||
this->value[0] = col_type(s, 0, 0);
|
||||
this->value[1] = col_type(0, s, 0);
|
||||
this->value[2] = col_type(0, 0, s);
|
||||
this->value[0] = col_type(scalar, 0, 0);
|
||||
this->value[1] = col_type(0, scalar, 0);
|
||||
this->value[2] = col_type(0, 0, scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
|
||||
(
|
||||
T const & x0, T const & y0, T const & z0,
|
||||
T const & x1, T const & y1, T const & z1,
|
||||
T const & x2, T const & y2, T const & z2
|
||||
T x0, T y0, T z0,
|
||||
T x1, T y1, T z1,
|
||||
T x2, T y2, T z2
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(x0, y0, z0);
|
||||
@ -116,8 +76,8 @@ namespace detail
|
||||
this->value[2] = v2;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion constructors
|
||||
// -- Conversion constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <
|
||||
typename X1, typename Y1, typename Z1,
|
||||
@ -125,9 +85,9 @@ namespace detail
|
||||
typename X3, typename Y3, typename Z3>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
|
||||
(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2,
|
||||
X3 const & x3, Y3 const & y3, Z3 const & z3
|
||||
X1 x1, Y1 y1, Z1 z1,
|
||||
X2 x2, Y2 y2, Z2 z2,
|
||||
X3 x3, Y3 y3, Z3 z3
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1));
|
||||
@ -149,8 +109,7 @@ namespace detail
|
||||
this->value[2] = col_type(v3);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
@ -225,53 +184,34 @@ namespace detail
|
||||
this->value[2] = m[2];
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3<T, P>::size_type tmat3x3<T, P>::size() const
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::size_type i)
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::size_type i) const
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
# else
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3<T, P>::length_type tmat3x3<T, P>::length() const
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
// -- Unary updatable operators --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i)
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<T, P> const & m)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
this->value[2] = m[2];
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Operators
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
@ -354,9 +294,11 @@ namespace detail
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator/=(tmat3x3<U, P> const & m)
|
||||
{
|
||||
return (*this = *this * detail::compute_inverse<T, P>(m));
|
||||
return *this *= inverse(m);
|
||||
}
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator++()
|
||||
{
|
||||
@ -391,25 +333,41 @@ namespace detail
|
||||
return Result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Binary operators
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T const & s)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m)
|
||||
{
|
||||
return tmat3x3<T, P>(
|
||||
m[0] + s,
|
||||
m[1] + s,
|
||||
m[2] + s);
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2]);
|
||||
}
|
||||
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x3<T, P>(
|
||||
m[0] + scalar,
|
||||
m[1] + scalar,
|
||||
m[2] + scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(T const & s, tmat3x3<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(T scalar, tmat3x3<T, P> const & m)
|
||||
{
|
||||
return tmat3x3<T, P>(
|
||||
m[0] + s,
|
||||
m[1] + s,
|
||||
m[2] + s);
|
||||
m[0] + scalar,
|
||||
m[1] + scalar,
|
||||
m[2] + scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -422,21 +380,21 @@ namespace detail
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x3<T, P>(
|
||||
m[0] - s,
|
||||
m[1] - s,
|
||||
m[2] - s);
|
||||
m[0] - scalar,
|
||||
m[1] - scalar,
|
||||
m[2] - scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(T const & s, tmat3x3<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(T scalar, tmat3x3<T, P> const & m)
|
||||
{
|
||||
return tmat3x3<T, P>(
|
||||
s - m[0],
|
||||
s - m[1],
|
||||
s - m[2]);
|
||||
scalar - m[0],
|
||||
scalar - m[1],
|
||||
scalar - m[2]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -449,21 +407,21 @@ namespace detail
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x3<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s,
|
||||
m[2] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar,
|
||||
m[2] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(T const & s, tmat3x3<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(T scalar, tmat3x3<T, P> const & m)
|
||||
{
|
||||
return tmat3x3<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s,
|
||||
m[2] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar,
|
||||
m[2] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -551,33 +509,33 @@ namespace detail
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x3<T, P>(
|
||||
m[0] / s,
|
||||
m[1] / s,
|
||||
m[2] / s);
|
||||
m[0] / scalar,
|
||||
m[1] / scalar,
|
||||
m[2] / scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(T const & s, tmat3x3<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(T scalar, tmat3x3<T, P> const & m)
|
||||
{
|
||||
return tmat3x3<T, P>(
|
||||
s / m[0],
|
||||
s / m[1],
|
||||
s / m[2]);
|
||||
scalar / m[0],
|
||||
scalar / m[1],
|
||||
scalar / m[2]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type operator/(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v)
|
||||
{
|
||||
return detail::compute_inverse<T, P>(m) * v;
|
||||
return inverse(m) * v;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::row_type operator/(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m)
|
||||
{
|
||||
return v * detail::compute_inverse<T, P>(m);
|
||||
return v * inverse(m);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -587,18 +545,7 @@ namespace detail
|
||||
return m1_copy /= m2;
|
||||
}
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> const operator-(tmat3x3<T, P> const & m)
|
||||
{
|
||||
return tmat3x3<T, P>(
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat3x4.hpp
|
||||
/// @date 2006-08-05 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -51,101 +22,86 @@ namespace glm
|
||||
typedef T value_type;
|
||||
|
||||
private:
|
||||
/// @cond DETAIL
|
||||
col_type value[3];
|
||||
/// @endcond
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
GLM_FUNC_DECL tmat3x4();
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL tmat3x4() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> const & m) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat3x4(ctor);
|
||||
GLM_FUNC_DECL explicit tmat3x4(T const & s);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat3x4(ctor);
|
||||
GLM_FUNC_DECL explicit tmat3x4(T scalar);
|
||||
GLM_FUNC_DECL tmat3x4(
|
||||
T const & x0, T const & y0, T const & z0, T const & w0,
|
||||
T const & x1, T const & y1, T const & z1, T const & w1,
|
||||
T const & x2, T const & y2, T const & z2, T const & w2);
|
||||
T x0, T y0, T z0, T w0,
|
||||
T x1, T y1, T z1, T w1,
|
||||
T x2, T y2, T z2, T w2);
|
||||
GLM_FUNC_DECL tmat3x4(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversions
|
||||
// -- Conversions --
|
||||
|
||||
template<
|
||||
typename X1, typename Y1, typename Z1, typename W1,
|
||||
typename X2, typename Y2, typename Z2, typename W2,
|
||||
typename X3, typename Y3, typename Z3, typename W3>
|
||||
GLM_FUNC_DECL tmat3x4(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
|
||||
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3);
|
||||
|
||||
X1 x1, Y1 y1, Z1 z1, W1 w1,
|
||||
X2 x2, Y2 y2, Z2 z2, W2 w2,
|
||||
X3 x3, Y3 y3, Z3 z3, W3 w3);
|
||||
|
||||
template <typename V1, typename V2, typename V3>
|
||||
GLM_FUNC_DECL tmat3x4(
|
||||
tvec4<V1, P> const & v1,
|
||||
tvec4<V2, P> const & v2,
|
||||
tvec4<V3, P> const & v3);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix conversion
|
||||
// -- Matrix conversions --
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tmat3x4(tmat3x4<U, Q> const & m);
|
||||
# else
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tmat3x4(tmat3x4<U, Q> const & m);
|
||||
# endif
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat3x4<U, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat3x4(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x4(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x4(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x4(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x4(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x4(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x4(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat3x4(tmat4x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat4x3<T, P> const & x);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 3;}
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
||||
# else
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<T, P> const & m) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<U, P> const & m);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> & operator+=(U s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> & operator+=(tmat3x4<U, P> const & m);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> & operator-=(U s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> & operator-=(tmat3x4<U, P> const & m);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> & operator*=(U s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> & operator/=(U s);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tmat3x4<T, P> & operator++();
|
||||
GLM_FUNC_DECL tmat3x4<T, P> & operator--();
|
||||
@ -153,49 +109,62 @@ namespace glm
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator--(int);
|
||||
};
|
||||
|
||||
// Binary operators
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator*(T const & s, tmat3x4<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator*(T scalar, tmat3x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat3x4<T, P>::col_type operator*(tmat3x4<T, P> const & m, typename tmat3x4<T, P>::row_type const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat3x4<T, P>::row_type operator*(typename tmat3x4<T, P>::col_type const & v, tmat3x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat4x3<T, P> const & m2);
|
||||
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat2x3<T, P> const & m2);
|
||||
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat3x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator/(T const & s, tmat3x4<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator/(T scalar, tmat3x4<T, P> const & m);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> const operator-(tmat3x4<T, P> const & m);
|
||||
GLM_FUNC_DECL bool operator==(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@ -1,49 +1,31 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat3x4.inl
|
||||
/// @date 2006-08-05 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm
|
||||
{
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Constructors
|
||||
// -- Constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
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);
|
||||
# endif
|
||||
}
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
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);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, P> const & m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
this->value[2] = m.value[2];
|
||||
}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <precision Q>
|
||||
@ -55,24 +37,23 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(ctor)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat3x4<T, P>::tmat3x4(ctor)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(T scalar)
|
||||
{
|
||||
value_type const Zero(0);
|
||||
this->value[0] = col_type(s, Zero, Zero, Zero);
|
||||
this->value[1] = col_type(Zero, s, Zero, Zero);
|
||||
this->value[2] = col_type(Zero, Zero, s, Zero);
|
||||
this->value[0] = col_type(scalar, 0, 0, 0);
|
||||
this->value[1] = col_type(0, scalar, 0, 0);
|
||||
this->value[2] = col_type(0, 0, scalar, 0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
|
||||
(
|
||||
T const & x0, T const & y0, T const & z0, T const & w0,
|
||||
T const & x1, T const & y1, T const & z1, T const & w1,
|
||||
T const & x2, T const & y2, T const & z2, T const & w2
|
||||
T x0, T y0, T z0, T w0,
|
||||
T x1, T y1, T z1, T w1,
|
||||
T x2, T y2, T z2, T w2
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(x0, y0, z0, w0);
|
||||
@ -93,8 +74,8 @@ namespace glm
|
||||
this->value[2] = v2;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion constructors
|
||||
// -- Conversion constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <
|
||||
typename X1, typename Y1, typename Z1, typename W1,
|
||||
@ -102,9 +83,9 @@ namespace glm
|
||||
typename X3, typename Y3, typename Z3, typename W3>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
|
||||
(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
|
||||
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3
|
||||
X1 x1, Y1 y1, Z1 z1, W1 w1,
|
||||
X2 x2, Y2 y2, Z2 z2, W2 w2,
|
||||
X3 x3, Y3 y3, Z3 z3, W3 w3
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1), value_type(w1));
|
||||
@ -126,7 +107,8 @@ namespace glm
|
||||
this->value[2] = col_type(v3);
|
||||
}
|
||||
|
||||
// Conversion
|
||||
// -- Matrix conversions --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<U, Q> const & m)
|
||||
@ -152,7 +134,7 @@ namespace glm
|
||||
this->value[2] = col_type(m[2], 0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x4<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -160,7 +142,7 @@ namespace glm
|
||||
this->value[2] = col_type(m[2]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
@ -168,15 +150,15 @@ namespace glm
|
||||
this->value[2] = col_type(0, 0, 1, 0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x2<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
this->value[2] = col_type(m[2], 0, 1);
|
||||
this->value[2] = col_type(m[2], 1, 0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x4<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -184,7 +166,7 @@ namespace glm
|
||||
this->value[2] = col_type(0, 0, 1, 0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x2<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
@ -192,7 +174,7 @@ namespace glm
|
||||
this->value[2] = col_type(m[2], 1, 0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
@ -200,53 +182,34 @@ namespace glm
|
||||
this->value[2] = col_type(m[2], 0);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4<T, P>::size_type tmat3x4<T, P>::size() const
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::size_type i)
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::size_type i) const
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
# else
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4<T, P>::length_type tmat3x4<T, P>::length() const
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
// -- Unary updatable operators --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i)
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<T, P> const & m)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
this->value[2] = m[2];
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Unary updatable operators
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
@ -318,6 +281,8 @@ namespace glm
|
||||
return *this;
|
||||
}
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator++()
|
||||
{
|
||||
@ -352,16 +317,32 @@ namespace glm
|
||||
return Result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Binary operators
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m)
|
||||
{
|
||||
return tmat3x4<T, P>(
|
||||
m[0] + s,
|
||||
m[1] + s,
|
||||
m[2] + s);
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2]);
|
||||
}
|
||||
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x4<T, P>(
|
||||
m[0] + scalar,
|
||||
m[1] + scalar,
|
||||
m[2] + scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -374,12 +355,12 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x4<T, P>(
|
||||
m[0] - s,
|
||||
m[1] - s,
|
||||
m[2] - s);
|
||||
m[0] - scalar,
|
||||
m[1] - scalar,
|
||||
m[2] - scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -392,21 +373,21 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x4<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s,
|
||||
m[2] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar,
|
||||
m[2] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(T const & s, tmat3x4<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(T scalar, tmat3x4<T, P> const & m)
|
||||
{
|
||||
return tmat3x4<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s,
|
||||
m[2] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar,
|
||||
m[2] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -518,35 +499,24 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat3x4<T, P>(
|
||||
m[0] / s,
|
||||
m[1] / s,
|
||||
m[2] / s);
|
||||
m[0] / scalar,
|
||||
m[1] / scalar,
|
||||
m[2] / scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(T const & s, tmat3x4<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(T scalar, tmat3x4<T, P> const & m)
|
||||
{
|
||||
return tmat3x4<T, P>(
|
||||
s / m[0],
|
||||
s / m[1],
|
||||
s / m[2]);
|
||||
scalar / m[0],
|
||||
scalar / m[1],
|
||||
scalar / m[2]);
|
||||
}
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> const operator-(tmat3x4<T, P> const & m)
|
||||
{
|
||||
return tmat3x4<T, P>(
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat4x2.hpp
|
||||
/// @date 2006-10-01 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -51,31 +22,30 @@ namespace glm
|
||||
typedef T value_type;
|
||||
|
||||
private:
|
||||
/// @cond DETAIL
|
||||
col_type value[4];
|
||||
/// @endcond
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
GLM_FUNC_DECL tmat4x2();
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL tmat4x2() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat4x2(ctor);
|
||||
GLM_FUNC_DECL explicit tmat4x2(T const & x);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat4x2(ctor);
|
||||
GLM_FUNC_DECL explicit tmat4x2(T scalar);
|
||||
GLM_FUNC_DECL tmat4x2(
|
||||
T const & x0, T const & y0,
|
||||
T const & x1, T const & y1,
|
||||
T const & x2, T const & y2,
|
||||
T const & x3, T const & y3);
|
||||
T x0, T y0,
|
||||
T x1, T y1,
|
||||
T x2, T y2,
|
||||
T x3, T y3);
|
||||
GLM_FUNC_DECL tmat4x2(
|
||||
col_type const & v0,
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2,
|
||||
col_type const & v3);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversions
|
||||
// -- Conversions --
|
||||
|
||||
template <
|
||||
typename X1, typename Y1,
|
||||
@ -83,10 +53,10 @@ namespace glm
|
||||
typename X3, typename Y3,
|
||||
typename X4, typename Y4>
|
||||
GLM_FUNC_DECL tmat4x2(
|
||||
X1 const & x1, Y1 const & y1,
|
||||
X2 const & x2, Y2 const & y2,
|
||||
X3 const & x3, Y3 const & y3,
|
||||
X4 const & x4, Y4 const & y4);
|
||||
X1 x1, Y1 y1,
|
||||
X2 x2, Y2 y2,
|
||||
X3 x3, Y3 y3,
|
||||
X4 x4, Y4 y4);
|
||||
|
||||
template <typename V1, typename V2, typename V3, typename V4>
|
||||
GLM_FUNC_DECL tmat4x2(
|
||||
@ -95,63 +65,48 @@ namespace glm
|
||||
tvec2<V3, P> const & v3,
|
||||
tvec2<V4, P> const & v4);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U, Q> const & m);
|
||||
# else
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tmat4x2(tmat4x2<U, Q> const & m);
|
||||
# endif
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x2<U, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x2(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x2(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x2(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x2(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x2(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x2(tmat4x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x2(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat3x4<T, P> const & x);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 4;}
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
||||
# else
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<T, P> const & m) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P>& operator=(tmat4x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P>& operator+=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P>& operator+=(tmat4x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P>& operator-=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P>& operator-=(tmat4x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P>& operator*=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P>& operator/=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> & operator+=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> & operator+=(tmat4x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> & operator-=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> & operator-=(tmat4x2<U, P> const & m);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> & operator*=(U s);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> & operator/=(U s);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tmat4x2<T, P> & operator++ ();
|
||||
GLM_FUNC_DECL tmat4x2<T, P> & operator-- ();
|
||||
@ -159,24 +114,33 @@ namespace glm
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator--(int);
|
||||
};
|
||||
|
||||
// Binary operators
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator*(T const & s, tmat4x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator*(T scalar, tmat4x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat4x2<T, P>::col_type operator*(tmat4x2<T, P> const & m, typename tmat4x2<T, P>::row_type const & v);
|
||||
@ -184,24 +148,28 @@ namespace glm
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat4x2<T, P>::row_type operator*(typename tmat4x2<T, P>::col_type const & v, tmat4x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat2x4<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat3x4<T, P> const & m2);
|
||||
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat4x4<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator/(T const & s, tmat4x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator/(T scalar, tmat4x2<T, P> const & m);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m);
|
||||
GLM_FUNC_DECL bool operator==(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@ -1,50 +1,40 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat4x2.inl
|
||||
/// @date 2006-10-01 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm
|
||||
{
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Constructors
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
template<typename T, precision P>
|
||||
const tmat4x2<T, P> tmat4x2<T, P>::ZERO(static_cast<T>(0));
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0);
|
||||
this->value[1] = col_type(0, 1);
|
||||
this->value[2] = col_type(0, 0);
|
||||
this->value[3] = col_type(0, 0);
|
||||
# endif
|
||||
}
|
||||
template<typename T, precision P>
|
||||
const tmat4x2<T, P> tmat4x2<T, P>::IDENTITY(static_cast<T>(1));
|
||||
# endif
|
||||
// -- Constructors --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0);
|
||||
this->value[1] = col_type(0, 1);
|
||||
this->value[2] = col_type(0, 0);
|
||||
this->value[3] = col_type(0, 0);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, P> const & m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
this->value[2] = m.value[2];
|
||||
this->value[3] = m.value[3];
|
||||
}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <precision Q>
|
||||
@ -57,26 +47,25 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(ctor)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat4x2<T, P>::tmat4x2(ctor)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(T scalar)
|
||||
{
|
||||
value_type const Zero(0);
|
||||
this->value[0] = col_type(s, Zero);
|
||||
this->value[1] = col_type(Zero, s);
|
||||
this->value[2] = col_type(Zero, Zero);
|
||||
this->value[3] = col_type(Zero, Zero);
|
||||
this->value[0] = col_type(scalar, 0);
|
||||
this->value[1] = col_type(0, scalar);
|
||||
this->value[2] = col_type(0, 0);
|
||||
this->value[3] = col_type(0, 0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
|
||||
(
|
||||
T const & x0, T const & y0,
|
||||
T const & x1, T const & y1,
|
||||
T const & x2, T const & y2,
|
||||
T const & x3, T const & y3
|
||||
T x0, T y0,
|
||||
T x1, T y1,
|
||||
T x2, T y2,
|
||||
T x3, T y3
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(x0, y0);
|
||||
@ -100,8 +89,7 @@ namespace glm
|
||||
this->value[3] = v3;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion constructors
|
||||
// -- Conversion constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <
|
||||
@ -111,10 +99,10 @@ namespace glm
|
||||
typename X4, typename Y4>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
|
||||
(
|
||||
X1 const & x1, Y1 const & y1,
|
||||
X2 const & x2, Y2 const & y2,
|
||||
X3 const & x3, Y3 const & y3,
|
||||
X4 const & x4, Y4 const & y4
|
||||
X1 x1, Y1 y1,
|
||||
X2 x2, Y2 y2,
|
||||
X3 x3, Y3 y3,
|
||||
X4 x4, Y4 y4
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(static_cast<T>(x1), value_type(y1));
|
||||
@ -139,8 +127,8 @@ namespace glm
|
||||
this->value[3] = col_type(v4);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion
|
||||
// -- Conversion --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<U, Q> const & m)
|
||||
@ -160,7 +148,7 @@ namespace glm
|
||||
this->value[3] = col_type(0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -169,7 +157,7 @@ namespace glm
|
||||
this->value[3] = col_type(0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x4<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -178,7 +166,7 @@ namespace glm
|
||||
this->value[3] = col_type(m[3]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -187,7 +175,7 @@ namespace glm
|
||||
this->value[3] = col_type(0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x2<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -196,7 +184,7 @@ namespace glm
|
||||
this->value[3] = col_type(0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x4<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -205,7 +193,7 @@ namespace glm
|
||||
this->value[3] = col_type(0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -214,7 +202,7 @@ namespace glm
|
||||
this->value[3] = col_type(m[3]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x4<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -223,53 +211,35 @@ namespace glm
|
||||
this->value[3] = col_type(0);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2<T, P>::size_type tmat4x2<T, P>::size() const
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::size_type i)
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::size_type i) const
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
# else
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2<T, P>::length_type tmat4x2<T, P>::length() const
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
// -- Unary updatable operators --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i)
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<T, P> const & m)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
this->value[2] = m[2];
|
||||
this->value[3] = m[3];
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Unary updatable operators
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
@ -348,6 +318,8 @@ namespace glm
|
||||
return *this;
|
||||
}
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator++()
|
||||
{
|
||||
@ -384,17 +356,34 @@ namespace glm
|
||||
return Result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Binary operators
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m)
|
||||
{
|
||||
return tmat4x2<T, P>(
|
||||
m[0] + s,
|
||||
m[1] + s,
|
||||
m[2] + s,
|
||||
m[3] + s);
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2],
|
||||
-m[3]);
|
||||
}
|
||||
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat4x2<T, P>(
|
||||
m[0] + scalar,
|
||||
m[1] + scalar,
|
||||
m[2] + scalar,
|
||||
m[3] + scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -408,13 +397,13 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat4x2<T, P>(
|
||||
m[0] - s,
|
||||
m[1] - s,
|
||||
m[2] - s,
|
||||
m[3] - s);
|
||||
m[0] - scalar,
|
||||
m[1] - scalar,
|
||||
m[2] - scalar,
|
||||
m[3] - scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -428,23 +417,23 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat4x2<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s,
|
||||
m[2] * s,
|
||||
m[3] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar,
|
||||
m[2] * scalar,
|
||||
m[3] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(T const & s, tmat4x2<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(T scalar, tmat4x2<T, P> const & m)
|
||||
{
|
||||
return tmat4x2<T, P>(
|
||||
m[0] * s,
|
||||
m[1] * s,
|
||||
m[2] * s,
|
||||
m[3] * s);
|
||||
m[0] * scalar,
|
||||
m[1] * scalar,
|
||||
m[2] * scalar,
|
||||
m[3] * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -521,38 +510,26 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T scalar)
|
||||
{
|
||||
return tmat4x2<T, P>(
|
||||
m[0] / s,
|
||||
m[1] / s,
|
||||
m[2] / s,
|
||||
m[3] / s);
|
||||
m[0] / scalar,
|
||||
m[1] / scalar,
|
||||
m[2] / scalar,
|
||||
m[3] / scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(T const & s, tmat4x2<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(T scalar, tmat4x2<T, P> const & m)
|
||||
{
|
||||
return tmat4x2<T, P>(
|
||||
s / m[0],
|
||||
s / m[1],
|
||||
s / m[2],
|
||||
s / m[3]);
|
||||
scalar / m[0],
|
||||
scalar / m[1],
|
||||
scalar / m[2],
|
||||
scalar / m[3]);
|
||||
}
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m)
|
||||
{
|
||||
return tmat4x2<T, P>(
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2],
|
||||
-m[3]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat4x3.hpp
|
||||
/// @date 2006-08-04 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -51,16 +22,17 @@ namespace glm
|
||||
typedef T value_type;
|
||||
|
||||
private:
|
||||
// Data
|
||||
col_type value[4];
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
GLM_FUNC_DECL tmat4x3();
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL tmat4x3() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> const & m) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat4x3(ctor);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat4x3(ctor);
|
||||
GLM_FUNC_DECL explicit tmat4x3(T const & x);
|
||||
GLM_FUNC_DECL tmat4x3(
|
||||
T const & x0, T const & y0, T const & z0,
|
||||
@ -73,8 +45,7 @@ namespace glm
|
||||
col_type const & v2,
|
||||
col_type const & v3);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversions
|
||||
// -- Conversions --
|
||||
|
||||
template <
|
||||
typename X1, typename Y1, typename Z1,
|
||||
@ -86,7 +57,7 @@ namespace glm
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2,
|
||||
X3 const & x3, Y3 const & y3, Z3 const & z3,
|
||||
X4 const & x4, Y4 const & y4, Z4 const & z4);
|
||||
|
||||
|
||||
template <typename V1, typename V2, typename V3, typename V4>
|
||||
GLM_FUNC_DECL tmat4x3(
|
||||
tvec3<V1, P> const & v1,
|
||||
@ -94,45 +65,31 @@ namespace glm
|
||||
tvec3<V3, P> const & v3,
|
||||
tvec3<V4, P> const & v4);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tmat4x3(tmat4x3<U, Q> const & m);
|
||||
# else
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tmat4x3(tmat4x3<U, Q> const & m);
|
||||
# endif
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat4x3<U, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat4x3(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x3(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x3(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x3(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x3(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x3(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x3(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x3(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat4x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat3x4<T, P> const & x);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 4;}
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
||||
# else
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<T, P> const & m) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<U, P> const & m);
|
||||
@ -149,8 +106,7 @@ namespace glm
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> & operator/=(U s);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tmat4x3<T, P> & operator++();
|
||||
GLM_FUNC_DECL tmat4x3<T, P> & operator--();
|
||||
@ -158,7 +114,16 @@ namespace glm
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator--(int);
|
||||
};
|
||||
|
||||
// Binary operators
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator-(tmat4x3<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m, T const & s);
|
||||
|
||||
@ -188,7 +153,7 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat3x4<T, P> const & m2);
|
||||
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat4x4<T, P> const & m2);
|
||||
|
||||
@ -198,9 +163,13 @@ namespace glm
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator/(T const & s, tmat4x3<T, P> const & m);
|
||||
|
||||
// Unary constant operators
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> const operator-(tmat4x3<T, P> const & m);
|
||||
GLM_FUNC_DECL bool operator==(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@ -1,50 +1,33 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat4x3.inl
|
||||
/// @date 2006-04-17 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm
|
||||
{
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Constructors
|
||||
// -- Constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0, 0);
|
||||
this->value[1] = col_type(0, 1, 0);
|
||||
this->value[2] = col_type(0, 0, 1);
|
||||
this->value[3] = col_type(0, 0, 0);
|
||||
# endif
|
||||
}
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
this->value[0] = col_type(1, 0, 0);
|
||||
this->value[1] = col_type(0, 1, 0);
|
||||
this->value[2] = col_type(0, 0, 1);
|
||||
this->value[3] = col_type(0, 0, 0);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
this->value[2] = m.value[2];
|
||||
this->value[3] = m.value[3];
|
||||
}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <precision Q>
|
||||
@ -56,11 +39,11 @@ namespace glm
|
||||
this->value[3] = m.value[3];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(ctor)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat4x3<T, P>::tmat4x3(ctor)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(T const & s)
|
||||
{
|
||||
this->value[0] = col_type(s, 0, 0);
|
||||
@ -69,7 +52,7 @@ namespace glm
|
||||
this->value[3] = col_type(0, 0, 0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
|
||||
(
|
||||
T const & x0, T const & y0, T const & z0,
|
||||
@ -84,11 +67,11 @@ namespace glm
|
||||
this->value[3] = col_type(x3, y3, z3);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
|
||||
(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2,
|
||||
col_type const & v3
|
||||
)
|
||||
@ -99,10 +82,9 @@ namespace glm
|
||||
this->value[3] = v3;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion constructors
|
||||
// -- Conversion constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
template <
|
||||
typename X1, typename Y1, typename Z1,
|
||||
typename X2, typename Y2, typename Z2,
|
||||
@ -138,8 +120,7 @@ namespace glm
|
||||
this->value[3] = col_type(v4);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Matrix conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
@ -151,16 +132,16 @@ namespace glm
|
||||
this->value[3] = col_type(m[3]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x2<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
this->value[2] = col_type(m[2], 1);
|
||||
this->value[2] = col_type(0, 0, 1);
|
||||
this->value[3] = col_type(0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -178,7 +159,7 @@ namespace glm
|
||||
this->value[3] = col_type(m[3]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x3<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -187,7 +168,7 @@ namespace glm
|
||||
this->value[3] = col_type(0);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x2<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
@ -223,53 +204,35 @@ namespace glm
|
||||
this->value[3] = col_type(0);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3<T, P>::size_type tmat4x3<T, P>::size() const
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::size_type i)
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::size_type i) const
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
# else
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3<T, P>::length_type tmat4x3<T, P>::length() const
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
// -- Unary updatable operators --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i)
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<T, P> const & m)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
this->value[2] = m[2];
|
||||
this->value[3] = m[3];
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Unary updatable operators
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
@ -348,6 +311,8 @@ namespace glm
|
||||
return *this;
|
||||
}
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator++()
|
||||
{
|
||||
@ -368,8 +333,41 @@ namespace glm
|
||||
return *this;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Binary operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator++(int)
|
||||
{
|
||||
tmat4x3<T, P> Result(*this);
|
||||
++*this;
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator--(int)
|
||||
{
|
||||
tmat4x3<T, P> Result(*this);
|
||||
--*this;
|
||||
return Result;
|
||||
}
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator-(tmat4x3<T, P> const & m)
|
||||
{
|
||||
return tmat4x3<T, P>(
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2],
|
||||
-m[3]);
|
||||
}
|
||||
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m, T const & s)
|
||||
@ -548,55 +546,7 @@ namespace glm
|
||||
s / m[3]);
|
||||
}
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator-(tmat4x3<T, P> const & m)
|
||||
{
|
||||
return tmat4x3<T, P>(
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2],
|
||||
-m[3]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator++(tmat4x3<T, P> const & m, int)
|
||||
{
|
||||
return tmat4x3<T, P>(
|
||||
m[0] + T(1),
|
||||
m[1] + T(1),
|
||||
m[2] + T(1),
|
||||
m[3] + T(1));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator--(tmat4x3<T, P> const & m, int)
|
||||
{
|
||||
return tmat4x3<T, P>(
|
||||
m[0] - T(1),
|
||||
m[1] - T(1),
|
||||
m[2] - T(1),
|
||||
m[3] - T(1));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator++(int)
|
||||
{
|
||||
tmat4x3<T, P> Result(*this);
|
||||
++*this;
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator--(int)
|
||||
{
|
||||
tmat4x3<T, P> Result(*this);
|
||||
--*this;
|
||||
return Result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat4x4.hpp
|
||||
/// @date 2005-01-27 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -49,19 +20,14 @@ namespace glm
|
||||
typedef tmat4x4<T, P> transpose_type;
|
||||
typedef T value_type;
|
||||
|
||||
template <typename U, precision Q>
|
||||
friend tvec4<U, Q> operator/(tmat4x4<U, Q> const & m, tvec4<U, Q> const & v);
|
||||
template <typename U, precision Q>
|
||||
friend tvec4<U, Q> operator/(tvec4<U, Q> const & v, tmat4x4<U, Q> const & m);
|
||||
|
||||
private:
|
||||
/// @cond DETAIL
|
||||
col_type value[4];
|
||||
/// @endcond
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
GLM_FUNC_DECL tmat4x4();
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL tmat4x4() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
|
||||
|
||||
@ -78,8 +44,7 @@ namespace glm
|
||||
col_type const & v2,
|
||||
col_type const & v3);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversions
|
||||
// -- Conversions --
|
||||
|
||||
template <
|
||||
typename X1, typename Y1, typename Z1, typename W1,
|
||||
@ -99,45 +64,31 @@ namespace glm
|
||||
tvec4<V3, P> const & v3,
|
||||
tvec4<V4, P> const & v4);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix conversions
|
||||
// -- Matrix conversions --
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tmat4x4(tmat4x4<U, Q> const & m);
|
||||
# else
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tmat4x4(tmat4x4<U, Q> const & m);
|
||||
# endif
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat4x4<U, Q> const & m);
|
||||
|
||||
GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x4(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x4(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x4(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x4(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x4(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x4(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL explicit tmat4x4(tmat4x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat2x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat3x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat2x3<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat3x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat2x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat4x2<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat3x4<T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat4x3<T, P> const & x);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 4;}
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
||||
# else
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<T, P> const & m) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<U, P> const & m);
|
||||
@ -158,8 +109,7 @@ namespace glm
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> & operator/=(tmat4x4<U, P> const & m);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tmat4x4<T, P> & operator++();
|
||||
GLM_FUNC_DECL tmat4x4<T, P> & operator--();
|
||||
@ -167,20 +117,29 @@ namespace glm
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator--(int);
|
||||
};
|
||||
|
||||
// Binary operators
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator+(T const & s, tmat4x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator-(T const & s, tmat4x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -217,14 +176,18 @@ namespace glm
|
||||
GLM_FUNC_DECL typename tmat4x4<T, P>::col_type operator/(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator/(typename tmat4x4<T, P>::col_type & v, tmat4x4<T, P> const & m);
|
||||
GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator/(typename tmat4x4<T, P>::col_type const & v, tmat4x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator/(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
|
||||
|
||||
// Unary constant operators
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> const operator-(tmat4x4<T, P> const & m);
|
||||
GLM_FUNC_DECL bool operator==(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@ -1,110 +1,35 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_mat4x4.inl
|
||||
/// @date 2005-01-27 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
#include "func_matrix.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> compute_inverse(tmat4x4<T, P> const & m)
|
||||
{
|
||||
T Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
|
||||
T Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3];
|
||||
T Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3];
|
||||
// -- Constructors --
|
||||
|
||||
T Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
|
||||
T Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3];
|
||||
T Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3];
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
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);
|
||||
this->value[3] = col_type(0, 0, 0, 1);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
T Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2];
|
||||
T Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2];
|
||||
T Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2];
|
||||
|
||||
T Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3];
|
||||
T Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3];
|
||||
T Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3];
|
||||
|
||||
T Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2];
|
||||
T Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2];
|
||||
T Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2];
|
||||
|
||||
T Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1];
|
||||
T Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1];
|
||||
T Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1];
|
||||
|
||||
tvec4<T, P> Fac0(Coef00, Coef00, Coef02, Coef03);
|
||||
tvec4<T, P> Fac1(Coef04, Coef04, Coef06, Coef07);
|
||||
tvec4<T, P> Fac2(Coef08, Coef08, Coef10, Coef11);
|
||||
tvec4<T, P> Fac3(Coef12, Coef12, Coef14, Coef15);
|
||||
tvec4<T, P> Fac4(Coef16, Coef16, Coef18, Coef19);
|
||||
tvec4<T, P> Fac5(Coef20, Coef20, Coef22, Coef23);
|
||||
|
||||
tvec4<T, P> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]);
|
||||
tvec4<T, P> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]);
|
||||
tvec4<T, P> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]);
|
||||
tvec4<T, P> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]);
|
||||
|
||||
tvec4<T, P> Inv0(Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);
|
||||
tvec4<T, P> Inv1(Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);
|
||||
tvec4<T, P> Inv2(Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);
|
||||
tvec4<T, P> Inv3(Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);
|
||||
|
||||
tvec4<T, P> SignA(+1, -1, +1, -1);
|
||||
tvec4<T, P> SignB(-1, +1, -1, +1);
|
||||
tmat4x4<T, P> Inverse(Inv0 * SignA, Inv1 * SignB, Inv2 * SignA, Inv3 * SignB);
|
||||
|
||||
tvec4<T, P> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);
|
||||
|
||||
tvec4<T, P> Dot0(m[0] * Row0);
|
||||
T Dot1 = (Dot0.x + Dot0.y) + (Dot0.z + Dot0.w);
|
||||
|
||||
T OneOverDeterminant = static_cast<T>(1) / Dot1;
|
||||
|
||||
return Inverse * OneOverDeterminant;
|
||||
}
|
||||
}//namespace detail
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Constructors
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4()
|
||||
{
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
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);
|
||||
this->value[3] = col_type(0, 0, 0, 1);
|
||||
# endif
|
||||
}
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, P> const & m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
this->value[2] = m[2];
|
||||
this->value[3] = m[3];
|
||||
}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <precision Q>
|
||||
@ -172,8 +97,8 @@ namespace detail
|
||||
this->value[3] = col_type(m[3]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion constructors
|
||||
// -- Conversions --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <
|
||||
typename X1, typename Y1, typename Z1, typename W1,
|
||||
@ -188,25 +113,25 @@ namespace detail
|
||||
X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X1>::is_iec559 || std::numeric_limits<X1>::is_integer, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y1>::is_iec559 || std::numeric_limits<Y1>::is_integer, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z1>::is_iec559 || std::numeric_limits<Z1>::is_integer, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W1>::is_iec559 || std::numeric_limits<W1>::is_integer, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X1>::is_iec559 || std::numeric_limits<X1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y1>::is_iec559 || std::numeric_limits<Y1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z1>::is_iec559 || std::numeric_limits<Z1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W1>::is_iec559 || std::numeric_limits<W1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
|
||||
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X2>::is_iec559 || std::numeric_limits<X2>::is_integer, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y2>::is_iec559 || std::numeric_limits<Y2>::is_integer, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z2>::is_iec559 || std::numeric_limits<Z2>::is_integer, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W2>::is_iec559 || std::numeric_limits<W2>::is_integer, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X2>::is_iec559 || std::numeric_limits<X2>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y2>::is_iec559 || std::numeric_limits<Y2>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z2>::is_iec559 || std::numeric_limits<Z2>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W2>::is_iec559 || std::numeric_limits<W2>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid.");
|
||||
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X3>::is_iec559 || std::numeric_limits<X3>::is_integer, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y3>::is_iec559 || std::numeric_limits<Y3>::is_integer, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z3>::is_iec559 || std::numeric_limits<Z3>::is_integer, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W3>::is_iec559 || std::numeric_limits<W3>::is_integer, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X3>::is_iec559 || std::numeric_limits<X3>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y3>::is_iec559 || std::numeric_limits<Y3>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z3>::is_iec559 || std::numeric_limits<Z3>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W3>::is_iec559 || std::numeric_limits<W3>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid.");
|
||||
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X4>::is_iec559 || std::numeric_limits<X4>::is_integer, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y4>::is_iec559 || std::numeric_limits<Y4>::is_integer, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z4>::is_iec559 || std::numeric_limits<Z4>::is_integer, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W4>::is_iec559 || std::numeric_limits<W4>::is_integer, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X4>::is_iec559 || std::numeric_limits<X4>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y4>::is_iec559 || std::numeric_limits<Y4>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z4>::is_iec559 || std::numeric_limits<Z4>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W4>::is_iec559 || std::numeric_limits<W4>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid.");
|
||||
|
||||
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1), value_type(w1));
|
||||
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2), value_type(w2));
|
||||
@ -224,10 +149,10 @@ namespace detail
|
||||
tvec4<V4, P> const & v4
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V1>::is_iec559 || std::numeric_limits<V1>::is_integer, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V2>::is_iec559 || std::numeric_limits<V2>::is_integer, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V3>::is_iec559 || std::numeric_limits<V3>::is_integer, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V4>::is_iec559 || std::numeric_limits<V4>::is_integer, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V1>::is_iec559 || std::numeric_limits<V1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V2>::is_iec559 || std::numeric_limits<V2>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V3>::is_iec559 || std::numeric_limits<V3>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V4>::is_iec559 || std::numeric_limits<V4>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
|
||||
|
||||
this->value[0] = col_type(v1);
|
||||
this->value[1] = col_type(v2);
|
||||
@ -235,14 +160,14 @@ namespace detail
|
||||
this->value[3] = col_type(v4);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Matrix convertion constructors
|
||||
// -- Matrix conversions --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x2<T, P> const & m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
this->value[2] = col_type(0);
|
||||
this->value[2] = col_type(0, 0, 1, 0);
|
||||
this->value[3] = col_type(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
@ -260,7 +185,7 @@ namespace detail
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
this->value[2] = col_type(0);
|
||||
this->value[2] = col_type(0, 0, 1, 0);
|
||||
this->value[3] = col_type(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
@ -269,7 +194,7 @@ namespace detail
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
this->value[2] = col_type(m[2], 0, 0);
|
||||
this->value[2] = col_type(m[2], 1, 0);
|
||||
this->value[3] = col_type(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
@ -278,7 +203,7 @@ namespace detail
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
this->value[2] = col_type(0);
|
||||
this->value[2] = col_type(0, 0, 1, 0);
|
||||
this->value[3] = col_type(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
@ -287,7 +212,7 @@ namespace detail
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
this->value[2] = col_type(0);
|
||||
this->value[2] = col_type(0, 0, 1, 0);
|
||||
this->value[3] = col_type(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
@ -309,53 +234,37 @@ namespace detail
|
||||
this->value[3] = col_type(m[3], 1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4<T, P>::size_type tmat4x4<T, P>::size() const
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::size_type i)
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::size_type i) const
|
||||
{
|
||||
assert(i < this->size());
|
||||
return this->value[i];
|
||||
}
|
||||
# else
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4<T, P>::length_type tmat4x4<T, P>::length() const
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i)
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<T, P> const & m)
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
//memcpy could be faster
|
||||
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
this->value[2] = m[2];
|
||||
this->value[3] = m[3];
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
}
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Operators
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
@ -447,9 +356,11 @@ namespace detail
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator/=(tmat4x4<U, P> const & m)
|
||||
{
|
||||
return (*this = *this * detail::compute_inverse<T, P>(m));
|
||||
return *this *= inverse(m);
|
||||
}
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator++()
|
||||
{
|
||||
@ -486,7 +397,26 @@ namespace detail
|
||||
return Result;
|
||||
}
|
||||
|
||||
// Binary operators
|
||||
// -- Unary constant operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(tmat4x4<T, P> const & m)
|
||||
{
|
||||
return tmat4x4<T, P>(
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2],
|
||||
-m[3]);
|
||||
}
|
||||
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m, T const & s)
|
||||
{
|
||||
@ -705,13 +635,13 @@ namespace detail
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type operator/(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v)
|
||||
{
|
||||
return detail::compute_inverse<T, P>(m) * v;
|
||||
return inverse(m) * v;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::row_type operator/(typename tmat4x4<T, P>::col_type const & v, tmat4x4<T, P> const & m)
|
||||
{
|
||||
return v * detail::compute_inverse<T, P>(m);
|
||||
return v * inverse(m);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -721,39 +651,7 @@ namespace detail
|
||||
return m1_copy /= m2;
|
||||
}
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator-(tmat4x4<T, P> const & m)
|
||||
{
|
||||
return tmat4x4<T, P>(
|
||||
-m[0],
|
||||
-m[1],
|
||||
-m[2],
|
||||
-m[3]);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator++(tmat4x4<T, P> const & m, int)
|
||||
{
|
||||
return tmat4x4<T, P>(
|
||||
m[0] + static_cast<T>(1),
|
||||
m[1] + static_cast<T>(1),
|
||||
m[2] + static_cast<T>(1),
|
||||
m[3] + static_cast<T>(1));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator--(tmat4x4<T, P> const & m, int)
|
||||
{
|
||||
return tmat4x4<T, P>(
|
||||
m[0] - static_cast<T>(1),
|
||||
m[1] - static_cast<T>(1),
|
||||
m[2] - static_cast<T>(1),
|
||||
m[3] - static_cast<T>(1));
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
|
||||
@ -767,3 +665,7 @@ namespace detail
|
||||
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
#if GLM_ARCH != GLM_ARCH_PURE
|
||||
# include "type_mat4x4_simd.inl"
|
||||
#endif
|
||||
|
||||
7
common/glm/glm/detail/type_mat4x4_simd.inl
Normal file
7
common/glm/glm/detail/type_mat4x4_simd.inl
Normal file
@ -0,0 +1,7 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/type_mat4x4_sse2.inl
|
||||
|
||||
namespace glm
|
||||
{
|
||||
|
||||
}//namespace glm
|
||||
@ -1,42 +1,106 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_vec.hpp
|
||||
/// @date 2010-01-26 / 2014-10-05
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "precision.hpp"
|
||||
#include "type_int.hpp"
|
||||
|
||||
namespace glm
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T, std::size_t size, bool aligned>
|
||||
struct storage
|
||||
{
|
||||
typedef struct type {
|
||||
uint8 data[size];
|
||||
} type;
|
||||
};
|
||||
|
||||
#define GLM_ALIGNED_STORAGE_TYPE_STRUCT(x) \
|
||||
template <typename T> \
|
||||
struct storage<T, x, true> { \
|
||||
GLM_ALIGNED_STRUCT(x) type { \
|
||||
uint8 data[x]; \
|
||||
}; \
|
||||
};
|
||||
|
||||
GLM_ALIGNED_STORAGE_TYPE_STRUCT(1)
|
||||
GLM_ALIGNED_STORAGE_TYPE_STRUCT(2)
|
||||
GLM_ALIGNED_STORAGE_TYPE_STRUCT(4)
|
||||
GLM_ALIGNED_STORAGE_TYPE_STRUCT(8)
|
||||
GLM_ALIGNED_STORAGE_TYPE_STRUCT(16)
|
||||
GLM_ALIGNED_STORAGE_TYPE_STRUCT(32)
|
||||
GLM_ALIGNED_STORAGE_TYPE_STRUCT(64)
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
template <>
|
||||
struct storage<float, 16, true>
|
||||
{
|
||||
typedef glm_vec4 type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct storage<int, 16, true>
|
||||
{
|
||||
typedef glm_ivec4 type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct storage<unsigned int, 16, true>
|
||||
{
|
||||
typedef glm_uvec4 type;
|
||||
};
|
||||
/*
|
||||
# else
|
||||
typedef union __declspec(align(16)) glm_128
|
||||
{
|
||||
unsigned __int8 data[16];
|
||||
} glm_128;
|
||||
|
||||
template <>
|
||||
struct storage<float, 16, true>
|
||||
{
|
||||
typedef glm_128 type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct storage<int, 16, true>
|
||||
{
|
||||
typedef glm_128 type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct storage<unsigned int, 16, true>
|
||||
{
|
||||
typedef glm_128 type;
|
||||
};
|
||||
*/
|
||||
# endif
|
||||
|
||||
# if (GLM_ARCH & GLM_ARCH_AVX_BIT)
|
||||
template <>
|
||||
struct storage<double, 32, true>
|
||||
{
|
||||
typedef glm_dvec4 type;
|
||||
};
|
||||
# endif
|
||||
|
||||
# if (GLM_ARCH & GLM_ARCH_AVX2_BIT)
|
||||
template <>
|
||||
struct storage<int64, 32, true>
|
||||
{
|
||||
typedef glm_i64vec4 type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct storage<uint64, 32, true>
|
||||
{
|
||||
typedef glm_u64vec4 type;
|
||||
};
|
||||
# endif
|
||||
}//namespace detail
|
||||
|
||||
template <typename T, precision P> struct tvec1;
|
||||
template <typename T, precision P> struct tvec2;
|
||||
template <typename T, precision P> struct tvec3;
|
||||
@ -168,7 +232,6 @@ namespace glm
|
||||
|
||||
/// @}
|
||||
|
||||
|
||||
/// @addtogroup core_precision
|
||||
/// @{
|
||||
|
||||
@ -374,8 +437,7 @@ namespace glm
|
||||
/// @addtogroup core_types
|
||||
/// @{
|
||||
|
||||
//////////////////////////
|
||||
// Default float definition
|
||||
// -- Default float definition --
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef lowp_vec2 vec2;
|
||||
@ -402,8 +464,7 @@ namespace glm
|
||||
typedef highp_vec4 vec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
//////////////////////////
|
||||
// Default double definition
|
||||
// -- Default double definition --
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_DOUBLE))
|
||||
typedef lowp_dvec2 dvec2;
|
||||
@ -418,21 +479,20 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_dvec2 dvec2;
|
||||
|
||||
|
||||
//! 3 components vector of double-precision floating-point numbers.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_dvec3 dvec3;
|
||||
|
||||
|
||||
//! 4 components vector of double-precision floating-point numbers.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_dvec4 dvec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
//////////////////////////
|
||||
// Signed integer definition
|
||||
|
||||
|
||||
// -- Signed integer definition --
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef lowp_ivec2 ivec2;
|
||||
typedef lowp_ivec3 ivec3;
|
||||
@ -442,25 +502,24 @@ namespace glm
|
||||
typedef mediump_ivec3 ivec3;
|
||||
typedef mediump_ivec4 ivec4;
|
||||
#else //defined(GLM_PRECISION_HIGHP_INT)
|
||||
//! 2 components vector of signed integer numbers.
|
||||
/// 2 components vector of signed integer numbers.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_ivec2 ivec2;
|
||||
|
||||
//! 3 components vector of signed integer numbers.
|
||||
|
||||
/// 3 components vector of signed integer numbers.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_ivec3 ivec3;
|
||||
|
||||
//! 4 components vector of signed integer numbers.
|
||||
|
||||
/// 4 components vector of signed integer numbers.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_ivec4 ivec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
//////////////////////////
|
||||
// Unsigned integer definition
|
||||
|
||||
|
||||
// -- Unsigned integer definition --
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef lowp_uvec2 uvec2;
|
||||
typedef lowp_uvec3 uvec3;
|
||||
@ -474,20 +533,19 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_uvec2 uvec2;
|
||||
|
||||
|
||||
/// 3 components vector of unsigned integer numbers.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_uvec3 uvec3;
|
||||
|
||||
|
||||
/// 4 components vector of unsigned integer numbers.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_uvec4 uvec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
//////////////////////////
|
||||
// Boolean definition
|
||||
|
||||
// -- Boolean definition --
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_BOOL))
|
||||
typedef lowp_bvec2 bvec2;
|
||||
@ -498,21 +556,21 @@ namespace glm
|
||||
typedef mediump_bvec3 bvec3;
|
||||
typedef mediump_bvec4 bvec4;
|
||||
#else //defined(GLM_PRECISION_HIGHP_BOOL)
|
||||
//! 2 components vector of boolean.
|
||||
/// 2 components vector of boolean.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_bvec2 bvec2;
|
||||
|
||||
//! 3 components vector of boolean.
|
||||
|
||||
/// 3 components vector of boolean.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_bvec3 bvec3;
|
||||
|
||||
//! 4 components vector of boolean.
|
||||
|
||||
/// 4 components vector of boolean.
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
|
||||
typedef highp_bvec4 bvec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
@ -1,31 +1,2 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_vec.inl
|
||||
/// @date 2011-06-15 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -1,41 +1,12 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_vec1.hpp
|
||||
/// @date 2008-08-25 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../fwd.hpp"
|
||||
#include "type_vec.hpp"
|
||||
#ifdef GLM_SWIZZLE
|
||||
# if GLM_HAS_ANONYMOUS_UNION
|
||||
#if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "_swizzle.hpp"
|
||||
# else
|
||||
# include "_swizzle_func.hpp"
|
||||
@ -48,24 +19,35 @@ namespace glm
|
||||
template <typename T, precision P = defaultp>
|
||||
struct tvec1
|
||||
{
|
||||
//////////////////////////////////////
|
||||
// Implementation detail
|
||||
// -- Implementation detail --
|
||||
|
||||
typedef T value_type;
|
||||
typedef tvec1<T, P> type;
|
||||
typedef tvec1<bool, P> bool_type;
|
||||
typedef T value_type;
|
||||
|
||||
//////////////////////////////////////
|
||||
// Data
|
||||
// -- Data --
|
||||
|
||||
# if GLM_HAS_ANONYMOUS_UNION
|
||||
# if GLM_HAS_ONLY_XYZW
|
||||
T x;
|
||||
|
||||
# elif GLM_HAS_ALIGNED_TYPE
|
||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||
# endif
|
||||
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||
# endif
|
||||
|
||||
union
|
||||
{
|
||||
T x;
|
||||
T r;
|
||||
T s;
|
||||
/*
|
||||
# ifdef GLM_SWIZZLE
|
||||
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
_GLM_SWIZZLE1_2_MEMBERS(T, P, tvec2, x)
|
||||
_GLM_SWIZZLE1_2_MEMBERS(T, P, tvec2, r)
|
||||
_GLM_SWIZZLE1_2_MEMBERS(T, P, tvec2, s)
|
||||
@ -77,178 +59,230 @@ namespace glm
|
||||
_GLM_SWIZZLE1_4_MEMBERS(T, P, tvec4, s)
|
||||
# endif//GLM_SWIZZLE*/
|
||||
};
|
||||
|
||||
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic pop
|
||||
# endif
|
||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic pop
|
||||
# endif
|
||||
# else
|
||||
union {T x, r, s;};
|
||||
/*
|
||||
# ifdef GLM_SWIZZLE
|
||||
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC1(T, P, tvec2, tvec2, tvec3, tvec4)
|
||||
# endif//GLM_SWIZZLE*/
|
||||
# endif
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
// -- Component accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
/// Return the count of components of the vector
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
|
||||
/// Return the count of components of the vector
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 1;}
|
||||
|
||||
GLM_FUNC_DECL T & operator[](size_type i);
|
||||
GLM_FUNC_DECL T const & operator[](size_type i) const;
|
||||
# else
|
||||
/// Return the count of components of the vector
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Implicit basic constructors
|
||||
|
||||
GLM_FUNC_DECL tvec1();
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec1() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec1(tvec1<T, P> const & v) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tvec1(tvec1<T, Q> const & v);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec1(tvec1<T, Q> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Explicit basic constructors
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL explicit tvec1(ctor);
|
||||
GLM_FUNC_DECL explicit tvec1(T const & s);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec1(ctor);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec1(T scalar);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion vector constructors
|
||||
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
// -- Conversion vector constructors --
|
||||
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec1(tvec2<U, Q> const & v);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec1(tvec2<U, Q> const & v);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec1(tvec3<U, Q> const & v);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec1(tvec3<U, Q> const & v);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec1(tvec4<U, Q> const & v);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec1(tvec4<U, Q> const & v);
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec1(tvec1<U, Q> const & v);
|
||||
# else
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tvec1(tvec1<U, Q> const & v);
|
||||
# endif
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec1(tvec1<U, Q> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Swizzle constructors
|
||||
|
||||
# if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
|
||||
// -- Swizzle constructors --
|
||||
/*
|
||||
# if(GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED))
|
||||
template <int E0>
|
||||
GLM_FUNC_DECL tvec1(detail::_swizzle<1, T, P, tvec1<T, P>, E0, -1,-2,-3> const & that)
|
||||
GLM_FUNC_DECL tvec1(detail::_swizzle<1, T, P, tvec1, E0, -1,-2,-3> const & that)
|
||||
{
|
||||
*this = that();
|
||||
}
|
||||
# endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
|
||||
# endif//(GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED))
|
||||
*/
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<T, P> const & v) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator+=(U const & s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator+=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator+=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator-=(U const & s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator-=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator-=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator*=(U const & s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator*=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator*=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator/=(U const & s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator/=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator/=(tvec1<U, P> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator++();
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator--();
|
||||
GLM_FUNC_DECL tvec1<T, P> operator++(int);
|
||||
GLM_FUNC_DECL tvec1<T, P> operator--(int);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary bit operators
|
||||
// -- Unary bit operators --
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator%=(U const & s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator%=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator%=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator&=(U const & s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator&=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator&=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator|=(U const & s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator|=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator|=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator^=(U const & s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator^=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator^=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator<<=(U const & s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator<<=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator<<=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator>>=(U const & s);
|
||||
template <typename U>
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator>>=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec1<T, P> & operator>>=(tvec1<U, P> const & v);
|
||||
};
|
||||
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator+(T const & s, tvec1<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator+(T scalar, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator-(T const & s, tvec1<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec1<T, P> operator-(T scalar, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator- (tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator*(T const & s, tvec1<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec1<T, P> operator*(T scalar, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator/(T const & s, tvec1<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec1<T, P> operator/(T scalar, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator%(T scalar, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator&(T scalar, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator|(T scalar, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator^(T scalar, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator<<(T scalar, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator>>(T scalar, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator~(tvec1<T, P> const & v);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator==(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
@ -256,62 +290,11 @@ namespace glm
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v, T const & s);
|
||||
template <precision P>
|
||||
GLM_FUNC_DECL tvec1<bool, P> operator&&(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator%(T const & s, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator&(T const & s, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator|(T const & s, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator^(T const & s, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator<<(T const & s, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v, T const & s);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator>>(T const & s, tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator~(tvec1<T, P> const & v);
|
||||
template <precision P>
|
||||
GLM_FUNC_DECL tvec1<bool, P> operator||(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@ -1,139 +1,95 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_vec1.inl
|
||||
/// @date 2008-08-25 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm
|
||||
{
|
||||
//////////////////////////////////////
|
||||
// Implicit basic constructors
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: x(0)
|
||||
# endif
|
||||
{}
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: x(0)
|
||||
# endif
|
||||
{}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec1<T, P> const & v)
|
||||
: x(v.x)
|
||||
{}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<T, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec1<T, Q> const & v)
|
||||
: x(v.x)
|
||||
{}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Explicit basic constructors
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(ctor)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(ctor)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(T const & s)
|
||||
: x(s)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(T scalar)
|
||||
: x(scalar)
|
||||
{}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion vector constructors
|
||||
// -- Conversion vector constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<U, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec1<U, Q> const & v)
|
||||
: x(static_cast<T>(v.x))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec2<U, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec2<U, Q> const & v)
|
||||
: x(static_cast<T>(v.x))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec3<U, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec3<U, Q> const & v)
|
||||
: x(static_cast<T>(v.x))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec4<U, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec4<U, Q> const & v)
|
||||
: x(static_cast<T>(v.x))
|
||||
{}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Component accesses
|
||||
// -- Component accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec1<T, P>::size_type tvec1<T, P>::size() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T & tvec1<T, P>::operator[](typename tvec1<T, P>::length_type i)
|
||||
{
|
||||
assert(i >= 0 && i < this->length());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T & tvec1<T, P>::operator[](typename tvec1<T, P>::size_type i)
|
||||
{
|
||||
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
|
||||
return (&x)[i];
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T const & tvec1<T, P>::operator[](typename tvec1<T, P>::length_type i) const
|
||||
{
|
||||
assert(i >= 0 && i < this->length());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T const & tvec1<T, P>::operator[](typename tvec1<T, P>::size_type i) const
|
||||
{
|
||||
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
|
||||
return (&x)[i];
|
||||
}
|
||||
# else
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec1<T, P>::length_type tvec1<T, P>::length() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T & tvec1<T, P>::operator[](typename tvec1<T, P>::length_type i)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=(tvec1<T, P> const & v)
|
||||
{
|
||||
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
|
||||
return (&x)[i];
|
||||
this->x = v.x;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T const & tvec1<T, P>::operator[](typename tvec1<T, P>::length_type i) const
|
||||
{
|
||||
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
|
||||
return (&x)[i];
|
||||
}
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
@ -145,9 +101,9 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator+=(U const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator+=(U scalar)
|
||||
{
|
||||
this->x += static_cast<T>(s);
|
||||
this->x += static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -161,9 +117,9 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator-=(U const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator-=(U scalar)
|
||||
{
|
||||
this->x -= static_cast<T>(s);
|
||||
this->x -= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -177,9 +133,9 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator*=(U const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator*=(U scalar)
|
||||
{
|
||||
this->x *= static_cast<T>(s);
|
||||
this->x *= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -193,9 +149,9 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator/=(U const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator/=(U scalar)
|
||||
{
|
||||
this->x /= static_cast<T>(s);
|
||||
this->x /= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -207,8 +163,7 @@ namespace glm
|
||||
return *this;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator++()
|
||||
@ -240,29 +195,13 @@ namespace glm
|
||||
return Result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
|
||||
{
|
||||
return (v1.x == v2.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
|
||||
{
|
||||
return (v1.x != v2.x);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary bit operators
|
||||
// -- Unary bit operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator%=(U const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator%=(U scalar)
|
||||
{
|
||||
this->x %= static_cast<T>(s);
|
||||
this->x %= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -276,9 +215,9 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator&=(U const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator&=(U scalar)
|
||||
{
|
||||
this->x &= static_cast<T>(s);
|
||||
this->x &= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -292,9 +231,9 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator|=(U const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator|=(U scalar)
|
||||
{
|
||||
this->x |= static_cast<T>(s);
|
||||
this->x |= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -308,9 +247,9 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator^=(U const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator^=(U scalar)
|
||||
{
|
||||
this->x ^= static_cast<T>(s);
|
||||
this->x ^= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -324,9 +263,9 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator<<=(U const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator<<=(U scalar)
|
||||
{
|
||||
this->x <<= static_cast<T>(s);
|
||||
this->x <<= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -340,9 +279,9 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator>>=(U const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator>>=(U scalar)
|
||||
{
|
||||
this->x >>= static_cast<T>(s);
|
||||
this->x >>= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -354,21 +293,35 @@ namespace glm
|
||||
return *this;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Binary arithmetic operators
|
||||
// -- Unary constant operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(tvec1<T, P> const & v, T const & s)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(tvec1<T, P> const & v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x + s);
|
||||
-v.x);
|
||||
}
|
||||
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(tvec1<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x + scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(T const & s, tvec1<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(T scalar, tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
s + v.x);
|
||||
scalar + v.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -380,17 +333,17 @@ namespace glm
|
||||
|
||||
//operator-
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x - s);
|
||||
v.x - scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(T const & s, tvec1<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(T scalar, tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
s - v.x);
|
||||
scalar - v.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -400,19 +353,18 @@ namespace glm
|
||||
v1.x - v2.x);
|
||||
}
|
||||
|
||||
//operator*
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator*(tvec1<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator*(tvec1<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x * s);
|
||||
v.x * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator*(T const & s, tvec1<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator*(T scalar, tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
s * v.x);
|
||||
scalar * v.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -422,19 +374,18 @@ namespace glm
|
||||
v1.x * v2.x);
|
||||
}
|
||||
|
||||
//operator/
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator/(tvec1<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator/(tvec1<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x / s);
|
||||
v.x / scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator/(T const & s, tvec1<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator/(T scalar, tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
s / v.x);
|
||||
scalar / v.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -444,43 +395,20 @@ namespace glm
|
||||
v1.x / v2.x);
|
||||
}
|
||||
|
||||
// Unary constant operators
|
||||
// -- Binary bit operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator%(tvec1<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
-v.x);
|
||||
v.x % scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator++(tvec1<T, P> const & v, int)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator%(T scalar, tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x + T(1));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator--(tvec1<T, P> const & v, int)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x - T(1));
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Binary bit operators
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator%(tvec1<T, P> const & v, T const & s)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x % s);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator%(T const & s, tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
s % v.x);
|
||||
scalar % v.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -491,17 +419,17 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator&(tvec1<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator&(tvec1<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x & s);
|
||||
v.x & scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator&(T const & s, tvec1<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator&(T scalar, tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
s & v.x);
|
||||
scalar & v.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -512,17 +440,17 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator|(tvec1<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator|(tvec1<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x | s);
|
||||
v.x | scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator|(T const & s, tvec1<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator|(T scalar, tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
s | v.x);
|
||||
scalar | v.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -533,17 +461,17 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator^(tvec1<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator^(tvec1<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x ^ s);
|
||||
v.x ^ scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator^(T const & s, tvec1<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator^(T scalar, tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
s ^ v.x);
|
||||
scalar ^ v.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -554,17 +482,17 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(tvec1<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(tvec1<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x << s);
|
||||
v.x << scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(T const & s, tvec1<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(T scalar, tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
s << v.x);
|
||||
scalar << v.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -575,17 +503,17 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(tvec1<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(tvec1<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
v.x >> s);
|
||||
v.x >> scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(T const & s, tvec1<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(T scalar, tvec1<T, P> const & v)
|
||||
{
|
||||
return tvec1<T, P>(
|
||||
s >> v.x);
|
||||
scalar >> v.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -601,4 +529,30 @@ namespace glm
|
||||
return tvec1<T, P>(
|
||||
~v.x);
|
||||
}
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
|
||||
{
|
||||
return (v1.x == v2.x);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
|
||||
{
|
||||
return (v1.x != v2.x);
|
||||
}
|
||||
|
||||
template <precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<bool, P> operator&&(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2)
|
||||
{
|
||||
return tvec1<bool, P>(v1.x && v2.x);
|
||||
}
|
||||
|
||||
template <precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<bool, P> operator||(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2)
|
||||
{
|
||||
return tvec1<bool, P>(v1.x || v2.x);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
@ -1,41 +1,11 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_vec2.hpp
|
||||
/// @date 2008-08-18 / 2013-08-27
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
//#include "../fwd.hpp"
|
||||
#include "type_vec.hpp"
|
||||
#ifdef GLM_SWIZZLE
|
||||
# if GLM_HAS_ANONYMOUS_UNION
|
||||
#if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "_swizzle.hpp"
|
||||
# else
|
||||
# include "_swizzle_func.hpp"
|
||||
@ -48,204 +18,211 @@ namespace glm
|
||||
template <typename T, precision P = defaultp>
|
||||
struct tvec2
|
||||
{
|
||||
//////////////////////////////////////
|
||||
// Implementation detail
|
||||
// -- Implementation detail --
|
||||
|
||||
typedef T value_type;
|
||||
typedef tvec2<T, P> type;
|
||||
typedef tvec2<bool, P> bool_type;
|
||||
typedef T value_type;
|
||||
|
||||
//////////////////////////////////////
|
||||
// Data
|
||||
// -- Data --
|
||||
|
||||
# if GLM_HAS_ANONYMOUS_UNION
|
||||
# if GLM_HAS_ONLY_XYZW
|
||||
T x, y;
|
||||
|
||||
# elif GLM_HAS_ALIGNED_TYPE
|
||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||
# endif
|
||||
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||
# endif
|
||||
|
||||
union
|
||||
{
|
||||
struct{ T x, y; };
|
||||
struct{ T r, g; };
|
||||
struct{ T s, t; };
|
||||
|
||||
# ifdef GLM_SWIZZLE
|
||||
_GLM_SWIZZLE2_2_MEMBERS(T, P, tvec2, x, y)
|
||||
_GLM_SWIZZLE2_2_MEMBERS(T, P, tvec2, r, g)
|
||||
_GLM_SWIZZLE2_2_MEMBERS(T, P, tvec2, s, t)
|
||||
_GLM_SWIZZLE2_3_MEMBERS(T, P, tvec3, x, y)
|
||||
_GLM_SWIZZLE2_3_MEMBERS(T, P, tvec3, r, g)
|
||||
_GLM_SWIZZLE2_3_MEMBERS(T, P, tvec3, s, t)
|
||||
_GLM_SWIZZLE2_4_MEMBERS(T, P, tvec4, x, y)
|
||||
_GLM_SWIZZLE2_4_MEMBERS(T, P, tvec4, r, g)
|
||||
_GLM_SWIZZLE2_4_MEMBERS(T, P, tvec4, s, t)
|
||||
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
_GLM_SWIZZLE2_2_MEMBERS(T, P, glm::tvec2, x, y)
|
||||
_GLM_SWIZZLE2_2_MEMBERS(T, P, glm::tvec2, r, g)
|
||||
_GLM_SWIZZLE2_2_MEMBERS(T, P, glm::tvec2, s, t)
|
||||
_GLM_SWIZZLE2_3_MEMBERS(T, P, glm::tvec3, x, y)
|
||||
_GLM_SWIZZLE2_3_MEMBERS(T, P, glm::tvec3, r, g)
|
||||
_GLM_SWIZZLE2_3_MEMBERS(T, P, glm::tvec3, s, t)
|
||||
_GLM_SWIZZLE2_4_MEMBERS(T, P, glm::tvec4, x, y)
|
||||
_GLM_SWIZZLE2_4_MEMBERS(T, P, glm::tvec4, r, g)
|
||||
_GLM_SWIZZLE2_4_MEMBERS(T, P, glm::tvec4, s, t)
|
||||
# endif//GLM_SWIZZLE
|
||||
|
||||
};
|
||||
|
||||
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic pop
|
||||
# endif
|
||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic pop
|
||||
# endif
|
||||
# else
|
||||
union {T x, r, s;};
|
||||
union {T y, g, t;};
|
||||
|
||||
# ifdef GLM_SWIZZLE
|
||||
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, P, tvec2, tvec2, tvec3, tvec4)
|
||||
# endif//GLM_SWIZZLE
|
||||
# endif
|
||||
|
||||
//////////////////////////////////////
|
||||
// Component accesses
|
||||
// -- Component accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
/// Return the count of components of the vector
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
|
||||
/// Return the count of components of the vector
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 2;}
|
||||
|
||||
GLM_FUNC_DECL T & operator[](size_type i);
|
||||
GLM_FUNC_DECL T const & operator[](size_type i) const;
|
||||
# else
|
||||
/// Return the count of components of the vector
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Implicit basic constructors
|
||||
|
||||
GLM_FUNC_DECL tvec2();
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2(tvec2<T, P> const& v) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tvec2(tvec2<T, Q> const & v);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2(tvec2<T, Q> const& v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Explicit basic constructors
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL explicit tvec2(ctor);
|
||||
GLM_FUNC_DECL explicit tvec2(T const & s);
|
||||
GLM_FUNC_DECL tvec2(T const & s1, T const & s2);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec2(ctor);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec2(T scalar);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2(T s1, T s2);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion constructors
|
||||
// -- Conversion constructors --
|
||||
|
||||
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B>
|
||||
GLM_FUNC_DECL tvec2(A const & x, B const & y);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2(A x, B y);
|
||||
template <typename A, typename B>
|
||||
GLM_FUNC_DECL tvec2(tvec1<A, P> const & v1, tvec1<B, P> const & v2);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2(tvec1<A, P> const & v1, tvec1<B, P> const & v2);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion vector constructors
|
||||
// -- Conversion vector constructors --
|
||||
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec2(tvec3<U, Q> const & v);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec2(tvec3<U, Q> const & v);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec2(tvec4<U, Q> const & v);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec2(tvec4<U, Q> const & v);
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec2(tvec2<U, Q> const & v);
|
||||
# else
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tvec2(tvec2<U, Q> const & v);
|
||||
# endif
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec2(tvec2<U, Q> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Swizzle constructors
|
||||
|
||||
# if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
// -- Swizzle constructors --
|
||||
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
|
||||
template <int E0, int E1>
|
||||
GLM_FUNC_DECL tvec2(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1,-1,-2> const & that)
|
||||
GLM_FUNC_DECL tvec2(detail::_swizzle<2, T, P, glm::tvec2, E0, E1,-1,-2> const& that)
|
||||
{
|
||||
*this = that();
|
||||
}
|
||||
# endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
# endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator=(tvec2<T, P> const & v) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator=(tvec2<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator=(tvec2<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator+=(U s);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator+=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator+=(tvec1<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator+=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator+=(tvec2<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator+=(tvec2<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator-=(U s);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator-=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator-=(tvec1<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator-=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator-=(tvec2<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator-=(tvec2<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator*=(U s);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator*=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator*=(tvec1<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator*=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator*=(tvec2<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator*=(tvec2<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator/=(U s);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator/=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator/=(tvec1<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator/=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator/=(tvec2<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P>& operator/=(tvec2<U, P> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator++();
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator--();
|
||||
GLM_FUNC_DECL tvec2<T, P> operator++(int);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator--(int);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary bit operators
|
||||
// -- Unary bit operators --
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator%= (U s);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator%=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator%= (tvec1<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator%=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator%= (tvec2<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator%=(tvec2<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator&= (U s);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator&=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator&= (tvec1<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator&=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator&= (tvec2<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator&=(tvec2<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator|= (U s);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator|=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator|= (tvec1<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator|=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator|= (tvec2<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator|=(tvec2<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator^= (U s);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator^=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator^= (tvec1<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator^=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator^= (tvec2<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator^=(tvec2<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator<<=(U s);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator<<=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator<<=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator<<=(tvec2<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator>>=(U s);
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator>>=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator>>=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec2<T, P> & operator>>=(tvec2<U, P> const & v);
|
||||
};
|
||||
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator+(T const & s, tvec2<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator+(T scalar, tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator+(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
@ -254,13 +231,13 @@ namespace glm
|
||||
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator-(T const & s, tvec2<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator-(T scalar, tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator-(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
@ -269,13 +246,13 @@ namespace glm
|
||||
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator*(T const & s, tvec2<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator*(T scalar, tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator*(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
@ -284,13 +261,13 @@ namespace glm
|
||||
GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator/(T const & s, tvec2<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator/(T scalar, tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator/(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
@ -299,16 +276,13 @@ namespace glm
|
||||
GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator%(T const & s, tvec2<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator%(T scalar, tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator%(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
@ -317,13 +291,13 @@ namespace glm
|
||||
GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator&(T const & s, tvec2<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator&(T scalar, tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator&(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
@ -332,13 +306,13 @@ namespace glm
|
||||
GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator|(T const & s, tvec2<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator|(T scalar, tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator|(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
@ -347,13 +321,13 @@ namespace glm
|
||||
GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator^(T const & s, tvec2<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator^(T scalar, tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator^(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
@ -362,13 +336,13 @@ namespace glm
|
||||
GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator<<(T const & s, tvec2<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator<<(T scalar, tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator<<(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
@ -377,13 +351,13 @@ namespace glm
|
||||
GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator>>(T const & s, tvec2<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec2<T, P> operator>>(T scalar, tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator>>(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
@ -393,6 +367,20 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator~(tvec2<T, P> const & v);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator==(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
|
||||
|
||||
template <precision P>
|
||||
GLM_FUNC_DECL tvec2<bool, P> operator&&(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2);
|
||||
|
||||
template <precision P>
|
||||
GLM_FUNC_DECL tvec2<bool, P> operator||(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@ -1,158 +1,127 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_tvec2.inl
|
||||
/// @date 2008-08-18 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// @file glm/core/type_tvec2.inl
|
||||
|
||||
namespace glm
|
||||
{
|
||||
//////////////////////////////////////
|
||||
// Implicit basic constructors
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
template <typename T, precision P>
|
||||
const tvec2<T, P> tvec2<T, P>::ZERO(static_cast<T>(0), static_cast<T>(0));
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: x(0), y(0)
|
||||
# endif
|
||||
{}
|
||||
const tvec2<T, P> tvec2<T, P>::X(static_cast<T>(1), static_cast<T>(0));
|
||||
|
||||
template <typename T, precision P>
|
||||
const tvec2<T, P> tvec2<T, P>::Y(static_cast<T>(0), static_cast<T>(1));
|
||||
|
||||
template <typename T, precision P>
|
||||
const tvec2<T, P> tvec2<T, P>::XY(static_cast<T>(1), static_cast<T>(1));
|
||||
# endif
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: x(0), y(0)
|
||||
# endif
|
||||
{}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec2<T, P> const & v)
|
||||
: x(v.x), y(v.y)
|
||||
{}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec2<T, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec2<T, Q> const & v)
|
||||
: x(v.x), y(v.y)
|
||||
{}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Explicit basic constructors
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(ctor)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(ctor)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(T const & s)
|
||||
: x(s), y(s)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(T scalar)
|
||||
: x(scalar), y(scalar)
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(T const & a, T const & b)
|
||||
: x(a), y(b)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(T s1, T s2)
|
||||
: x(s1), y(s2)
|
||||
{}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion scalar constructors
|
||||
// -- Conversion scalar constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename A, typename B>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(A const & a, B const & b)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(A a, B b)
|
||||
: x(static_cast<T>(a))
|
||||
, y(static_cast<T>(b))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename A, typename B>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec1<A, P> const & a, tvec1<B, P> const & b)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec1<A, P> const & a, tvec1<B, P> const & b)
|
||||
: x(static_cast<T>(a.x))
|
||||
, y(static_cast<T>(b.x))
|
||||
{}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion vector constructors
|
||||
// -- Conversion vector constructors --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec2<U, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec2<U, Q> const & v)
|
||||
: x(static_cast<T>(v.x))
|
||||
, y(static_cast<T>(v.y))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec3<U, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec3<U, Q> const & v)
|
||||
: x(static_cast<T>(v.x))
|
||||
, y(static_cast<T>(v.y))
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec4<U, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec4<U, Q> const & v)
|
||||
: x(static_cast<T>(v.x))
|
||||
, y(static_cast<T>(v.y))
|
||||
{}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Component accesses
|
||||
// -- Component accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec2<T, P>::size_type tvec2<T, P>::size() const
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T & tvec2<T, P>::operator[](typename tvec2<T, P>::length_type i)
|
||||
{
|
||||
assert(i >= 0 && i < this->length());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T & tvec2<T, P>::operator[](typename tvec2<T, P>::size_type i)
|
||||
{
|
||||
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
|
||||
return (&x)[i];
|
||||
}
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T const & tvec2<T, P>::operator[](typename tvec2<T, P>::length_type i) const
|
||||
{
|
||||
assert(i >= 0 && i < this->length());
|
||||
return (&x)[i];
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T const & tvec2<T, P>::operator[](typename tvec2<T, P>::size_type i) const
|
||||
{
|
||||
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
|
||||
return (&x)[i];
|
||||
}
|
||||
# else
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec2<T, P>::length_type tvec2<T, P>::length() const
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T & tvec2<T, P>::operator[](typename tvec2<T, P>::length_type i)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator=(tvec2<T, P> const & v)
|
||||
{
|
||||
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
|
||||
return (&x)[i];
|
||||
this->x = v.x;
|
||||
this->y = v.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T const & tvec2<T, P>::operator[](typename tvec2<T, P>::length_type i) const
|
||||
{
|
||||
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
|
||||
return (&x)[i];
|
||||
}
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
@ -165,10 +134,10 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator+=(U s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator+=(U scalar)
|
||||
{
|
||||
this->x += static_cast<T>(s);
|
||||
this->y += static_cast<T>(s);
|
||||
this->x += static_cast<T>(scalar);
|
||||
this->y += static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -192,10 +161,10 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator-=(U s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator-=(U scalar)
|
||||
{
|
||||
this->x -= static_cast<T>(s);
|
||||
this->y -= static_cast<T>(s);
|
||||
this->x -= static_cast<T>(scalar);
|
||||
this->y -= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -219,10 +188,10 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator*=(U s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator*=(U scalar)
|
||||
{
|
||||
this->x *= static_cast<T>(s);
|
||||
this->y *= static_cast<T>(s);
|
||||
this->x *= static_cast<T>(scalar);
|
||||
this->y *= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -246,10 +215,10 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator/=(U s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator/=(U scalar)
|
||||
{
|
||||
this->x /= static_cast<T>(s);
|
||||
this->y /= static_cast<T>(s);
|
||||
this->x /= static_cast<T>(scalar);
|
||||
this->y /= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -271,8 +240,7 @@ namespace glm
|
||||
return *this;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator++()
|
||||
@ -306,30 +274,14 @@ namespace glm
|
||||
return Result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Boolean operators
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tvec2<T, P> const & v1, tvec2<T, P> const & v2)
|
||||
{
|
||||
return (v1.x == v2.x) && (v1.y == v2.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(tvec2<T, P> const & v1, tvec2<T, P> const & v2)
|
||||
{
|
||||
return (v1.x != v2.x) || (v1.y != v2.y);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary bit operators
|
||||
// -- Unary bit operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator%=(U s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator%=(U scalar)
|
||||
{
|
||||
this->x %= static_cast<T>(s);
|
||||
this->y %= static_cast<T>(s);
|
||||
this->x %= static_cast<T>(scalar);
|
||||
this->y %= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -353,10 +305,10 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator&=(U s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator&=(U scalar)
|
||||
{
|
||||
this->x &= static_cast<T>(s);
|
||||
this->y &= static_cast<T>(s);
|
||||
this->x &= static_cast<T>(scalar);
|
||||
this->y &= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -380,10 +332,10 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator|=(U s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator|=(U scalar)
|
||||
{
|
||||
this->x |= static_cast<T>(s);
|
||||
this->y |= static_cast<T>(s);
|
||||
this->x |= static_cast<T>(scalar);
|
||||
this->y |= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -407,10 +359,10 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator^=(U s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator^=(U scalar)
|
||||
{
|
||||
this->x ^= static_cast<T>(s);
|
||||
this->y ^= static_cast<T>(s);
|
||||
this->x ^= static_cast<T>(scalar);
|
||||
this->y ^= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -434,10 +386,10 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator<<=(U s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator<<=(U scalar)
|
||||
{
|
||||
this->x <<= static_cast<T>(s);
|
||||
this->y <<= static_cast<T>(s);
|
||||
this->x <<= static_cast<T>(scalar);
|
||||
this->y <<= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -461,10 +413,10 @@ namespace glm
|
||||
|
||||
template <typename T, precision P>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator>>=(U s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator>>=(U scalar)
|
||||
{
|
||||
this->x >>= static_cast<T>(s);
|
||||
this->y >>= static_cast<T>(s);
|
||||
this->x >>= static_cast<T>(scalar);
|
||||
this->y >>= static_cast<T>(scalar);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -486,15 +438,30 @@ namespace glm
|
||||
return *this;
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Binary arithmetic operators
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator+(tvec2<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator+(tvec2<T, P> const & v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator-(tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
v.x + s,
|
||||
v.y + s);
|
||||
-v.x,
|
||||
-v.y);
|
||||
}
|
||||
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator+(tvec2<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
v.x + scalar,
|
||||
v.y + scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -506,11 +473,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator+(T const & s, tvec2<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator+(T scalar, tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
s + v.x,
|
||||
s + v.y);
|
||||
scalar + v.x,
|
||||
scalar + v.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -529,13 +496,12 @@ namespace glm
|
||||
v1.y + v2.y);
|
||||
}
|
||||
|
||||
//operator-
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator-(tvec2<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator-(tvec2<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
v.x - s,
|
||||
v.y - s);
|
||||
v.x - scalar,
|
||||
v.y - scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -547,11 +513,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator-(T const & s, tvec2<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator-(T scalar, tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
s - v.x,
|
||||
s - v.y);
|
||||
scalar - v.x,
|
||||
scalar - v.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -570,13 +536,12 @@ namespace glm
|
||||
v1.y - v2.y);
|
||||
}
|
||||
|
||||
//operator*
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator*(tvec2<T, P> const & v1, T const & v2)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator*(tvec2<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
v1.x * v2,
|
||||
v1.y * v2);
|
||||
v.x * scalar,
|
||||
v.y * scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -588,11 +553,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator*(T const & s, tvec2<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator*(T scalar, tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
s * v.x,
|
||||
s * v.y);
|
||||
scalar * v.x,
|
||||
scalar * v.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -611,13 +576,12 @@ namespace glm
|
||||
v1.y * v2.y);
|
||||
}
|
||||
|
||||
//operator/
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator/(tvec2<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator/(tvec2<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
v.x / s,
|
||||
v.y / s);
|
||||
v.x / scalar,
|
||||
v.y / scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -629,11 +593,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator/(T const & s, tvec2<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator/(T scalar, tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
s / v.x,
|
||||
s / v.y);
|
||||
scalar / v.x,
|
||||
scalar / v.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -652,24 +616,14 @@ namespace glm
|
||||
v1.y / v2.y);
|
||||
}
|
||||
|
||||
// Unary constant operators
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator-(tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
-v.x,
|
||||
-v.y);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Binary bit operators
|
||||
// -- Binary bit operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator%(tvec2<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator%(tvec2<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
v.x % s,
|
||||
v.y % s);
|
||||
v.x % scalar,
|
||||
v.y % scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -681,11 +635,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator%(T const & s, tvec2<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator%(T scalar, tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
s % v.x,
|
||||
s % v.y);
|
||||
scalar % v.x,
|
||||
scalar % v.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -705,11 +659,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator&(tvec2<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator&(tvec2<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
v.x & s,
|
||||
v.y & s);
|
||||
v.x & scalar,
|
||||
v.y & scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -721,11 +675,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator&(T const & s, tvec2<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator&(T scalar, tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
s & v.x,
|
||||
s & v.y);
|
||||
scalar & v.x,
|
||||
scalar & v.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -745,11 +699,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator|(tvec2<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator|(tvec2<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
v.x | s,
|
||||
v.y | s);
|
||||
v.x | scalar,
|
||||
v.y | scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -761,11 +715,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator|(T const & s, tvec2<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator|(T scalar, tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
s | v.x,
|
||||
s | v.y);
|
||||
scalar | v.x,
|
||||
scalar | v.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -785,11 +739,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator^(tvec2<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator^(tvec2<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
v.x ^ s,
|
||||
v.y ^ s);
|
||||
v.x ^ scalar,
|
||||
v.y ^ scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -801,11 +755,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator^(T const & s, tvec2<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator^(T scalar, tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
s ^ v.x,
|
||||
s ^ v.y);
|
||||
scalar ^ v.x,
|
||||
scalar ^ v.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -825,11 +779,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator<<(tvec2<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator<<(tvec2<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
v.x << s,
|
||||
v.y << s);
|
||||
v.x << scalar,
|
||||
v.y << scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -841,11 +795,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator<<(T const & s, tvec2<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator<<(T scalar, tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
s << v.x,
|
||||
s << v.y);
|
||||
scalar << v.x,
|
||||
scalar << v.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -865,11 +819,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator>>(tvec2<T, P> const & v, T const & s)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator>>(tvec2<T, P> const & v, T scalar)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
v.x >> s,
|
||||
v.y >> s);
|
||||
v.x >> scalar,
|
||||
v.y >> scalar);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -881,11 +835,11 @@ namespace glm
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator>>(T const & s, tvec2<T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator>>(T scalar, tvec2<T, P> const & v)
|
||||
{
|
||||
return tvec2<T, P>(
|
||||
s >> v.x,
|
||||
s >> v.y);
|
||||
scalar >> v.x,
|
||||
scalar >> v.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
@ -911,4 +865,30 @@ namespace glm
|
||||
~v.x,
|
||||
~v.y);
|
||||
}
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tvec2<T, P> const & v1, tvec2<T, P> const & v2)
|
||||
{
|
||||
return (v1.x == v2.x) && (v1.y == v2.y);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(tvec2<T, P> const & v1, tvec2<T, P> const & v2)
|
||||
{
|
||||
return (v1.x != v2.x) || (v1.y != v2.y);
|
||||
}
|
||||
|
||||
template <precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<bool, P> operator&&(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2)
|
||||
{
|
||||
return tvec2<bool, P>(v1.x && v2.x, v1.y && v2.y);
|
||||
}
|
||||
|
||||
template <precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<bool, P> operator||(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2)
|
||||
{
|
||||
return tvec2<bool, P>(v1.x || v2.x, v1.y || v2.y);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
@ -1,420 +1,407 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_vec3.hpp
|
||||
/// @date 2008-08-22 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
//#include "../fwd.hpp"
|
||||
#include "type_vec.hpp"
|
||||
#ifdef GLM_SWIZZLE
|
||||
# if GLM_HAS_ANONYMOUS_UNION
|
||||
#if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "_swizzle.hpp"
|
||||
# else
|
||||
# include "_swizzle_func.hpp"
|
||||
# endif
|
||||
#endif //GLM_SWIZZLE
|
||||
#endif //GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
#include <cstddef>
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template <typename T, precision P = defaultp>
|
||||
struct tvec3
|
||||
{
|
||||
//////////////////////////////////////
|
||||
// Implementation detail
|
||||
{
|
||||
// -- Implementation detail --
|
||||
|
||||
typedef T value_type;
|
||||
typedef tvec3<T, P> type;
|
||||
typedef tvec3<bool, P> bool_type;
|
||||
typedef T value_type;
|
||||
|
||||
//////////////////////////////////////
|
||||
// Data
|
||||
// -- Data --
|
||||
|
||||
# if GLM_HAS_ONLY_XYZW
|
||||
T x, y, z;
|
||||
|
||||
# elif GLM_HAS_ALIGNED_TYPE
|
||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||
# endif
|
||||
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||
# endif
|
||||
|
||||
# if GLM_HAS_ANONYMOUS_UNION
|
||||
union
|
||||
{
|
||||
struct{ T x, y, z; };
|
||||
struct{ T r, g, b; };
|
||||
struct{ T s, t, p; };
|
||||
|
||||
# ifdef GLM_SWIZZLE
|
||||
_GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, x, y, z)
|
||||
_GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, r, g, b)
|
||||
_GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, s, t, p)
|
||||
_GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, x, y, z)
|
||||
_GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, r, g, b)
|
||||
_GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, s, t, p)
|
||||
_GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, x, y, z)
|
||||
_GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, r, g, b)
|
||||
_GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, s, t, p)
|
||||
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
_GLM_SWIZZLE3_2_MEMBERS(T, P, glm::tvec2, x, y, z)
|
||||
_GLM_SWIZZLE3_2_MEMBERS(T, P, glm::tvec2, r, g, b)
|
||||
_GLM_SWIZZLE3_2_MEMBERS(T, P, glm::tvec2, s, t, p)
|
||||
_GLM_SWIZZLE3_3_MEMBERS(T, P, glm::tvec3, x, y, z)
|
||||
_GLM_SWIZZLE3_3_MEMBERS(T, P, glm::tvec3, r, g, b)
|
||||
_GLM_SWIZZLE3_3_MEMBERS(T, P, glm::tvec3, s, t, p)
|
||||
_GLM_SWIZZLE3_4_MEMBERS(T, P, glm::tvec4, x, y, z)
|
||||
_GLM_SWIZZLE3_4_MEMBERS(T, P, glm::tvec4, r, g, b)
|
||||
_GLM_SWIZZLE3_4_MEMBERS(T, P, glm::tvec4, s, t, p)
|
||||
# endif//GLM_SWIZZLE
|
||||
};
|
||||
|
||||
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic pop
|
||||
# endif
|
||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic pop
|
||||
# endif
|
||||
# else
|
||||
union { T x, r, s; };
|
||||
union { T y, g, t; };
|
||||
union { T z, b, p; };
|
||||
|
||||
# ifdef GLM_SWIZZLE
|
||||
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P, tvec3, tvec2, tvec3, tvec4)
|
||||
# endif//GLM_SWIZZLE
|
||||
# endif//GLM_LANG
|
||||
|
||||
//////////////////////////////////////
|
||||
// Component accesses
|
||||
// -- Component accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
/// Return the count of components of the vector
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
|
||||
/// Return the count of components of the vector
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 3;}
|
||||
|
||||
GLM_FUNC_DECL T & operator[](size_type i);
|
||||
GLM_FUNC_DECL T const & operator[](size_type i) const;
|
||||
# else
|
||||
/// Return the count of components of the vector
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Implicit basic constructors
|
||||
|
||||
GLM_FUNC_DECL tvec3();
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec3<T, P> const & v) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tvec3(tvec3<T, Q> const & v);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec3<T, Q> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Explicit basic constructors
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL explicit tvec3(ctor);
|
||||
GLM_FUNC_DECL explicit tvec3(T const & s);
|
||||
GLM_FUNC_DECL tvec3(T const & a, T const & b, T const & c);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec3(ctor);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec3(T scalar);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(T a, T b, T c);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion scalar constructors
|
||||
// -- Conversion scalar constructors --
|
||||
|
||||
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C>
|
||||
GLM_FUNC_DECL tvec3(A const & a, B const & b, C const & c);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(A a, B b, C c);
|
||||
template <typename A, typename B, typename C>
|
||||
GLM_FUNC_DECL tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion vector constructors
|
||||
// -- Conversion vector constructors --
|
||||
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec2<A, Q> const & a, B const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec2<A, Q> const & a, B b);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(A const & a, tvec2<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(A a, tvec2<B, Q> const & b);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec3(tvec4<U, Q> const & v);
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec3(tvec3<U, Q> const & v);
|
||||
# else
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tvec3(tvec3<U, Q> const & v);
|
||||
# endif
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec3(tvec3<U, Q> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Swizzle constructors
|
||||
|
||||
# if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
// -- Swizzle constructors --
|
||||
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
|
||||
template <int E0, int E1, int E2>
|
||||
GLM_FUNC_DECL tvec3(detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & that)
|
||||
GLM_FUNC_DECL tvec3(detail::_swizzle<3, T, P, glm::tvec3, E0, E1, E2, -1> const & that)
|
||||
{
|
||||
*this = that();
|
||||
}
|
||||
|
||||
template <int E0, int E1>
|
||||
GLM_FUNC_DECL tvec3(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & s)
|
||||
GLM_FUNC_DECL tvec3(detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v, T const & scalar)
|
||||
{
|
||||
*this = tvec3<T, P>(v(), s);
|
||||
*this = tvec3<T, P>(v(), scalar);
|
||||
}
|
||||
|
||||
template <int E0, int E1>
|
||||
GLM_FUNC_DECL tvec3(T const & s, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v)
|
||||
GLM_FUNC_DECL tvec3(T const & scalar, detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v)
|
||||
{
|
||||
*this = tvec3<T, P>(s, v());
|
||||
*this = tvec3<T, P>(scalar, v());
|
||||
}
|
||||
# endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
# endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<T, P> const & v) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator+=(U s);
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator+=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator-=(U s);
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator-=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator*=(U s);
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator*=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator/=(U s);
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator/=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec3<U, P> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator++();
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator--();
|
||||
GLM_FUNC_DECL tvec3<T, P> operator++(int);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator--(int);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary bit operators
|
||||
// -- Unary bit operators --
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator%=(U s);
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator%=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator&=(U s);
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator&=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator|=(U s);
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator|=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator^=(U s);
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator^=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator<<=(U s);
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator<<=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec3<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator>>=(U s);
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator>>=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec1<U, P> const & v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec3<U, P> const & v);
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, T const & s);
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator+(T const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator+(tvec1<T, P> const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, tvec1<T, P> const & scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator+(T scalar, tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator+(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(T const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(T scalar, tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(tvec1<T, P> const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator*(T const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator*(T scalar, tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator*(tvec1<T, P> const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator*(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator/(T const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator/(T scalar, tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator/(tvec1<T, P> const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator/(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator%(T const & scalar, tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator%(T const & s, tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator%(tvec1<T, P> const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator%(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v1, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator&(T const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator&(T scalar, tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator&(tvec1<T, P> const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator&(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator|(T const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator|(T scalar, tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator|(tvec1<T, P> const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator|(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator^(T const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator^(T scalar, tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator^(tvec1<T, P> const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator^(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator<<(T const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator<<(T scalar, tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec1<T, P> const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v, T const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator>>(T const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator>>(T scalar, tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec1<T, P> const & s, tvec3<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator~(tvec3<T, P> const & v);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator==(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
|
||||
|
||||
template <precision P>
|
||||
GLM_FUNC_DECL tvec3<bool, P> operator&&(tvec3<bool, P> const & v1, tvec3<bool, P> const & v2);
|
||||
|
||||
template <precision P>
|
||||
GLM_FUNC_DECL tvec3<bool, P> operator||(tvec3<bool, P> const & v1, tvec3<bool, P> const & v2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,42 +1,11 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_vec4.hpp
|
||||
/// @date 2008-08-22 / 2011-06-15
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
//#include "../fwd.hpp"
|
||||
#include "setup.hpp"
|
||||
#include "type_vec.hpp"
|
||||
#ifdef GLM_SWIZZLE
|
||||
# if GLM_HAS_ANONYMOUS_UNION
|
||||
#if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
||||
# include "_swizzle.hpp"
|
||||
# else
|
||||
# include "_swizzle_func.hpp"
|
||||
@ -44,244 +13,189 @@
|
||||
#endif //GLM_SWIZZLE
|
||||
#include <cstddef>
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
namespace glm
|
||||
{
|
||||
template <typename T>
|
||||
struct simd
|
||||
{
|
||||
typedef T type[4];
|
||||
};
|
||||
|
||||
# define GLM_NOT_BUGGY_VC32BITS !(GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER & GLM_COMPILER_VC && GLM_COMPILER < GLM_COMPILER_VC2013)
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_SSE2 && GLM_NOT_BUGGY_VC32BITS
|
||||
template <>
|
||||
struct simd<float>
|
||||
{
|
||||
typedef __m128 type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct simd<int>
|
||||
{
|
||||
typedef __m128i type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct simd<unsigned int>
|
||||
{
|
||||
typedef __m128i type;
|
||||
};
|
||||
# endif
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX && GLM_NOT_BUGGY_VC32BITS
|
||||
template <>
|
||||
struct simd<double>
|
||||
{
|
||||
typedef __m256d type;
|
||||
};
|
||||
# endif
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2 && GLM_NOT_BUGGY_VC32BITS
|
||||
template <>
|
||||
struct simd<int64>
|
||||
{
|
||||
typedef __m256i type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct simd<uint64>
|
||||
{
|
||||
typedef __m256i type;
|
||||
};
|
||||
# endif
|
||||
|
||||
}//namespace detail
|
||||
|
||||
template <typename T, precision P = defaultp>
|
||||
struct tvec4
|
||||
{
|
||||
//////////////////////////////////////
|
||||
// Implementation detail
|
||||
// -- Implementation detail --
|
||||
|
||||
typedef T value_type;
|
||||
typedef tvec4<T, P> type;
|
||||
typedef tvec4<bool, P> bool_type;
|
||||
typedef T value_type;
|
||||
|
||||
//////////////////////////////////////
|
||||
// Data
|
||||
// -- Data --
|
||||
|
||||
# if GLM_HAS_ONLY_XYZW
|
||||
T x, y, z, w;
|
||||
|
||||
# elif GLM_HAS_ALIGNED_TYPE
|
||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||
# endif
|
||||
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||
# endif
|
||||
|
||||
# if GLM_HAS_ANONYMOUS_UNION
|
||||
union
|
||||
{
|
||||
typename detail::simd<T>::type data;
|
||||
struct { T x, y, z, w;};
|
||||
struct { T r, g, b, a; };
|
||||
struct { T s, t, p, q; };
|
||||
struct { T x, y, z, w;};
|
||||
|
||||
# ifdef GLM_SWIZZLE
|
||||
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w)
|
||||
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, r, g, b, a)
|
||||
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, s, t, p, q)
|
||||
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, x, y, z, w)
|
||||
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, r, g, b, a)
|
||||
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, s, t, p, q)
|
||||
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, x, y, z, w)
|
||||
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, r, g, b, a)
|
||||
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, s, t, p, q)
|
||||
typename detail::storage<T, sizeof(T) * 4, detail::is_aligned<P>::value>::type data;
|
||||
|
||||
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
_GLM_SWIZZLE4_2_MEMBERS(T, P, glm::tvec2, x, y, z, w)
|
||||
_GLM_SWIZZLE4_2_MEMBERS(T, P, glm::tvec2, r, g, b, a)
|
||||
_GLM_SWIZZLE4_2_MEMBERS(T, P, glm::tvec2, s, t, p, q)
|
||||
_GLM_SWIZZLE4_3_MEMBERS(T, P, glm::tvec3, x, y, z, w)
|
||||
_GLM_SWIZZLE4_3_MEMBERS(T, P, glm::tvec3, r, g, b, a)
|
||||
_GLM_SWIZZLE4_3_MEMBERS(T, P, glm::tvec3, s, t, p, q)
|
||||
_GLM_SWIZZLE4_4_MEMBERS(T, P, glm::tvec4, x, y, z, w)
|
||||
_GLM_SWIZZLE4_4_MEMBERS(T, P, glm::tvec4, r, g, b, a)
|
||||
_GLM_SWIZZLE4_4_MEMBERS(T, P, glm::tvec4, s, t, p, q)
|
||||
# endif//GLM_SWIZZLE
|
||||
};
|
||||
|
||||
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic pop
|
||||
# endif
|
||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic pop
|
||||
# endif
|
||||
# else
|
||||
union { T x, r, s; };
|
||||
union { T y, g, t; };
|
||||
union { T z, b, p; };
|
||||
union { T w, a, q; };
|
||||
|
||||
# ifdef GLM_SWIZZLE
|
||||
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P, tvec4, tvec2, tvec3, tvec4)
|
||||
# endif//GLM_SWIZZLE
|
||||
# endif//GLM_LANG
|
||||
# endif
|
||||
|
||||
//////////////////////////////////////
|
||||
// Component accesses
|
||||
// -- Component accesses --
|
||||
|
||||
# ifdef GLM_FORCE_SIZE_FUNC
|
||||
/// Return the count of components of the vector
|
||||
typedef size_t size_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
|
||||
/// Return the count of components of the vector
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL static length_type length(){return 4;}
|
||||
|
||||
GLM_FUNC_DECL T & operator[](size_type i);
|
||||
GLM_FUNC_DECL T const & operator[](size_type i) const;
|
||||
# else
|
||||
/// Return the count of components of the vector
|
||||
typedef length_t length_type;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
# endif//GLM_FORCE_SIZE_FUNC
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
//////////////////////////////////////
|
||||
// Implicit basic constructors
|
||||
|
||||
GLM_FUNC_DECL tvec4();
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec4() GLM_DEFAULT_CTOR;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec4(tvec4<T, P> const& v) GLM_DEFAULT;
|
||||
template <precision Q>
|
||||
GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec4(tvec4<T, Q> const& v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Explicit basic constructors
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL explicit tvec4(ctor);
|
||||
GLM_FUNC_DECL explicit tvec4(T s);
|
||||
GLM_FUNC_DECL tvec4(T a, T b, T c, T d);
|
||||
GLM_FUNC_DECL ~tvec4(){}
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit tvec4(ctor);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit tvec4(T scalar);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec4(T a, T b, T c, T d);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion scalar constructors
|
||||
// -- Conversion scalar constructors --
|
||||
|
||||
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, typename D>
|
||||
GLM_FUNC_DECL tvec4(A a, B b, C c, D d);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec4(A a, B b, C c, D d);
|
||||
template <typename A, typename B, typename C, typename D>
|
||||
GLM_FUNC_DECL tvec4(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c, tvec1<D, P> const & d);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec1<A, P> const& a, tvec1<B, P> const& b, tvec1<C, P> const& c, tvec1<D, P> const& d);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversion vector constructors
|
||||
// -- Conversion vector constructors --
|
||||
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, B b, C c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec2<A, Q> const & a, B b, C c);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(A a, tvec2<B, Q> const & b, C c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(A a, tvec2<B, Q> const & b, C c);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(A a, B b, tvec2<C, Q> const & c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(A a, B b, tvec2<C, Q> const & c);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, typename C, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & a, B b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec3<A, Q> const & a, B b);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(A a, tvec3<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(A a, tvec3<B, Q> const & b);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b);
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b);
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename A, typename B, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b);
|
||||
|
||||
# ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL explicit tvec4(tvec4<U, Q> const & v);
|
||||
# else
|
||||
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL tvec4(tvec4<U, Q> const & v);
|
||||
# endif
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Swizzle constructors
|
||||
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
|
||||
template <typename U, precision Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec4(tvec4<U, Q> const& v);
|
||||
|
||||
# if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
// -- Swizzle constructors --
|
||||
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
|
||||
template <int E0, int E1, int E2, int E3>
|
||||
GLM_FUNC_DECL tvec4(detail::_swizzle<4, T, P, tvec4<T, P>, E0, E1, E2, E3> const & that)
|
||||
GLM_FUNC_DECL tvec4(detail::_swizzle<4, T, P, glm::tvec4, E0, E1, E2, E3> const & that)
|
||||
{
|
||||
*this = that();
|
||||
}
|
||||
|
||||
template <int E0, int E1, int F0, int F1>
|
||||
GLM_FUNC_DECL tvec4(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, tvec2<T, P>, F0, F1, -1, -2> const & u)
|
||||
GLM_FUNC_DECL tvec4(detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, glm::tvec2, F0, F1, -1, -2> const & u)
|
||||
{
|
||||
*this = tvec4<T, P>(v(), u());
|
||||
}
|
||||
|
||||
template <int E0, int E1>
|
||||
GLM_FUNC_DECL tvec4(T const & x, T const & y, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v)
|
||||
GLM_FUNC_DECL tvec4(T const & x, T const & y, detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v)
|
||||
{
|
||||
*this = tvec4<T, P>(x, y, v());
|
||||
}
|
||||
|
||||
template <int E0, int E1>
|
||||
GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & w)
|
||||
GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v, T const & w)
|
||||
{
|
||||
*this = tvec4<T, P>(x, v(), w);
|
||||
}
|
||||
|
||||
template <int E0, int E1>
|
||||
GLM_FUNC_DECL tvec4(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & z, T const & w)
|
||||
GLM_FUNC_DECL tvec4(detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v, T const & z, T const & w)
|
||||
{
|
||||
*this = tvec4<T, P>(v(), z, w);
|
||||
}
|
||||
|
||||
template <int E0, int E1, int E2>
|
||||
GLM_FUNC_DECL tvec4(detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v, T const & w)
|
||||
GLM_FUNC_DECL tvec4(detail::_swizzle<3, T, P, glm::tvec3, E0, E1, E2, -1> const & v, T const & w)
|
||||
{
|
||||
*this = tvec4<T, P>(v(), w);
|
||||
}
|
||||
|
||||
template <int E0, int E1, int E2>
|
||||
GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v)
|
||||
GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<3, T, P, glm::tvec3, E0, E1, E2, -1> const & v)
|
||||
{
|
||||
*this = tvec4<T, P>(x, v());
|
||||
}
|
||||
# endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
|
||||
# endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary arithmetic operators
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<T, P> const & v) GLM_DEFAULT;
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<U, P> const & v);
|
||||
@ -300,9 +214,9 @@ namespace detail
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator*=(U scalar);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec1<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec1<U, P> const& v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec4<U, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec4<U, P> const& v);
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator/=(U scalar);
|
||||
template <typename U>
|
||||
@ -310,16 +224,14 @@ namespace detail
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec4<U, P> const & v);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Increment and decrement operators
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator++();
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator--();
|
||||
GLM_FUNC_DECL tvec4<T, P> operator++(int);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator--(int);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary bit operators
|
||||
// -- Unary bit operators --
|
||||
|
||||
template <typename U>
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator%=(U scalar);
|
||||
@ -359,17 +271,27 @@ namespace detail
|
||||
GLM_FUNC_DECL tvec4<T, P> & operator>>=(tvec4<U, P> const & v);
|
||||
};
|
||||
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(T scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec1<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
@ -378,13 +300,13 @@ namespace detail
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(T scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec1<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
@ -393,13 +315,13 @@ namespace detail
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(T scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(tvec1<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
@ -408,37 +330,28 @@ namespace detail
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec1<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(T scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(tvec1<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator==(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(T scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
@ -447,13 +360,13 @@ namespace detail
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(T scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
@ -462,13 +375,13 @@ namespace detail
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(T scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
@ -477,13 +390,13 @@ namespace detail
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(T scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
@ -492,13 +405,13 @@ namespace detail
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(T scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
@ -507,19 +420,33 @@ namespace detail
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, T scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, tvec1<T, P> const & s);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(T scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec1<T, P> const & s, tvec4<T, P> const & v);
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator~(tvec4<T, P> const & v);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator==(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL bool operator!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
|
||||
|
||||
template <precision P>
|
||||
GLM_FUNC_DECL tvec4<bool, P> operator&&(tvec4<bool, P> const & v1, tvec4<bool, P> const & v2);
|
||||
|
||||
template <precision P>
|
||||
GLM_FUNC_DECL tvec4<bool, P> operator||(tvec4<bool, P> const & v1, tvec4<bool, P> const & v2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,41 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_tvec4_avx.inl
|
||||
/// @date 2014-12-01 / 2014-12-01
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
}//namespace detail
|
||||
|
||||
|
||||
|
||||
}//namespace glm
|
||||
@ -1,41 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_tvec4_avx2.inl
|
||||
/// @date 2014-12-01 / 2014-12-01
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
}//namespace detail
|
||||
|
||||
|
||||
|
||||
}//namespace glm
|
||||
481
common/glm/glm/detail/type_vec4_simd.inl
Normal file
481
common/glm/glm/detail/type_vec4_simd.inl
Normal file
@ -0,0 +1,481 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/type_tvec4_simd.inl
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
template <precision P, int E0, int E1, int E2, int E3>
|
||||
struct _swizzle_base1<4, float, P, glm::tvec4, E0,E1,E2,E3, true> : public _swizzle_base0<float, 4>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER tvec4<float, P> operator ()() const
|
||||
{
|
||||
__m128 data = *reinterpret_cast<__m128 const*>(&this->_buffer);
|
||||
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
Result.data = _mm_permute_ps(data, _MM_SHUFFLE(E3, E2, E1, E0));
|
||||
# else
|
||||
Result.data = _mm_shuffle_ps(data, data, _MM_SHUFFLE(E3, E2, E1, E0));
|
||||
# endif
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P, int E0, int E1, int E2, int E3>
|
||||
struct _swizzle_base1<4, int32, P, glm::tvec4, E0,E1,E2,E3, true> : public _swizzle_base0<int32, 4>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER tvec4<int32, P> operator ()() const
|
||||
{
|
||||
__m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer);
|
||||
|
||||
tvec4<int32, P> Result(uninitialize);
|
||||
Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P, int E0, int E1, int E2, int E3>
|
||||
struct _swizzle_base1<4, uint32, P, glm::tvec4, E0,E1,E2,E3, true> : public _swizzle_base0<uint32, 4>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER tvec4<uint32, P> operator ()() const
|
||||
{
|
||||
__m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer);
|
||||
|
||||
tvec4<uint32, P> Result(uninitialize);
|
||||
Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif// GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_add<float, P, true>
|
||||
{
|
||||
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
|
||||
{
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_add_ps(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_vec4_add<double, P, true>
|
||||
{
|
||||
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
|
||||
{
|
||||
tvec4<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_add_pd(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_sub<float, P, true>
|
||||
{
|
||||
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
|
||||
{
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_sub_ps(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_vec4_sub<double, P, true>
|
||||
{
|
||||
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
|
||||
{
|
||||
tvec4<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_sub_pd(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_mul<float, P, true>
|
||||
{
|
||||
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
|
||||
{
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_mul_ps(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_vec4_mul<double, P, true>
|
||||
{
|
||||
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
|
||||
{
|
||||
tvec4<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_mul_pd(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_div<float, P, true>
|
||||
{
|
||||
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
|
||||
{
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_div_ps(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_vec4_div<double, P, true>
|
||||
{
|
||||
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
|
||||
{
|
||||
tvec4<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_div_pd(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <>
|
||||
struct compute_vec4_div<float, aligned_lowp, true>
|
||||
{
|
||||
static tvec4<float, aligned_lowp> call(tvec4<float, aligned_lowp> const & a, tvec4<float, aligned_lowp> const & b)
|
||||
{
|
||||
tvec4<float, aligned_lowp> Result(uninitialize);
|
||||
Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_and<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_and_si128(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_and<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_and_si256(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_or<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_or_si128(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_or<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_or_si256(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_xor<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_xor_si128(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_xor<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_xor_si256(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_shift_left<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_sll_epi32(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_shift_left<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_sll_epi64(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_shift_right<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_srl_epi32(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_shift_right<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_srl_epi64(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_bitwise_not<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const & v)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_bitwise_not<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const & v)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_xor_si256(v.data, _mm_set1_epi32(-1));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_equal<float, P, false, 32, true>
|
||||
{
|
||||
static bool call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
|
||||
{
|
||||
return _mm_movemask_ps(_mm_cmpeq_ps(v1.data, v2.data)) != 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_equal<int32, P, true, 32, true>
|
||||
{
|
||||
static bool call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
|
||||
{
|
||||
return _mm_movemask_epi8(_mm_cmpeq_epi32(v1.data, v2.data)) != 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_nequal<float, P, false, 32, true>
|
||||
{
|
||||
static bool call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
|
||||
{
|
||||
return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_nequal<int32, P, true, 32, true>
|
||||
{
|
||||
static bool call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
|
||||
{
|
||||
return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: data(_mm_setzero_ps())
|
||||
# endif
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec4()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: data(_mm_setzero_ps())
|
||||
# endif
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec4()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: data(_mm_setzero_ps())
|
||||
# endif
|
||||
{}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4(float s) :
|
||||
data(_mm_set1_ps(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec4(float s) :
|
||||
data(_mm_set1_ps(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec4(float s) :
|
||||
data(_mm_set1_ps(s))
|
||||
{}
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_lowp>::tvec4(double s) :
|
||||
data(_mm256_set1_pd(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_mediump>::tvec4(double s) :
|
||||
data(_mm256_set1_pd(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_highp>::tvec4(double s) :
|
||||
data(_mm256_set1_pd(s))
|
||||
{}
|
||||
# endif
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_lowp>::tvec4(int32 s) :
|
||||
data(_mm_set1_epi32(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_mediump>::tvec4(int32 s) :
|
||||
data(_mm_set1_epi32(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_highp>::tvec4(int32 s) :
|
||||
data(_mm_set1_epi32(s))
|
||||
{}
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_lowp>::tvec4(int64 s) :
|
||||
data(_mm256_set1_epi64x(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_mediump>::tvec4(int64 s) :
|
||||
data(_mm256_set1_epi64x(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_highp>::tvec4(int64 s) :
|
||||
data(_mm256_set1_epi64x(s))
|
||||
{}
|
||||
# endif
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4(float a, float b, float c, float d) :
|
||||
data(_mm_set_ps(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec4(float a, float b, float c, float d) :
|
||||
data(_mm_set_ps(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec4(float a, float b, float c, float d) :
|
||||
data(_mm_set_ps(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_lowp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_set_epi32(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_mediump>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_set_epi32(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_highp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_set_epi32(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
|
||||
{}
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
@ -1,120 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/detail/type_tvec4_sse2.inl
|
||||
/// @date 2014-12-01 / 2014-12-01
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
}//namespace detail
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: data(_mm_setzero_ps())
|
||||
# endif
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: data(_mm_setzero_ps())
|
||||
# endif
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float s) :
|
||||
data(_mm_set1_ps(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4(float s) :
|
||||
data(_mm_set1_ps(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float a, float b, float c, float d) :
|
||||
data(_mm_set_ps(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4(float a, float b, float c, float d) :
|
||||
data(_mm_set_ps(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(U scalar)
|
||||
{
|
||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(scalar)));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=<float>(float scalar)
|
||||
{
|
||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=(U scalar)
|
||||
{
|
||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(scalar)));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=<float>(float scalar)
|
||||
{
|
||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(tvec1<U, lowp> const & v)
|
||||
{
|
||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(v.x)));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <>
|
||||
template <typename U>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=(tvec1<U, mediump> const & v)
|
||||
{
|
||||
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(v.x)));
|
||||
return *this;
|
||||
}
|
||||
}//namespace glm
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/exponential.hpp
|
||||
/// @date 2013-12-24 / 2013-12-24
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,32 +1,4 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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.
|
||||
///
|
||||
/// @file glm/glm.hpp
|
||||
/// @date 2009-05-01 / 2011-05-16
|
||||
/// @author Christophe Riccio
|
||||
/// @file glm/ext.hpp
|
||||
///
|
||||
/// @ref core (Dependence)
|
||||
///
|
||||
@ -52,18 +24,21 @@
|
||||
/// Even if it's highly unrecommended, it's possible to include all the extensions
|
||||
/// at once by including <glm/ext.hpp>. Otherwise, each extension needs to be
|
||||
/// included a specific file.
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_EXT_INCLUDED_DISPLAYED))
|
||||
#include "glm.hpp"
|
||||
|
||||
#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_EXT_INCLUDED_DISPLAYED)
|
||||
# define GLM_MESSAGE_EXT_INCLUDED_DISPLAYED
|
||||
# pragma message("GLM: All extensions included (not recommanded)")
|
||||
#endif//GLM_MESSAGES
|
||||
|
||||
#include "./gtc/bitfield.hpp"
|
||||
#include "./gtc/color_space.hpp"
|
||||
#include "./gtc/constants.hpp"
|
||||
#include "./gtc/epsilon.hpp"
|
||||
#include "./gtc/functions.hpp"
|
||||
#include "./gtc/integer.hpp"
|
||||
#include "./gtc/matrix_access.hpp"
|
||||
#include "./gtc/matrix_integer.hpp"
|
||||
@ -75,10 +50,14 @@
|
||||
#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_ALIGNED_TYPE
|
||||
# include "./gtc/type_aligned.hpp"
|
||||
#endif
|
||||
|
||||
#include "./gtx/associated_min_max.hpp"
|
||||
#include "./gtx/bit.hpp"
|
||||
@ -90,7 +69,7 @@
|
||||
#include "./gtx/dual_quaternion.hpp"
|
||||
#include "./gtx/euler_angles.hpp"
|
||||
#include "./gtx/extend.hpp"
|
||||
#include "./gtx/extented_min_max.hpp"
|
||||
#include "./gtx/extended_min_max.hpp"
|
||||
#include "./gtx/fast_exponential.hpp"
|
||||
#include "./gtx/fast_square_root.hpp"
|
||||
#include "./gtx/fast_trigonometry.hpp"
|
||||
@ -124,7 +103,6 @@
|
||||
#endif
|
||||
#include "./gtx/transform.hpp"
|
||||
#include "./gtx/transform2.hpp"
|
||||
#include "./gtx/type_aligned.hpp"
|
||||
#include "./gtx/vector_angle.hpp"
|
||||
#include "./gtx/vector_query.hpp"
|
||||
#include "./gtx/wrap.hpp"
|
||||
@ -136,8 +114,3 @@
|
||||
#if GLM_HAS_RANGE_FOR
|
||||
# include "./gtx/range.hpp"
|
||||
#endif
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2
|
||||
# include "./gtx/simd_vec4.hpp"
|
||||
# include "./gtx/simd_mat4.hpp"
|
||||
#endif
|
||||
|
||||
@ -1,34 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/// 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.
|
||||
///
|
||||
/// 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
|
||||
/// 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/fwd.hpp
|
||||
/// @date 2013-03-30 / 2013-03-31
|
||||
/// @author Christophe Riccio
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -124,9 +95,6 @@ namespace glm
|
||||
// GLM_GTC_precision
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup gtc_type_precision
|
||||
/// @{
|
||||
|
||||
/// Low precision 8 bit signed integer type.
|
||||
/// @see gtc_type_precision
|
||||
typedef detail::int8 lowp_int8;
|
||||
@ -1547,15 +1515,15 @@ namespace glm
|
||||
typedef tvec1<float, lowp> lowp_vec1;
|
||||
|
||||
/// Low single-precision floating-point vector of 2 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec2<float, lowp> lowp_vec2;
|
||||
|
||||
/// Low single-precision floating-point vector of 3 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec3<float, lowp> lowp_vec3;
|
||||
|
||||
/// Low single-precision floating-point vector of 4 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec4<float, lowp> lowp_vec4;
|
||||
|
||||
/// Low single-precision floating-point vector of 1 component.
|
||||
@ -1580,15 +1548,15 @@ namespace glm
|
||||
typedef tvec1<float, mediump> mediump_vec1;
|
||||
|
||||
/// Medium Single-precision floating-point vector of 2 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec2<float, mediump> mediump_vec2;
|
||||
|
||||
/// Medium Single-precision floating-point vector of 3 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec3<float, mediump> mediump_vec3;
|
||||
|
||||
/// Medium Single-precision floating-point vector of 4 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec4<float, mediump> mediump_vec4;
|
||||
|
||||
/// Medium single-precision floating-point vector of 1 component.
|
||||
@ -1613,15 +1581,15 @@ namespace glm
|
||||
typedef tvec1<float, highp> highp_vec1;
|
||||
|
||||
/// High Single-precision floating-point vector of 2 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec2<float, highp> highp_vec2;
|
||||
|
||||
/// High Single-precision floating-point vector of 3 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec3<float, highp> highp_vec3;
|
||||
|
||||
/// High Single-precision floating-point vector of 4 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec4<float, highp> highp_vec4;
|
||||
|
||||
/// High single-precision floating-point vector of 1 component.
|
||||
@ -1629,15 +1597,15 @@ namespace glm
|
||||
typedef tvec1<float, highp> highp_fvec1;
|
||||
|
||||
/// High Single-precision floating-point vector of 2 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec2<float, highp> highp_fvec2;
|
||||
|
||||
/// High Single-precision floating-point vector of 3 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec3<float, highp> highp_fvec3;
|
||||
|
||||
/// High Single-precision floating-point vector of 4 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec4<float, highp> highp_fvec4;
|
||||
|
||||
|
||||
@ -1646,15 +1614,15 @@ namespace glm
|
||||
typedef tvec1<f32, lowp> lowp_f32vec1;
|
||||
|
||||
/// Low single-precision floating-point vector of 2 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec2<f32, lowp> lowp_f32vec2;
|
||||
|
||||
/// Low single-precision floating-point vector of 3 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec3<f32, lowp> lowp_f32vec3;
|
||||
|
||||
/// Low single-precision floating-point vector of 4 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec4<f32, lowp> lowp_f32vec4;
|
||||
|
||||
/// Medium single-precision floating-point vector of 1 component.
|
||||
@ -1662,15 +1630,15 @@ namespace glm
|
||||
typedef tvec1<f32, mediump> mediump_f32vec1;
|
||||
|
||||
/// Medium single-precision floating-point vector of 2 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec2<f32, mediump> mediump_f32vec2;
|
||||
|
||||
/// Medium single-precision floating-point vector of 3 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec3<f32, mediump> mediump_f32vec3;
|
||||
|
||||
/// Medium single-precision floating-point vector of 4 components.
|
||||
/// @see gtc_type_precision
|
||||
/// @see core_precision
|
||||
typedef tvec4<f32, mediump> mediump_f32vec4;
|
||||
|
||||
/// High single-precision floating-point vector of 1 component.
|
||||
@ -2598,4 +2566,5 @@ namespace glm
|
||||
/// @see gtc_type_precision
|
||||
typedef highp_f64quat f64quat;
|
||||
#endif
|
||||
|
||||
}//namespace glm
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user