diff --git a/Part1/PROJ_WIN/Project3/Project3.vcxproj b/Part1/PROJ_WIN/Project3/Project3.vcxproj index 20ddcbc..de4fe27 100644 --- a/Part1/PROJ_WIN/Project3/Project3.vcxproj +++ b/Part1/PROJ_WIN/Project3/Project3.vcxproj @@ -26,11 +26,11 @@ false true MultiByte - v110 + v100 - + @@ -46,7 +46,7 @@ Level3 Disabled - C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include;C:/ProgramData/NVIDIA Corporation/CUDA Samples/v5.5/common/inc;../shared/glew/includes;../shared/freeglut/includes + C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include;C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\common\inc;../shared/glew/includes;../shared/freeglut/includes WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) @@ -57,7 +57,7 @@ mainCRTStartup - C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include;C:/ProgramData/NVIDIA Corporation/CUDA Samples/v5.5/common/inc;../shared/glew/includes;../shared/freeglut/includes + C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include;C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\common\inc;../shared/glew/includes;../shared/freeglut/includes $(ProjectDir)$(Platform)/$(Configuration)/%(Filename)%(Extension).obj true true @@ -71,12 +71,19 @@ MaxSpeed true true + C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include;C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\common\inc;../shared/glew/includes;../shared/freeglut/includes true true true + ../shared/glew/lib;../shared/freeglut/lib;%(AdditionalLibraryDirectories) + cudart.lib; glew32.lib;glu32.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include;C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\common\inc;../shared/glew/includes;../shared/freeglut/includes + $(ProjectDir)$(Platform)/$(Configuration)/%(Filename)%(Extension).obj + @@ -105,6 +112,6 @@ - + \ No newline at end of file diff --git a/Part1/PROJ_WIN/Project3/shaders/heightFS.glsl b/Part1/PROJ_WIN/Project3/shaders/heightFS.glsl index e36d53e..300fdda 100644 --- a/Part1/PROJ_WIN/Project3/shaders/heightFS.glsl +++ b/Part1/PROJ_WIN/Project3/shaders/heightFS.glsl @@ -1,4 +1,10 @@ +varying vec2 v_Texcoords; +varying float f_height; + void main(void) { - gl_FragColor = vec4(0.05,0.15,0.3,1.0); -} + float shade = (1.0-2.0*sqrt(f_height)); + float alpha = float(mod(v_Texcoords.x+0.025, 0.05) > 0.046 || mod(v_Texcoords.y+0.025, 0.05) > 0.046); + vec4 color = mix(vec4(0.05,0.15,0.3,1.0), vec4(0.05, 0.3, 0.4, 1.0), alpha); + gl_FragColor = shade*color; +} \ No newline at end of file diff --git a/Part1/PROJ_WIN/Project3/shaders/heightVS.glsl b/Part1/PROJ_WIN/Project3/shaders/heightVS.glsl index eda1b93..db82f90 100644 --- a/Part1/PROJ_WIN/Project3/shaders/heightVS.glsl +++ b/Part1/PROJ_WIN/Project3/shaders/heightVS.glsl @@ -1,9 +1,18 @@ uniform mat4 u_projMatrix; +uniform sampler2D u_height; + attribute vec4 Position; +attribute vec2 Texcoords; + +varying vec2 v_Texcoords; +varying float f_height; void main(void) { - vec4 pos = u_projMatrix * Position; - pos.z += 0.01; - gl_Position = pos; -} + v_Texcoords = Texcoords; + vec4 pos = Position; + f_height = texture2D(u_height, Texcoords).w; + pos.z = -0.01-clamp(f_height,0.0,2.0); + pos = u_projMatrix * pos; + gl_Position = pos; +} \ No newline at end of file diff --git a/Part1/PROJ_WIN/Project3/shaders/planetFS.glsl b/Part1/PROJ_WIN/Project3/shaders/planetFS.glsl index e2c1350..d4333eb 100644 --- a/Part1/PROJ_WIN/Project3/shaders/planetFS.glsl +++ b/Part1/PROJ_WIN/Project3/shaders/planetFS.glsl @@ -1,4 +1,28 @@ -void main(void) +#version 330 + +in vec3 WorldCoord; +in vec3 ToCam; +in vec3 Up; +in vec3 Right; +in vec2 TexCoord; +out vec4 FragColor; + +void main() { - gl_FragColor = vec4(1.0); -} + vec2 coord = 2.01 * (TexCoord - vec2(0.5)); + float r = length(coord); + if (r >= 1.0) { discard; } + + float dist = length(WorldCoord); + if(dist <= 0.01) + { + FragColor = vec4(1.0); + return; + } + + vec3 N = Right*-coord.x + Up*coord.y + ToCam*sqrt(1-r*r); + vec3 L = normalize(-WorldCoord); + float light = 0.1 + 0.9*clamp(dot(N,L),0.0, 1.0)*exp(-dist); + vec3 color = vec3(0.4, 0.1, 0.6); + FragColor = vec4(color*light,1.0); +} \ No newline at end of file diff --git a/Part1/PROJ_WIN/Project3/shaders/planetGS.glsl b/Part1/PROJ_WIN/Project3/shaders/planetGS.glsl index 88027d3..e45f28e 100644 --- a/Part1/PROJ_WIN/Project3/shaders/planetGS.glsl +++ b/Part1/PROJ_WIN/Project3/shaders/planetGS.glsl @@ -1,15 +1,49 @@ #version 330 uniform mat4 u_projMatrix; +uniform vec3 u_cameraPos; layout (points) in; -layout (points) out; -layout (max_vertices = 1) out; +layout (triangle_strip) out; +layout (max_vertices = 4) out; + +out vec3 WorldCoord; +out vec3 ToCam; +out vec3 Up; +out vec3 Right; +out vec2 TexCoord; + +const float scale = 0.03; void main() { vec3 Position = gl_in[0].gl_Position.xyz; - gl_Position = u_projMatrix * vec4(Position, 1.0); + WorldCoord = Position; + + ToCam = normalize(u_cameraPos - Position); + Up = vec3(0.0, 0.0, 1.0); + Right = cross(ToCam, Up); + Up = cross(Right, ToCam); + + vec3 Pos = Position + scale*Right - scale*Up; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.0, 0.0); + EmitVertex(); + + Pos = Position + scale*Right + scale*Up; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(0.0, 1.0); EmitVertex(); + + Pos = Position - scale*Right - scale*Up; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(1.0, 0.0); + EmitVertex(); + + Pos = Position - scale*Right + scale*Up; + gl_Position = u_projMatrix * vec4(Pos, 1.0); + TexCoord = vec2(1.0, 1.0); + EmitVertex(); + EndPrimitive(); -} +} \ No newline at end of file diff --git a/Part1/PROJ_WIN/shared/glut32.dll b/Part1/PROJ_WIN/shared/glut32.dll new file mode 100644 index 0000000..106646f Binary files /dev/null and b/Part1/PROJ_WIN/shared/glut32.dll differ diff --git a/Part1/PROJ_WIN/src/kernel.cu.deps b/Part1/PROJ_WIN/src/kernel.cu.deps index 35aaf16..b99b4bb 100644 --- a/Part1/PROJ_WIN/src/kernel.cu.deps +++ b/Part1/PROJ_WIN/src/kernel.cu.deps @@ -1,18 +1,18 @@ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\cuda_runtime.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_config.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sal.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sal.h c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vadefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vadefs.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\builtin_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\device_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_defines.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\driver_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_defines.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stddef.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stddef.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\surface_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\driver_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\texture_types.h @@ -68,12 +68,12 @@ c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\surface_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\texture_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\vector_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_defines.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\time.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wtime.inl -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\time.inl +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\time.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wtime.inl +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\time.inl c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\math_functions.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\builtin_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\device_types.h @@ -82,16 +82,16 @@ c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\surface_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\texture_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\vector_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_defines.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdlib.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cmath -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\yvals.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\use_ansi.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdlib.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cmath +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\yvals.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\use_ansi.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\cuda_surface_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\builtin_types.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\device_types.h @@ -239,285 +239,286 @@ c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\host_defines.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\vector_functions.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\device_launch_parameters.h c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\vector_types.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\swprintf.inl +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\swprintf.inl C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\cuda.h -c:\users\liam\project3-simulation\part1\src\glm/glm.hpp -c:\users\liam\project3-simulation\part1\src\glm\core/_fixes.hpp -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\climits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cfloat -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\float.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtwrn.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cwchar -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wchar.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstddef -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdio -c:\users\liam\project3-simulation\part1\src\glm\core/setup.hpp -c:\users\liam\project3-simulation\part1\src\glm\./core/_detail.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\setup.hpp -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cassert -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\assert.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -c:\users\liam\project3-simulation\part1\src\glm\./core/_vectorize.hpp -c:\users\liam\project3-simulation\part1\src\glm\./core/type.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_half.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_half.inl -c:\users\liam\project3-simulation\part1\src\glm\core\_detail.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_half.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\setup.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\setup.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_detail.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_gentype.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec1.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_gentype.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_swizzle_func.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec1.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec2.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec2.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec3.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec3.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec4.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_float.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_int.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_size.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_swizzle.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_vec4.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x2.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_gentype.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x2.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x3.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x3.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x4.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat2x4.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x2.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x2.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x3.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x3.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x4.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat3x4.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x2.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x2.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x3.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x3.inl -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x4.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\type_mat4x4.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_trigonometric.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_trigonometric.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_exponential.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_exponential.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_common.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_fixes.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_common.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_packing.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_packing.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_geometric.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_geometric.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_matrix.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_matrix.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_vector_relational.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\_detail.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_vector_relational.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_integer.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_integer.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/func_noise.hpp -c:\users\liam\project3-simulation\part1\src\glm\core\func_noise.inl -c:\users\liam\project3-simulation\part1\src\glm\./core/_swizzle.hpp -c:\users\liam\project3-simulation\part1\src\utilities.h -c:\users\liam\project3-simulation\part1\src\glm/glm.hpp -c:\users\liam\project3-simulation\part1\src\glm\core/_fixes.hpp -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\algorithm -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\memory -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmemory -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\exception -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\eh.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\malloc.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\utility -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdbg.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\type_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xtr1common -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\typeinfo -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\intrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\setjmp.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\immintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wmmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\nmmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\smmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\tmmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\pmmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\emmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mm3dnow.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mmintrin.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\istream -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ios -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocnum -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\streambuf -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xiosbase -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdexcept -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstring -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocinfo -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocinfo.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\locale.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xdebug -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cerrno -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\share.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iterator -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sstream -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfunctional -c:\users\liam\project3-simulation\part1\src\cudaMat4.h -c:\users\liam\project3-simulation\part1\src\glm/glm.hpp -c:\users\liam\project3-simulation\part1\src\glm\core/_fixes.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm/glm.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core/_fixes.hpp +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\climits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cfloat +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\float.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtwrn.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cwchar +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wchar.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstddef +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdio +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core/setup.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/_detail.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\setup.hpp +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cassert +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\assert.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/_vectorize.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/type.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_half.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_half.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\_detail.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_float.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_half.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\setup.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_int.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\setup.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\_detail.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_gentype.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_size.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec1.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_gentype.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_float.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_int.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_size.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\_swizzle.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\_swizzle_func.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec1.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec2.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_float.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_int.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_size.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\_swizzle.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec2.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec3.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_float.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_int.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_size.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\_swizzle.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec3.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec4.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_float.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_int.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_size.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\_swizzle.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_vec4.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat2x2.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_gentype.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat2x2.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat2x3.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat2x3.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat2x4.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat2x4.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat3x2.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat3x2.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat3x3.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat3x3.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat3x4.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat3x4.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat4x2.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat4x2.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat4x3.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat4x3.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat4x4.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\type_mat4x4.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/func_trigonometric.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\func_trigonometric.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/func_exponential.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\func_exponential.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/func_common.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\_fixes.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\func_common.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/func_packing.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\func_packing.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/func_geometric.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\func_geometric.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/func_matrix.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\func_matrix.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/func_vector_relational.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\_detail.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\func_vector_relational.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/func_integer.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\func_integer.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/func_noise.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core\func_noise.inl +c:\users\hms\daltonb\project3-simulation\part1\src\glm\./core/_swizzle.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\utilities.h +c:\users\hms\daltonb\project3-simulation\part1\src\glm/glm.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core/_fixes.hpp +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\algorithm +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\memory +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmemory +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\exception +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\eh.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\malloc.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\utility +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdbg.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\type_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xtr1common +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxtype_traits +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\typeinfo +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\intrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\setjmp.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\immintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wmmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\nmmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\smmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\tmmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\pmmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\emmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ammintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mm3dnow.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\mmintrin.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfwrap1 +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxshared +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\istream +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ios +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocnum +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\streambuf +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xiosbase +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdexcept +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstring +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocinfo +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocinfo.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\locale.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xdebug +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cerrno +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\errno.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\share.h +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iterator +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sstream +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\string +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xfunctional +c:\users\hms\daltonb\project3-simulation\part1\src\cudaMat4.h +c:\users\hms\daltonb\project3-simulation\part1\src\glm/glm.hpp +c:\users\hms\daltonb\project3-simulation\part1\src\glm\core/_fixes.hpp C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\cuda_runtime.h -c:\users\liam\project3-simulation\part1\src\kernel.h +c:\users\hms\daltonb\project3-simulation\part1\src\kernel.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/random.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/config.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/config/config.h @@ -534,7 +535,7 @@ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/co C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/config/hd_warning_disable.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/detail/cstdint.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/random/discard_block_engine.h -C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iostream +c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iostream C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/random/detail/random_core_access.h C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/random/detail/discard_block_engine.inl C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust/random/linear_congruential_engine.h diff --git a/Part1/src/glm/core/_detail.hpp b/Part1/src/glm/core/_detail.hpp index e6b42c2..b842dea 100644 --- a/Part1/src/glm/core/_detail.hpp +++ b/Part1/src/glm/core/_detail.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -444,15 +444,7 @@ namespace detail # define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct # define GLM_RESTRICT __declspec(restrict) # define GLM_RESTRICT_VAR __restrict -# define GLM_CONSTEXPR -#elif(GLM_COMPILER & GLM_COMPILER_INTEL) -# define GLM_DEPRECATED -# define GLM_ALIGN(x) __declspec(align(x)) -# define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct -# define GLM_RESTRICT -# define GLM_RESTRICT_VAR __restrict -# define GLM_CONSTEXPR -#elif(((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) || (GLM_COMPILER & GLM_COMPILER_CLANG)) +#elif((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) # define GLM_DEPRECATED __attribute__((__deprecated__)) # define GLM_ALIGN(x) __attribute__((aligned(x))) # define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) @@ -465,18 +457,12 @@ namespace detail # endif # define GLM_RESTRICT __restrict__ # define GLM_RESTRICT_VAR __restrict__ -# if((GLM_COMPILER >= GLM_COMPILER_GCC47) && ((GLM_LANG & GLM_LANG_CXX0X) == GLM_LANG_CXX0X)) -# define GLM_CONSTEXPR constexpr -# else -# define GLM_CONSTEXPR -# endif #else # define GLM_DEPRECATED # define GLM_ALIGN # define GLM_ALIGNED_STRUCT(x) # define GLM_RESTRICT # define GLM_RESTRICT_VAR -# define GLM_CONSTEXPR #endif//GLM_COMPILER #endif//glm_core_detail diff --git a/Part1/src/glm/core/_fixes.hpp b/Part1/src/glm/core/_fixes.hpp index b4cec5f..1b4ddda 100644 --- a/Part1/src/glm/core/_fixes.hpp +++ b/Part1/src/glm/core/_fixes.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 diff --git a/Part1/src/glm/core/_swizzle.hpp b/Part1/src/glm/core/_swizzle.hpp index dc06944..61be1d6 100644 --- a/Part1/src/glm/core/_swizzle.hpp +++ b/Part1/src/glm/core/_swizzle.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -53,130 +53,124 @@ namespace glm namespace glm{ namespace detail { - // Internal class for implementing swizzle operators - template - struct _swizzle_base0 - { - typedef T value_type; - - protected: - GLM_FUNC_QUALIFIER value_type& elem (size_t i) { return (reinterpret_cast(_buffer))[i]; } - GLM_FUNC_QUALIFIER const value_type& elem (size_t i) const { return (reinterpret_cast(_buffer))[i]; } - - // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. - // The size 1 buffer is assumed to aligned to the actual members so that the - // elem() - char _buffer[1]; - }; - - template - struct _swizzle_base1 : public _swizzle_base0 - { - }; - - template - struct _swizzle_base1 : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1)); } - }; - - template - struct _swizzle_base1 : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); } - }; - - template - struct _swizzle_base1 : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } - }; - - // Internal class for implementing swizzle operators - /* - Template parameters: - - ValueType = type of scalar values (e.g. float, double) - VecType = class the swizzle is applies to (e.g. tvec3) - N = number of components in the vector (e.g. 3) - E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec - - DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles - containing duplicate elements so that they cannot be used as r-values). - */ - template - struct _swizzle_base2 : public _swizzle_base1 - { + // Internal class for implementing swizzle operators + template + struct _swizzle_base0 + { + typedef T value_type; + + protected: + value_type& elem (size_t i) { return (reinterpret_cast(_buffer))[i]; } + const value_type& elem (size_t i) const { return (reinterpret_cast(_buffer))[i]; } + + // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. + // The size 1 buffer is assumed to aligned to the actual members so that the + // elem() + char _buffer[1]; + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + V operator ()() const { return V(this->elem(E0), this->elem(E1)); } + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); } + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } + }; + + // Internal class for implementing swizzle operators + /* + Template parameters: + + ValueType = type of scalar values (e.g. float, double) + VecType = class the swizzle is applies to (e.g. tvec3) + N = number of components in the vector (e.g. 3) + E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec + + DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles + containing duplicate elements so that they cannot be used as r-values). + */ + template + struct _swizzle_base2 : public _swizzle_base1 + { typedef VecType vec_type; typedef ValueType value_type; - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const ValueType& t) + _swizzle_base2& operator= (const ValueType& t) { for (int i = 0; i < N; ++i) (*this)[i] = t; return *this; } - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const VecType& that) + _swizzle_base2& operator= (const VecType& that) { struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e = t; } + void operator() (value_type& e, value_type& t) { e = t; } }; _apply_op(that, op()); return *this; } - GLM_FUNC_QUALIFIER void operator -= (const VecType& that) + void operator -= (const VecType& that) { struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e -= t; } + void operator() (value_type& e, value_type& t) { e -= t; } }; _apply_op(that, op()); } - GLM_FUNC_QUALIFIER void operator += (const VecType& that) + void operator += (const VecType& that) { struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e += t; } + void operator() (value_type& e, value_type& t) { e += t; } }; _apply_op(that, op()); } - GLM_FUNC_QUALIFIER void operator *= (const VecType& that) + void operator *= (const VecType& that) { struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e *= t; } + void operator() (value_type& e, value_type& t) { e *= t; } }; _apply_op(that, op()); } - GLM_FUNC_QUALIFIER void operator /= (const VecType& that) + void operator /= (const VecType& that) { struct op { - GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e /= t; } + void operator() (value_type& e, value_type& t) { e /= t; } }; _apply_op(that, op()); } - GLM_FUNC_QUALIFIER value_type& operator[] (size_t i) + value_type& operator[] (size_t i) { -#ifndef __CUDA_ARCH__ - static -#endif - const int offset_dst[4] = { E0, E1, E2, E3 }; + static const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } - GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const + value_type operator[] (size_t i) const { -#ifndef __CUDA_ARCH__ - static -#endif - const int offset_dst[4] = { E0, E1, E2, E3 }; + static const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } protected: template - GLM_FUNC_QUALIFIER void _apply_op(const VecType& that, T op) + void _apply_op(const VecType& that, T op) { // Make a copy of the data in this == &that. // The copier should optimize out the copy in cases where the function is @@ -187,7 +181,7 @@ namespace detail for (int i = 0; i < N; ++i) op( (*this)[i], t[i] ); } - }; + }; // Specialization for swizzles containing duplicate elements. These cannot be modified. template @@ -197,16 +191,13 @@ namespace detail typedef ValueType value_type; struct Stub {}; - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; } + _swizzle_base2& operator= (Stub const &) {} - GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const + value_type operator[] (size_t i) const { -#ifndef __CUDA_ARCH__ - static -#endif - const int offset_dst[4] = { E0, E1, E2, E3 }; + static const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); - } + } }; template @@ -216,7 +207,7 @@ namespace detail using base_type::operator=; - GLM_FUNC_QUALIFIER operator VecType () const { return (*this)(); } + operator VecType () const { return (*this)(); } }; // @@ -232,17 +223,17 @@ namespace detail // #define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ _GLM_SWIZZLE_TEMPLATE2 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ { \ return a() OPERAND b(); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \ + V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \ { \ return a() OPERAND b; \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return a OPERAND b(); \ } @@ -252,12 +243,12 @@ namespace detail // #define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ + V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ { \ return a() OPERAND b; \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ + V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return a OPERAND b(); \ } @@ -267,7 +258,7 @@ namespace detail // #define _GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \ + typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \ { \ return FUNCTION(a()); \ } @@ -277,22 +268,22 @@ namespace detail // #define _GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ _GLM_SWIZZLE_TEMPLATE2 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ { \ return FUNCTION(a(), b()); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \ + typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return FUNCTION(a(), b()); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \ + typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \ { \ return FUNCTION(a(), b); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return FUNCTION(a, b()); \ } @@ -302,22 +293,22 @@ namespace detail // #define _GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \ _GLM_SWIZZLE_TEMPLATE2 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \ + typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \ { \ return FUNCTION(a(), b(), c); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ { \ return FUNCTION(a(), b(), c); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ + typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ { \ return FUNCTION(a(), b, c); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ { \ return FUNCTION(a, b(), c); \ } @@ -331,32 +322,33 @@ namespace glm { _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(-) _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(*) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(+) _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(-) _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(*) _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(/) } - // - // Swizzles are distinct types from the unswizzled type. The below macros will - // provide template specializations for the swizzle types for the given functions - // so that the compiler does not have any ambiguity to choosing how to handle - // the function. - // - // The alternative is to use the operator()() when calling the function in order - // to explicitly convert the swizzled type to the unswizzled type. - // - - //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs); - //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos); - //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh); - //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all); - //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any); - - //_GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot); - //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross); - //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step); - //_GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix); + // + // Swizzles are distinct types from the unswizzled type. The below macros will + // provide template specializations for the swizzle types for the given functions + // so that the compiler does not have any ambiguity to choosing how to handle + // the function. + // + // The alternative is to use the operator()() when calling the function in order + // to explicitly convert the swizzled type to the unswizzled type. + // + + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any); + + //_GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot); + //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross); + //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step); + //_GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix); } #define _GLM_SWIZZLE2_2_MEMBERS(T,P,E0,E1) \ @@ -649,22 +641,6 @@ namespace glm struct { glm::detail::swizzle<4,T,P,0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ struct { glm::detail::swizzle<4,T,P,0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ struct { glm::detail::swizzle<4,T,P,0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ - struct { glm::detail::swizzle<4,T,P,0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ struct { glm::detail::swizzle<4,T,P,1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ struct { glm::detail::swizzle<4,T,P,1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ struct { glm::detail::swizzle<4,T,P,1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ diff --git a/Part1/src/glm/core/_swizzle_func.hpp b/Part1/src/glm/core/_swizzle_func.hpp index be66784..255a3ec 100644 --- a/Part1/src/glm/core/_swizzle_func.hpp +++ b/Part1/src/glm/core/_swizzle_func.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 diff --git a/Part1/src/glm/core/_vectorize.hpp b/Part1/src/glm/core/_vectorize.hpp index 9984014..e69d809 100644 --- a/Part1/src/glm/core/_vectorize.hpp +++ b/Part1/src/glm/core/_vectorize.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -27,37 +27,37 @@ /////////////////////////////////////////////////////////////////////////////////// #define VECTORIZE2_VEC(func) \ - template \ - GLM_FUNC_QUALIFIER detail::tvec2 func( \ + template \ + GLM_FUNC_QUALIFIER detail::tvec2 func( \ detail::tvec2 const & v) \ - { \ - return detail::tvec2( \ - func(v.x), \ - func(v.y)); \ - } + { \ + return detail::tvec2( \ + func(v.x), \ + func(v.y)); \ + } #define VECTORIZE3_VEC(func) \ - template \ - GLM_FUNC_QUALIFIER detail::tvec3 func( \ + template \ + GLM_FUNC_QUALIFIER detail::tvec3 func( \ detail::tvec3 const & v) \ - { \ - return detail::tvec3( \ - func(v.x), \ - func(v.y), \ - func(v.z)); \ - } + { \ + return detail::tvec3( \ + func(v.x), \ + func(v.y), \ + func(v.z)); \ + } #define VECTORIZE4_VEC(func) \ - template \ - GLM_FUNC_QUALIFIER detail::tvec4 func( \ + template \ + GLM_FUNC_QUALIFIER detail::tvec4 func( \ detail::tvec4 const & v) \ - { \ - return detail::tvec4( \ - func(v.x), \ - func(v.y), \ - func(v.z), \ - func(v.w)); \ - } + { \ + return detail::tvec4( \ + func(v.x), \ + func(v.y), \ + func(v.z), \ + func(v.w)); \ + } #define VECTORIZE_VEC(func) \ VECTORIZE2_VEC(func) \ @@ -65,46 +65,46 @@ VECTORIZE4_VEC(func) #define VECTORIZE2_VEC_SCA(func) \ - template \ - GLM_FUNC_QUALIFIER detail::tvec2 func \ + template \ + GLM_FUNC_QUALIFIER detail::tvec2 func \ ( \ detail::tvec2 const & x, \ typename detail::tvec2::value_type const & y \ ) \ - { \ - return detail::tvec2( \ - func(x.x, y), \ - func(x.y, y)); \ - } + { \ + return detail::tvec2( \ + func(x.x, y), \ + func(x.y, y)); \ + } #define VECTORIZE3_VEC_SCA(func) \ - template \ - GLM_FUNC_QUALIFIER detail::tvec3 func \ + template \ + GLM_FUNC_QUALIFIER detail::tvec3 func \ ( \ detail::tvec3 const & x, \ typename detail::tvec3::value_type const & y \ ) \ - { \ - return detail::tvec3( \ - func(x.x, y), \ - func(x.y, y), \ - func(x.z, y)); \ - } + { \ + return detail::tvec3( \ + func(x.x, y), \ + func(x.y, y), \ + func(x.z, y)); \ + } #define VECTORIZE4_VEC_SCA(func) \ - template \ - GLM_FUNC_QUALIFIER detail::tvec4 func \ + template \ + GLM_FUNC_QUALIFIER detail::tvec4 func \ ( \ detail::tvec4 const & x, \ typename detail::tvec4::value_type const & y \ ) \ - { \ - return detail::tvec4( \ - func(x.x, y), \ - func(x.y, y), \ - func(x.z, y), \ - func(x.w, y)); \ - } + { \ + return detail::tvec4( \ + func(x.x, y), \ + func(x.y, y), \ + func(x.z, y), \ + func(x.w, y)); \ + } #define VECTORIZE_VEC_SCA(func) \ VECTORIZE2_VEC_SCA(func) \ @@ -112,46 +112,46 @@ VECTORIZE4_VEC_SCA(func) #define VECTORIZE2_VEC_VEC(func) \ - template \ - GLM_FUNC_QUALIFIER detail::tvec2 func \ + template \ + GLM_FUNC_QUALIFIER detail::tvec2 func \ ( \ detail::tvec2 const & x, \ detail::tvec2 const & y \ ) \ - { \ - return detail::tvec2( \ - func(x.x, y.x), \ - func(x.y, y.y)); \ - } + { \ + return detail::tvec2( \ + func(x.x, y.x), \ + func(x.y, y.y)); \ + } #define VECTORIZE3_VEC_VEC(func) \ - template \ - GLM_FUNC_QUALIFIER detail::tvec3 func \ + template \ + GLM_FUNC_QUALIFIER detail::tvec3 func \ ( \ detail::tvec3 const & x, \ detail::tvec3 const & y \ ) \ - { \ - return detail::tvec3( \ - func(x.x, y.x), \ - func(x.y, y.y), \ - func(x.z, y.z)); \ - } + { \ + return detail::tvec3( \ + func(x.x, y.x), \ + func(x.y, y.y), \ + func(x.z, y.z)); \ + } #define VECTORIZE4_VEC_VEC(func) \ - template \ - GLM_FUNC_QUALIFIER detail::tvec4 func \ + template \ + GLM_FUNC_QUALIFIER detail::tvec4 func \ ( \ detail::tvec4 const & x, \ detail::tvec4 const & y \ ) \ - { \ - return detail::tvec4( \ - func(x.x, y.x), \ - func(x.y, y.y), \ - func(x.z, y.z), \ - func(x.w, y.w)); \ - } + { \ + return detail::tvec4( \ + func(x.x, y.x), \ + func(x.y, y.y), \ + func(x.z, y.z), \ + func(x.w, y.w)); \ + } #define VECTORIZE_VEC_VEC(func) \ VECTORIZE2_VEC_VEC(func) \ diff --git a/Part1/src/glm/core/dummy.cpp b/Part1/src/glm/core/dummy.cpp index 38fcca0..443c072 100644 --- a/Part1/src/glm/core/dummy.cpp +++ b/Part1/src/glm/core/dummy.cpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -31,6 +31,7 @@ #define GLM_MESSAGES #include "../glm.hpp" +#include "../ext.hpp" //#error "GLM is a header only library" diff --git a/Part1/src/glm/core/func_common.hpp b/Part1/src/glm/core/func_common.hpp index fcf7eb7..3c26819 100644 --- a/Part1/src/glm/core/func_common.hpp +++ b/Part1/src/glm/core/func_common.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -46,39 +46,39 @@ namespace glm /// Returns x if x >= 0; otherwise, it returns -x. /// /// @tparam genType floating-point or signed integer; scalar or vector types. - /// - /// @see GLSL abs man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType abs(genType const & x); + /// + /// @see GLSL abs man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + genType abs(genType const & x); /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. /// /// @tparam genType Floating-point or signed integer; scalar or vector types. /// - /// @see GLSL sign man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see GLSL sign man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType sign(genType const & x); + genType sign(genType const & x); - /// Returns a value equal to the nearest integer that is less then or equal to x. + /// Returns a value equal to the nearest integer that is less then or equal to x. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL floor man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @see GLSL floor man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType floor(genType const & x); + genType floor(genType const & x); /// Returns a value equal to the nearest integer to x /// whose absolute value is not larger than the absolute value of x. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL trunc man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @see GLSL trunc man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType trunc(genType const & x); + genType trunc(genType const & x); /// Returns a value equal to the nearest integer to x. /// The fraction 0.5 will round in a direction chosen by the @@ -87,52 +87,52 @@ namespace glm /// same value as roundEven(x) for all values of x. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL round man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @see GLSL round man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType round(genType const & x); + genType round(genType const & x); /// Returns a value equal to the nearest integer to x. /// A fractional part of 0.5 will round toward the nearest even /// integer. (Both 3.5 and 4.5 for x will return 4.0.) /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL roundEven man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @see GLSL roundEven man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions /// @see New round to even technique template - GLM_FUNC_DECL genType roundEven(genType const & x); + genType roundEven(genType const & x); /// Returns a value equal to the nearest integer /// that is greater than or equal to x. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL ceil man page + /// @see GLSL ceil man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType ceil(genType const & x); + template + genType ceil(genType const & x); /// Return x - floor(x). - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL fract man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType fract(genType const & x); + /// @see GLSL fract man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + genType fract(genType const & x); /// Modulus. Returns x - y * floor(x / y) /// for each component in x using the floating point value y. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL mod man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType mod( + /// + /// @see GLSL mod man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + genType mod( genType const & x, genType const & y); @@ -140,11 +140,11 @@ namespace glm /// for each component in x using the floating point value y. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL mod man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType mod( + /// + /// @see GLSL mod man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + genType mod( genType const & x, typename genType::value_type const & y); @@ -152,86 +152,86 @@ namespace glm /// part (as a whole number floating point value). Both the /// return value and the output parameter will have the same /// sign as x. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL modf man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see GLSL modf man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType modf( + genType modf( genType const & x, genType & i); - /// Returns y if y < x; otherwise, it returns x. + /// Returns y if y < x; otherwise, it returns x. /// /// @tparam genType Floating-point or integer; scalar or vector types. - /// - /// @see GLSL min man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType min( + genType min( genType const & x, genType const & y); template - GLM_FUNC_DECL genType min( + genType min( genType const & x, typename genType::value_type const & y); - /// Returns y if x < y; otherwise, it returns x. + /// Returns y if x < y; otherwise, it returns x. /// /// @tparam genType Floating-point or integer; scalar or vector types. - /// - /// @see GLSL max man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType max( + genType max( genType const & x, genType const & y); template - GLM_FUNC_DECL genType max( + genType max( genType const & x, typename genType::value_type const & y); - /// Returns min(max(x, minVal), maxVal) for each component in x + /// Returns min(max(x, minVal), maxVal) for each component in x /// using the floating-point values minVal and maxVal. - /// + /// /// @tparam genType Floating-point or integer; scalar or vector types. /// - /// @see GLSL clamp man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType clamp( + genType clamp( genType const & x, genType const & minVal, genType const & maxVal); template - GLM_FUNC_DECL genType clamp( + genType clamp( genType const & x, typename genType::value_type const & minVal, typename genType::value_type const & maxVal); - /// If genTypeU is a floating scalar or vector: - /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of - /// x and y using the floating-point value a. - /// The value for a is not restricted to the range [0, 1]. - /// - /// If genTypeU is a boolean scalar or vector: - /// Selects which vector each returned component comes - /// from. For a component of that is false, the - /// corresponding component of x is returned. For a - /// component of a that is true, the corresponding - /// component of y is returned. Components of x and y that - /// are not selected are allowed to be invalid floating point - /// values and will have no effect on the results. Thus, this - /// provides different functionality than - /// genType mix(genType x, genType y, genType(a)) - /// where a is a Boolean vector. - /// - /// @see GLSL mix man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + //! @return If genTypeU is a floating scalar or vector: + //! Returns x * (1.0 - a) + y * a, i.e., the linear blend of + //! x and y using the floating-point value a. + //! The value for a is not restricted to the range [0, 1]. + //! + //! @return If genTypeU is a boolean scalar or vector: + //! Selects which vector each returned component comes + //! from. For a component of a that is false, the + //! corresponding component of x is returned. For a + //! component of a that is true, the corresponding + //! component of y is returned. Components of x and y that + //! are not selected are allowed to be invalid floating point + //! values and will have no effect on the results. Thus, this + //! provides different functionality than + //! genType mix(genType x, genType y, genType(a)) + //! where a is a Boolean vector. + /// + /// @see GLSL mix man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions /// /// @param[in] x Value to interpolate. /// @param[in] y Value to interpolate. @@ -256,19 +256,19 @@ namespace glm /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. /// @endcode template - GLM_FUNC_DECL genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a); + genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a); //! Returns 0.0 if x < edge, otherwise it returns 1.0. - //! - /// @see GLSL step man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + //! + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType step( + genType step( genType const & edge, genType const & x); template - GLM_FUNC_DECL genType step( + genType step( typename genType::value_type const & edge, genType const & x); @@ -278,22 +278,22 @@ namespace glm /// you would want a threshold function with a smooth /// transition. This is equivalent to: /// genType t; - /// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1); - /// return t * t * (3 - 2 * t); + /// t = clamp ((x – edge0) / (edge1 – edge0), 0, 1); + /// return t * t * (3 – 2 * t); /// Results are undefined if edge0 >= edge1. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL smoothstep man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @see GLSL smoothstep man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType smoothstep( + genType smoothstep( genType const & edge0, genType const & edge1, genType const & x); template - GLM_FUNC_DECL genType smoothstep( + genType smoothstep( typename genType::value_type const & edge0, typename genType::value_type const & edge1, genType const & x); @@ -303,28 +303,26 @@ namespace glm /// floating point representations. Returns false otherwise, /// including for implementations with no NaN /// representations. - /// - /// /!\ When using compiler fast math, this function may fail. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL isnan man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see GLSL isnan man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL typename genType::bool_type isnan(genType const & x); + typename genType::bool_type isnan(genType const & x); /// Returns true if x holds a positive infinity or negative /// infinity representation in the underlying implementation's /// set of floating point representations. Returns false /// otherwise, including for implementations with no infinity /// representations. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL isinf man page + /// @see GLSL isinf man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL typename genType::bool_type isinf(genType const & x); + typename genType::bool_type isinf(genType const & x); /// Returns a signed integer value representing /// the encoding of a floating-point value. The floatingpoint @@ -332,11 +330,11 @@ namespace glm /// /// @tparam genType Single-precision floating-point scalar or vector types. /// @tparam genIType Signed integer scalar or vector types. - /// - /// @see GLSL floatBitsToInt man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @see GLSL floatBitsToInt man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genIType floatBitsToInt(genType const & value); + genIType floatBitsToInt(genType const & value); /// Returns a unsigned integer value representing /// the encoding of a floating-point value. The floatingpoint @@ -344,52 +342,52 @@ namespace glm /// /// @tparam genType Single-precision floating-point scalar or vector types. /// @tparam genUType Unsigned integer scalar or vector types. - /// - /// @see GLSL floatBitsToUint man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @see GLSL floatBitsToUint man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genUType floatBitsToUint(genType const & value); + genUType floatBitsToUint(genType const & value); /// Returns a floating-point value corresponding to a signed /// integer encoding of a floating-point value. /// If an inf or NaN is passed in, it will not signal, and the /// resulting floating point value is unspecified. Otherwise, /// the bit-level representation is preserved. - /// + /// /// @tparam genType Single-precision floating-point scalar or vector types. /// @tparam genIType Signed integer scalar or vector types. /// - /// @see GLSL intBitsToFloat man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see GLSL intBitsToFloat man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions /// /// @todo Clarify this declaration, we don't need to actually specify the return type template - GLM_FUNC_DECL genType intBitsToFloat(genIType const & value); - - /// Returns a floating-point value corresponding to a - /// unsigned integer encoding of a floating-point value. - /// If an inf or NaN is passed in, it will not signal, and the - /// resulting floating point value is unspecified. Otherwise, - /// the bit-level representation is preserved. - /// + genType intBitsToFloat(genIType const & value); + + /// Returns a floating-point value corresponding to a + /// unsigned integer encoding of a floating-point value. + /// If an inf or NaN is passed in, it will not signal, and the + /// resulting floating point value is unspecified. Otherwise, + /// the bit-level representation is preserved. + /// /// @tparam genType Single-precision floating-point scalar or vector types. /// @tparam genUType Unsigned integer scalar or vector types. - /// - /// @see GLSL uintBitsToFloat man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @see GLSL uintBitsToFloat man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions /// /// @todo Clarify this declaration, we don't need to actually specify the return type - template - GLM_FUNC_DECL genType uintBitsToFloat(genUType const & value); - + template + genType uintBitsToFloat(genUType const & value); + /// Computes and returns a * b + c. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL fma man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @see GLSL fma man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType fma(genType const & a, genType const & b, genType const & c); + genType fma(genType const & a, genType const & b, genType const & c); /// Splits x into a floating-point significand in the range /// [0.5, 1.0) and an integral exponent of two, such that: @@ -404,9 +402,9 @@ namespace glm /// @tparam genType Floating-point scalar or vector types. /// /// @see GLSL frexp man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType frexp(genType const & x, genIType & exp); + genType frexp(genType const & x, genIType & exp); /// Builds a floating-point number from x and the /// corresponding integral exponent of two in exp, returning: @@ -418,9 +416,9 @@ namespace glm /// @tparam genType Floating-point scalar or vector types. /// /// @see GLSL ldexp man page; - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType ldexp(genType const & x, genIType const & exp); + genType ldexp(genType const & x, genIType const & exp); /// @} }//namespace glm diff --git a/Part1/src/glm/core/func_common.inl b/Part1/src/glm/core/func_common.inl index 1c0d9df..0e70745 100644 --- a/Part1/src/glm/core/func_common.inl +++ b/Part1/src/glm/core/func_common.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -26,53 +26,55 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// +#include "_vectorize.hpp" + namespace glm{ namespace detail { - template - struct Abs_ - {}; - - template - struct Abs_ - { - GLM_FUNC_QUALIFIER static genFIType get(genFIType const & x) - { - GLM_STATIC_ASSERT( - detail::type::is_float || - detail::type::is_int, "'abs' only accept floating-point and integer inputs"); - return x >= genFIType(0) ? x : -x; + template + struct Abs_ + {}; + + template + struct Abs_ + { + static genFIType get(genFIType const & x) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int, "'abs' only accept floating-point and integer inputs"); + return x >= genFIType(0) ? x : -x; // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff; - } - }; - - template - struct Abs_ - { - GLM_FUNC_QUALIFIER static genFIType get(genFIType const & x) - { - GLM_STATIC_ASSERT( + } + }; + + template + struct Abs_ + { + static genFIType get(genFIType const & x) + { + GLM_STATIC_ASSERT( detail::type::is_uint, "'abs' only accept floating-point and integer inputs"); - return x; - } - }; + return x; + } + }; }//namespace detail // abs template - GLM_FUNC_QUALIFIER genFIType abs + GLM_FUNC_QUALIFIER genFIType abs ( genFIType const & x ) - { + { return detail::Abs_::is_signed>::get(x); - } + } VECTORIZE_VEC(abs) - // sign + // sign //Try something like based on x >> 31 to get the sign bit - template + template GLM_FUNC_QUALIFIER genFIType sign ( genFIType const & x @@ -81,74 +83,74 @@ namespace detail GLM_STATIC_ASSERT( detail::type::is_float || detail::type::is_int, "'sign' only accept signed inputs"); - + genFIType result; if(x > genFIType(0)) - result = genFIType(1); - else if(x < genFIType(0)) - result = genFIType(-1); - else - result = genFIType(0); - return result; + result = genFIType(1); + else if(x < genFIType(0)) + result = genFIType(-1); + else + result = genFIType(0); + return result; } VECTORIZE_VEC(sign) - // floor - template <> + // floor + template <> GLM_FUNC_QUALIFIER detail::half floor(detail::half const & x) - { - return detail::half(::std::floor(float(x))); - } + { + return detail::half(::std::floor(float(x))); + } - template - GLM_FUNC_QUALIFIER genType floor(genType const & x) - { + template + GLM_FUNC_QUALIFIER genType floor(genType const & x) + { GLM_STATIC_ASSERT(detail::type::is_float, "'floor' only accept floating-point inputs"); - return ::std::floor(x); - } + return ::std::floor(x); + } VECTORIZE_VEC(floor) - // trunc - template - GLM_FUNC_QUALIFIER genType trunc(genType const & x) - { + // trunc + template + GLM_FUNC_QUALIFIER genType trunc(genType const & x) + { GLM_STATIC_ASSERT(detail::type::is_float, "'trunc' only accept floating-point inputs"); - return x < 0 ? -floor(-x) : floor(x); - } + return x < 0 ? -floor(-x) : floor(x); + } VECTORIZE_VEC(trunc) - // round - template - GLM_FUNC_QUALIFIER genType round(genType const& x) - { + // round + template + GLM_FUNC_QUALIFIER genType round(genType const& x) + { GLM_STATIC_ASSERT(detail::type::is_float, "'round' only accept floating-point inputs"); if(x < 0) return genType(int(x - genType(0.5))); return genType(int(x + genType(0.5))); - } + } VECTORIZE_VEC(round) /* - // roundEven - template - GLM_FUNC_QUALIFIER genType roundEven(genType const& x) - { + // roundEven + template + GLM_FUNC_QUALIFIER genType roundEven(genType const& x) + { GLM_STATIC_ASSERT(detail::type::is_float, "'roundEven' only accept floating-point inputs"); return genType(int(x + genType(int(x) % 2))); - } + } */ - // roundEven - template - GLM_FUNC_QUALIFIER genType roundEven(genType const & x) - { + // roundEven + template + GLM_FUNC_QUALIFIER genType roundEven(genType const & x) + { GLM_STATIC_ASSERT(detail::type::is_float, "'roundEven' only accept floating-point inputs"); int Integer = int(x); @@ -179,328 +181,338 @@ namespace detail VECTORIZE_VEC(roundEven) - // ceil - template - GLM_FUNC_QUALIFIER genType ceil(genType const & x) - { + // ceil + template + GLM_FUNC_QUALIFIER genType ceil(genType const & x) + { GLM_STATIC_ASSERT(detail::type::is_float, "'ceil' only accept floating-point inputs"); - return ::std::ceil(x); - } + return ::std::ceil(x); + } VECTORIZE_VEC(ceil) - // fract - template - GLM_FUNC_QUALIFIER genType fract + // fract + template + GLM_FUNC_QUALIFIER genType fract ( genType const & x ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'fract' only accept floating-point inputs"); - return x - ::std::floor(x); - } + return x - ::std::floor(x); + } VECTORIZE_VEC(fract) - // mod - template - GLM_FUNC_QUALIFIER genType mod + // mod + template + GLM_FUNC_QUALIFIER genType mod ( genType const & x, genType const & y ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'mod' only accept floating-point inputs"); - return x - y * floor(x / y); - } + return x - y * floor(x / y); + } VECTORIZE_VEC_SCA(mod) VECTORIZE_VEC_VEC(mod) - // modf - template - GLM_FUNC_QUALIFIER genType modf + // modf + template + GLM_FUNC_QUALIFIER genType modf ( genType const & x, genType & i ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'modf' only accept floating-point inputs"); return std::modf(x, &i); - } + } - template - GLM_FUNC_QUALIFIER detail::tvec2 modf + template + GLM_FUNC_QUALIFIER detail::tvec2 modf ( detail::tvec2 const & x, detail::tvec2 & i ) - { - return detail::tvec2( - modf(x.x, i.x), - modf(x.y, i.y)); - } + { + return detail::tvec2( + modf(x.x, i.x), + modf(x.y, i.y)); + } - template - GLM_FUNC_QUALIFIER detail::tvec3 modf + template + GLM_FUNC_QUALIFIER detail::tvec3 modf ( detail::tvec3 const & x, detail::tvec3 & i ) - { - return detail::tvec3( - modf(x.x, i.x), - modf(x.y, i.y), - modf(x.z, i.z)); - } + { + return detail::tvec3( + modf(x.x, i.x), + modf(x.y, i.y), + modf(x.z, i.z)); + } - template - GLM_FUNC_QUALIFIER detail::tvec4 modf + template + GLM_FUNC_QUALIFIER detail::tvec4 modf ( detail::tvec4 const & x, detail::tvec4 & i ) - { - return detail::tvec4( - modf(x.x, i.x), - modf(x.y, i.y), - modf(x.z, i.z), - modf(x.w, i.w)); - } + { + return detail::tvec4( + modf(x.x, i.x), + modf(x.y, i.y), + modf(x.z, i.z), + modf(x.w, i.w)); + } //// Only valid if (INT_MIN <= x-y <= INT_MAX) //// min(x,y) //r = y + ((x - y) & ((x - y) >> (sizeof(int) * - //CHAR_BIT - 1))); + //CHAR_BIT – 1))); //// max(x,y) //r = x - ((x - y) & ((x - y) >> (sizeof(int) * //CHAR_BIT - 1))); - // min - template - GLM_FUNC_QUALIFIER genType min + // min + template + GLM_FUNC_QUALIFIER genType min ( genType const & x, genType const & y ) - { + { GLM_STATIC_ASSERT( detail::type::is_float || detail::type::is_int || detail::type::is_uint, "'min' only accept numbers"); - return x < y ? x : y; - } + return x < y ? x : y; + } VECTORIZE_VEC_SCA(min) VECTORIZE_VEC_VEC(min) - // max - template - GLM_FUNC_QUALIFIER genType max + // max + template + GLM_FUNC_QUALIFIER genType max ( genType const & x, genType const & y ) - { + { GLM_STATIC_ASSERT( detail::type::is_float || detail::type::is_int || detail::type::is_uint, "'max' only accept numbers"); return x > y ? x : y; - } + } VECTORIZE_VEC_SCA(max) VECTORIZE_VEC_VEC(max) - // clamp - template - GLM_FUNC_QUALIFIER valType clamp + // clamp + template + GLM_FUNC_QUALIFIER valType clamp ( valType const & x, valType const & minVal, valType const & maxVal ) - { + { GLM_STATIC_ASSERT( detail::type::is_float || detail::type::is_int || detail::type::is_uint, "'clamp' only accept numbers"); - return min(maxVal, max(minVal, x)); - } + // Old implementation, less predictable branching + //if(x >= maxVal) return maxVal; + //if(x <= minVal) return minVal; + //return x; + return max(min(x, maxVal), minVal); + } - template - GLM_FUNC_QUALIFIER detail::tvec2 clamp + template + GLM_FUNC_QUALIFIER detail::tvec2 clamp ( detail::tvec2 const & x, typename detail::tvec2::value_type const & minVal, typename detail::tvec2::value_type const & maxVal ) - { - return detail::tvec2( - clamp(x.x, minVal, maxVal), - clamp(x.y, minVal, maxVal)); - } + { + return detail::tvec2( + clamp(x.x, minVal, maxVal), + clamp(x.y, minVal, maxVal)); + } - template - GLM_FUNC_QUALIFIER detail::tvec3 clamp + template + GLM_FUNC_QUALIFIER detail::tvec3 clamp ( detail::tvec3 const & x, typename detail::tvec3::value_type const & minVal, typename detail::tvec3::value_type const & maxVal ) - { - return detail::tvec3( - clamp(x.x, minVal, maxVal), - clamp(x.y, minVal, maxVal), - clamp(x.z, minVal, maxVal)); - } + { + return detail::tvec3( + clamp(x.x, minVal, maxVal), + clamp(x.y, minVal, maxVal), + clamp(x.z, minVal, maxVal)); + } - template - GLM_FUNC_QUALIFIER detail::tvec4 clamp + template + GLM_FUNC_QUALIFIER detail::tvec4 clamp ( detail::tvec4 const & x, typename detail::tvec4::value_type const & minVal, typename detail::tvec4::value_type const & maxVal ) - { - return detail::tvec4( - clamp(x.x, minVal, maxVal), - clamp(x.y, minVal, maxVal), - clamp(x.z, minVal, maxVal), - clamp(x.w, minVal, maxVal)); - } + { + return detail::tvec4( + clamp(x.x, minVal, maxVal), + clamp(x.y, minVal, maxVal), + clamp(x.z, minVal, maxVal), + clamp(x.w, minVal, maxVal)); + } - template - GLM_FUNC_QUALIFIER detail::tvec2 clamp + template + GLM_FUNC_QUALIFIER detail::tvec2 clamp ( detail::tvec2 const & x, detail::tvec2 const & minVal, detail::tvec2 const & maxVal ) - { - return detail::tvec2( - clamp(x.x, minVal.x, maxVal.x), - clamp(x.y, minVal.y, maxVal.y)); - } + { + return detail::tvec2( + clamp(x.x, minVal.x, maxVal.x), + clamp(x.y, minVal.y, maxVal.y)); + } - template - GLM_FUNC_QUALIFIER detail::tvec3 clamp + template + GLM_FUNC_QUALIFIER detail::tvec3 clamp ( detail::tvec3 const & x, detail::tvec3 const & minVal, detail::tvec3 const & maxVal ) - { - return detail::tvec3( - clamp(x.x, minVal.x, maxVal.x), - clamp(x.y, minVal.y, maxVal.y), - clamp(x.z, minVal.z, maxVal.z)); - } + { + return detail::tvec3( + clamp(x.x, minVal.x, maxVal.x), + clamp(x.y, minVal.y, maxVal.y), + clamp(x.z, minVal.z, maxVal.z)); + } - template - GLM_FUNC_QUALIFIER detail::tvec4 clamp + template + GLM_FUNC_QUALIFIER detail::tvec4 clamp ( detail::tvec4 const & x, detail::tvec4 const & minVal, detail::tvec4 const & maxVal ) - { - return detail::tvec4( - clamp(x.x, minVal.x, maxVal.x), - clamp(x.y, minVal.y, maxVal.y), - clamp(x.z, minVal.z, maxVal.z), - clamp(x.w, minVal.w, maxVal.w)); - } + { + return detail::tvec4( + clamp(x.x, minVal.x, maxVal.x), + clamp(x.y, minVal.y, maxVal.y), + clamp(x.z, minVal.z, maxVal.z), + clamp(x.w, minVal.w, maxVal.w)); + } // mix - template - GLM_FUNC_QUALIFIER genType mix + template + GLM_FUNC_QUALIFIER genTypeT mix ( - genType const & x, - genType const & y, - genType const & a + genTypeT const & x, + genTypeT const & y, + genTypeU const & a ) { - GLM_STATIC_ASSERT(detail::type::is_float , "'genType' is not floating-point type"); + // It could be a vector too + //GLM_STATIC_ASSERT( + // detail::type::is_float && + // detail::type::is_float); - return x + a * (y - x); + //return x + a * (y - x); + return genTypeT(genTypeU(x) + a * genTypeU(y - x)); } - template - GLM_FUNC_QUALIFIER detail::tvec2 mix + template + GLM_FUNC_QUALIFIER detail::tvec2 mix ( - detail::tvec2 const & x, - detail::tvec2 const & y, - valType const & a + detail::tvec2 const & x, + detail::tvec2 const & y, + valTypeB const & a ) { - GLM_STATIC_ASSERT(detail::type::is_float , "'genType' is not floating-point type"); - - return x + a * (y - x); + return detail::tvec2( + detail::tvec2(x) + a * detail::tvec2(y - x)); } - template - GLM_FUNC_QUALIFIER detail::tvec3 mix + template + GLM_FUNC_QUALIFIER detail::tvec3 mix ( - detail::tvec3 const & x, - detail::tvec3 const & y, - valType const & a + detail::tvec3 const & x, + detail::tvec3 const & y, + valTypeB const & a ) { - return x + a * (y - x); + return detail::tvec3( + detail::tvec3(x) + a * detail::tvec3(y - x)); } - template - GLM_FUNC_QUALIFIER detail::tvec4 mix + template + GLM_FUNC_QUALIFIER detail::tvec4 mix ( - detail::tvec4 const & x, - detail::tvec4 const & y, - valType const & a + detail::tvec4 const & x, + detail::tvec4 const & y, + valTypeB const & a ) { - return x + a * (y - x); + return detail::tvec4( + detail::tvec4(x) + a * detail::tvec4(y - x)); } - template - GLM_FUNC_QUALIFIER detail::tvec2 mix + template + GLM_FUNC_QUALIFIER detail::tvec2 mix ( - detail::tvec2 const & x, - detail::tvec2 const & y, - detail::tvec2 const & a + detail::tvec2 const & x, + detail::tvec2 const & y, + detail::tvec2 const & a ) { - return x + a * (y - x); + return detail::tvec2( + detail::tvec2(x) + a * detail::tvec2(y - x)); } - template - GLM_FUNC_QUALIFIER detail::tvec3 mix + template + GLM_FUNC_QUALIFIER detail::tvec3 mix ( - detail::tvec3 const & x, - detail::tvec3 const & y, - detail::tvec3 const & a + detail::tvec3 const & x, + detail::tvec3 const & y, + detail::tvec3 const & a ) { - GLM_STATIC_ASSERT(detail::type::is_float , "'genType' is not floating-point type"); - - return x + a * (y - x); + return detail::tvec3( + detail::tvec3(x) + a * detail::tvec3(y - x)); } - template - GLM_FUNC_QUALIFIER detail::tvec4 mix + template + GLM_FUNC_QUALIFIER detail::tvec4 mix ( - detail::tvec4 const & x, - detail::tvec4 const & y, - detail::tvec4 const & a + detail::tvec4 const & x, + detail::tvec4 const & y, + detail::tvec4 const & a ) { - return x + a * (y - x); + return detail::tvec4( + detail::tvec4(x) + a * detail::tvec4(y - x)); } //template @@ -519,63 +531,15 @@ namespace detail // return x + a * (y - x); //} - template <> - GLM_FUNC_QUALIFIER float mix - ( - float const & x, - float const & y, - bool const & a - ) - { - return a ? y : x; - } - - template <> - GLM_FUNC_QUALIFIER double mix + template + GLM_FUNC_QUALIFIER genType mix ( - double const & x, - double const & y, + genType const & x, + genType const & y, bool const & a ) { - return a ? y : x; - } - - template - GLM_FUNC_QUALIFIER detail::tvec2 mix - ( - detail::tvec2 const & x, - detail::tvec2 const & y, - bool a - ) - { - GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); - - return a ? y : x; - } - - template - GLM_FUNC_QUALIFIER detail::tvec3 mix - ( - detail::tvec3 const & x, - detail::tvec3 const & y, - bool a - ) - { - GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); - - return a ? y : x; - } - - template - GLM_FUNC_QUALIFIER detail::tvec4 mix - ( - detail::tvec4 const & x, - detail::tvec4 const & y, - bool a - ) - { - GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); + GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); return a ? y : x; } @@ -594,7 +558,8 @@ namespace detail for ( typename detail::tvec2::size_type i = 0; - i < x.length(); ++i + i < detail::tvec2::value_size(); + ++i ) { result[i] = a[i] ? y[i] : x[i]; @@ -616,7 +581,8 @@ namespace detail for ( typename detail::tvec3::size_type i = 0; - i < x.length(); ++i + i < detail::tvec3::value_size(); + ++i ) { result[i] = a[i] ? y[i] : x[i]; @@ -638,7 +604,8 @@ namespace detail for ( typename detail::tvec4::size_type i = 0; - i < x.length(); ++i + i < detail::tvec4::value_size(); + ++i ) { result[i] = a[i] ? y[i] : x[i]; @@ -647,251 +614,249 @@ namespace detail } // step - template - GLM_FUNC_QUALIFIER genType step + template + GLM_FUNC_QUALIFIER genType step ( genType const & edge, genType const & x ) - { - GLM_STATIC_ASSERT(detail::type::is_float, "'step' only accept floating-point inputs"); + { + GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); - return x < edge ? genType(0) : genType(1); - } + return x < edge ? genType(0) : genType(1); + } - template - GLM_FUNC_QUALIFIER detail::tvec2 step + template + GLM_FUNC_QUALIFIER detail::tvec2 step ( typename detail::tvec2::value_type const & edge, detail::tvec2 const & x ) - { - return detail::tvec2( - x.x < edge ? T(0) : T(1), - x.y < edge ? T(0) : T(1)); - } + { + return detail::tvec2( + x.x < edge ? T(0) : T(1), + x.y < edge ? T(0) : T(1)); + } - template - GLM_FUNC_QUALIFIER detail::tvec3 step + template + GLM_FUNC_QUALIFIER detail::tvec3 step ( typename detail::tvec3::value_type const & edge, detail::tvec3 const & x ) - { + { return detail::tvec3( x.x < edge ? T(0) : T(1), x.y < edge ? T(0) : T(1), x.z < edge ? T(0) : T(1)); - } + } - template - GLM_FUNC_QUALIFIER detail::tvec4 step + template + GLM_FUNC_QUALIFIER detail::tvec4 step ( typename detail::tvec4::value_type const & edge, detail::tvec4 const & x ) - { - return detail::tvec4( - x.x < edge ? T(0) : T(1), - x.y < edge ? T(0) : T(1), - x.z < edge ? T(0) : T(1), - x.w < edge ? T(0) : T(1)); - } + { + return detail::tvec4( + x.x < edge ? T(0) : T(1), + x.y < edge ? T(0) : T(1), + x.z < edge ? T(0) : T(1), + x.w < edge ? T(0) : T(1)); + } - template - GLM_FUNC_QUALIFIER detail::tvec2 step + template + GLM_FUNC_QUALIFIER detail::tvec2 step ( detail::tvec2 const & edge, detail::tvec2 const & x ) - { - return detail::tvec2( - x.x < edge.x ? T(0) : T(1), - x.y < edge.y ? T(0) : T(1)); - } + { + return detail::tvec2( + x.x < edge.x ? T(0) : T(1), + x.y < edge.y ? T(0) : T(1)); + } - template - GLM_FUNC_QUALIFIER detail::tvec3 step + template + GLM_FUNC_QUALIFIER detail::tvec3 step ( detail::tvec3 const & edge, detail::tvec3 const & x ) - { - return detail::tvec3( - x.x < edge.x ? T(0) : T(1), - x.y < edge.y ? T(0) : T(1), - x.z < edge.z ? T(0) : T(1)); - } + { + return detail::tvec3( + x.x < edge.x ? T(0) : T(1), + x.y < edge.y ? T(0) : T(1), + x.z < edge.z ? T(0) : T(1)); + } - template - GLM_FUNC_QUALIFIER detail::tvec4 step + template + GLM_FUNC_QUALIFIER detail::tvec4 step ( detail::tvec4 const & edge, detail::tvec4 const & x ) - { - return detail::tvec4( - x.x < edge.x ? T(0) : T(1), - x.y < edge.y ? T(0) : T(1), - x.z < edge.z ? T(0) : T(1), - x.w < edge.w ? T(0) : T(1)); - } + { + return detail::tvec4( + x.x < edge.x ? T(0) : T(1), + x.y < edge.y ? T(0) : T(1), + x.z < edge.z ? T(0) : T(1), + x.w < edge.w ? T(0) : T(1)); + } - // smoothstep - template - GLM_FUNC_QUALIFIER genType smoothstep + // smoothstep + template + GLM_FUNC_QUALIFIER genType smoothstep ( genType const & edge0, genType const & edge1, genType const & x ) - { - GLM_STATIC_ASSERT(detail::type::is_float, "'smoothstep' only accept floating-point inputs"); + { + GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); - genType tmp = clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1)); - return tmp * tmp * (genType(3) - genType(2) * tmp); - } + genType tmp = clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1)); + return tmp * tmp * (genType(3) - genType(2) * tmp); + } - template - GLM_FUNC_QUALIFIER detail::tvec2 smoothstep + template + GLM_FUNC_QUALIFIER detail::tvec2 smoothstep ( typename detail::tvec2::value_type const & edge0, typename detail::tvec2::value_type const & edge1, detail::tvec2 const & x ) - { - return detail::tvec2( - smoothstep(edge0, edge1, x.x), - smoothstep(edge0, edge1, x.y)); - } + { + return detail::tvec2( + smoothstep(edge0, edge1, x.x), + smoothstep(edge0, edge1, x.y)); + } - template - GLM_FUNC_QUALIFIER detail::tvec3 smoothstep + template + GLM_FUNC_QUALIFIER detail::tvec3 smoothstep ( typename detail::tvec3::value_type const & edge0, typename detail::tvec3::value_type const & edge1, detail::tvec3 const & x ) - { - return detail::tvec3( - smoothstep(edge0, edge1, x.x), - smoothstep(edge0, edge1, x.y), - smoothstep(edge0, edge1, x.z)); - } + { + return detail::tvec3( + smoothstep(edge0, edge1, x.x), + smoothstep(edge0, edge1, x.y), + smoothstep(edge0, edge1, x.z)); + } - template - GLM_FUNC_QUALIFIER detail::tvec4 smoothstep + template + GLM_FUNC_QUALIFIER detail::tvec4 smoothstep ( typename detail::tvec4::value_type const & edge0, typename detail::tvec4::value_type const & edge1, detail::tvec4 const & x ) - { - return detail::tvec4( - smoothstep(edge0, edge1, x.x), - smoothstep(edge0, edge1, x.y), - smoothstep(edge0, edge1, x.z), - smoothstep(edge0, edge1, x.w)); - } + { + return detail::tvec4( + smoothstep(edge0, edge1, x.x), + smoothstep(edge0, edge1, x.y), + smoothstep(edge0, edge1, x.z), + smoothstep(edge0, edge1, x.w)); + } - template - GLM_FUNC_QUALIFIER detail::tvec2 smoothstep + template + GLM_FUNC_QUALIFIER detail::tvec2 smoothstep ( detail::tvec2 const & edge0, detail::tvec2 const & edge1, detail::tvec2 const & x ) - { - return detail::tvec2( - smoothstep(edge0.x, edge1.x, x.x), - smoothstep(edge0.y, edge1.y, x.y)); - } + { + return detail::tvec2( + smoothstep(edge0.x, edge1.x, x.x), + smoothstep(edge0.y, edge1.y, x.y)); + } - template - GLM_FUNC_QUALIFIER detail::tvec3 smoothstep + template + GLM_FUNC_QUALIFIER detail::tvec3 smoothstep ( detail::tvec3 const & edge0, detail::tvec3 const & edge1, detail::tvec3 const & x ) - { - return detail::tvec3( - smoothstep(edge0.x, edge1.x, x.x), - smoothstep(edge0.y, edge1.y, x.y), - smoothstep(edge0.z, edge1.z, x.z)); - } + { + return detail::tvec3( + smoothstep(edge0.x, edge1.x, x.x), + smoothstep(edge0.y, edge1.y, x.y), + smoothstep(edge0.z, edge1.z, x.z)); + } - template - GLM_FUNC_QUALIFIER detail::tvec4 smoothstep + template + GLM_FUNC_QUALIFIER detail::tvec4 smoothstep ( detail::tvec4 const & edge0, detail::tvec4 const & edge1, detail::tvec4 const & x ) - { - return detail::tvec4( - smoothstep(edge0.x, edge1.x, x.x), - smoothstep(edge0.y, edge1.y, x.y), - smoothstep(edge0.z, edge1.z, x.z), - smoothstep(edge0.w, edge1.w, x.w)); - } + { + return detail::tvec4( + smoothstep(edge0.x, edge1.x, x.x), + smoothstep(edge0.y, edge1.y, x.y), + smoothstep(edge0.z, edge1.z, x.z), + smoothstep(edge0.w, edge1.w, x.w)); + } - // TODO: Not working on MinGW... template GLM_FUNC_QUALIFIER bool isnan(genType const & x) { GLM_STATIC_ASSERT(detail::type::is_float, "'isnan' only accept floating-point inputs"); -# if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL)) +# if(GLM_COMPILER & GLM_COMPILER_VC) + return _isnan(x) != 0; +# elif(GLM_COMPILER & GLM_COMPILER_GCC) +# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return _isnan(x) != 0; +# else + return std::isnan(x) != 0; +# endif +# else + //return std::isnan(x) != 0; return _isnan(x) != 0; -# elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)) -# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return _isnan(x) != 0; -# else - return std::isnan(x); -# endif -# elif(GLM_COMPILER & GLM_COMPILER_CUDA) - return isnan(x) != 0; -# else - return std::isnan(x); -# endif +# endif } - template - GLM_FUNC_QUALIFIER typename detail::tvec2::bool_type isnan + template + GLM_FUNC_QUALIFIER typename detail::tvec2::bool_type isnan ( detail::tvec2 const & x ) - { - return typename detail::tvec2::bool_type( - isnan(x.x), - isnan(x.y)); - } + { + return typename detail::tvec2::bool_type( + isnan(x.x), + isnan(x.y)); + } - template - GLM_FUNC_QUALIFIER typename detail::tvec3::bool_type isnan + template + GLM_FUNC_QUALIFIER typename detail::tvec3::bool_type isnan ( detail::tvec3 const & x ) - { - return typename detail::tvec3::bool_type( - isnan(x.x), - isnan(x.y), - isnan(x.z)); - } + { + return typename detail::tvec3::bool_type( + isnan(x.x), + isnan(x.y), + isnan(x.z)); + } - template - GLM_FUNC_QUALIFIER typename detail::tvec4::bool_type isnan + template + GLM_FUNC_QUALIFIER typename detail::tvec4::bool_type isnan ( detail::tvec4 const & x ) - { - return typename detail::tvec4::bool_type( - isnan(x.x), - isnan(x.y), - isnan(x.z), - isnan(x.w)); - } + { + return typename detail::tvec4::bool_type( + isnan(x.x), + isnan(x.y), + isnan(x.z), + isnan(x.w)); + } template GLM_FUNC_QUALIFIER bool isinf( @@ -899,57 +864,55 @@ namespace detail { GLM_STATIC_ASSERT(detail::type::is_float, "'isinf' only accept floating-point inputs"); -# if(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_CLANG)) -# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return _isinf(x) != 0; -# else - return std::isinf(x); -# endif -# elif(GLM_COMPILER & GLM_COMPILER_CUDA) - // http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab - return isinf(double(x)) != 0; -# else - return std::isinf(x); -# endif +# if(GLM_COMPILER & GLM_COMPILER_VC) + return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; +# elif(GLM_COMPILER & GLM_COMPILER_GCC) +# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return _isinf(x) != 0; +# else + return std::isinf(x) != 0; +# endif +# else + return isinf(x) != 0; + //return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; +# endif } - template - GLM_FUNC_QUALIFIER typename detail::tvec2::bool_type isinf + template + GLM_FUNC_QUALIFIER typename detail::tvec2::bool_type isinf ( detail::tvec2 const & x ) - { - return typename detail::tvec2::bool_type( - isinf(x.x), - isinf(x.y)); - } + { + return typename detail::tvec2::bool_type( + isinf(x.x), + isinf(x.y)); + } - template - GLM_FUNC_QUALIFIER typename detail::tvec3::bool_type isinf + template + GLM_FUNC_QUALIFIER typename detail::tvec3::bool_type isinf ( detail::tvec3 const & x ) - { - return typename detail::tvec3::bool_type( - isinf(x.x), - isinf(x.y), - isinf(x.z)); - } + { + return typename detail::tvec3::bool_type( + isinf(x.x), + isinf(x.y), + isinf(x.z)); + } - template - GLM_FUNC_QUALIFIER typename detail::tvec4::bool_type isinf + template + GLM_FUNC_QUALIFIER typename detail::tvec4::bool_type isinf ( detail::tvec4 const & x ) - { - return typename detail::tvec4::bool_type( - isinf(x.x), - isinf(x.y), - isinf(x.z), - isinf(x.w)); - } + { + return typename detail::tvec4::bool_type( + isinf(x.x), + isinf(x.y), + isinf(x.z), + isinf(x.w)); + } GLM_FUNC_QUALIFIER int floatBitsToInt(float const & value) { @@ -963,38 +926,38 @@ namespace detail return fi.i; } - GLM_FUNC_QUALIFIER detail::tvec2 floatBitsToInt + GLM_FUNC_QUALIFIER detail::tvec2 floatBitsToInt ( detail::tvec2 const & value ) - { - return detail::tvec2( - floatBitsToInt(value.x), - floatBitsToInt(value.y)); - } + { + return detail::tvec2( + floatBitsToInt(value.x), + floatBitsToInt(value.y)); + } - GLM_FUNC_QUALIFIER detail::tvec3 floatBitsToInt + GLM_FUNC_QUALIFIER detail::tvec3 floatBitsToInt ( detail::tvec3 const & value ) - { - return detail::tvec3( - floatBitsToInt(value.x), + { + return detail::tvec3( + floatBitsToInt(value.x), floatBitsToInt(value.y), floatBitsToInt(value.z)); - } + } - GLM_FUNC_QUALIFIER detail::tvec4 floatBitsToInt + GLM_FUNC_QUALIFIER detail::tvec4 floatBitsToInt ( detail::tvec4 const & value ) - { - return detail::tvec4( - floatBitsToInt(value.x), + { + return detail::tvec4( + floatBitsToInt(value.x), floatBitsToInt(value.y), floatBitsToInt(value.z), floatBitsToInt(value.w)); - } + } GLM_FUNC_QUALIFIER uint floatBitsToUint(float const & value) { @@ -1008,38 +971,38 @@ namespace detail return fu.u; } - GLM_FUNC_QUALIFIER detail::tvec2 floatBitsToUint + GLM_FUNC_QUALIFIER detail::tvec2 floatBitsToUint ( detail::tvec2 const & value ) - { - return detail::tvec2( - floatBitsToUint(value.x), - floatBitsToUint(value.y)); - } + { + return detail::tvec2( + floatBitsToUint(value.x), + floatBitsToUint(value.y)); + } - GLM_FUNC_QUALIFIER detail::tvec3 floatBitsToUint + GLM_FUNC_QUALIFIER detail::tvec3 floatBitsToUint ( detail::tvec3 const & value ) - { - return detail::tvec3( - floatBitsToUint(value.x), + { + return detail::tvec3( + floatBitsToUint(value.x), floatBitsToUint(value.y), floatBitsToUint(value.z)); - } + } - GLM_FUNC_QUALIFIER detail::tvec4 floatBitsToUint + GLM_FUNC_QUALIFIER detail::tvec4 floatBitsToUint ( detail::tvec4 const & value ) - { - return detail::tvec4( - floatBitsToUint(value.x), + { + return detail::tvec4( + floatBitsToUint(value.x), floatBitsToUint(value.y), floatBitsToUint(value.z), floatBitsToUint(value.w)); - } + } GLM_FUNC_QUALIFIER float intBitsToFloat(int const & value) { @@ -1058,79 +1021,79 @@ namespace detail ( detail::tvec2 const & value ) - { - return detail::tvec2( - intBitsToFloat(value.x), - intBitsToFloat(value.y)); - } + { + return detail::tvec2( + intBitsToFloat(value.x), + intBitsToFloat(value.y)); + } GLM_FUNC_QUALIFIER detail::tvec3 intBitsToFloat ( detail::tvec3 const & value ) - { - return detail::tvec3( - intBitsToFloat(value.x), + { + return detail::tvec3( + intBitsToFloat(value.x), intBitsToFloat(value.y), intBitsToFloat(value.z)); - } + } - GLM_FUNC_QUALIFIER detail::tvec4 intBitsToFloat + GLM_FUNC_QUALIFIER detail::tvec4 intBitsToFloat ( detail::tvec4 const & value ) - { - return detail::tvec4( - intBitsToFloat(value.x), + { + return detail::tvec4( + intBitsToFloat(value.x), intBitsToFloat(value.y), intBitsToFloat(value.z), intBitsToFloat(value.w)); - } + } - GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const & value) - { - union - { - float f; - uint u; - } fu; + GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const & value) + { + union + { + float f; + uint u; + } fu; - fu.u = value; - return fu.f; - } + fu.u = value; + return fu.f; + } - GLM_FUNC_QUALIFIER detail::tvec2 uintBitsToFloat + GLM_FUNC_QUALIFIER detail::tvec2 uintBitsToFloat ( detail::tvec2 const & value ) - { - return detail::tvec2( - uintBitsToFloat(value.x), - uintBitsToFloat(value.y)); - } + { + return detail::tvec2( + uintBitsToFloat(value.x), + uintBitsToFloat(value.y)); + } - GLM_FUNC_QUALIFIER detail::tvec3 uintBitsToFloat + GLM_FUNC_QUALIFIER detail::tvec3 uintBitsToFloat ( detail::tvec3 const & value ) - { - return detail::tvec3( - uintBitsToFloat(value.x), + { + return detail::tvec3( + uintBitsToFloat(value.x), uintBitsToFloat(value.y), uintBitsToFloat(value.z)); - } + } - GLM_FUNC_QUALIFIER detail::tvec4 uintBitsToFloat + GLM_FUNC_QUALIFIER detail::tvec4 uintBitsToFloat ( detail::tvec4 const & value ) - { - return detail::tvec4( - uintBitsToFloat(value.x), + { + return detail::tvec4( + uintBitsToFloat(value.x), uintBitsToFloat(value.y), uintBitsToFloat(value.z), uintBitsToFloat(value.w)); - } + } template GLM_FUNC_QUALIFIER genType fma diff --git a/Part1/src/glm/core/func_exponential.hpp b/Part1/src/glm/core/func_exponential.hpp index dc76fcb..69399e8 100644 --- a/Part1/src/glm/core/func_exponential.hpp +++ b/Part1/src/glm/core/func_exponential.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -41,26 +41,26 @@ namespace glm /// @addtogroup core_func_exponential /// @{ - /// Returns 'base' raised to the power 'exponent'. + /// Returns x raised to the y power. /// - /// @param base Floating point value. pow function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision. - /// @param exponent Floating point value representing the 'exponent'. + /// @param x pow function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision. + /// @param y /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL pow man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + /// + /// @see GLSL pow man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - GLM_FUNC_DECL genType pow(genType const & base, genType const & exponent); + genType pow(genType const & x, genType const & y); /// Returns the natural exponentiation of x, i.e., e^x. /// /// @param x exp function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision. /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL exp man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + /// + /// @see GLSL exp man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - GLM_FUNC_DECL genType exp(genType const & x); + genType exp(genType const & x); /// Returns the natural logarithm of x, i.e., /// returns the value y which satisfies the equation x = e^y. @@ -68,52 +68,52 @@ namespace glm /// /// @param x log function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision. /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL log man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + /// + /// @see GLSL log man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - GLM_FUNC_DECL genType log(genType const & x); + genType log(genType const & x); /// Returns 2 raised to the x power. /// /// @param x exp2 function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision. /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL exp2 man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + /// + /// @see GLSL exp2 man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - GLM_FUNC_DECL genType exp2(genType const & x); + genType exp2(genType const & x); /// Returns the base 2 log of x, i.e., returns the value y, /// which satisfies the equation x = 2 ^ y. - /// + /// /// @param x log2 function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision. /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL log2 man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + /// @see GLSL log2 man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - GLM_FUNC_DECL genType log2(genType const & x); + genType log2(genType const & x); /// Returns the positive square root of x. - /// + /// /// @param x sqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision. /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL sqrt man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + /// @see GLSL sqrt man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - GLM_FUNC_DECL genType sqrt(genType const & x); + genType sqrt(genType const & x); /// Returns the reciprocal of the positive square root of x. - /// + /// /// @param x inversesqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision. /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL inversesqrt man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + /// @see GLSL inversesqrt man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - GLM_FUNC_DECL genType inversesqrt(genType const & x); + genType inversesqrt(genType const & x); /// @} }//namespace glm diff --git a/Part1/src/glm/core/func_exponential.inl b/Part1/src/glm/core/func_exponential.inl index 1b08786..5ad49b7 100644 --- a/Part1/src/glm/core/func_exponential.inl +++ b/Part1/src/glm/core/func_exponential.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -26,62 +26,64 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// +#include "_vectorize.hpp" + namespace glm { - // pow - template - GLM_FUNC_QUALIFIER genType pow + // pow + template + GLM_FUNC_QUALIFIER genType pow ( genType const & x, genType const & y ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'pow' only accept floating-point input"); - return genType(::std::pow(x, y)); - } + return ::std::pow(x, y); + } VECTORIZE_VEC_VEC(pow) - // exp - template - GLM_FUNC_QUALIFIER genType exp + // exp + template + GLM_FUNC_QUALIFIER genType exp ( genType const & x ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'exp' only accept floating-point input"); - return genType(::std::exp(x)); - } + return ::std::exp(x); + } VECTORIZE_VEC(exp) - // log - template - GLM_FUNC_QUALIFIER genType log + // log + template + GLM_FUNC_QUALIFIER genType log ( genType const & x ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'log' only accept floating-point input"); - return genType(::std::log(x)); - } + return ::std::log(x); + } VECTORIZE_VEC(log) - //exp2, ln2 = 0.69314718055994530941723212145818f - template - GLM_FUNC_QUALIFIER genType exp2 + //exp2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType exp2 ( genType const & x ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'exp2' only accept floating-point input"); - return genType(::std::exp(genType(0.69314718055994530941723212145818) * x)); - } + return ::std::exp(genType(0.69314718055994530941723212145818) * x); + } VECTORIZE_VEC(exp2) @@ -109,47 +111,46 @@ namespace _detail return T(::std::log(Value)) / T(0.69314718055994530941723212145818); } }; - + }//namespace _detail - // log2, ln2 = 0.69314718055994530941723212145818f - template - GLM_FUNC_QUALIFIER genType log2 + // log2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType log2 ( genType const & x ) - { + { assert(x > genType(0)); // log2 is only defined on the range (0, inf] return _detail::_compute_log2::ID>()(x); - } + } VECTORIZE_VEC(log2) - // sqrt - template - GLM_FUNC_QUALIFIER genType sqrt + // sqrt + template + GLM_FUNC_QUALIFIER genType sqrt ( genType const & x ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'sqrt' only accept floating-point input"); - return genType(::std::sqrt(x)); - } + return genType(::std::sqrt(x)); + } VECTORIZE_VEC(sqrt) - template - GLM_FUNC_QUALIFIER genType inversesqrt + template + GLM_FUNC_QUALIFIER genType inversesqrt ( genType const & x ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'inversesqrt' only accept floating-point input"); - assert(x > genType(0)); - return genType(1) / ::std::sqrt(x); - } + return genType(1) / ::std::sqrt(x); + } VECTORIZE_VEC(inversesqrt) diff --git a/Part1/src/glm/core/func_geometric.hpp b/Part1/src/glm/core/func_geometric.hpp index c221084..d24a9c8 100644 --- a/Part1/src/glm/core/func_geometric.hpp +++ b/Part1/src/glm/core/func_geometric.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -42,90 +42,90 @@ namespace glm /// @{ /// Returns the length of x, i.e., sqrt(x * x). - /// + /// /// @tparam genType Floating-point vector types. /// - /// @see GLSL length man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + /// @see GLSL length man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - GLM_FUNC_DECL typename genType::value_type length( + typename genType::value_type length( genType const & x); /// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). /// /// @tparam genType Floating-point vector types. - /// - /// @see GLSL distance man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + /// + /// @see GLSL distance man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - GLM_FUNC_DECL typename genType::value_type distance( + typename genType::value_type distance( genType const & p0, genType const & p1); /// Returns the dot product of x and y, i.e., result = x * y. /// /// @tparam genType Floating-point vector types. - /// - /// @see GLSL dot man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL typename genType::value_type dot( + /// + /// @see GLSL dot man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + typename genType::value_type dot( genType const & x, genType const & y); /// Returns the cross product of x and y. /// /// @tparam valType Floating-point scalar types. - /// - /// @see GLSL cross man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL detail::tvec3 cross( + /// + /// @see GLSL cross man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + detail::tvec3 cross( detail::tvec3 const & x, detail::tvec3 const & y); /// Returns a vector in the same direction as x but with length of 1. - /// - /// @see GLSL normalize man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + /// + /// @see GLSL normalize man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - GLM_FUNC_DECL genType normalize( + genType normalize( genType const & x); /// If dot(Nref, I) < 0.0, return N, otherwise, return -N. /// /// @tparam genType Floating-point vector types. - /// - /// @see GLSL faceforward man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL genType faceforward( + /// + /// @see GLSL faceforward man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + genType faceforward( genType const & N, genType const & I, genType const & Nref); - + /// For the incident vector I and surface orientation N, /// returns the reflection direction : result = I - 2.0 * dot(N, I) * N. /// /// @tparam genType Floating-point vector types. - /// - /// @see GLSL reflect man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL genType reflect( + /// + /// @see GLSL reflect man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + genType reflect( genType const & I, genType const & N); - + /// For the incident vector I and surface normal N, /// and the ratio of indices of refraction eta, /// return the refraction vector. /// /// @tparam genType Floating-point vector types. - /// - /// @see GLSL refract man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL genType refract( + /// + /// @see GLSL refract man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + genType refract( genType const & I, genType const & N, typename genType::value_type const & eta); diff --git a/Part1/src/glm/core/func_geometric.inl b/Part1/src/glm/core/func_geometric.inl index 259a0ff..ccc5bbc 100644 --- a/Part1/src/glm/core/func_geometric.inl +++ b/Part1/src/glm/core/func_geometric.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -26,69 +26,71 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// +#include "_vectorize.hpp" + namespace glm { - // length - template + // length + template GLM_FUNC_QUALIFIER genType length ( genType const & x ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'length' only accept floating-point inputs"); - genType sqr = x * x; - return sqrt(sqr); - } + genType sqr = x * x; + return sqrt(sqr); + } template GLM_FUNC_QUALIFIER typename detail::tvec2::value_type length ( detail::tvec2 const & v ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'length' only accept floating-point inputs"); - typename detail::tvec2::value_type sqr = v.x * v.x + v.y * v.y; - return sqrt(sqr); - } + typename detail::tvec2::value_type sqr = v.x * v.x + v.y * v.y; + return sqrt(sqr); + } - template - GLM_FUNC_QUALIFIER typename detail::tvec3::value_type length + template + GLM_FUNC_QUALIFIER typename detail::tvec3::value_type length ( detail::tvec3 const & v ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'length' only accept floating-point inputs"); - typename detail::tvec3::value_type sqr = v.x * v.x + v.y * v.y + v.z * v.z; - return sqrt(sqr); - } + typename detail::tvec3::value_type sqr = v.x * v.x + v.y * v.y + v.z * v.z; + return sqrt(sqr); + } - template - GLM_FUNC_QUALIFIER typename detail::tvec4::value_type length + template + GLM_FUNC_QUALIFIER typename detail::tvec4::value_type length ( detail::tvec4 const & v ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'length' only accept floating-point inputs"); - typename detail::tvec4::value_type sqr = v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w; - return sqrt(sqr); - } + typename detail::tvec4::value_type sqr = v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w; + return sqrt(sqr); + } - // distance + // distance template - GLM_FUNC_QUALIFIER genType distance + GLM_FUNC_QUALIFIER genType distance ( genType const & p0, genType const & p1 ) - { - GLM_STATIC_ASSERT(detail::type::is_float, "'distance' only accept floating-point inputs"); + { + GLM_STATIC_ASSERT(detail::type::is_float, "'distance' only accept floating-point inputs"); return length(p1 - p0); - } + } template GLM_FUNC_QUALIFIER typename detail::tvec2::value_type distance @@ -96,35 +98,35 @@ namespace glm detail::tvec2 const & p0, detail::tvec2 const & p1 ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'distance' only accept floating-point inputs"); - return length(p1 - p0); - } + return length(p1 - p0); + } - template - GLM_FUNC_QUALIFIER typename detail::tvec3::value_type distance + template + GLM_FUNC_QUALIFIER typename detail::tvec3::value_type distance ( detail::tvec3 const & p0, detail::tvec3 const & p1 ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'distance' only accept floating-point inputs"); return length(p1 - p0); - } + } - template - GLM_FUNC_QUALIFIER typename detail::tvec4::value_type distance + template + GLM_FUNC_QUALIFIER typename detail::tvec4::value_type distance ( detail::tvec4 const & p0, detail::tvec4 const & p1 ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'distance' only accept floating-point inputs"); return length(p1 - p0); - } + } // dot template @@ -132,6 +134,7 @@ namespace glm ( genType const & x, genType const & y + ) { GLM_STATIC_ASSERT(detail::type::is_float, "'dot' only accept floating-point inputs"); @@ -139,124 +142,124 @@ namespace glm return x * y; } - template + template GLM_FUNC_QUALIFIER typename detail::tvec2::value_type dot ( detail::tvec2 const & x, detail::tvec2 const & y ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'dot' only accept floating-point inputs"); return x.x * y.x + x.y * y.y; - } + } - template - GLM_FUNC_QUALIFIER T dot + template + GLM_FUNC_QUALIFIER T dot ( detail::tvec3 const & x, detail::tvec3 const & y ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'dot' only accept floating-point inputs"); return x.x * y.x + x.y * y.y + x.z * y.z; - } + } /* // SSE3 - GLM_FUNC_QUALIFIER float dot(const tvec4& x, const tvec4& y) - { - float Result; - __asm - { - mov esi, x - mov edi, y - movaps xmm0, [esi] - mulps xmm0, [edi] - haddps( _xmm0, _xmm0 ) - haddps( _xmm0, _xmm0 ) - movss Result, xmm0 - } - return Result; - } + GLM_FUNC_QUALIFIER float dot(const tvec4& x, const tvec4& y) + { + float Result; + __asm + { + mov esi, x + mov edi, y + movaps xmm0, [esi] + mulps xmm0, [edi] + haddps( _xmm0, _xmm0 ) + haddps( _xmm0, _xmm0 ) + movss Result, xmm0 + } + return Result; + } */ - template - GLM_FUNC_QUALIFIER T dot + template + GLM_FUNC_QUALIFIER T dot ( detail::tvec4 const & x, detail::tvec4 const & y ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'dot' only accept floating-point inputs"); - return x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w; - } + return x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w; + } - // cross - template - GLM_FUNC_QUALIFIER detail::tvec3 cross + // cross + template + GLM_FUNC_QUALIFIER detail::tvec3 cross ( detail::tvec3 const & x, detail::tvec3 const & y ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'cross' only accept floating-point inputs"); - return detail::tvec3( - 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::tvec3( + x.y * y.z - y.y * x.z, + x.z * y.x - y.z * x.x, + x.x * y.y - y.x * x.y); + } - // normalize - template - GLM_FUNC_QUALIFIER genType normalize + // normalize + template + GLM_FUNC_QUALIFIER genType normalize ( genType const & x ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'normalize' only accept floating-point inputs"); - return x < genType(0) ? genType(-1) : genType(1); - } + return x < genType(0) ? genType(-1) : genType(1); + } - // According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefine and generate an error - template - GLM_FUNC_QUALIFIER detail::tvec2 normalize + // According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefine and generate an error + template + GLM_FUNC_QUALIFIER detail::tvec2 normalize ( detail::tvec2 const & x ) - { + { GLM_STATIC_ASSERT(detail::type::is_float, "'normalize' only accept floating-point inputs"); typename detail::tvec2::value_type sqr = x.x * x.x + x.y * x.y; - return x * inversesqrt(sqr); - } + return x * inversesqrt(sqr); + } - template - GLM_FUNC_QUALIFIER detail::tvec3 normalize + template + GLM_FUNC_QUALIFIER detail::tvec3 normalize ( detail::tvec3 const & x ) - { - GLM_STATIC_ASSERT(detail::type::is_float, "'normalize' only accept floating-point inputs"); + { + GLM_STATIC_ASSERT(detail::type::is_float, "'normalize' only accept floating-point inputs"); typename detail::tvec3::value_type sqr = x.x * x.x + x.y * x.y + x.z * x.z; - return x * inversesqrt(sqr); - } + return x * inversesqrt(sqr); + } - template - GLM_FUNC_QUALIFIER detail::tvec4 normalize + template + GLM_FUNC_QUALIFIER detail::tvec4 normalize ( detail::tvec4 const & x ) - { - GLM_STATIC_ASSERT(detail::type::is_float, "'normalize' only accept floating-point inputs"); + { + GLM_STATIC_ASSERT(detail::type::is_float, "'normalize' only accept floating-point inputs"); typename detail::tvec4::value_type sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; - return x * inversesqrt(sqr); - } + return x * inversesqrt(sqr); + } - // faceforward + // faceforward template GLM_FUNC_QUALIFIER genType faceforward ( @@ -270,7 +273,7 @@ namespace glm // reflect template - GLM_FUNC_QUALIFIER genType reflect + genType reflect ( genType const & I, genType const & N @@ -279,43 +282,43 @@ namespace glm return I - N * dot(N, I) * genType(2); } - // refract - template - GLM_FUNC_QUALIFIER genType refract + // refract + template + GLM_FUNC_QUALIFIER genType refract ( genType const & I, genType const & N, genType const & eta ) - { + { //It could be a vector //GLM_STATIC_ASSERT(detail::type::is_float); - genType dotValue = dot(N, I); - genType k = genType(1) - eta * eta * (genType(1) - dotValue * dotValue); - if(k < genType(0)) - return genType(0); - else - return eta * I - (eta * dotValue + sqrt(k)) * N; - } + genType dotValue = dot(N, I); + genType k = genType(1) - eta * eta * (genType(1) - dotValue * dotValue); + if(k < genType(0)) + return genType(0); + else + return eta * I - (eta * dotValue + sqrt(k)) * N; + } - template - GLM_FUNC_QUALIFIER genType refract + template + GLM_FUNC_QUALIFIER genType refract ( genType const & I, genType const & N, typename genType::value_type const & eta ) - { + { //It could be a vector //GLM_STATIC_ASSERT(detail::type::is_float); - typename genType::value_type dotValue = dot(N, I); - typename genType::value_type k = typename genType::value_type(1) - eta * eta * (typename genType::value_type(1) - dotValue * dotValue); - if(k < typename genType::value_type(0)) - return genType(0); - else - return eta * I - (eta * dotValue + sqrt(k)) * N; - } + typename genType::value_type dotValue = dot(N, I); + typename genType::value_type k = typename genType::value_type(1) - eta * eta * (typename genType::value_type(1) - dotValue * dotValue); + if(k < typename genType::value_type(0)) + return genType(0); + else + return eta * I - (eta * dotValue + sqrt(k)) * N; + } }//namespace glm diff --git a/Part1/src/glm/core/func_integer.hpp b/Part1/src/glm/core/func_integer.hpp index df9a401..c9ae0c0 100644 --- a/Part1/src/glm/core/func_integer.hpp +++ b/Part1/src/glm/core/func_integer.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -49,10 +49,10 @@ namespace glm /// /// @tparam genUType Unsigned integer scalar or vector types. /// - /// @see GLSL uaddCarry man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + /// @see GLSL uaddCarry man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - GLM_FUNC_DECL genUType uaddCarry( + genUType uaddCarry( genUType const & x, genUType const & y, genUType & carry); @@ -63,10 +63,10 @@ namespace glm /// /// @tparam genUType Unsigned integer scalar or vector types. /// - /// @see GLSL usubBorrow man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + /// @see GLSL usubBorrow man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - GLM_FUNC_DECL genUType usubBorrow( + genUType usubBorrow( genUType const & x, genUType const & y, genUType & borrow); @@ -77,10 +77,10 @@ namespace glm /// /// @tparam genUType Unsigned integer scalar or vector types. /// - /// @see GLSL umulExtended man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + /// @see GLSL umulExtended man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - GLM_FUNC_DECL void umulExtended( + void umulExtended( genUType const & x, genUType const & y, genUType & msb, @@ -92,10 +92,10 @@ namespace glm /// /// @tparam genIType Signed integer scalar or vector types. /// - /// @see GLSL imulExtended man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + /// @see GLSL imulExtended man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - GLM_FUNC_DECL void imulExtended( + void imulExtended( genIType const & x, genIType const & y, genIType & msb, @@ -105,7 +105,7 @@ namespace glm /// returning them in the least significant bits of the result. /// For unsigned data types, the most significant bits of the /// result will be set to zero. For signed data types, the - /// most significant bits will be set to the value of bit offset + base - 1. + /// most significant bits will be set to the value of bit offset + base – 1. /// /// If bits is zero, the result will be zero. The result will be /// undefined if offset or bits is negative, or if the sum of @@ -114,10 +114,10 @@ namespace glm /// /// @tparam genIUType Signed or unsigned integer scalar or vector types. /// - /// @see GLSL bitfieldExtract man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + /// @see GLSL bitfieldExtract man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - GLM_FUNC_DECL genIUType bitfieldExtract( + genIUType bitfieldExtract( genIUType const & Value, int const & Offset, int const & Bits); @@ -125,7 +125,7 @@ namespace glm /// Returns the insertion the bits least-significant bits of insert into base. /// /// The result will have bits [offset, offset + bits - 1] taken - /// from bits [0, bits - 1] of insert, and all other bits taken + /// from bits [0, bits – 1] of insert, and all other bits taken /// directly from the corresponding bits of base. If bits is /// zero, the result will simply be base. The result will be /// undefined if offset or bits is negative, or if the sum of @@ -134,10 +134,10 @@ namespace glm /// /// @tparam genIUType Signed or unsigned integer scalar or vector types. /// - /// @see GLSL bitfieldInsert man page + /// @see GLSL bitfieldInsert man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - GLM_FUNC_DECL genIUType bitfieldInsert( + genIUType bitfieldInsert( genIUType const & Base, genIUType const & Insert, int const & Offset, @@ -149,21 +149,21 @@ namespace glm /// /// @tparam genIUType Signed or unsigned integer scalar or vector types. /// - /// @see GLSL bitfieldReverse man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + /// @see GLSL bitfieldReverse man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - GLM_FUNC_DECL genIUType bitfieldReverse(genIUType const & Value); + genIUType bitfieldReverse(genIUType const & value); /// Returns the number of bits set to 1 in the binary representation of value. /// /// @tparam genIUType Signed or unsigned integer scalar or vector types. /// - /// @see GLSL bitCount man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + /// @see GLSL bitCount man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions /// /// @todo Clarify the declaration to specify that scalars are suported. template class genIUType> - GLM_FUNC_DECL typename genIUType::signed_type bitCount(genIUType const & Value); + typename genIUType::signed_type bitCount(genIUType const & Value); /// Returns the bit number of the least significant bit set to /// 1 in the binary representation of value. @@ -171,12 +171,12 @@ namespace glm /// /// @tparam genIUType Signed or unsigned integer scalar or vector types. /// - /// @see GLSL findLSB man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + /// @see GLSL findLSB man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions /// /// @todo Clarify the declaration to specify that scalars are suported. template class genIUType> - GLM_FUNC_DECL typename genIUType::signed_type findLSB(genIUType const & Value); + typename genIUType::signed_type findLSB(genIUType const & Value); /// Returns the bit number of the most significant bit in the binary representation of value. /// For positive integers, the result will be the bit number of the most significant bit set to 1. @@ -185,12 +185,12 @@ namespace glm /// /// @tparam genIUType Signed or unsigned integer scalar or vector types. /// - /// @see GLSL findMSB man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + /// @see GLSL findMSB man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions /// /// @todo Clarify the declaration to specify that scalars are suported. template class genIUType> - GLM_FUNC_DECL typename genIUType::signed_type findMSB(genIUType const & Value); + typename genIUType::signed_type findMSB(genIUType const & Value); /// @} }//namespace glm diff --git a/Part1/src/glm/core/func_integer.inl b/Part1/src/glm/core/func_integer.inl index ad8b1fe..5de9fcb 100644 --- a/Part1/src/glm/core/func_integer.inl +++ b/Part1/src/glm/core/func_integer.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -26,12 +26,11 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// -#if(GLM_ARCH != GLM_ARCH_PURE) +#include "_vectorize.hpp" #if(GLM_COMPILER & GLM_COMPILER_VC) -# include -# pragma intrinsic(_BitScanReverse) -#endif//(GLM_COMPILER & GLM_COMPILER_VC) -#endif//(GLM_ARCH != GLM_ARCH_PURE) +#include +#pragma intrinsic(_BitScanReverse) +#endif namespace glm { @@ -105,7 +104,7 @@ namespace glm if(x > y) return genUType(detail::highp_int_t(x) - detail::highp_int_t(y)); else - return genUType((detail::highp_int_t(1) << detail::highp_int_t(32)) + detail::highp_int_t(x) - detail::highp_int_t(y)); + return genUType(detail::highp_int_t(1) << detail::highp_int_t(32) + detail::highp_int_t(x) - detail::highp_int_t(y)); } template @@ -531,16 +530,11 @@ namespace glm genIUType const & Value ) { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); - if(Value == 0) - return -1; - unsigned long Result(0); _BitScanReverse(&Result, Value); return int(Result); } -/* -// __builtin_clz seems to be buggy as it crasks for some values, from 0x00200000 to 80000000 + #elif((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC40)) template @@ -549,38 +543,10 @@ namespace glm genIUType const & Value ) { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); - if(Value == 0) - return -1; - - // clz returns the number or trailing 0-bits; see - // http://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Other-Builtins.html - // - // NoteBecause __builtin_clz only works for unsigned ints, this - // implementation will not work for 64-bit integers. - // - return 31 - __builtin_clzl(Value); + return __builtin_clz(Value); } -*/ -#else - -/* SSE implementation idea - __m128i const Zero = _mm_set_epi32( 0, 0, 0, 0); - __m128i const One = _mm_set_epi32( 1, 1, 1, 1); - __m128i Bit = _mm_set_epi32(-1, -1, -1, -1); - __m128i Tmp = _mm_set_epi32(Value, Value, Value, Value); - __m128i Mmi = Zero; - for(int i = 0; i < 32; ++i) - { - __m128i Shilt = _mm_and_si128(_mm_cmpgt_epi32(Tmp, One), One); - Tmp = _mm_srai_epi32(Tmp, One); - Bit = _mm_add_epi32(Bit, _mm_and_si128(Shilt, i)); - Mmi = _mm_and_si128(Mmi, One); - } - return Bit; - -*/ +#else template GLM_FUNC_QUALIFIER int findMSB @@ -589,24 +555,12 @@ namespace glm ) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); - - if(Value == genIUType(0) || Value == genIUType(-1)) + if(Value == 0) return -1; - else if(Value > 0) - { - genIUType Bit = genIUType(-1); - for(genIUType tmp = Value; tmp > 0; tmp >>= 1, ++Bit){} - return Bit; - } - else //if(Value < 0) - { - int const BitCount(sizeof(genIUType) * 8); - int MostSignificantBit(-1); - for(int BitIndex(0); BitIndex < BitCount; ++BitIndex) - MostSignificantBit = (Value & (1 << BitIndex)) ? MostSignificantBit : BitIndex; - assert(MostSignificantBit >= 0); - return MostSignificantBit; - } + + genIUType bit = genIUType(-1); + for(genIUType tmp = Value; tmp; tmp >>= 1, ++bit){} + return bit; } #endif//(GLM_COMPILER) diff --git a/Part1/src/glm/core/func_matrix.hpp b/Part1/src/glm/core/func_matrix.hpp index 3c92cbb..41acf59 100644 --- a/Part1/src/glm/core/func_matrix.hpp +++ b/Part1/src/glm/core/func_matrix.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -49,11 +49,11 @@ namespace glm /// result[i][j] is the scalar product of x[i][j] and y[i][j]. /// /// @tparam matType Floating-point matrix types. - /// - /// @see GLSL matrixCompMult man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + /// + /// @see GLSL matrixCompMult man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - GLM_FUNC_DECL matType matrixCompMult( + matType matrixCompMult( matType const & x, matType const & y); @@ -62,84 +62,84 @@ namespace glm /// and does a linear algebraic matrix multiply c * r. /// /// @tparam matType Floating-point matrix types. - /// - /// @see GLSL outerProduct man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + /// + /// @see GLSL outerProduct man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions /// /// @todo Clarify the declaration to specify that matType doesn't have to be provided when used. - template - GLM_FUNC_DECL matType outerProduct( + template + matType outerProduct( vecType const & c, vecType const & r); /// Returns the transposed matrix of x /// /// @tparam matType Floating-point matrix types. - /// - /// @see GLSL transpose man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL typename matType::transpose_type transpose( + /// + /// @see GLSL transpose man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + typename matType::transpose_type transpose( matType const & x); /// Return the determinant of a mat2 matrix. /// /// @tparam valType Floating-point scalar types. - /// - /// @see GLSL determinant man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + /// + /// @see GLSL determinant man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - GLM_FUNC_DECL typename detail::tmat2x2::value_type determinant( + typename detail::tmat2x2::value_type determinant( detail::tmat2x2 const & m); /// Return the determinant of a mat3 matrix. /// /// @tparam valType Floating-point scalar types. - /// - /// @see GLSL determinant man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + /// + /// @see GLSL determinant man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - GLM_FUNC_DECL typename detail::tmat3x3::value_type determinant( + typename detail::tmat3x3::value_type determinant( detail::tmat3x3 const & m); /// Return the determinant of a mat4 matrix. /// /// @tparam valType Floating-point scalar types. - /// - /// @see GLSL determinant man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL typename detail::tmat4x4::value_type determinant( + /// + /// @see GLSL determinant man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + typename detail::tmat4x4::value_type determinant( detail::tmat4x4 const & m); /// Return the inverse of a mat2 matrix. /// /// @tparam valType Floating-point scalar types. - /// - /// @see GLSL inverse man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + /// + /// @see GLSL inverse man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - GLM_FUNC_DECL detail::tmat2x2 inverse( + detail::tmat2x2 inverse( detail::tmat2x2 const & m); /// Return the inverse of a mat3 matrix. /// /// @tparam valType Floating-point scalar types. - /// - /// @see GLSL inverse man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + /// + /// @see GLSL inverse man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - GLM_FUNC_DECL detail::tmat3x3 inverse( + detail::tmat3x3 inverse( detail::tmat3x3 const & m); /// Return the inverse of a mat4 matrix. /// /// @tparam valType Floating-point scalar types. - /// - /// @see GLSL inverse man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + /// + /// @see GLSL inverse man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - GLM_FUNC_DECL detail::tmat4x4 inverse( + detail::tmat4x4 inverse( detail::tmat4x4 const & m); /// @} diff --git a/Part1/src/glm/core/func_matrix.inl b/Part1/src/glm/core/func_matrix.inl index d89d5d4..3d8ab4f 100644 --- a/Part1/src/glm/core/func_matrix.inl +++ b/Part1/src/glm/core/func_matrix.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -26,6 +26,8 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// +#include "_vectorize.hpp" + namespace glm { // matrixCompMult @@ -576,7 +578,7 @@ namespace glm T Determinant = glm::dot(m[0], Row0); Inverse /= Determinant; - + return Inverse; } }//namespace glm diff --git a/Part1/src/glm/core/func_noise.hpp b/Part1/src/glm/core/func_noise.hpp index 3e5f874..296554e 100644 --- a/Part1/src/glm/core/func_noise.hpp +++ b/Part1/src/glm/core/func_noise.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -46,38 +46,38 @@ namespace glm /// Returns a 1D noise value based on the input value x. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL noise1 man page + /// + /// @see GLSL noise1 man page /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions template - GLM_FUNC_DECL typename genType::value_type noise1(genType const & x); + 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 GLSL noise2 man page - /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions + /// + /// @see GLSL noise2 man page + /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions template - GLM_FUNC_DECL detail::tvec2 noise2(genType const & x); + detail::tvec2 noise2(genType const & x); /// Returns a 3D noise value based on the input value x. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL noise3 man page - /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions + /// + /// @see GLSL noise3 man page + /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions template - GLM_FUNC_DECL detail::tvec3 noise3(genType const & x); + detail::tvec3 noise3(genType const & x); /// Returns a 4D noise value based on the input value x. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL noise4 man page - /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions + /// + /// @see GLSL noise4 man page + /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions template - GLM_FUNC_DECL detail::tvec4 noise4(genType const & x); + detail::tvec4 noise4(genType const & x); /// @} }//namespace glm diff --git a/Part1/src/glm/core/func_noise.inl b/Part1/src/glm/core/func_noise.inl index 68a1933..af197e4 100644 --- a/Part1/src/glm/core/func_noise.inl +++ b/Part1/src/glm/core/func_noise.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -27,7 +27,7 @@ /////////////////////////////////////////////////////////////////////////////////// namespace glm -{ +{ template GLM_FUNC_QUALIFIER T noise1(T const & x) { diff --git a/Part1/src/glm/core/func_packing.hpp b/Part1/src/glm/core/func_packing.hpp index b4312e1..91582b2 100644 --- a/Part1/src/glm/core/func_packing.hpp +++ b/Part1/src/glm/core/func_packing.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -37,152 +37,153 @@ #define GLM_CORE_func_packing GLM_VERSION namespace glm -{ +{ /// @addtogroup core_func_packing /// @{ - //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - //! Then, the results are packed into the returned 32-bit unsigned integer. - //! - //! The conversion for component c of v to fixed point is done as follows: - //! packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) - //! - //! The first component of the vector will be written to the least significant bits of the output; - //! the last component will be written to the most significant bits. - //! - /// @see GLSL packUnorm2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL detail::uint32 packUnorm2x16(detail::tvec2 const & v); - - //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - //! Then, the results are packed into the returned 32-bit unsigned integer. - //! - //! The conversion for component c of v to fixed point is done as follows: - //! packSnorm2x16: round(clamp(v, -1, +1) * 32767.0) - //! - //! The first component of the vector will be written to the least significant bits of the output; - //! the last component will be written to the most significant bits. - //! - /// @see GLSL packSnorm2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL detail::uint32 packSnorm2x16(detail::tvec2 const & v); - - //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - //! Then, the results are packed into the returned 32-bit unsigned integer. - //! - //! The conversion for component c of v to fixed point is done as follows: - //! packUnorm4x8: round(clamp(c, 0, +1) * 255.0) - //! - //! The first component of the vector will be written to the least significant bits of the output; - //! the last component will be written to the most significant bits. - //! - /// @see GLSL packUnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL detail::uint32 packUnorm4x8(detail::tvec4 const & v); - - //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - //! Then, the results are packed into the returned 32-bit unsigned integer. - //! - //! The conversion for component c of v to fixed point is done as follows: - //! packSnorm4x8: round(clamp(c, -1, +1) * 127.0) - //! - //! The first component of the vector will be written to the least significant bits of the output; - //! the last component will be written to the most significant bits. - //! - /// @see GLSL packSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL detail::uint32 packSnorm4x8(detail::tvec4 const & v); - - //! 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. - //! - //! The conversion for unpacked fixed-point value f to floating point is done as follows: - //! unpackUnorm2x16: f / 65535.0 - //! - //! The first component of the returned vector will be extracted from the least significant bits of the input; - //! the last component will be extracted from the most significant bits. - //! - /// @see GLSL unpackUnorm2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL detail::tvec2 unpackUnorm2x16(detail::uint32 const & 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. - //! - //! The conversion for unpacked fixed-point value f to floating point is done as follows: - //! unpackSnorm2x16: clamp(f / 32767.0, -1, +1) - //! - //! The first component of the returned vector will be extracted from the least significant bits of the input; - //! the last component will be extracted from the most significant bits. - //! - /// @see GLSL unpackSnorm2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL detail::tvec2 unpackSnorm2x16(detail::uint32 const & 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. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnorm4x8: f / 255.0 - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see GLSL unpackUnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL detail::tvec4 unpackUnorm4x8(detail::uint32 const & 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. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm4x8: clamp(f / 127.0, -1, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see GLSL unpackSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL detail::tvec4 unpackSnorm4x8(detail::uint32 const & 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. - /// Otherwise, the bit- level representation of v is preserved. - /// The first vector component specifies the 32 least significant bits; - /// the second component specifies the 32 most significant bits. - /// - /// @see GLSL packDouble2x32 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL double packDouble2x32(detail::tvec2 const & v); - - /// Returns a two-component unsigned integer vector representation of v. - /// The bit-level representation of v is preserved. - /// The first component of the vector contains the 32 least significant bits of the double; - /// the second component consists the 32 most significant bits. - /// - /// @see GLSL unpackDouble2x32 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL detail::tvec2 unpackDouble2x32(double const & v); + //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + //! Then, the results are packed into the returned 32-bit unsigned integer. + //! + //! The conversion for component c of v to fixed point is done as follows: + //! packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) + //! + //! The first component of the vector will be written to the least significant bits of the output; + //! the last component will be written to the most significant bits. + //! + /// @see GLSL packUnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + detail::uint32 packUnorm2x16(detail::tvec2 const & v); + + //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + //! Then, the results are packed into the returned 32-bit unsigned integer. + //! + //! The conversion for component c of v to fixed point is done as follows: + //! packSnorm2x16: round(clamp(v, -1, +1) * 32767.0) + //! + //! The first component of the vector will be written to the least significant bits of the output; + //! the last component will be written to the most significant bits. + //! + /// @see GLSL packSnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + detail::uint32 packSnorm2x16(detail::tvec2 const & v); + + //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + //! Then, the results are packed into the returned 32-bit unsigned integer. + //! + //! The conversion for component c of v to fixed point is done as follows: + //! packUnorm4x8: round(clamp(c, 0, +1) * 255.0) + //! + //! The first component of the vector will be written to the least significant bits of the output; + //! the last component will be written to the most significant bits. + //! + /// @see GLSL packUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + detail::uint32 packUnorm4x8(detail::tvec4 const & v); + + //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + //! Then, the results are packed into the returned 32-bit unsigned integer. + //! + //! The conversion for component c of v to fixed point is done as follows: + //! packSnorm4x8: round(clamp(c, -1, +1) * 127.0) + //! + //! The first component of the vector will be written to the least significant bits of the output; + //! the last component will be written to the most significant bits. + //! + /// @see GLSL packSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + detail::uint32 packSnorm4x8(detail::tvec4 const & v); + + //! 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. + //! + //! The conversion for unpacked fixed-point value f to floating point is done as follows: + //! unpackUnorm2x16: f / 65535.0 + //! + //! The first component of the returned vector will be extracted from the least significant bits of the input; + //! the last component will be extracted from the most significant bits. + //! + /// @see GLSL unpackUnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + detail::tvec2 unpackUnorm2x16(detail::uint32 const & 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. + //! + //! The conversion for unpacked fixed-point value f to floating point is done as follows: + //! unpackSnorm2x16: clamp(f / 32767.0, -1, +1) + //! + //! The first component of the returned vector will be extracted from the least significant bits of the input; + //! the last component will be extracted from the most significant bits. + //! + /// @see GLSL unpackSnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + detail::tvec2 unpackSnorm2x16(detail::uint32 const & 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. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnorm4x8: f / 255.0 + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see GLSL unpackUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + detail::tvec4 unpackUnorm4x8(detail::uint32 const & 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. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm4x8: clamp(f / 127.0, -1, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see GLSL unpackSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + detail::tvec4 unpackSnorm4x8(detail::uint32 const & 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. + /// Otherwise, the bit- level representation of v is preserved. + /// The first vector component specifies the 32 least significant bits; + /// the second component specifies the 32 most significant bits. + /// + /// @see GLSL packDouble2x32 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + double packDouble2x32(detail::tvec2 const & v); + + /// Returns a two-component unsigned integer vector representation of v. + /// The bit-level representation of v is preserved. + /// The first component of the vector contains the 32 least significant bits of the double; + /// the second component consists the 32 most significant bits. + /// + /// @see GLSL unpackDouble2x32 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + detail::tvec2 unpackDouble2x32(double const & 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, /// and then packing these two 16- bit integers into a 32-bit unsigned integer. /// The first vector component specifies the 16 least-significant bits of the result; /// the second component specifies the 16 most-significant bits. - /// - /// @see GLSL packHalf2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint packHalf2x16(vec2 const & v); + /// + /// @see GLSL packHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + uint packHalf2x16(vec2 const & v); /// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values, /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, /// and converting them to 32-bit floating-point values. /// The first component of the vector is obtained from the 16 least-significant bits of v; /// the second component is obtained from the 16 most-significant bits of v. - /// - /// @see GLSL unpackHalf2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec2 unpackHalf2x16(uint const & v); + /// + /// @see GLSL unpackHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + vec2 unpackHalf2x16(uint const & v); /// @} }//namespace glm diff --git a/Part1/src/glm/core/func_packing.inl b/Part1/src/glm/core/func_packing.inl index e10e161..b025895 100644 --- a/Part1/src/glm/core/func_packing.inl +++ b/Part1/src/glm/core/func_packing.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -136,72 +136,42 @@ namespace glm GLM_FUNC_QUALIFIER double packDouble2x32(detail::tvec2 const & v) { - struct uint32_pair - { - detail::uint32 x; - detail::uint32 y; - }; - - union helper - { - uint32_pair input; - double output; - } Helper; - - Helper.input.x = v.x; - Helper.input.y = v.y; - - return Helper.output; - //return *(double*)&v; + return *(double*)&v; } GLM_FUNC_QUALIFIER detail::tvec2 unpackDouble2x32(double const & v) { - struct uint32_pair - { - detail::uint32 x; - detail::uint32 y; - }; - - union helper - { - double input; - uint32_pair output; - } Helper; - - Helper.input = v; - - return detail::tvec2(Helper.output.x, Helper.output.y); + return *(detail::tvec2*)&v; } GLM_FUNC_QUALIFIER uint packHalf2x16(detail::tvec2 const & v) { - union helper - { - uint other; - struct - { - detail::hdata a, b; - } orig; - } Pack; - - Pack.orig.a = detail::toFloat16(v.x); - Pack.orig.b = detail::toFloat16(v.y); - return Pack.other; + union helper + { + uint other; + struct + { + detail::hdata a, b; + } orig; + } Pack; + + Pack.orig.a = detail::toFloat16(v.x); + Pack.orig.b = detail::toFloat16(v.y); + return *(uint*)&Pack; } GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint const & v) { - union helper - { - uint other; - struct - { - detail::hdata a, b; - } orig; - } Unpack; - Unpack.other = v; - + union helper + { + uint other; + struct + { + detail::hdata a, b; + } orig; + } Unpack; + Unpack.other = v; + return vec2(detail::toFloat32(Unpack.orig.a), detail::toFloat32(Unpack.orig.b)); } }//namespace glm diff --git a/Part1/src/glm/core/func_trigonometric.hpp b/Part1/src/glm/core/func_trigonometric.hpp index 9954d9c..ba57cb6 100644 --- a/Part1/src/glm/core/func_trigonometric.hpp +++ b/Part1/src/glm/core/func_trigonometric.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -48,150 +48,150 @@ namespace glm /// Converts degrees to radians and returns the result. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL radians man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// + /// @see GLSL radians man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType radians(genType const & degrees); + genType radians(genType const & degrees); /// Converts radians to degrees and returns the result. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL degrees man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// @see GLSL degrees man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType degrees(genType const & radians); + genType degrees(genType const & radians); /// The standard trigonometric sine function. /// The values returned by this function will range from [-1, 1]. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL sin man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// + /// @see GLSL sin man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType sin(genType const & angle); + genType sin(genType const & angle); /// The standard trigonometric cosine function. /// The values returned by this function will range from [-1, 1]. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL cos man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// + /// @see GLSL cos man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType cos(genType const & angle); + genType cos(genType const & angle); /// The standard trigonometric tangent function. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL tan man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// @see GLSL tan man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType tan(genType const & angle); + genType tan(genType const & angle); /// Arc sine. Returns an angle whose sine is x. /// The range of values returned by this function is [-PI/2, PI/2]. /// Results are undefined if |x| > 1. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL asin man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// @see GLSL asin man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType asin(genType const & x); + genType asin(genType const & x); /// Arc cosine. Returns an angle whose sine is x. /// The range of values returned by this function is [0, PI]. /// Results are undefined if |x| > 1. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL acos man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// @see GLSL acos man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType acos(genType const & x); + genType acos(genType const & x); /// Arc tangent. Returns an angle whose tangent is y/x. /// The signs of x and y are used to determine what /// quadrant the angle is in. The range of values returned /// by this function is [-PI, PI]. Results are undefined /// if x and y are both 0. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL atan man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// @see GLSL atan man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType atan(genType const & y, genType const & x); + genType atan(genType const & y, genType const & x); /// Arc tangent. Returns an angle whose tangent is y_over_x. /// The range of values returned by this function is [-PI/2, PI/2]. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL atan man page + /// @see GLSL atan man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType atan(genType const & y_over_x); + genType atan(genType const & y_over_x); /// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL sinh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// @see GLSL sinh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType sinh(genType const & angle); + genType sinh(genType const & angle); /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL cosh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// @see GLSL cosh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType cosh(genType const & angle); + genType cosh(genType const & angle); /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL tanh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// @see GLSL tanh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType tanh(genType const & angle); + genType tanh(genType const & angle); /// Arc hyperbolic sine; returns the inverse of sinh. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL asinh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// @see GLSL asinh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType asinh(genType const & x); + genType asinh(genType const & x); /// Arc hyperbolic cosine; returns the non-negative inverse /// of cosh. Results are undefined if x < 1. - /// + /// /// @tparam genType Floating-point scalar or vector types. /// - /// @see GLSL acosh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// @see GLSL acosh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType acosh(genType const & x); + genType acosh(genType const & x); /// Arc hyperbolic tangent; returns the inverse of tanh. /// Results are undefined if abs(x) >= 1. /// /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL atanh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + /// + /// @see GLSL atanh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - GLM_FUNC_DECL genType atanh(genType const & x); + genType atanh(genType const & x); /// @} }//namespace glm diff --git a/Part1/src/glm/core/func_trigonometric.inl b/Part1/src/glm/core/func_trigonometric.inl index bd59cd7..6d87bf3 100644 --- a/Part1/src/glm/core/func_trigonometric.inl +++ b/Part1/src/glm/core/func_trigonometric.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -26,6 +26,8 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// +#include "_vectorize.hpp" + namespace glm { // radians @@ -67,7 +69,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'sin' only accept floating-point input"); - return genType(::std::sin(angle)); + return ::std::sin(angle); } VECTORIZE_VEC(sin) @@ -78,7 +80,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'cos' only accept floating-point input"); - return genType(::std::cos(angle)); + return ::std::cos(angle); } VECTORIZE_VEC(cos) @@ -92,7 +94,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'tan' only accept floating-point input"); - return genType(::std::tan(angle)); + return ::std::tan(angle); } VECTORIZE_VEC(tan) @@ -106,7 +108,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'asin' only accept floating-point input"); - return genType(::std::asin(x)); + return ::std::asin(x); } VECTORIZE_VEC(asin) @@ -120,7 +122,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'acos' only accept floating-point input"); - return genType(::std::acos(x)); + return ::std::acos(x); } VECTORIZE_VEC(acos) @@ -135,7 +137,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'atan' only accept floating-point input"); - return genType(::std::atan2(y, x)); + return ::std::atan2(y, x); } VECTORIZE_VEC_VEC(atan) @@ -148,7 +150,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'atan' only accept floating-point input"); - return genType(::std::atan(x)); + return ::std::atan(x); } VECTORIZE_VEC(atan) @@ -162,7 +164,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'sinh' only accept floating-point input"); - return genType(std::sinh(angle)); + return std::sinh(angle); } VECTORIZE_VEC(sinh) @@ -176,7 +178,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'cosh' only accept floating-point input"); - return genType(std::cosh(angle)); + return std::cosh(angle); } VECTORIZE_VEC(cosh) @@ -190,7 +192,7 @@ namespace glm { GLM_STATIC_ASSERT(detail::type::is_float, "'tanh' only accept floating-point input"); - return genType(std::tanh(angle)); + return std::tanh(angle); } VECTORIZE_VEC(tanh) diff --git a/Part1/src/glm/core/func_vector_relational.hpp b/Part1/src/glm/core/func_vector_relational.hpp index 4ffe14e..8afba38 100644 --- a/Part1/src/glm/core/func_vector_relational.hpp +++ b/Part1/src/glm/core/func_vector_relational.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2013 G-Truc Creation (www.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 @@ -51,84 +51,84 @@ namespace glm /// Returns the component-wise comparison result of x < y. /// /// @tparam vecType Floating-point or integer vector types. - /// - /// @see GLSL lessThan man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL typename vecType::bool_type lessThan(vecType const & x, vecType const & y); + /// + /// @see GLSL lessThan man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + typename vecType::bool_type lessThan(vecType const & x, vecType const & y); /// Returns the component-wise comparison of result x <= y. - /// + /// /// @tparam vecType Floating-point or integer vector types. /// - /// @see GLSL lessThanEqual man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + /// @see GLSL lessThanEqual man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL typename vecType::bool_type lessThanEqual(vecType const & x, vecType const & y); + typename vecType::bool_type lessThanEqual(vecType const & x, vecType const & y); /// Returns the component-wise comparison of result x > y. - /// + /// /// @tparam vecType Floating-point or integer vector types. /// - /// @see GLSL greaterThan man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + /// @see GLSL greaterThan man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL typename vecType::bool_type greaterThan(vecType const & x, vecType const & y); + typename vecType::bool_type greaterThan(vecType const & x, vecType const & y); /// Returns the component-wise comparison of result x >= y. - /// + /// /// @tparam vecType Floating-point or integer vector types. /// - /// @see GLSL greaterThanEqual man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + /// @see GLSL greaterThanEqual man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL typename vecType::bool_type greaterThanEqual(vecType const & x, vecType const & y); + typename vecType::bool_type greaterThanEqual(vecType const & x, vecType const & y); /// Returns the component-wise comparison of result x == y. - /// + /// /// @tparam vecType Floating-point, integer or boolean vector types. /// - /// @see GLSL equal man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + /// @see GLSL equal man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL typename vecType::bool_type equal(vecType const & x, vecType const & y); + typename vecType::bool_type equal(vecType const & x, vecType const & y); /// Returns the component-wise comparison of result x != y. /// /// @tparam vecType Floating-point, integer or boolean vector types. - /// - /// @see GLSL notEqual man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + /// + /// @see GLSL notEqual man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL typename vecType::bool_type notEqual(vecType const & x, vecType const & y); + typename vecType::bool_type notEqual(vecType const & x, vecType const & y); /// Returns true if any component of x is true. /// /// @tparam vecType Boolean vector types. - /// - /// @see GLSL any man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + /// + /// @see GLSL any man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template