Import Debian changes 0.9.8.4-1
glm (0.9.8.4-1) unstable; urgency=medium
* New upstream release.
* Make libglm-doc Multi-Arch: foreign.
* Drop patches/fix-packing-test, a proper fix has been applied upstream.
* Bump Standards-Version.
Guus Sliepen
6 years ago
0 | clone_folder: c:\dev\glm-cmake | |
1 | ||
2 | os: | |
3 | - Visual Studio 2013 | |
4 | ||
5 | platform: | |
6 | - x86 | |
7 | - x86_64 | |
8 | ||
9 | build_script: | |
10 | - md build_pure_11 | |
11 | - cd build_pure_11 | |
12 | - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_FORCE_PURE=ON .. | |
13 | - cmake --build . --config Debug | |
14 | - cmake --build . --config Release | |
15 | - cd .. | |
16 | - md build_simd_11 | |
17 | - cd build_simd_11 | |
18 | - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON .. | |
19 | - cmake --build . --config Debug | |
20 | - cmake --build . --config Release | |
21 | - cd .. | |
22 | - md build_pure_98 | |
23 | - cd build_pure_98 | |
24 | - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON .. | |
25 | - cmake --build . --config Debug | |
26 | - cmake --build . --config Release | |
27 | - cd .. | |
28 | - md build_simd_98 | |
29 | - cd build_simd_98 | |
30 | - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON .. | |
31 | - cmake --build . --config Debug | |
32 | - cmake --build . --config Release | |
33 | - cd .. |
0 | language: cpp | |
1 | ||
2 | os: | |
3 | - linux | |
4 | - osx | |
5 | ||
6 | matrix: | |
7 | include: | |
8 | - compiler: gcc | |
9 | addons: | |
10 | apt: | |
11 | sources: | |
12 | - ubuntu-toolchain-r-test | |
13 | packages: | |
14 | - g++-4.9 | |
15 | env: COMPILER=g++-4.9 | |
16 | - compiler: clang | |
17 | addons: | |
18 | apt: | |
19 | sources: | |
20 | - ubuntu-toolchain-r-test | |
21 | - llvm-toolchain-precise-3.8 | |
22 | packages: | |
23 | - clang-3.8 | |
24 | env: COMPILER=clang++-3.8 | |
25 | ||
26 | compiler: | |
27 | - clang | |
28 | ||
29 | before_script: | |
30 | ||
31 | script: | |
32 | - mkdir ./build_pure_11 | |
33 | - cd ./build_pure_11 | |
34 | - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_FORCE_PURE=ON .. | |
35 | - cmake --build . | |
36 | - ctest | |
37 | - cd .. | |
38 | - mkdir ./build_pure_98 | |
39 | - cd ./build_pure_98 | |
40 | - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON .. | |
41 | - cmake --build . | |
42 | - ctest | |
43 | - cd .. | |
44 | - mkdir ./build_pure_11_debug | |
45 | - cd ./build_pure_11_debug | |
46 | - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_FORCE_PURE=ON .. | |
47 | - cmake --build . | |
48 | - ctest | |
49 | - cd .. | |
50 | - mkdir ./build_pure_98_debug | |
51 | - cd ./build_pure_98_debug | |
52 | - cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON .. | |
53 | - cmake --build . | |
54 | - ctest | |
55 | - cd .. | |
56 | - mkdir ./build_simd_11 | |
57 | - cd ./build_simd_11 | |
58 | - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON ..; else cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON ..; fi | |
59 | - cmake --build . | |
60 | - ctest | |
61 | - cd .. | |
62 | - mkdir ./build_simd_98 | |
63 | - cd ./build_simd_98 | |
64 | - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON ..; else cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON ..; fi | |
65 | - cmake --build . | |
66 | - ctest | |
67 | - cd .. | |
68 | - mkdir ./build_simd_11_debug | |
69 | - cd ./build_simd_11_debug | |
70 | - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON ..; else cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON ..; fi | |
71 | - cmake --build . | |
72 | - ctest | |
73 | - cd .. | |
74 | - mkdir ./build_simd_98_debug | |
75 | - cd ./build_simd_98_debug | |
76 | - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON ..; else cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON ..; fi | |
77 | - cmake --build . | |
78 | - ctest | |
79 | - cd .. | |
80 | ||
81 | ||
82 | ||
83 |
106 | 106 | if(CMAKE_COMPILER_IS_GNUCXX) |
107 | 107 | add_definitions(-mfpmath=387) |
108 | 108 | endif() |
109 | message(STATUS "GLM: No SIMD instruction set") | |
109 | 110 | elseif(GLM_TEST_ENABLE_SIMD_AVX2) |
110 | if(CMAKE_COMPILER_IS_GNUCXX) | |
111 | if(CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) | |
111 | 112 | add_definitions(-mavx2) |
112 | 113 | elseif(GLM_USE_INTEL) |
113 | 114 | add_definitions(/QxAVX2) |
114 | 115 | elseif(MSVC) |
115 | 116 | add_definitions(/arch:AVX2) |
116 | 117 | endif() |
118 | message(STATUS "GLM: AVX2 instruction set") | |
117 | 119 | elseif(GLM_TEST_ENABLE_SIMD_AVX) |
118 | if(CMAKE_COMPILER_IS_GNUCXX) | |
120 | if(CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) | |
119 | 121 | add_definitions(-mavx) |
120 | 122 | elseif(GLM_USE_INTEL) |
121 | 123 | add_definitions(/QxAVX) |
122 | 124 | elseif(MSVC) |
123 | 125 | add_definitions(/arch:AVX) |
124 | 126 | endif() |
127 | message(STATUS "GLM: AVX instruction set") | |
125 | 128 | elseif(GLM_TEST_ENABLE_SIMD_SSE3) |
126 | if(CMAKE_COMPILER_IS_GNUCXX) | |
129 | if(CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) | |
127 | 130 | add_definitions(-msse3) |
128 | 131 | elseif(GLM_USE_INTEL) |
129 | 132 | add_definitions(/QxSSE3) |
130 | 133 | elseif(MSVC AND NOT CMAKE_CL_64) |
131 | add_definitions(/arch:SSE2) # VC doesn't support /arch:SSE3 | |
132 | endif() | |
134 | add_definitions(/arch:SSE2) # VC doesn't support /arch:SSE3 | |
135 | endif() | |
136 | message(STATUS "GLM: SSE3 instruction set") | |
133 | 137 | elseif(GLM_TEST_ENABLE_SIMD_SSE2) |
134 | if(CMAKE_COMPILER_IS_GNUCXX) | |
138 | if(CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) | |
135 | 139 | add_definitions(-msse2) |
136 | 140 | elseif(GLM_USE_INTEL) |
137 | 141 | add_definitions(/QxSSE2) |
138 | 142 | elseif(MSVC AND NOT CMAKE_CL_64) |
139 | 143 | add_definitions(/arch:SSE2) |
140 | 144 | endif() |
145 | message(STATUS "GLM: SSE2 instruction set") | |
141 | 146 | endif() |
142 | 147 | |
143 | 148 | if(CMAKE_COMPILER_IS_GNUCXX) |
0 | glm (0.9.8.4-1) unstable; urgency=medium | |
1 | ||
2 | * New upstream release. | |
3 | * Make libglm-doc Multi-Arch: foreign. | |
4 | * Drop patches/fix-packing-test, a proper fix has been applied upstream. | |
5 | * Bump Standards-Version. | |
6 | ||
7 | -- Guus Sliepen <guus@debian.org> Sat, 24 Jun 2017 17:27:12 +0200 | |
8 | ||
0 | 9 | glm (0.9.8.3-3) unstable; urgency=medium |
1 | 10 | |
2 | 11 | * Fix FTBFS on i386. Closes: 860701 |
5 | 5 | Priority: extra |
6 | 6 | Build-Depends: debhelper (>= 10), |
7 | 7 | cmake |
8 | Standards-Version: 3.9.8 | |
8 | Standards-Version: 4.0.0 | |
9 | 9 | Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/glm.git |
10 | 10 | Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/glm.git |
11 | 11 | Homepage: http://glm.g-truc.net/ |
35 | 35 | |
36 | 36 | Package: libglm-doc |
37 | 37 | Architecture: all |
38 | Multi-Arch: foreign | |
38 | 39 | Section: doc |
39 | 40 | Depends: ${misc:Depends} |
40 | 41 | Recommends: libjs-jquery |
5 | 5 | CMakeLists.txt | 5 +++++ |
6 | 6 | 1 file changed, 5 insertions(+) |
7 | 7 | |
8 | diff --git a/CMakeLists.txt b/CMakeLists.txt | |
9 | index 253eee5..2c68e8a 100644 | |
10 | 8 | --- a/CMakeLists.txt |
11 | 9 | +++ b/CMakeLists.txt |
12 | @@ -163,11 +163,16 @@ add_subdirectory(test) | |
10 | @@ -168,11 +168,16 @@ | |
13 | 11 | set(GLM_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/glm") |
14 | 12 | install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) |
15 | 13 |
0 | Description: Fix failure of gtc_packing test on i386 | |
1 | Author: Guus Sliepen <guus@debian.org> | |
2 | Last-Update: 2017-04-19 | |
3 | ||
4 | --- glm-0.9.8.3.orig/test/gtc/gtc_packing.cpp | |
5 | +++ glm-0.9.8.3/test/gtc/gtc_packing.cpp | |
6 | @@ -100,8 +100,8 @@ int test_Half4x16() | |
7 | glm::u16vec4 p2 = glm::packHalf(v0); | |
8 | glm::vec4 v2 = glm::unpackHalf(p2); | |
9 | ||
10 | - Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; | |
11 | - Error += glm::all(glm::equal(v0, v2)) ? 0 : 1; | |
12 | + Error += !!memcmp(&v0, &v1, sizeof v0); | |
13 | + Error += !!memcmp(&v0, &v2, sizeof v0); | |
14 | } | |
15 | ||
16 | return Error; | |
17 | @@ -125,7 +125,7 @@ int test_I3x10_1x2() | |
18 | glm::ivec4 v0 = glm::unpackI3x10_1x2(p0); | |
19 | glm::uint32 p1 = glm::packI3x10_1x2(v0); | |
20 | glm::ivec4 v1 = glm::unpackI3x10_1x2(p1); | |
21 | - Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; | |
22 | + Error += !!memcmp(&v0, &v1, sizeof v0); | |
23 | } | |
24 | ||
25 | return Error; | |
26 | @@ -149,7 +149,7 @@ int test_U3x10_1x2() | |
27 | glm::uvec4 v0 = glm::unpackU3x10_1x2(p0); | |
28 | glm::uint32 p1 = glm::packU3x10_1x2(v0); | |
29 | glm::uvec4 v1 = glm::unpackU3x10_1x2(p1); | |
30 | - Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; | |
31 | + Error += !!memcmp(&v0, &v1, sizeof v0); | |
32 | } | |
33 | ||
34 | return Error; | |
35 | @@ -173,7 +173,7 @@ int test_Snorm3x10_1x2() | |
36 | glm::vec4 v0 = glm::unpackSnorm3x10_1x2(p0); | |
37 | glm::uint32 p1 = glm::packSnorm3x10_1x2(v0); | |
38 | glm::vec4 v1 = glm::unpackSnorm3x10_1x2(p1); | |
39 | - Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; | |
40 | + Error += !!memcmp(&v0, &v1, sizeof v0); | |
41 | } | |
42 | ||
43 | return Error; | |
44 | @@ -197,7 +197,7 @@ int test_Unorm3x10_1x2() | |
45 | glm::vec4 v0 = glm::unpackUnorm3x10_1x2(p0); | |
46 | glm::uint32 p1 = glm::packUnorm3x10_1x2(v0); | |
47 | glm::vec4 v1 = glm::unpackUnorm3x10_1x2(p1); | |
48 | - Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; | |
49 | + Error += !!memcmp(&v0, &v1, sizeof v0); | |
50 | } | |
51 | ||
52 | return Error; | |
53 | @@ -221,6 +221,7 @@ int test_F2x11_1x10() | |
54 | glm::vec3 v0 = glm::unpackF2x11_1x10(p0); | |
55 | glm::uint32 p1 = glm::packF2x11_1x10(v0); | |
56 | glm::vec3 v1 = glm::unpackF2x11_1x10(p1); | |
57 | + Error += !!memcmp(&v0, &v1, sizeof v0); | |
58 | Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; | |
59 | } | |
60 |
0 | function toggleVisibility(linkObj) | |
1 | { | |
2 | var base = $(linkObj).attr('id'); | |
3 | var summary = $('#'+base+'-summary'); | |
4 | var content = $('#'+base+'-content'); | |
5 | var trigger = $('#'+base+'-trigger'); | |
6 | var src=$(trigger).attr('src'); | |
7 | if (content.is(':visible')===true) { | |
8 | content.hide(); | |
9 | summary.show(); | |
10 | $(linkObj).addClass('closed').removeClass('opened'); | |
11 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); | |
12 | } else { | |
13 | content.show(); | |
14 | summary.hide(); | |
15 | $(linkObj).removeClass('closed').addClass('opened'); | |
16 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); | |
17 | } | |
18 | return false; | |
19 | } | |
20 | ||
21 | function updateStripes() | |
22 | { | |
23 | $('table.directory tr'). | |
24 | removeClass('even').filter(':visible:even').addClass('even'); | |
25 | } | |
26 | ||
27 | function toggleLevel(level) | |
28 | { | |
29 | $('table.directory tr').each(function() { | |
30 | var l = this.id.split('_').length-1; | |
31 | var i = $('#img'+this.id.substring(3)); | |
32 | var a = $('#arr'+this.id.substring(3)); | |
33 | if (l<level+1) { | |
34 | i.removeClass('iconfopen iconfclosed').addClass('iconfopen'); | |
35 | a.html('▼'); | |
36 | $(this).show(); | |
37 | } else if (l==level+1) { | |
38 | i.removeClass('iconfclosed iconfopen').addClass('iconfclosed'); | |
39 | a.html('►'); | |
40 | $(this).show(); | |
41 | } else { | |
42 | $(this).hide(); | |
43 | } | |
44 | }); | |
45 | updateStripes(); | |
46 | } | |
47 | ||
48 | function toggleFolder(id) | |
49 | { | |
50 | // the clicked row | |
51 | var currentRow = $('#row_'+id); | |
52 | ||
53 | // all rows after the clicked row | |
54 | var rows = currentRow.nextAll("tr"); | |
55 | ||
56 | var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub | |
57 | ||
58 | // only match elements AFTER this one (can't hide elements before) | |
59 | var childRows = rows.filter(function() { return this.id.match(re); }); | |
60 | ||
61 | // first row is visible we are HIDING | |
62 | if (childRows.filter(':first').is(':visible')===true) { | |
63 | // replace down arrow by right arrow for current row | |
64 | var currentRowSpans = currentRow.find("span"); | |
65 | currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); | |
66 | currentRowSpans.filter(".arrow").html('►'); | |
67 | rows.filter("[id^=row_"+id+"]").hide(); // hide all children | |
68 | } else { // we are SHOWING | |
69 | // replace right arrow by down arrow for current row | |
70 | var currentRowSpans = currentRow.find("span"); | |
71 | currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen"); | |
72 | currentRowSpans.filter(".arrow").html('▼'); | |
73 | // replace down arrows by right arrows for child rows | |
74 | var childRowsSpans = childRows.find("span"); | |
75 | childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); | |
76 | childRowsSpans.filter(".arrow").html('►'); | |
77 | childRows.show(); //show all children | |
78 | } | |
79 | updateStripes(); | |
80 | } | |
81 | ||
82 | ||
83 | function toggleInherit(id) | |
84 | { | |
85 | var rows = $('tr.inherit.'+id); | |
86 | var img = $('tr.inherit_header.'+id+' img'); | |
87 | var src = $(img).attr('src'); | |
88 | if (rows.filter(':first').is(':visible')===true) { | |
89 | rows.css('display','none'); | |
90 | $(img).attr('src',src.substring(0,src.length-8)+'closed.png'); | |
91 | } else { | |
92 | rows.css('display','table-row'); // using show() causes jump in firefox | |
93 | $(img).attr('src',src.substring(0,src.length-10)+'open.png'); | |
94 | } | |
95 | } | |
96 | ||
97 | ||
98 | $(document).ready(function() { | |
99 | $('.code,.codeRef').each(function() { | |
100 | $(this).data('powertip',$('#'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html()); | |
101 | $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true }); | |
102 | }); | |
103 | }); | |
0 | function toggleVisibility(linkObj) | |
1 | { | |
2 | var base = $(linkObj).attr('id'); | |
3 | var summary = $('#'+base+'-summary'); | |
4 | var content = $('#'+base+'-content'); | |
5 | var trigger = $('#'+base+'-trigger'); | |
6 | var src=$(trigger).attr('src'); | |
7 | if (content.is(':visible')===true) { | |
8 | content.hide(); | |
9 | summary.show(); | |
10 | $(linkObj).addClass('closed').removeClass('opened'); | |
11 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); | |
12 | } else { | |
13 | content.show(); | |
14 | summary.hide(); | |
15 | $(linkObj).removeClass('closed').addClass('opened'); | |
16 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); | |
17 | } | |
18 | return false; | |
19 | } | |
20 | ||
21 | function updateStripes() | |
22 | { | |
23 | $('table.directory tr'). | |
24 | removeClass('even').filter(':visible:even').addClass('even'); | |
25 | } | |
26 | ||
27 | function toggleLevel(level) | |
28 | { | |
29 | $('table.directory tr').each(function() { | |
30 | var l = this.id.split('_').length-1; | |
31 | var i = $('#img'+this.id.substring(3)); | |
32 | var a = $('#arr'+this.id.substring(3)); | |
33 | if (l<level+1) { | |
34 | i.removeClass('iconfopen iconfclosed').addClass('iconfopen'); | |
35 | a.html('▼'); | |
36 | $(this).show(); | |
37 | } else if (l==level+1) { | |
38 | i.removeClass('iconfclosed iconfopen').addClass('iconfclosed'); | |
39 | a.html('►'); | |
40 | $(this).show(); | |
41 | } else { | |
42 | $(this).hide(); | |
43 | } | |
44 | }); | |
45 | updateStripes(); | |
46 | } | |
47 | ||
48 | function toggleFolder(id) | |
49 | { | |
50 | // the clicked row | |
51 | var currentRow = $('#row_'+id); | |
52 | ||
53 | // all rows after the clicked row | |
54 | var rows = currentRow.nextAll("tr"); | |
55 | ||
56 | var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub | |
57 | ||
58 | // only match elements AFTER this one (can't hide elements before) | |
59 | var childRows = rows.filter(function() { return this.id.match(re); }); | |
60 | ||
61 | // first row is visible we are HIDING | |
62 | if (childRows.filter(':first').is(':visible')===true) { | |
63 | // replace down arrow by right arrow for current row | |
64 | var currentRowSpans = currentRow.find("span"); | |
65 | currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); | |
66 | currentRowSpans.filter(".arrow").html('►'); | |
67 | rows.filter("[id^=row_"+id+"]").hide(); // hide all children | |
68 | } else { // we are SHOWING | |
69 | // replace right arrow by down arrow for current row | |
70 | var currentRowSpans = currentRow.find("span"); | |
71 | currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen"); | |
72 | currentRowSpans.filter(".arrow").html('▼'); | |
73 | // replace down arrows by right arrows for child rows | |
74 | var childRowsSpans = childRows.find("span"); | |
75 | childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); | |
76 | childRowsSpans.filter(".arrow").html('►'); | |
77 | childRows.show(); //show all children | |
78 | } | |
79 | updateStripes(); | |
80 | } | |
81 | ||
82 | ||
83 | function toggleInherit(id) | |
84 | { | |
85 | var rows = $('tr.inherit.'+id); | |
86 | var img = $('tr.inherit_header.'+id+' img'); | |
87 | var src = $(img).attr('src'); | |
88 | if (rows.filter(':first').is(':visible')===true) { | |
89 | rows.css('display','none'); | |
90 | $(img).attr('src',src.substring(0,src.length-8)+'closed.png'); | |
91 | } else { | |
92 | rows.css('display','table-row'); // using show() causes jump in firefox | |
93 | $(img).attr('src',src.substring(0,src.length-10)+'open.png'); | |
94 | } | |
95 | } | |
96 | ||
97 | ||
98 | $(document).ready(function() { | |
99 | $('.code,.codeRef').each(function() { | |
100 | $(this).data('powertip',$('#'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html()); | |
101 | $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true }); | |
102 | }); | |
103 | }); |
100 | 100 | GLM_FUNC_QUALIFIER static genFIType call(genFIType x) |
101 | 101 | { |
102 | 102 | GLM_STATIC_ASSERT( |
103 | !std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer || GLM_UNRESTRICTED_GENTYPE, | |
103 | (!std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer) || GLM_UNRESTRICTED_GENTYPE, | |
104 | 104 | "'abs' only accept floating-point and integer scalar or vector inputs"); |
105 | 105 | return x; |
106 | 106 | } |
35 | 35 | #define GLM_VERSION_MAJOR 0 |
36 | 36 | #define GLM_VERSION_MINOR 9 |
37 | 37 | #define GLM_VERSION_PATCH 8 |
38 | #define GLM_VERSION_REVISION 3 | |
38 | #define GLM_VERSION_REVISION 4 | |
39 | 39 | |
40 | 40 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_VERSION_DISPLAYED) |
41 | 41 | # define GLM_MESSAGE_VERSION_DISPLAYED |
42 | # pragma message ("GLM: version 0.9.8.3") | |
42 | # pragma message ("GLM: version 0.9.8.4") | |
43 | 43 | #endif//GLM_MESSAGES |
44 | 44 | |
45 | 45 | // Report compiler detection |
298 | 298 | #if GLM_PLATFORM == GLM_PLATFORM_ANDROID && !defined(GLM_LANG_STL11_FORCED) |
299 | 299 | # define GLM_HAS_CXX11_STL 0 |
300 | 300 | #elif GLM_COMPILER & GLM_COMPILER_CLANG |
301 | # if defined(_LIBCPP_VERSION) && GLM_LANG & GLM_LANG_CXX11_FLAG | |
301 | # if (defined(_LIBCPP_VERSION) && GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED) | |
302 | 302 | # define GLM_HAS_CXX11_STL 1 |
303 | 303 | # else |
304 | 304 | # define GLM_HAS_CXX11_STL 0 |
448 | 448 | ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \ |
449 | 449 | ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \ |
450 | 450 | ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA70)))) |
451 | #endif | |
452 | ||
453 | #define GLM_HAS_ONLY_XYZW ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER < GLM_COMPILER_GCC46)) | |
454 | #if GLM_HAS_ONLY_XYZW | |
455 | # pragma message("GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components") | |
451 | 456 | #endif |
452 | 457 | |
453 | 458 | // |
732 | 737 | # define GLM_DEFAULT_CTOR |
733 | 738 | #endif |
734 | 739 | |
735 | #if GLM_HAS_CONSTEXPR | |
740 | #if GLM_HAS_CONSTEXPR || GLM_HAS_CONSTEXPR_PARTIAL | |
736 | 741 | # define GLM_CONSTEXPR constexpr |
737 | # define GLM_CONSTEXPR_CTOR constexpr | |
738 | # define GLM_RELAXED_CONSTEXPR constexpr | |
739 | #elif GLM_HAS_CONSTEXPR_PARTIAL | |
740 | # define GLM_CONSTEXPR constexpr | |
741 | # define GLM_CONSTEXPR_CTOR | |
742 | # define GLM_RELAXED_CONSTEXPR const | |
742 | # if GLM_COMPILER & GLM_COMPILER_VC // Visual C++ has a bug #594 https://github.com/g-truc/glm/issues/594 | |
743 | # define GLM_CONSTEXPR_CTOR | |
744 | # else | |
745 | # define GLM_CONSTEXPR_CTOR constexpr | |
746 | # endif | |
743 | 747 | #else |
744 | 748 | # define GLM_CONSTEXPR |
745 | 749 | # define GLM_CONSTEXPR_CTOR |
750 | #endif | |
751 | ||
752 | #if GLM_HAS_CONSTEXPR | |
753 | # define GLM_RELAXED_CONSTEXPR constexpr | |
754 | #else | |
746 | 755 | # define GLM_RELAXED_CONSTEXPR const |
747 | 756 | #endif |
748 | 757 |
26 | 26 | |
27 | 27 | // -- Data -- |
28 | 28 | |
29 | # if GLM_HAS_ALIGNED_TYPE | |
29 | # if GLM_HAS_ONLY_XYZW | |
30 | T x; | |
31 | ||
32 | # elif GLM_HAS_ALIGNED_TYPE | |
30 | 33 | # if GLM_COMPILER & GLM_COMPILER_GCC |
31 | 34 | # pragma GCC diagnostic push |
32 | 35 | # pragma GCC diagnostic ignored "-Wpedantic" |
81 | 84 | |
82 | 85 | // -- Implicit basic constructors -- |
83 | 86 | |
84 | GLM_FUNC_DECL GLM_CONSTEXPR tvec1() GLM_DEFAULT_CTOR; | |
85 | GLM_FUNC_DECL GLM_CONSTEXPR tvec1(tvec1<T, P> const & v) GLM_DEFAULT; | |
87 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec1() GLM_DEFAULT_CTOR; | |
88 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec1(tvec1<T, P> const & v) GLM_DEFAULT; | |
86 | 89 | template <precision Q> |
87 | GLM_FUNC_DECL GLM_CONSTEXPR tvec1(tvec1<T, Q> const & v); | |
90 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec1(tvec1<T, Q> const & v); | |
88 | 91 | |
89 | 92 | // -- Explicit basic constructors -- |
90 | 93 | |
91 | 94 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec1(ctor); |
92 | GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec1(T scalar); | |
95 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec1(T scalar); | |
93 | 96 | |
94 | 97 | // -- Conversion vector constructors -- |
95 | 98 | |
96 | 99 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
97 | 100 | template <typename U, precision Q> |
98 | GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec1(tvec2<U, Q> const & v); | |
101 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec1(tvec2<U, Q> const & v); | |
99 | 102 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
100 | 103 | template <typename U, precision Q> |
101 | GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec1(tvec3<U, Q> const & v); | |
104 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec1(tvec3<U, Q> const & v); | |
102 | 105 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
103 | 106 | template <typename U, precision Q> |
104 | GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec1(tvec4<U, Q> const & v); | |
107 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec1(tvec4<U, Q> const & v); | |
105 | 108 | |
106 | 109 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
107 | 110 | template <typename U, precision Q> |
108 | GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec1(tvec1<U, Q> const & v); | |
111 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec1(tvec1<U, Q> const & v); | |
109 | 112 | |
110 | 113 | // -- Swizzle constructors -- |
111 | 114 | /* |
6 | 6 | |
7 | 7 | # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) |
8 | 8 | template <typename T, precision P> |
9 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1() | |
9 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1() | |
10 | 10 | # ifndef GLM_FORCE_NO_CTOR_INIT |
11 | 11 | : x(0) |
12 | 12 | # endif |
15 | 15 | |
16 | 16 | # if !GLM_HAS_DEFAULTED_FUNCTIONS |
17 | 17 | template <typename T, precision P> |
18 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(tvec1<T, P> const & v) | |
18 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec1<T, P> const & v) | |
19 | 19 | : x(v.x) |
20 | 20 | {} |
21 | 21 | # endif//!GLM_HAS_DEFAULTED_FUNCTIONS |
22 | 22 | |
23 | 23 | template <typename T, precision P> |
24 | 24 | template <precision Q> |
25 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(tvec1<T, Q> const & v) | |
25 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec1<T, Q> const & v) | |
26 | 26 | : x(v.x) |
27 | 27 | {} |
28 | 28 | |
33 | 33 | {} |
34 | 34 | |
35 | 35 | template <typename T, precision P> |
36 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(T scalar) | |
36 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(T scalar) | |
37 | 37 | : x(scalar) |
38 | 38 | {} |
39 | 39 | |
41 | 41 | |
42 | 42 | template <typename T, precision P> |
43 | 43 | template <typename U, precision Q> |
44 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(tvec1<U, Q> const & v) | |
44 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec1<U, Q> const & v) | |
45 | 45 | : x(static_cast<T>(v.x)) |
46 | 46 | {} |
47 | 47 | |
48 | 48 | template <typename T, precision P> |
49 | 49 | template <typename U, precision Q> |
50 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(tvec2<U, Q> const & v) | |
50 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec2<U, Q> const & v) | |
51 | 51 | : x(static_cast<T>(v.x)) |
52 | 52 | {} |
53 | 53 | |
54 | 54 | template <typename T, precision P> |
55 | 55 | template <typename U, precision Q> |
56 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(tvec3<U, Q> const & v) | |
56 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec3<U, Q> const & v) | |
57 | 57 | : x(static_cast<T>(v.x)) |
58 | 58 | {} |
59 | 59 | |
60 | 60 | template <typename T, precision P> |
61 | 61 | template <typename U, precision Q> |
62 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(tvec4<U, Q> const & v) | |
62 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1<T, P>::tvec1(tvec4<U, Q> const & v) | |
63 | 63 | : x(static_cast<T>(v.x)) |
64 | 64 | {} |
65 | 65 |
25 | 25 | |
26 | 26 | // -- Data -- |
27 | 27 | |
28 | # if GLM_HAS_ALIGNED_TYPE | |
28 | # if GLM_HAS_ONLY_XYZW | |
29 | T x, y; | |
30 | ||
31 | # elif GLM_HAS_ALIGNED_TYPE | |
29 | 32 | # if GLM_COMPILER & GLM_COMPILER_GCC |
30 | 33 | # pragma GCC diagnostic push |
31 | 34 | # pragma GCC diagnostic ignored "-Wpedantic" |
82 | 85 | |
83 | 86 | // -- Implicit basic constructors -- |
84 | 87 | |
85 | GLM_FUNC_DECL GLM_CONSTEXPR tvec2() GLM_DEFAULT_CTOR; | |
86 | GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec2<T, P> const& v) GLM_DEFAULT; | |
88 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2() GLM_DEFAULT_CTOR; | |
89 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2(tvec2<T, P> const& v) GLM_DEFAULT; | |
87 | 90 | template <precision Q> |
88 | GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec2<T, Q> const& v); | |
91 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2(tvec2<T, Q> const& v); | |
89 | 92 | |
90 | 93 | // -- Explicit basic constructors -- |
91 | 94 | |
92 | 95 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec2(ctor); |
93 | GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec2(T scalar); | |
94 | GLM_FUNC_DECL GLM_CONSTEXPR tvec2(T s1, T s2); | |
96 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec2(T scalar); | |
97 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2(T s1, T s2); | |
95 | 98 | |
96 | 99 | // -- Conversion constructors -- |
97 | 100 | |
98 | 101 | /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
99 | 102 | template <typename A, typename B> |
100 | GLM_FUNC_DECL GLM_CONSTEXPR tvec2(A x, B y); | |
103 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2(A x, B y); | |
101 | 104 | template <typename A, typename B> |
102 | GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec1<A, P> const & v1, tvec1<B, P> const & v2); | |
105 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec2(tvec1<A, P> const & v1, tvec1<B, P> const & v2); | |
103 | 106 | |
104 | 107 | // -- Conversion vector constructors -- |
105 | 108 | |
106 | 109 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
107 | 110 | template <typename U, precision Q> |
108 | GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec2(tvec3<U, Q> const & v); | |
111 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec2(tvec3<U, Q> const & v); | |
109 | 112 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
110 | 113 | template <typename U, precision Q> |
111 | GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec2(tvec4<U, Q> const & v); | |
114 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec2(tvec4<U, Q> const & v); | |
112 | 115 | |
113 | 116 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
114 | 117 | template <typename U, precision Q> |
115 | GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec2(tvec2<U, Q> const & v); | |
118 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec2(tvec2<U, Q> const & v); | |
116 | 119 | |
117 | 120 | // -- Swizzle constructors -- |
118 | 121 | # if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) |
19 | 19 | |
20 | 20 | # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) |
21 | 21 | template <typename T, precision P> |
22 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2() | |
22 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2() | |
23 | 23 | # ifndef GLM_FORCE_NO_CTOR_INIT |
24 | 24 | : x(0), y(0) |
25 | 25 | # endif |
28 | 28 | |
29 | 29 | # if !GLM_HAS_DEFAULTED_FUNCTIONS |
30 | 30 | template <typename T, precision P> |
31 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(tvec2<T, P> const & v) | |
31 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec2<T, P> const & v) | |
32 | 32 | : x(v.x), y(v.y) |
33 | 33 | {} |
34 | 34 | # endif//!GLM_HAS_DEFAULTED_FUNCTIONS |
35 | 35 | |
36 | 36 | template <typename T, precision P> |
37 | 37 | template <precision Q> |
38 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(tvec2<T, Q> const & v) | |
38 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec2<T, Q> const & v) | |
39 | 39 | : x(v.x), y(v.y) |
40 | 40 | {} |
41 | 41 | |
46 | 46 | {} |
47 | 47 | |
48 | 48 | template <typename T, precision P> |
49 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(T scalar) | |
49 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(T scalar) | |
50 | 50 | : x(scalar), y(scalar) |
51 | 51 | {} |
52 | 52 | |
53 | 53 | template <typename T, precision P> |
54 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(T s1, T s2) | |
54 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(T s1, T s2) | |
55 | 55 | : x(s1), y(s2) |
56 | 56 | {} |
57 | 57 | |
59 | 59 | |
60 | 60 | template <typename T, precision P> |
61 | 61 | template <typename A, typename B> |
62 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(A a, B b) | |
62 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(A a, B b) | |
63 | 63 | : x(static_cast<T>(a)) |
64 | 64 | , y(static_cast<T>(b)) |
65 | 65 | {} |
66 | 66 | |
67 | 67 | template <typename T, precision P> |
68 | 68 | template <typename A, typename B> |
69 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(tvec1<A, P> const & a, tvec1<B, P> const & b) | |
69 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec1<A, P> const & a, tvec1<B, P> const & b) | |
70 | 70 | : x(static_cast<T>(a.x)) |
71 | 71 | , y(static_cast<T>(b.x)) |
72 | 72 | {} |
75 | 75 | |
76 | 76 | template <typename T, precision P> |
77 | 77 | template <typename U, precision Q> |
78 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(tvec2<U, Q> const & v) | |
78 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec2<U, Q> const & v) | |
79 | 79 | : x(static_cast<T>(v.x)) |
80 | 80 | , y(static_cast<T>(v.y)) |
81 | 81 | {} |
82 | 82 | |
83 | 83 | template <typename T, precision P> |
84 | 84 | template <typename U, precision Q> |
85 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(tvec3<U, Q> const & v) | |
85 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec3<U, Q> const & v) | |
86 | 86 | : x(static_cast<T>(v.x)) |
87 | 87 | , y(static_cast<T>(v.y)) |
88 | 88 | {} |
89 | 89 | |
90 | 90 | template <typename T, precision P> |
91 | 91 | template <typename U, precision Q> |
92 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(tvec4<U, Q> const & v) | |
92 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec2<T, P>::tvec2(tvec4<U, Q> const & v) | |
93 | 93 | : x(static_cast<T>(v.x)) |
94 | 94 | , y(static_cast<T>(v.y)) |
95 | 95 | {} |
25 | 25 | |
26 | 26 | // -- Data -- |
27 | 27 | |
28 | # if GLM_HAS_ALIGNED_TYPE | |
28 | # if GLM_HAS_ONLY_XYZW | |
29 | T x, y, z; | |
30 | ||
31 | # elif GLM_HAS_ALIGNED_TYPE | |
29 | 32 | # if GLM_COMPILER & GLM_COMPILER_GCC |
30 | 33 | # pragma GCC diagnostic push |
31 | 34 | # pragma GCC diagnostic ignored "-Wpedantic" |
82 | 85 | |
83 | 86 | // -- Implicit basic constructors -- |
84 | 87 | |
85 | GLM_FUNC_DECL GLM_CONSTEXPR tvec3() GLM_DEFAULT_CTOR; | |
86 | GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec3<T, P> const & v) GLM_DEFAULT; | |
88 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3() GLM_DEFAULT_CTOR; | |
89 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec3<T, P> const & v) GLM_DEFAULT; | |
87 | 90 | template <precision Q> |
88 | GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec3<T, Q> const & v); | |
91 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec3<T, Q> const & v); | |
89 | 92 | |
90 | 93 | // -- Explicit basic constructors -- |
91 | 94 | |
92 | 95 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec3(ctor); |
93 | GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec3(T scalar); | |
94 | GLM_FUNC_DECL GLM_CONSTEXPR tvec3(T a, T b, T c); | |
96 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec3(T scalar); | |
97 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(T a, T b, T c); | |
95 | 98 | |
96 | 99 | // -- Conversion scalar constructors -- |
97 | 100 | |
98 | /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
101 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
99 | 102 | template <typename A, typename B, typename C> |
100 | GLM_FUNC_DECL GLM_CONSTEXPR tvec3(A a, B b, C c); | |
103 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(A a, B b, C c); | |
101 | 104 | template <typename A, typename B, typename C> |
102 | GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c); | |
105 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c); | |
103 | 106 | |
104 | 107 | // -- Conversion vector constructors -- |
105 | 108 | |
106 | 109 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
107 | 110 | template <typename A, typename B, precision Q> |
108 | GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec2<A, Q> const & a, B b); | |
111 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec2<A, Q> const & a, B b); | |
109 | 112 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
110 | 113 | template <typename A, typename B, precision Q> |
111 | GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b); | |
114 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b); | |
112 | 115 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
113 | 116 | template <typename A, typename B, precision Q> |
114 | GLM_FUNC_DECL GLM_CONSTEXPR tvec3(A a, tvec2<B, Q> const & b); | |
117 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(A a, tvec2<B, Q> const & b); | |
115 | 118 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
116 | 119 | template <typename A, typename B, precision Q> |
117 | GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b); | |
120 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b); | |
118 | 121 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
119 | 122 | template <typename U, precision Q> |
120 | GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec3(tvec4<U, Q> const & v); | |
123 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec3(tvec4<U, Q> const & v); | |
121 | 124 | |
122 | 125 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
123 | 126 | template <typename U, precision Q> |
124 | GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec3(tvec3<U, Q> const & v); | |
127 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec3(tvec3<U, Q> const & v); | |
125 | 128 | |
126 | 129 | // -- Swizzle constructors -- |
127 | 130 | # if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) |
32 | 32 | |
33 | 33 | # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) |
34 | 34 | template <typename T, precision P> |
35 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3() | |
35 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3() | |
36 | 36 | # ifndef GLM_FORCE_NO_CTOR_INIT |
37 | 37 | : x(0), y(0), z(0) |
38 | 38 | # endif |
41 | 41 | |
42 | 42 | # if !GLM_HAS_DEFAULTED_FUNCTIONS |
43 | 43 | template <typename T, precision P> |
44 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(tvec3<T, P> const & v) | |
44 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(tvec3<T, P> const & v) | |
45 | 45 | : x(v.x), y(v.y), z(v.z) |
46 | 46 | {} |
47 | 47 | # endif//!GLM_HAS_DEFAULTED_FUNCTIONS |
48 | 48 | |
49 | 49 | template <typename T, precision P> |
50 | 50 | template <precision Q> |
51 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(tvec3<T, Q> const & v) | |
51 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(tvec3<T, Q> const & v) | |
52 | 52 | : x(v.x), y(v.y), z(v.z) |
53 | 53 | {} |
54 | 54 | |
59 | 59 | {} |
60 | 60 | |
61 | 61 | template <typename T, precision P> |
62 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(T scalar) | |
62 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(T scalar) | |
63 | 63 | : x(scalar), y(scalar), z(scalar) |
64 | 64 | {} |
65 | 65 | |
66 | 66 | template <typename T, precision P> |
67 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(T a, T b, T c) | |
67 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(T a, T b, T c) | |
68 | 68 | : x(a), y(b), z(c) |
69 | 69 | {} |
70 | 70 | |
72 | 72 | |
73 | 73 | template <typename T, precision P> |
74 | 74 | template <typename A, typename B, typename C> |
75 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(A a, B b, C c) : | |
75 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(A a, B b, C c) : | |
76 | 76 | x(static_cast<T>(a)), |
77 | 77 | y(static_cast<T>(b)), |
78 | 78 | z(static_cast<T>(c)) |
80 | 80 | |
81 | 81 | template <typename T, precision P> |
82 | 82 | template <typename A, typename B, typename C> |
83 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c) : | |
83 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c) : | |
84 | 84 | x(static_cast<T>(a)), |
85 | 85 | y(static_cast<T>(b)), |
86 | 86 | z(static_cast<T>(c)) |
90 | 90 | |
91 | 91 | template <typename T, precision P> |
92 | 92 | template <typename A, typename B, precision Q> |
93 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(tvec2<A, Q> const & a, B b) : | |
93 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(tvec2<A, Q> const & a, B b) : | |
94 | 94 | x(static_cast<T>(a.x)), |
95 | 95 | y(static_cast<T>(a.y)), |
96 | 96 | z(static_cast<T>(b)) |
98 | 98 | |
99 | 99 | template <typename T, precision P> |
100 | 100 | template <typename A, typename B, precision Q> |
101 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b) : | |
101 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b) : | |
102 | 102 | x(static_cast<T>(a.x)), |
103 | 103 | y(static_cast<T>(a.y)), |
104 | 104 | z(static_cast<T>(b.x)) |
106 | 106 | |
107 | 107 | template <typename T, precision P> |
108 | 108 | template <typename A, typename B, precision Q> |
109 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(A a, tvec2<B, Q> const & b) : | |
109 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(A a, tvec2<B, Q> const & b) : | |
110 | 110 | x(static_cast<T>(a)), |
111 | 111 | y(static_cast<T>(b.x)), |
112 | 112 | z(static_cast<T>(b.y)) |
114 | 114 | |
115 | 115 | template <typename T, precision P> |
116 | 116 | template <typename A, typename B, precision Q> |
117 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b) : | |
117 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b) : | |
118 | 118 | x(static_cast<T>(a.x)), |
119 | 119 | y(static_cast<T>(b.x)), |
120 | 120 | z(static_cast<T>(b.y)) |
122 | 122 | |
123 | 123 | template <typename T, precision P> |
124 | 124 | template <typename U, precision Q> |
125 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(tvec3<U, Q> const & v) : | |
125 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(tvec3<U, Q> const & v) : | |
126 | 126 | x(static_cast<T>(v.x)), |
127 | 127 | y(static_cast<T>(v.y)), |
128 | 128 | z(static_cast<T>(v.z)) |
130 | 130 | |
131 | 131 | template <typename T, precision P> |
132 | 132 | template <typename U, precision Q> |
133 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(tvec4<U, Q> const & v) : | |
133 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3<T, P>::tvec3(tvec4<U, Q> const & v) : | |
134 | 134 | x(static_cast<T>(v.x)), |
135 | 135 | y(static_cast<T>(v.y)), |
136 | 136 | z(static_cast<T>(v.z)) |
25 | 25 | |
26 | 26 | // -- Data -- |
27 | 27 | |
28 | # if GLM_HAS_ALIGNED_TYPE | |
28 | # if GLM_HAS_ONLY_XYZW | |
29 | T x, y, z, w; | |
30 | ||
31 | # elif GLM_HAS_ALIGNED_TYPE | |
29 | 32 | # if GLM_COMPILER & GLM_COMPILER_GCC |
30 | 33 | # pragma GCC diagnostic push |
31 | 34 | # pragma GCC diagnostic ignored "-Wpedantic" |
35 | 38 | # pragma clang diagnostic ignored "-Wgnu-anonymous-struct" |
36 | 39 | # pragma clang diagnostic ignored "-Wnested-anon-types" |
37 | 40 | # endif |
38 | ||
41 | ||
39 | 42 | union |
40 | 43 | { |
41 | 44 | struct { T x, y, z, w;}; |
108 | 111 | |
109 | 112 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
110 | 113 | template <typename A, typename B, typename C, precision Q> |
111 | GLM_FUNC_DECL GLM_CONSTEXPR tvec4(tvec2<A, Q> const & a, B b, C c); | |
112 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
113 | template <typename A, typename B, typename C, precision Q> | |
114 | GLM_FUNC_DECL GLM_CONSTEXPR tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c); | |
115 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
116 | template <typename A, typename B, typename C, precision Q> | |
117 | GLM_FUNC_DECL GLM_CONSTEXPR tvec4(A a, tvec2<B, Q> const & b, C c); | |
118 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
119 | template <typename A, typename B, typename C, precision Q> | |
120 | GLM_FUNC_DECL GLM_CONSTEXPR tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c); | |
121 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
122 | template <typename A, typename B, typename C, precision Q> | |
123 | GLM_FUNC_DECL GLM_CONSTEXPR tvec4(A a, B b, tvec2<C, Q> const & c); | |
124 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
125 | template <typename A, typename B, typename C, precision Q> | |
126 | GLM_FUNC_DECL GLM_CONSTEXPR tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c); | |
114 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec2<A, Q> const & a, B b, C c); | |
115 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
116 | template <typename A, typename B, typename C, precision Q> | |
117 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c); | |
118 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
119 | template <typename A, typename B, typename C, precision Q> | |
120 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(A a, tvec2<B, Q> const & b, C c); | |
121 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
122 | template <typename A, typename B, typename C, precision Q> | |
123 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c); | |
124 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
125 | template <typename A, typename B, typename C, precision Q> | |
126 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(A a, B b, tvec2<C, Q> const & c); | |
127 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) | |
128 | template <typename A, typename B, typename C, precision Q> | |
129 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c); | |
127 | 130 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
128 | 131 | template <typename A, typename B, precision Q> |
129 | GLM_FUNC_DECL GLM_CONSTEXPR tvec4(tvec3<A, Q> const & a, B b); | |
132 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec3<A, Q> const & a, B b); | |
130 | 133 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
131 | 134 | template <typename A, typename B, precision Q> |
132 | GLM_FUNC_DECL GLM_CONSTEXPR tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b); | |
135 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b); | |
133 | 136 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
134 | 137 | template <typename A, typename B, precision Q> |
135 | GLM_FUNC_DECL GLM_CONSTEXPR tvec4(A a, tvec3<B, Q> const & b); | |
138 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(A a, tvec3<B, Q> const & b); | |
136 | 139 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
137 | 140 | template <typename A, typename B, precision Q> |
138 | GLM_FUNC_DECL GLM_CONSTEXPR tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b); | |
141 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b); | |
139 | 142 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
140 | 143 | template <typename A, typename B, precision Q> |
141 | GLM_FUNC_DECL GLM_CONSTEXPR tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b); | |
144 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b); | |
142 | 145 | |
143 | 146 | /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) |
144 | 147 | template <typename U, precision Q> |
145 | GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec4(tvec4<U, Q> const& v); | |
148 | GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT tvec4(tvec4<U, Q> const& v); | |
146 | 149 | |
147 | 150 | // -- Swizzle constructors -- |
148 | 151 | # if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) |
215 | 215 | |
216 | 216 | template <typename T, precision P> |
217 | 217 | template <typename A, typename B, typename C, precision Q> |
218 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(tvec2<A, Q> const & a, B b, C c) : | |
218 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(tvec2<A, Q> const & a, B b, C c) : | |
219 | 219 | x(static_cast<T>(a.x)), |
220 | 220 | y(static_cast<T>(a.y)), |
221 | 221 | z(static_cast<T>(b)), |
224 | 224 | |
225 | 225 | template <typename T, precision P> |
226 | 226 | template <typename A, typename B, typename C, precision Q> |
227 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c) : | |
227 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c) : | |
228 | 228 | x(static_cast<T>(a.x)), |
229 | 229 | y(static_cast<T>(a.y)), |
230 | 230 | z(static_cast<T>(b.x)), |
233 | 233 | |
234 | 234 | template <typename T, precision P> |
235 | 235 | template <typename A, typename B, typename C, precision Q> |
236 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(A s1, tvec2<B, Q> const & v, C s2) : | |
236 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(A s1, tvec2<B, Q> const & v, C s2) : | |
237 | 237 | x(static_cast<T>(s1)), |
238 | 238 | y(static_cast<T>(v.x)), |
239 | 239 | z(static_cast<T>(v.y)), |
242 | 242 | |
243 | 243 | template <typename T, precision P> |
244 | 244 | template <typename A, typename B, typename C, precision Q> |
245 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c) : | |
245 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c) : | |
246 | 246 | x(static_cast<T>(a.x)), |
247 | 247 | y(static_cast<T>(b.x)), |
248 | 248 | z(static_cast<T>(b.y)), |
251 | 251 | |
252 | 252 | template <typename T, precision P> |
253 | 253 | template <typename A, typename B, typename C, precision Q> |
254 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(A s1, B s2, tvec2<C, Q> const & v) : | |
254 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(A s1, B s2, tvec2<C, Q> const & v) : | |
255 | 255 | x(static_cast<T>(s1)), |
256 | 256 | y(static_cast<T>(s2)), |
257 | 257 | z(static_cast<T>(v.x)), |
260 | 260 | |
261 | 261 | template <typename T, precision P> |
262 | 262 | template <typename A, typename B, typename C, precision Q> |
263 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c) : | |
263 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c) : | |
264 | 264 | x(static_cast<T>(a.x)), |
265 | 265 | y(static_cast<T>(b.x)), |
266 | 266 | z(static_cast<T>(c.x)), |
269 | 269 | |
270 | 270 | template <typename T, precision P> |
271 | 271 | template <typename A, typename B, precision Q> |
272 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(tvec3<A, Q> const & a, B b) : | |
272 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(tvec3<A, Q> const & a, B b) : | |
273 | 273 | x(static_cast<T>(a.x)), |
274 | 274 | y(static_cast<T>(a.y)), |
275 | 275 | z(static_cast<T>(a.z)), |
278 | 278 | |
279 | 279 | template <typename T, precision P> |
280 | 280 | template <typename A, typename B, precision Q> |
281 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b) : | |
281 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b) : | |
282 | 282 | x(static_cast<T>(a.x)), |
283 | 283 | y(static_cast<T>(a.y)), |
284 | 284 | z(static_cast<T>(a.z)), |
287 | 287 | |
288 | 288 | template <typename T, precision P> |
289 | 289 | template <typename A, typename B, precision Q> |
290 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(A a, tvec3<B, Q> const & b) : | |
290 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(A a, tvec3<B, Q> const & b) : | |
291 | 291 | x(static_cast<T>(a)), |
292 | 292 | y(static_cast<T>(b.x)), |
293 | 293 | z(static_cast<T>(b.y)), |
296 | 296 | |
297 | 297 | template <typename T, precision P> |
298 | 298 | template <typename A, typename B, precision Q> |
299 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b) : | |
299 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b) : | |
300 | 300 | x(static_cast<T>(a.x)), |
301 | 301 | y(static_cast<T>(b.x)), |
302 | 302 | z(static_cast<T>(b.y)), |
305 | 305 | |
306 | 306 | template <typename T, precision P> |
307 | 307 | template <typename A, typename B, precision Q> |
308 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b) : | |
308 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b) : | |
309 | 309 | x(static_cast<T>(a.x)), |
310 | 310 | y(static_cast<T>(a.y)), |
311 | 311 | z(static_cast<T>(b.x)), |
314 | 314 | |
315 | 315 | template <typename T, precision P> |
316 | 316 | template <typename U, precision Q> |
317 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(tvec4<U, Q> const & v) : | |
317 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4<T, P>::tvec4(tvec4<U, Q> const & v) : | |
318 | 318 | x(static_cast<T>(v.x)), |
319 | 319 | y(static_cast<T>(v.y)), |
320 | 320 | z(static_cast<T>(v.z)), |
22 | 22 | { |
23 | 23 | GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const& ColorRGB, T GammaCorrection) |
24 | 24 | { |
25 | return tvec4<T, P>(compute_rgbToSrgb<T, P, tvec3>::call(tvec3<T, P>(ColorRGB), GammaCorrection), ColorRGB.a); | |
25 | return tvec4<T, P>(compute_rgbToSrgb<T, P, tvec3>::call(tvec3<T, P>(ColorRGB), GammaCorrection), ColorRGB.w); | |
26 | 26 | } |
27 | 27 | }; |
28 | 28 | |
43 | 43 | { |
44 | 44 | GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const& ColorSRGB, T Gamma) |
45 | 45 | { |
46 | return tvec4<T, P>(compute_srgbToRgb<T, P, tvec3>::call(tvec3<T, P>(ColorSRGB), Gamma), ColorSRGB.a); | |
46 | return tvec4<T, P>(compute_srgbToRgb<T, P, tvec3>::call(tvec3<T, P>(ColorSRGB), Gamma), ColorSRGB.w); | |
47 | 47 | } |
48 | 48 | }; |
49 | 49 | }//namespace detail |
104 | 104 | { |
105 | 105 | tvec3<T, defaultp> rgbw = tvec3<T, defaultp>(T(0.2126), T(0.7152), T(0.0722)); |
106 | 106 | |
107 | T col0 = (T(1) - s) * rgbw.r; | |
108 | T col1 = (T(1) - s) * rgbw.g; | |
109 | T col2 = (T(1) - s) * rgbw.b; | |
107 | tvec3<T, defaultp> const col((T(1) - s) * rgbw); | |
110 | 108 | |
111 | 109 | tmat4x4<T, defaultp> result(T(1)); |
112 | result[0][0] = col0 + s; | |
113 | result[0][1] = col0; | |
114 | result[0][2] = col0; | |
115 | result[1][0] = col1; | |
116 | result[1][1] = col1 + s; | |
117 | result[1][2] = col1; | |
118 | result[2][0] = col2; | |
119 | result[2][1] = col2; | |
120 | result[2][2] = col2 + s; | |
110 | result[0][0] = col.x + s; | |
111 | result[0][1] = col.x; | |
112 | result[0][2] = col.x; | |
113 | result[1][0] = col.y; | |
114 | result[1][1] = col.y + s; | |
115 | result[1][2] = col.y; | |
116 | result[2][0] = col.z; | |
117 | result[2][1] = col.z; | |
118 | result[2][2] = col.z + s; | |
121 | 119 | return result; |
122 | 120 | } |
123 | 121 |
13 | 13 | typename genType::value_type d = glm::dot(dir, planeNormal); |
14 | 14 | typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon(); |
15 | 15 | |
16 | if(d < Epsilon) | |
16 | if(d < -Epsilon) | |
17 | 17 | { |
18 | 18 | intersectionDistance = glm::dot(planeOrig - orig, planeNormal) / d; |
19 | 19 | return true; |
124 | 124 | { |
125 | 125 | for(length_t i = 0; i < 3; i++) |
126 | 126 | { |
127 | Scale.x *= static_cast<T>(-1); | |
127 | Scale[i] *= static_cast<T>(-1); | |
128 | 128 | Row[i] *= static_cast<T>(-1); |
129 | 129 | } |
130 | 130 | } |
421 | 421 | #elif GLM_ARCH & GLM_ARCH_AVX_BIT |
422 | 422 | # include <immintrin.h> |
423 | 423 | #elif GLM_ARCH & GLM_ARCH_SSE42_BIT |
424 | # if GLM_COMPILER & GLM_COMPILER_CLANG | |
425 | # include <popcntintrin.h> | |
426 | # endif | |
424 | 427 | # include <nmmintrin.h> |
425 | 428 | #elif GLM_ARCH & GLM_ARCH_SSE41_BIT |
426 | 429 | # include <smmintrin.h> |
49 | 49 | ## [Lastest release](https://github.com/g-truc/glm/releases/latest) |
50 | 50 | |
51 | 51 | ## Release notes |
52 | ||
53 | #### [GLM 0.9.8.4](https://github.com/g-truc/glm/releases/tag/0.9.8.4) - 2017-01-22 | |
54 | ##### Fixes: | |
55 | - Fixed GTC_packing test failing on GCC x86 due to denorms #212 #577 | |
56 | - Fixed POPCNT optimization build in Clang #512 | |
57 | - Fixed intersectRayPlane returns true in parallel case #578 | |
58 | - Fixed GCC 6.2 compiler warnings #580 | |
59 | - Fixed GTX_matrix_decompose decompose #582 #448 | |
60 | - Fixed GCC 4.5 and older build #566 | |
61 | - Fixed Visual C++ internal error when declaring a global vec type with siwzzle expression enabled #594 | |
62 | - Fixed GLM_FORCE_CXX11 with Clang and libstlc++ which wasn't using C++11 STL features. #604 | |
52 | 63 | |
53 | 64 | #### [GLM 0.9.8.3](https://github.com/g-truc/glm/releases/tag/0.9.8.3) - 2016-11-12 |
54 | 65 | ##### Improvements: |
97 | 97 | glm::uint ulp(0); |
98 | 98 | float diff(0.0f); |
99 | 99 | |
100 | for(float f = 0.001f; f < 10.f; f *= 1.001f) | |
100 | for(float f = 0.001f; f < 10.f; f *= 1.01f) | |
101 | 101 | { |
102 | 102 | glm::lowp_fvec1 u(f); |
103 | 103 | glm::lowp_fvec1 lowp_v = glm::inversesqrt(u); |
105 | 105 | |
106 | 106 | ulp = glm::max(glm::float_distance(lowp_v.x, defaultp_v), ulp); |
107 | 107 | diff = glm::abs(lowp_v.x - defaultp_v); |
108 | Error += diff > 0.1f ? 1 : 0; | |
108 | 109 | } |
109 | 110 | |
110 | 111 | return Error; |
0 | 0 | #define GLM_FORCE_MESSAGES |
1 | 1 | #define GLM_FORCE_SWIZZLE |
2 | 2 | #include <glm/glm.hpp> |
3 | ||
4 | #if !GLM_HAS_ONLY_XYZW | |
3 | 5 | |
4 | 6 | int test_ivec2_swizzle() |
5 | 7 | { |
59 | 61 | |
60 | 62 | return Error; |
61 | 63 | } |
64 | #endif//!GLM_HAS_ONLY_XYZW | |
62 | 65 | |
63 | 66 | int main() |
64 | 67 | { |
65 | 68 | int Error = 0; |
66 | 69 | |
67 | Error += test_ivec2_swizzle(); | |
68 | Error += test_ivec3_swizzle(); | |
69 | Error += test_ivec4_swizzle(); | |
70 | # if !GLM_HAS_ONLY_XYZW | |
71 | Error += test_ivec2_swizzle(); | |
72 | Error += test_ivec3_swizzle(); | |
73 | Error += test_ivec4_swizzle(); | |
70 | 74 | |
71 | Error += test_vec4_swizzle(); | |
75 | Error += test_vec4_swizzle(); | |
76 | # endif//!GLM_HAS_ONLY_XYZW | |
72 | 77 | |
73 | 78 | return Error; |
74 | 79 | } |
225 | 225 | |
226 | 226 | int test_cpp_version() |
227 | 227 | { |
228 | std::printf("__cplusplus: %lld\n", __cplusplus); | |
228 | std::printf("__cplusplus: %d\n", static_cast<int>(__cplusplus)); | |
229 | 229 | |
230 | 230 | return 0; |
231 | 231 | } |
93 | 93 | size_t align64_unaligned = alignof(glm::detail::storage<int, 64, false>::type); |
94 | 94 | Error += align64_unaligned == 1 ? 0 : 1; |
95 | 95 | |
96 | # else | |
96 | # elif GLM_COMPILER & GLM_COMPILER_GCC | |
97 | 97 | |
98 | 98 | size_t align1_unaligned = __alignof__(glm::detail::storage<int, 1, false>::type); |
99 | 99 | Error += align1_unaligned == 1 ? 0 : 1; |
1 | 1 | #include <glm/vector_relational.hpp> |
2 | 2 | #include <glm/gtc/vec1.hpp> |
3 | 3 | #include <vector> |
4 | ||
5 | static glm::vec1 v1; | |
6 | static glm::vec1 v2(1); | |
4 | 7 | |
5 | 8 | int test_vec1_operators() |
6 | 9 | { |
4 | 4 | #if GLM_HAS_TRIVIAL_QUERIES |
5 | 5 | # include <type_traits> |
6 | 6 | #endif |
7 | ||
8 | static glm::vec2 v1; | |
9 | static glm::vec2 v2(1); | |
10 | static glm::vec2 v3(1, 1); | |
7 | 11 | |
8 | 12 | int test_vec2_operators() |
9 | 13 | { |
5 | 5 | #include <glm/vec4.hpp> |
6 | 6 | #include <cstdio> |
7 | 7 | #include <vector> |
8 | ||
9 | static glm::vec3 v1; | |
10 | static glm::vec3 v2(1); | |
11 | static glm::vec3 v3(1, 1, 1); | |
8 | 12 | |
9 | 13 | int test_vec3_ctor() |
10 | 14 | { |
333 | 337 | return Error; |
334 | 338 | } |
335 | 339 | |
340 | #if !GLM_HAS_ONLY_XYZW | |
336 | 341 | int test_vec3_swizzle_operators() |
337 | 342 | { |
338 | 343 | int Error = 0; |
439 | 444 | |
440 | 445 | return Error; |
441 | 446 | } |
447 | #endif//!GLM_HAS_ONLY_XYZW | |
442 | 448 | |
443 | 449 | int test_operator_increment() |
444 | 450 | { |
479 | 485 | Error += test_vec3_size(); |
480 | 486 | Error += test_vec3_swizzle3_2(); |
481 | 487 | Error += test_vec3_swizzle3_3(); |
482 | Error += test_vec3_swizzle_partial(); | |
483 | Error += test_vec3_swizzle_operators(); | |
484 | Error += test_vec3_swizzle_functions(); | |
485 | 488 | Error += test_operator_increment(); |
486 | 489 | |
487 | return Error; | |
488 | } | |
490 | # if !GLM_HAS_ONLY_XYZW | |
491 | Error += test_vec3_swizzle_partial(); | |
492 | Error += test_vec3_swizzle_operators(); | |
493 | Error += test_vec3_swizzle_functions(); | |
494 | # endif//!GLM_HAS_ONLY_XYZW | |
495 | ||
496 | return Error; | |
497 | } |
6 | 6 | #include <cstdio> |
7 | 7 | #include <ctime> |
8 | 8 | #include <vector> |
9 | ||
10 | static glm::vec4 v1; | |
11 | static glm::vec4 v2(1); | |
12 | static glm::vec4 v3(1, 1, 1, 1); | |
9 | 13 | |
10 | 14 | template <int Value> |
11 | 15 | struct mask |
1 | 1 | #include <gli/gli.hpp> |
2 | 2 | #include <gli/gtx/loader.hpp> |
3 | 3 | |
4 | std::size_t const Size = 64; | |
5 | ||
4 | 6 | int test_simplex() |
5 | 7 | { |
6 | std::size_t const Size = 256; | |
7 | ||
8 | 8 | { |
9 | 9 | std::vector<glm::byte> ImageData(Size * Size * 3); |
10 | 10 | |
61 | 61 | |
62 | 62 | int test_perlin() |
63 | 63 | { |
64 | std::size_t const Size = 256; | |
65 | ||
66 | 64 | { |
67 | 65 | std::vector<glm::byte> ImageData(Size * Size * 3); |
68 | 66 | |
119 | 117 | |
120 | 118 | int test_perlin_pedioric() |
121 | 119 | { |
122 | std::size_t const Size = 256; | |
123 | ||
124 | 120 | { |
125 | 121 | std::vector<glm::byte> ImageData(Size * Size * 3); |
126 | 122 |
172 | 172 | glm::vec4 v0 = glm::unpackSnorm3x10_1x2(p0); |
173 | 173 | glm::uint32 p1 = glm::packSnorm3x10_1x2(v0); |
174 | 174 | glm::vec4 v1 = glm::unpackSnorm3x10_1x2(p1); |
175 | Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; | |
175 | ||
176 | Error += glm::all(glm::epsilonEqual(v0, v1, 0.01f)) ? 0 : 1; | |
176 | 177 | } |
177 | 178 | |
178 | 179 | return Error; |
196 | 197 | glm::vec4 v0 = glm::unpackUnorm3x10_1x2(p0); |
197 | 198 | glm::uint32 p1 = glm::packUnorm3x10_1x2(v0); |
198 | 199 | glm::vec4 v1 = glm::unpackUnorm3x10_1x2(p1); |
199 | Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; | |
200 | ||
201 | Error += glm::all(glm::epsilonEqual(v0, v1, 0.001f)) ? 0 : 1; | |
200 | 202 | } |
201 | 203 | |
202 | 204 | return Error; |
672 | 674 | Error += test_F3x9_E1x5(); |
673 | 675 | Error += test_Snorm3x10_1x2(); |
674 | 676 | Error += test_Unorm3x10_1x2(); |
677 | ||
675 | 678 | Error += test_I3x10_1x2(); |
676 | 679 | Error += test_U3x10_1x2(); |
677 | 680 | Error += test_Half1x16(); |
3 | 3 | # include <array> |
4 | 4 | #endif |
5 | 5 | |
6 | std::size_t const TestSamples = 10000; | |
7 | ||
6 | 8 | int test_linearRand() |
7 | 9 | { |
8 | 10 | int Error = 0; |
14 | 16 | glm::u8vec2 AMin(std::numeric_limits<glm::u8>::max()); |
15 | 17 | glm::u8vec2 AMax(std::numeric_limits<glm::u8>::min()); |
16 | 18 | { |
17 | for(std::size_t i = 0; i < 100000; ++i) | |
19 | for(std::size_t i = 0; i < TestSamples; ++i) | |
18 | 20 | { |
19 | 21 | glm::u8vec2 A = glm::linearRand(glm::u8vec2(Min), glm::u8vec2(Max)); |
20 | 22 | AMin = glm::min(AMin, A); |
35 | 37 | glm::u16vec2 BMin(std::numeric_limits<glm::u16>::max()); |
36 | 38 | glm::u16vec2 BMax(std::numeric_limits<glm::u16>::min()); |
37 | 39 | { |
38 | for(std::size_t i = 0; i < 100000; ++i) | |
40 | for(std::size_t i = 0; i < TestSamples; ++i) | |
39 | 41 | { |
40 | 42 | glm::u16vec2 B = glm::linearRand(glm::u16vec2(Min), glm::u16vec2(Max)); |
41 | 43 | BMin = glm::min(BMin, B); |
56 | 58 | glm::u32vec2 CMin(std::numeric_limits<glm::u32>::max()); |
57 | 59 | glm::u32vec2 CMax(std::numeric_limits<glm::u32>::min()); |
58 | 60 | { |
59 | for(std::size_t i = 0; i < 100000; ++i) | |
61 | for(std::size_t i = 0; i < TestSamples; ++i) | |
60 | 62 | { |
61 | 63 | glm::u32vec2 C = glm::linearRand(glm::u32vec2(Min), glm::u32vec2(Max)); |
62 | 64 | CMin = glm::min(CMin, C); |
77 | 79 | glm::u64vec2 DMin(std::numeric_limits<glm::u64>::max()); |
78 | 80 | glm::u64vec2 DMax(std::numeric_limits<glm::u64>::min()); |
79 | 81 | { |
80 | for(std::size_t i = 0; i < 100000; ++i) | |
82 | for(std::size_t i = 0; i < TestSamples; ++i) | |
81 | 83 | { |
82 | 84 | glm::u64vec2 D = glm::linearRand(glm::u64vec2(Min), glm::u64vec2(Max)); |
83 | 85 | DMin = glm::min(DMin, D); |
100 | 102 | glm::i8vec2 AMin(std::numeric_limits<glm::i8>::max()); |
101 | 103 | glm::i8vec2 AMax(std::numeric_limits<glm::i8>::min()); |
102 | 104 | { |
103 | for(std::size_t i = 0; i < 100000; ++i) | |
105 | for(std::size_t i = 0; i < TestSamples; ++i) | |
104 | 106 | { |
105 | 107 | glm::i8vec2 A = glm::linearRand(glm::i8vec2(Min), glm::i8vec2(Max)); |
106 | 108 | AMin = glm::min(AMin, A); |
121 | 123 | glm::i16vec2 BMin(std::numeric_limits<glm::i16>::max()); |
122 | 124 | glm::i16vec2 BMax(std::numeric_limits<glm::i16>::min()); |
123 | 125 | { |
124 | for(std::size_t i = 0; i < 100000; ++i) | |
126 | for(std::size_t i = 0; i < TestSamples; ++i) | |
125 | 127 | { |
126 | 128 | glm::i16vec2 B = glm::linearRand(glm::i16vec2(Min), glm::i16vec2(Max)); |
127 | 129 | BMin = glm::min(BMin, B); |
142 | 144 | glm::i32vec2 CMin(std::numeric_limits<glm::i32>::max()); |
143 | 145 | glm::i32vec2 CMax(std::numeric_limits<glm::i32>::min()); |
144 | 146 | { |
145 | for(std::size_t i = 0; i < 100000; ++i) | |
147 | for(std::size_t i = 0; i < TestSamples; ++i) | |
146 | 148 | { |
147 | 149 | glm::i32vec2 C = glm::linearRand(glm::i32vec2(Min), glm::i32vec2(Max)); |
148 | 150 | CMin = glm::min(CMin, C); |
163 | 165 | glm::i64vec2 DMin(std::numeric_limits<glm::i64>::max()); |
164 | 166 | glm::i64vec2 DMax(std::numeric_limits<glm::i64>::min()); |
165 | 167 | { |
166 | for(std::size_t i = 0; i < 100000; ++i) | |
168 | for(std::size_t i = 0; i < TestSamples; ++i) | |
167 | 169 | { |
168 | 170 | glm::i64vec2 D = glm::linearRand(glm::i64vec2(Min), glm::i64vec2(Max)); |
169 | 171 | DMin = glm::min(DMin, D); |
182 | 184 | } |
183 | 185 | } |
184 | 186 | |
185 | for(std::size_t i = 0; i < 100000; ++i) | |
187 | for(std::size_t i = 0; i < TestSamples; ++i) | |
186 | 188 | { |
187 | 189 | glm::f32vec2 const A(glm::linearRand(glm::f32vec2(static_cast<float>(Min)), glm::f32vec2(static_cast<float>(Max)))); |
188 | 190 | if(!glm::all(glm::lessThanEqual(A, glm::f32vec2(static_cast<float>(Max))))) |
201 | 203 | { |
202 | 204 | float ResultFloat = 0.0f; |
203 | 205 | double ResultDouble = 0.0f; |
204 | for(std::size_t i = 0; i < 100000; ++i) | |
206 | for(std::size_t i = 0; i < TestSamples; ++i) | |
205 | 207 | { |
206 | 208 | ResultFloat += glm::linearRand(-1.0f, 1.0f); |
207 | 209 | ResultDouble += glm::linearRand(-1.0, 1.0); |
220 | 222 | int Error = 0; |
221 | 223 | |
222 | 224 | { |
223 | std::size_t Max = 100000; | |
225 | std::size_t Max = TestSamples; | |
224 | 226 | float ResultFloat = 0.0f; |
225 | 227 | double ResultDouble = 0.0f; |
226 | 228 | double Radius = 2.0f; |
244 | 246 | int Error = 0; |
245 | 247 | |
246 | 248 | { |
247 | std::size_t Max = 100000; | |
249 | std::size_t Max = TestSamples; | |
248 | 250 | float ResultFloatA = 0.0f; |
249 | 251 | float ResultFloatB = 0.0f; |
250 | 252 | float ResultFloatC = 0.0f; |
282 | 284 | float ResultFloat = 0.0f; |
283 | 285 | double ResultDouble = 0.0f; |
284 | 286 | |
285 | for(std::size_t i = 0; i < 100000; ++i) | |
287 | for(std::size_t i = 0; i < TestSamples; ++i) | |
286 | 288 | { |
287 | 289 | ResultFloat += glm::length(glm::diskRand(2.0f)); |
288 | 290 | ResultDouble += glm::length(glm::diskRand(2.0)); |
289 | 291 | } |
290 | 292 | |
291 | Error += ResultFloat < 200000.f ? 0 : 1; | |
292 | Error += ResultDouble < 200000.0 ? 0 : 1; | |
293 | Error += ResultFloat < float(TestSamples) * 2.f ? 0 : 1; | |
294 | Error += ResultDouble < double(TestSamples) * 2.0 ? 0 : 1; | |
293 | 295 | assert(!Error); |
294 | 296 | } |
295 | 297 | |
304 | 306 | float ResultFloat = 0.0f; |
305 | 307 | double ResultDouble = 0.0f; |
306 | 308 | |
307 | for(std::size_t i = 0; i < 100000; ++i) | |
309 | for(std::size_t i = 0; i < TestSamples; ++i) | |
308 | 310 | { |
309 | 311 | ResultFloat += glm::length(glm::ballRand(2.0f)); |
310 | 312 | ResultDouble += glm::length(glm::ballRand(2.0)); |
311 | 313 | } |
312 | 314 | |
313 | Error += ResultFloat < 200000.f ? 0 : 1; | |
314 | Error += ResultDouble < 200000.0 ? 0 : 1; | |
315 | Error += ResultFloat < float(TestSamples) * 2.f ? 0 : 1; | |
316 | Error += ResultDouble < double(TestSamples) * 2.0 ? 0 : 1; | |
315 | 317 | assert(!Error); |
316 | 318 | } |
317 | 319 |