├── Figures
├── 1.PNG
├── 1a.PNG
├── 2.PNG
├── 3.PNG
├── 5.PNG
├── 6.PNG
└── vid.PNG
├── LICENSE.txt
├── Mroz_DistanceFields.pdf
├── README.md
├── RayMarching.sln
├── RayMarching.v12.suo
├── RayMarching
├── Assets
│ ├── fields
│ │ ├── bla.sdf
│ │ ├── bla_5k_124.sdf
│ │ ├── bla_crc.sdf
│ │ ├── bla_teapot_200.sdf
│ │ ├── char.sdf
│ │ ├── char_med.sdf
│ │ ├── cube.sdf
│ │ ├── cube_tiny.sdf
│ │ ├── dragon.sdf
│ │ ├── dragon_med.sdf
│ │ ├── teapot.sdf
│ │ └── teapot_128.sdf
│ ├── gpp
│ │ └── gpp.exe
│ ├── materials
│ │ ├── char.mat
│ │ ├── default.mat
│ │ ├── dragon.mat
│ │ ├── floor.mat
│ │ ├── pillars.mat
│ │ ├── room.mat
│ │ └── teapot.mat
│ ├── meshes
│ │ ├── cube.obj
│ │ └── quad.obj
│ └── textures
│ │ ├── bricks.png
│ │ ├── bricks2.png
│ │ ├── bricks2_metal.png
│ │ ├── bricks2_nrm.png
│ │ ├── bricks2_rough.png
│ │ ├── bricks_metal.png
│ │ ├── bricks_nrm.png
│ │ ├── bricks_rough.png
│ │ ├── diam.png
│ │ ├── diam_metal.png
│ │ ├── diam_nrm.png
│ │ ├── diam_rough.png
│ │ ├── floor.png
│ │ ├── floor2.png
│ │ ├── floor2_nrm.png
│ │ ├── floor_metal.png
│ │ ├── floor_nrm.png
│ │ ├── floor_rough.png
│ │ ├── gold.png
│ │ ├── gold_metal.png
│ │ ├── gold_nrm.png
│ │ ├── gold_rough.png
│ │ ├── greasy.png
│ │ ├── greasy_metal.png
│ │ ├── greasy_nrm.png
│ │ ├── greasy_rough.png
│ │ ├── iron.png
│ │ ├── iron_metal.png
│ │ ├── iron_nrm.png
│ │ ├── iron_rough.png
│ │ ├── marble.png
│ │ ├── marble2.png
│ │ ├── marble2_metal.png
│ │ ├── marble2_nrm.png
│ │ ├── marble2_rough.png
│ │ ├── marble_nrm.png
│ │ ├── marbletiles.png
│ │ ├── marbletiles2.png
│ │ ├── marbletiles2_nrm.png
│ │ ├── marbletiles_nrm.png
│ │ ├── mip0.png
│ │ ├── mip1.png
│ │ ├── mip2.png
│ │ ├── mip3.png
│ │ ├── mip4.png
│ │ ├── mip5.png
│ │ ├── mip6.png
│ │ ├── mip7.png
│ │ ├── quad.png
│ │ ├── quad3.png
│ │ ├── stone.png
│ │ ├── stone_nrm.png
│ │ ├── stonewall.png
│ │ ├── stonewall_metal.png
│ │ ├── stonewall_nrm.png
│ │ ├── stonewall_rough.png
│ │ └── tiny.png
├── Game.cpp
├── Game.h
├── RayMarching.cpp
├── RayMarching.vcxproj
├── RayMarching.vcxproj.filters
├── RayMarching.vcxproj.user
├── gpp
│ └── gpp.exe
├── noise.cps
├── shaderInclude.targets
├── shaderInclude.xml
└── shaders
│ ├── aoCs.shader
│ ├── aoTracing.inc
│ ├── baseVs.shader
│ ├── blockMarchingFs.shader
│ ├── blur.shader
│ ├── conetracing.inc
│ ├── constants.inc
│ ├── cullingHelper.inc
│ ├── defaultVs.shader
│ ├── distanceFunctions.inc
│ ├── fieldCompactorCs.shader
│ ├── helper.inc
│ ├── implicitBlockMarchingFs.shader
│ ├── lighting.inc
│ ├── noise.inc
│ ├── rayMarchingCs.shader
│ ├── reflectionCs.shader
│ ├── reprojectionFs.shader
│ ├── shadingFs.shader
│ ├── shadowsCs.shader
│ ├── shadowsFieldCullingCs.shader
│ ├── spheretracing.inc
│ ├── upsamplerCs.shader
│ ├── velocityCs.shader
│ ├── worldIdCs.shader
│ └── worldSdfCs.shader
├── talk_notes.pdf
├── talk_slides.pdf
└── µTec
├── AssetManager.cpp
├── AssetManager.h
├── Camera.cpp
├── Camera.h
├── Event.cpp
├── Event.h
├── Fields.cpp
├── Fields.h
├── GameLoop.cpp
├── GameLoop.h
├── Gametime.cpp
├── Gametime.h
├── GlobalShader.cpp
├── GlobalShader.h
├── Input.cpp
├── Input.h
├── InputManager.cpp
├── InputManager.h
├── ObjectLoader.cpp
├── ObjectLoader.h
├── Raycaster.cpp
├── Raycaster.h
├── Renderable.cpp
├── Renderable.h
├── RenderableFactory.cpp
├── RenderableFactory.h
├── Renderer.cpp
├── Renderer.h
├── RenderingHelperFunctions.cpp
├── RenderingHelperFunctions.h
├── Shader.cpp
├── Shader.h
├── TextureLoader.cpp
├── TextureLoader.h
├── Vertex.cpp
├── Vertex.h
├── default.fs
├── default.vs
├── dirent.h
├── glm
├── CMakeLists.txt
├── common.hpp
├── detail
│ ├── _features.hpp
│ ├── _fixes.hpp
│ ├── _literals.hpp
│ ├── _noise.hpp
│ ├── _swizzle.hpp
│ ├── _swizzle_func.hpp
│ ├── _vectorize.hpp
│ ├── dummy.cpp
│ ├── func_common.hpp
│ ├── func_common.inl
│ ├── func_exponential.hpp
│ ├── func_exponential.inl
│ ├── func_geometric.hpp
│ ├── func_geometric.inl
│ ├── func_integer.hpp
│ ├── func_integer.inl
│ ├── func_matrix.hpp
│ ├── func_matrix.inl
│ ├── func_noise.hpp
│ ├── func_noise.inl
│ ├── func_packing.hpp
│ ├── func_packing.inl
│ ├── func_trigonometric.hpp
│ ├── func_trigonometric.inl
│ ├── func_vector_relational.hpp
│ ├── func_vector_relational.inl
│ ├── glm.cpp
│ ├── hint.hpp
│ ├── intrinsic_common.hpp
│ ├── intrinsic_common.inl
│ ├── intrinsic_exponential.hpp
│ ├── intrinsic_exponential.inl
│ ├── intrinsic_geometric.hpp
│ ├── intrinsic_geometric.inl
│ ├── intrinsic_integer.hpp
│ ├── intrinsic_integer.inl
│ ├── intrinsic_matrix.hpp
│ ├── intrinsic_matrix.inl
│ ├── intrinsic_trigonometric.hpp
│ ├── intrinsic_trigonometric.inl
│ ├── intrinsic_vector_relational.hpp
│ ├── intrinsic_vector_relational.inl
│ ├── precision.hpp
│ ├── precision.inl
│ ├── setup.hpp
│ ├── type_float.hpp
│ ├── type_gentype.hpp
│ ├── type_gentype.inl
│ ├── type_half.hpp
│ ├── type_half.inl
│ ├── type_int.hpp
│ ├── type_mat.hpp
│ ├── type_mat.inl
│ ├── type_mat2x2.hpp
│ ├── type_mat2x2.inl
│ ├── type_mat2x3.hpp
│ ├── type_mat2x3.inl
│ ├── type_mat2x4.hpp
│ ├── type_mat2x4.inl
│ ├── type_mat3x2.hpp
│ ├── type_mat3x2.inl
│ ├── type_mat3x3.hpp
│ ├── type_mat3x3.inl
│ ├── type_mat3x4.hpp
│ ├── type_mat3x4.inl
│ ├── type_mat4x2.hpp
│ ├── type_mat4x2.inl
│ ├── type_mat4x3.hpp
│ ├── type_mat4x3.inl
│ ├── type_mat4x4.hpp
│ ├── type_mat4x4.inl
│ ├── type_vec.hpp
│ ├── type_vec.inl
│ ├── type_vec1.hpp
│ ├── type_vec1.inl
│ ├── type_vec2.hpp
│ ├── type_vec2.inl
│ ├── type_vec3.hpp
│ ├── type_vec3.inl
│ ├── type_vec4.hpp
│ └── type_vec4.inl
├── exponential.hpp
├── ext.hpp
├── fwd.hpp
├── geometric.hpp
├── glm.hpp
├── gtc
│ ├── constants.hpp
│ ├── constants.inl
│ ├── epsilon.hpp
│ ├── epsilon.inl
│ ├── matrix_access.hpp
│ ├── matrix_access.inl
│ ├── matrix_integer.hpp
│ ├── matrix_inverse.hpp
│ ├── matrix_inverse.inl
│ ├── matrix_transform.hpp
│ ├── matrix_transform.inl
│ ├── noise.hpp
│ ├── noise.inl
│ ├── packing.hpp
│ ├── packing.inl
│ ├── quaternion.hpp
│ ├── quaternion.inl
│ ├── random.hpp
│ ├── random.inl
│ ├── reciprocal.hpp
│ ├── reciprocal.inl
│ ├── type_precision.hpp
│ ├── type_precision.inl
│ ├── type_ptr.hpp
│ ├── type_ptr.inl
│ ├── ulp.hpp
│ └── ulp.inl
├── gtx
│ ├── associated_min_max.hpp
│ ├── associated_min_max.inl
│ ├── bit.hpp
│ ├── bit.inl
│ ├── closest_point.hpp
│ ├── closest_point.inl
│ ├── color_space.hpp
│ ├── color_space.inl
│ ├── color_space_YCoCg.hpp
│ ├── color_space_YCoCg.inl
│ ├── compatibility.hpp
│ ├── compatibility.inl
│ ├── component_wise.hpp
│ ├── component_wise.inl
│ ├── constants.hpp
│ ├── dual_quaternion.hpp
│ ├── dual_quaternion.inl
│ ├── epsilon.hpp
│ ├── euler_angles.hpp
│ ├── euler_angles.inl
│ ├── extend.hpp
│ ├── extend.inl
│ ├── extented_min_max.hpp
│ ├── extented_min_max.inl
│ ├── fast_exponential.hpp
│ ├── fast_exponential.inl
│ ├── fast_square_root.hpp
│ ├── fast_square_root.inl
│ ├── fast_trigonometry.hpp
│ ├── fast_trigonometry.inl
│ ├── gradient_paint.hpp
│ ├── gradient_paint.inl
│ ├── handed_coordinate_space.hpp
│ ├── handed_coordinate_space.inl
│ ├── inertia.hpp
│ ├── inertia.inl
│ ├── int_10_10_10_2.hpp
│ ├── int_10_10_10_2.inl
│ ├── integer.hpp
│ ├── integer.inl
│ ├── intersect.hpp
│ ├── intersect.inl
│ ├── io.hpp
│ ├── io.inl
│ ├── log_base.hpp
│ ├── log_base.inl
│ ├── matrix_cross_product.hpp
│ ├── matrix_cross_product.inl
│ ├── matrix_interpolation.hpp
│ ├── matrix_interpolation.inl
│ ├── matrix_major_storage.hpp
│ ├── matrix_major_storage.inl
│ ├── matrix_operation.hpp
│ ├── matrix_operation.inl
│ ├── matrix_query.hpp
│ ├── matrix_query.inl
│ ├── matrix_transform_2d.hpp
│ ├── matrix_transform_2d.inl
│ ├── mixed_product.hpp
│ ├── mixed_product.inl
│ ├── multiple.hpp
│ ├── multiple.inl
│ ├── noise.hpp
│ ├── norm.hpp
│ ├── norm.inl
│ ├── normal.hpp
│ ├── normal.inl
│ ├── normalize_dot.hpp
│ ├── normalize_dot.inl
│ ├── number_precision.hpp
│ ├── number_precision.inl
│ ├── optimum_pow.hpp
│ ├── optimum_pow.inl
│ ├── orthonormalize.hpp
│ ├── orthonormalize.inl
│ ├── perpendicular.hpp
│ ├── perpendicular.inl
│ ├── polar_coordinates.hpp
│ ├── polar_coordinates.inl
│ ├── projection.hpp
│ ├── projection.inl
│ ├── quaternion.hpp
│ ├── quaternion.inl
│ ├── random.hpp
│ ├── raw_data.hpp
│ ├── raw_data.inl
│ ├── reciprocal.hpp
│ ├── rotate_normalized_axis.hpp
│ ├── rotate_normalized_axis.inl
│ ├── rotate_vector.hpp
│ ├── rotate_vector.inl
│ ├── scalar_relational.hpp
│ ├── scalar_relational.inl
│ ├── simd_mat4.hpp
│ ├── simd_mat4.inl
│ ├── simd_quat.hpp
│ ├── simd_quat.inl
│ ├── simd_vec4.hpp
│ ├── simd_vec4.inl
│ ├── spline.hpp
│ ├── spline.inl
│ ├── std_based_type.hpp
│ ├── std_based_type.inl
│ ├── string_cast.hpp
│ ├── string_cast.inl
│ ├── transform.hpp
│ ├── transform.inl
│ ├── transform2.hpp
│ ├── transform2.inl
│ ├── ulp.hpp
│ ├── unsigned_int.hpp
│ ├── unsigned_int.inl
│ ├── vec1.hpp
│ ├── vec1.inl
│ ├── vector_angle.hpp
│ ├── vector_angle.inl
│ ├── vector_query.hpp
│ ├── vector_query.inl
│ ├── wrap.hpp
│ └── wrap.inl
├── integer.hpp
├── mat2x2.hpp
├── mat2x3.hpp
├── mat2x4.hpp
├── mat3x2.hpp
├── mat3x3.hpp
├── mat3x4.hpp
├── mat4x2.hpp
├── mat4x3.hpp
├── mat4x4.hpp
├── matrix.hpp
├── packing.hpp
├── trigonometric.hpp
├── vec2.hpp
├── vec3.hpp
├── vec4.hpp
└── vector_relational.hpp
├── lodepng.cpp
├── lodepng.h
├── rapidjson
├── allocators.h
├── document.h
├── encodedstream.h
├── encodings.h
├── error
│ ├── en.h
│ └── error.h
├── filereadstream.h
├── filewritestream.h
├── fwd.h
├── internal
│ ├── biginteger.h
│ ├── diyfp.h
│ ├── dtoa.h
│ ├── ieee754.h
│ ├── itoa.h
│ ├── meta.h
│ ├── pow10.h
│ ├── regex.h
│ ├── stack.h
│ ├── strfunc.h
│ ├── strtod.h
│ └── swap.h
├── istreamwrapper.h
├── memorybuffer.h
├── memorystream.h
├── msinttypes
│ ├── inttypes.h
│ └── stdint.h
├── ostreamwrapper.h
├── pointer.h
├── prettywriter.h
├── rapidjson.h
├── reader.h
├── schema.h
├── stream.h
├── stringbuffer.h
└── writer.h
├── wglext.h
├── µTec.vcxproj
├── µTec.vcxproj.filters
└── µTec.vcxproj.user
/Figures/1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/Figures/1.PNG
--------------------------------------------------------------------------------
/Figures/1a.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/Figures/1a.PNG
--------------------------------------------------------------------------------
/Figures/2.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/Figures/2.PNG
--------------------------------------------------------------------------------
/Figures/3.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/Figures/3.PNG
--------------------------------------------------------------------------------
/Figures/5.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/Figures/5.PNG
--------------------------------------------------------------------------------
/Figures/6.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/Figures/6.PNG
--------------------------------------------------------------------------------
/Figures/vid.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/Figures/vid.PNG
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) [2017] Michael Mroz
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/Mroz_DistanceFields.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/Mroz_DistanceFields.pdf
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | mTec - Efficient Rendering with Distance Fields
2 | ========================================
3 | Master Thesis by Michael Mroz
4 |
5 | 
6 |
7 | In modern real-time rendering, there is a large focus on producing photorealistic qualities in images. Most techniques used to produce these effects were developed with older, less powerful hardware in mind and sacrifice visual fidelity for fast computation. Now that more and more powerful hardware has been developed, research into alternatives for these well-established techniques has gained traction in the field of computer graphics. Distance fields are one of these contemporary alternatives, and they offer more intuitive approaches to well-established techniques such as ambient occlusion and object shadows.
8 | This thesis gives an in-depth look into the most common distance field effects and presents a variety of acceleration techniques to show the viability of distance fields for modern game development.
9 |
10 | Please refer to the [slides](talk_notes.pdf) from my talk at the University of Pennsylvania for an introduction into the topic of distance fields or my [thesis](Mroz_DistanceFields.pdf) for more in-depth information.
11 |
12 | [](https://youtu.be/ARlbxXxB1UQ)
13 |
14 | Implementation
15 | --------------
16 | The entire code of the mTec renderer can be downloaded from this repo. Please note that Visual Studio and FreeGLUT/GLEW are required to compile an executable.
17 |
18 |
19 | Keyboard Controls:
20 |
21 | q - quit
22 | Arrow Keys - Move
23 | v/space - Up/Down
24 | Mouse Left + Mouse Move - Camera Look
25 | w - recompile shaders
26 | e - toggle rotation
27 | r - toggle rotation speed
28 | a - toggle animation
29 | d - count average frametime
30 | s - toggle TAA
31 |
32 | If the compilation of the project fails because of an GPP.exe error, please recompile a new [General PreProcessor](https://github.com/logological/gpp) exe and add it to the project.
33 |
34 | 
35 |
--------------------------------------------------------------------------------
/RayMarching.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.31101.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RayMarching", "RayMarching\RayMarching.vcxproj", "{17E430EF-878D-46DA-AB96-52FF9E99A02A}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "µTec", "µTec\µTec.vcxproj", "{1C10567C-C5CE-4764-89AE-48658F971D15}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Win32 = Debug|Win32
13 | Debug|x64 = Debug|x64
14 | Release|Win32 = Release|Win32
15 | Release|x64 = Release|x64
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {17E430EF-878D-46DA-AB96-52FF9E99A02A}.Debug|Win32.ActiveCfg = Debug|Win32
19 | {17E430EF-878D-46DA-AB96-52FF9E99A02A}.Debug|Win32.Build.0 = Debug|Win32
20 | {17E430EF-878D-46DA-AB96-52FF9E99A02A}.Debug|x64.ActiveCfg = Debug|x64
21 | {17E430EF-878D-46DA-AB96-52FF9E99A02A}.Debug|x64.Build.0 = Debug|x64
22 | {17E430EF-878D-46DA-AB96-52FF9E99A02A}.Release|Win32.ActiveCfg = Release|Win32
23 | {17E430EF-878D-46DA-AB96-52FF9E99A02A}.Release|Win32.Build.0 = Release|Win32
24 | {17E430EF-878D-46DA-AB96-52FF9E99A02A}.Release|x64.ActiveCfg = Release|x64
25 | {17E430EF-878D-46DA-AB96-52FF9E99A02A}.Release|x64.Build.0 = Release|x64
26 | {1C10567C-C5CE-4764-89AE-48658F971D15}.Debug|Win32.ActiveCfg = Debug|Win32
27 | {1C10567C-C5CE-4764-89AE-48658F971D15}.Debug|Win32.Build.0 = Debug|Win32
28 | {1C10567C-C5CE-4764-89AE-48658F971D15}.Debug|x64.ActiveCfg = Debug|x64
29 | {1C10567C-C5CE-4764-89AE-48658F971D15}.Debug|x64.Build.0 = Debug|x64
30 | {1C10567C-C5CE-4764-89AE-48658F971D15}.Release|Win32.ActiveCfg = Release|Win32
31 | {1C10567C-C5CE-4764-89AE-48658F971D15}.Release|Win32.Build.0 = Release|Win32
32 | {1C10567C-C5CE-4764-89AE-48658F971D15}.Release|x64.ActiveCfg = Release|x64
33 | {1C10567C-C5CE-4764-89AE-48658F971D15}.Release|x64.Build.0 = Release|x64
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | EndGlobal
39 |
--------------------------------------------------------------------------------
/RayMarching.v12.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching.v12.suo
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/bla.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/bla.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/bla_5k_124.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/bla_5k_124.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/bla_crc.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/bla_crc.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/bla_teapot_200.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/bla_teapot_200.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/char.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/char.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/char_med.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/char_med.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/cube.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/cube.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/cube_tiny.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/cube_tiny.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/dragon.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/dragon.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/dragon_med.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/dragon_med.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/teapot.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/teapot.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/fields/teapot_128.sdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/fields/teapot_128.sdf
--------------------------------------------------------------------------------
/RayMarching/Assets/gpp/gpp.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/gpp/gpp.exe
--------------------------------------------------------------------------------
/RayMarching/Assets/materials/char.mat:
--------------------------------------------------------------------------------
1 | {
2 | "Field" :"char",
3 | "Texture" : "greasy",
4 | "Color" : [1.0,1.0,1.0,1.0],
5 | "FillColor" : [1.0,1.0,1.0,1.0],
6 | "Specular" :[8.0,164.0],
7 | "Density": 4.0,
8 | "TextureScale":0.5
9 | }
--------------------------------------------------------------------------------
/RayMarching/Assets/materials/default.mat:
--------------------------------------------------------------------------------
1 | {
2 | "Field" :"dragon",
3 | "Texture" : "tiny",
4 | "Color" : [1.0,1.0,1.0,1.0],
5 | "FillColor" : [1.0,1.0,1.0,1.0],
6 | "Specular" :[7.5,350.0],
7 | "Density": 999.9,
8 | "TextureScale":1.0
9 | }
--------------------------------------------------------------------------------
/RayMarching/Assets/materials/dragon.mat:
--------------------------------------------------------------------------------
1 | {
2 | "Field" :"dragon_med",
3 | "Texture" : "marble2",
4 | "Color" : [1.0,1.0,0.7,1.0],
5 | "FillColor" : [2.0,2.0,2.0,1.0],
6 | "Specular" :[8.0,164.0],
7 | "Density": 1.9,
8 | "TextureScale":0.13
9 | }
--------------------------------------------------------------------------------
/RayMarching/Assets/materials/floor.mat:
--------------------------------------------------------------------------------
1 | {
2 | "Field" :"",
3 | "Texture" : "floor",
4 | "Color" : [1.0,1.0,1.0,1.0],
5 | "FillColor" : [0.0,0.0,0.0,0.0],
6 | "Specular" :[8.0,64.0],
7 | "Density": 0.0,
8 | "TextureScale":0.13
9 | }
--------------------------------------------------------------------------------
/RayMarching/Assets/materials/pillars.mat:
--------------------------------------------------------------------------------
1 | {
2 | "Field" :"",
3 | "Texture" : "diam",
4 | "Color" : [1.0,1.0,1.0,1.0],
5 | "FillColor" : [0.0,0.0,0.0,0.0],
6 | "Specular" :[8.0,64.0],
7 | "Density": 0.0,
8 | "TextureScale":0.25
9 | }
--------------------------------------------------------------------------------
/RayMarching/Assets/materials/room.mat:
--------------------------------------------------------------------------------
1 | {
2 | "Field" :"",
3 | "Texture" : "bricks2",
4 | "Color" : [1.0,1.0,1.0,1.0],
5 | "FillColor" : [0.0,0.0,0.0,0.0],
6 | "Specular" :[8.0,64.0],
7 | "Density": 0.0,
8 | "TextureScale":0.1
9 | }
--------------------------------------------------------------------------------
/RayMarching/Assets/materials/teapot.mat:
--------------------------------------------------------------------------------
1 | {
2 | "Field" :"teapot",
3 | "Texture" : "iron",
4 | "Color" : [1.0,1.0,1.0,1.0],
5 | "FillColor" : [0.0,1.8,0.48,1.0],
6 | "Specular" :[8.0,64.0],
7 | "Density": 1.9,
8 | "TextureScale":0.25
9 | }
--------------------------------------------------------------------------------
/RayMarching/Assets/meshes/cube.obj:
--------------------------------------------------------------------------------
1 | # This file uses centimeters as units for non-parametric coordinates.
2 |
3 | g default
4 | v -0.500000 -0.500000 0.500000
5 | v 0.500000 -0.500000 0.500000
6 | v -0.500000 0.500000 0.500000
7 | v 0.500000 0.500000 0.500000
8 | v -0.500000 0.500000 -0.500000
9 | v 0.500000 0.500000 -0.500000
10 | v -0.500000 -0.500000 -0.500000
11 | v 0.500000 -0.500000 -0.500000
12 | vt 0.375000 0.000000
13 | vt 0.625000 0.000000
14 | vt 0.375000 0.250000
15 | vt 0.625000 0.250000
16 | vt 0.375000 0.500000
17 | vt 0.625000 0.500000
18 | vt 0.375000 0.750000
19 | vt 0.625000 0.750000
20 | vt 0.375000 1.000000
21 | vt 0.625000 1.000000
22 | vt 0.875000 0.000000
23 | vt 0.875000 0.250000
24 | vt 0.125000 0.000000
25 | vt 0.125000 0.250000
26 | vn 0.000000 0.000000 1.000000
27 | vn 0.000000 0.000000 1.000000
28 | vn 0.000000 0.000000 1.000000
29 | vn 0.000000 0.000000 1.000000
30 | vn 0.000000 1.000000 0.000000
31 | vn 0.000000 1.000000 0.000000
32 | vn 0.000000 1.000000 0.000000
33 | vn 0.000000 1.000000 0.000000
34 | vn 0.000000 0.000000 -1.000000
35 | vn 0.000000 0.000000 -1.000000
36 | vn 0.000000 0.000000 -1.000000
37 | vn 0.000000 0.000000 -1.000000
38 | vn 0.000000 -1.000000 0.000000
39 | vn 0.000000 -1.000000 0.000000
40 | vn 0.000000 -1.000000 0.000000
41 | vn 0.000000 -1.000000 0.000000
42 | vn 1.000000 0.000000 0.000000
43 | vn 1.000000 0.000000 0.000000
44 | vn 1.000000 0.000000 0.000000
45 | vn 1.000000 0.000000 0.000000
46 | vn -1.000000 0.000000 0.000000
47 | vn -1.000000 0.000000 0.000000
48 | vn -1.000000 0.000000 0.000000
49 | vn -1.000000 0.000000 0.000000
50 | g cube
51 | f 1/1/1 2/2/2 3/3/3
52 | f 3/3/3 2/2/2 4/4/4
53 | f 3/3/5 4/4/6 5/5/7
54 | f 5/5/7 4/4/6 6/6/8
55 | f 5/5/9 6/6/10 7/7/11
56 | f 7/7/11 6/6/10 8/8/12
57 | f 7/7/13 8/8/14 1/9/15
58 | f 1/9/15 8/8/14 2/10/16
59 | f 2/2/17 8/11/18 4/4/19
60 | f 4/4/19 8/11/18 6/12/20
61 | f 7/13/21 1/1/22 5/14/23
62 | f 5/14/23 1/1/22 3/3/24
63 |
--------------------------------------------------------------------------------
/RayMarching/Assets/meshes/quad.obj:
--------------------------------------------------------------------------------
1 | # This file uses centimeters as units for non-parametric coordinates.
2 |
3 | g default
4 | v -1.000000 -1.000000 0.000000
5 | v 3.000000 -1.000000 0.000000
6 | v -1.000000 3.000000 0.000000
7 | vt 0.000000 0.000000
8 | vt 2.000000 0.000000
9 | vt 0.000000 2.000000
10 | vn 0.000000 0.000000 1.000000
11 | vn 0.000000 0.000000 1.000000
12 | vn 0.000000 0.000000 1.000000
13 | g quad
14 | f 1/1/1 2/2/2 3/3/3
15 |
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/bricks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/bricks.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/bricks2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/bricks2.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/bricks2_metal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/bricks2_metal.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/bricks2_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/bricks2_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/bricks2_rough.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/bricks2_rough.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/bricks_metal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/bricks_metal.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/bricks_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/bricks_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/bricks_rough.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/bricks_rough.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/diam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/diam.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/diam_metal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/diam_metal.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/diam_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/diam_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/diam_rough.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/diam_rough.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/floor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/floor.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/floor2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/floor2.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/floor2_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/floor2_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/floor_metal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/floor_metal.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/floor_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/floor_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/floor_rough.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/floor_rough.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/gold.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/gold.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/gold_metal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/gold_metal.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/gold_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/gold_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/gold_rough.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/gold_rough.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/greasy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/greasy.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/greasy_metal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/greasy_metal.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/greasy_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/greasy_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/greasy_rough.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/greasy_rough.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/iron.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/iron.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/iron_metal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/iron_metal.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/iron_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/iron_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/iron_rough.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/iron_rough.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/marble.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/marble.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/marble2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/marble2.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/marble2_metal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/marble2_metal.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/marble2_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/marble2_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/marble2_rough.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/marble2_rough.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/marble_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/marble_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/marbletiles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/marbletiles.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/marbletiles2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/marbletiles2.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/marbletiles2_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/marbletiles2_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/marbletiles_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/marbletiles_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/mip0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/mip0.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/mip1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/mip1.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/mip2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/mip2.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/mip3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/mip3.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/mip4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/mip4.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/mip5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/mip5.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/mip6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/mip6.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/mip7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/mip7.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/quad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/quad.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/quad3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/quad3.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/stone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/stone.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/stone_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/stone_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/stonewall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/stonewall.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/stonewall_metal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/stonewall_metal.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/stonewall_nrm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/stonewall_nrm.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/stonewall_rough.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/stonewall_rough.png
--------------------------------------------------------------------------------
/RayMarching/Assets/textures/tiny.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Assets/textures/tiny.png
--------------------------------------------------------------------------------
/RayMarching/Game.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/Game.h
--------------------------------------------------------------------------------
/RayMarching/RayMarching.cpp:
--------------------------------------------------------------------------------
1 | // Copyright (c) <2017> Michael Mroz
2 | // This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT)
3 |
4 |
5 | #include "Game.h"
6 |
7 | int main(int argc, char* argv[])
8 | {
9 | Game game;
10 |
11 | game.init(&argc, argv);
12 |
13 | game.run();
14 |
15 | return 0;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/RayMarching/RayMarching.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(OutDir)
5 | WindowsLocalDebugger
6 |
7 |
8 | $(OutDir)
9 | WindowsLocalDebugger
10 |
11 |
12 | $(OutDir)
13 | WindowsLocalDebugger
14 |
15 |
16 | $(OutDir)
17 | WindowsLocalDebugger
18 |
19 |
--------------------------------------------------------------------------------
/RayMarching/gpp/gpp.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/gpp/gpp.exe
--------------------------------------------------------------------------------
/RayMarching/noise.cps:
--------------------------------------------------------------------------------
1 | //
2 | // Description : Array and textureless GLSL 2D simplex noise function.
3 | // Author : Ian McEwan, Ashima Arts.
4 | // Maintainer : ijm
5 | // Lastmod : 20110822 (ijm)
6 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved.
7 | // Distributed under the MIT License. See LICENSE file.
8 | // https://github.com/ashima/webgl-noise
9 | //
10 | vec3 mod289(vec3 x) {
11 | return x - floor(x * (1.0 / 289.0)) * 289.0;
12 | }
13 | vec2 mod289(vec2 x) {
14 | return x - floor(x * (1.0 / 289.0)) * 289.0;
15 | }
16 | vec3 permute(vec3 x) {
17 | return mod289(((x*34.0)+1.0)*x);
18 | }
19 | float snoise(vec2 v)
20 | {
21 | const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0
22 | 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)
23 | -0.577350269189626, // -1.0 + 2.0 * C.x
24 | 0.024390243902439); // 1.0 / 41.0
25 | // First corner
26 | vec2 i = floor(v + dot(v, C.yy) );
27 | vec2 x0 = v - i + dot(i, C.xx);
28 | // Other corners
29 | vec2 i1;
30 | //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0
31 | //i1.y = 1.0 - i1.x;
32 | i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
33 | // x0 = x0 - 0.0 + 0.0 * C.xx ;
34 | // x1 = x0 - i1 + 1.0 * C.xx ;
35 | // x2 = x0 - 1.0 + 2.0 * C.xx ;
36 | vec4 x12 = x0.xyxy + C.xxzz;
37 | x12.xy -= i1;
38 | // Permutations
39 | i = mod289(i); // Avoid truncation effects in permutation
40 | vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))
41 | + i.x + vec3(0.0, i1.x, 1.0 ));
42 | vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);
43 | m = m*m ;
44 | m = m*m ;
45 | // Gradients: 41 points uniformly over a line, mapped onto a diamond.
46 | // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)
47 | vec3 x = 2.0 * fract(p * C.www) - 1.0;
48 | vec3 h = abs(x) - 0.5;
49 | vec3 ox = floor(x + 0.5);
50 | vec3 a0 = x - ox;
51 | // Normalise gradients implicitly by scaling m
52 | // Approximation of: m *= inversesqrt( a0*a0 + h*h );
53 | m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );
54 | // Compute final noise value at P
55 | vec3 g;
56 | g.x = a0.x * x0.x + h.x * x0.y;
57 | g.yz = a0.yz * x12.xz + h.yz * x12.yw;
58 | return 130.0 * dot(m, g);
59 |
60 | }
--------------------------------------------------------------------------------
/RayMarching/shaderInclude.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | GenerateIncludedShaders
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | $(CleanDependsOn);
19 | CustomAfterClean
20 |
21 |
22 |
23 |
24 |
25 | $(BuildDependsOn);
26 | CustomAfterBuild
27 |
28 |
29 |
30 |
31 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
51 |
52 |
56 |
57 |
58 |
59 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/RayMarching/shaderInclude.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/RayMarching/shaders/aoCs.shader:
--------------------------------------------------------------------------------
1 | // Copyright (c) <2017> Michael Mroz
2 | // This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT)
3 |
4 | #version 430
5 | #extension GL_ARB_compute_shader : enable
6 | #extension GL_ARB_shader_storage_buffer_object : enable
7 | #extension GL_ARB_bindless_texture : require
8 |
9 | layout (local_size_x=8,local_size_y=8,local_size_z=1) in;
10 |
11 | restrict writeonly uniform image2D aoBuffer;
12 | uniform sampler2D positions;
13 | uniform sampler2D normals;
14 |
15 | #include "constants.inc"
16 |
17 | layout(std430, binding = 3) buffer fieldbuffer {
18 | sampler3D fields[];
19 | };
20 |
21 | layout(std140, binding = 5) uniform indexbuffer {
22 | SDF objects[MAX_OBJECT_COUNT];
23 | };
24 |
25 | layout(std140, binding = 6) uniform matbuffer {
26 | mat4 transforms[MAX_OBJECT_COUNT];
27 | };
28 |
29 | layout(std430, binding = 13) buffer culledbuffer {
30 | int ids[];
31 | };
32 |
33 | #include "distanceFunctions.inc"
34 | #include "conetracing.inc"
35 | #include "aoTracing.inc"
36 |
37 |
38 | void main()
39 | {
40 | ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);
41 | vec2 uv = (vec2(gl_GlobalInvocationID.xy)+vec2(0.5,0.5)) / renderDimensions;
42 | ivec2 groupid = ivec2(vec2(gl_WorkGroupID.xy)/4.0);
43 | uint offset = gl_NumWorkGroups.x*gl_WorkGroupSize.x*gl_NumWorkGroups.y*gl_WorkGroupSize.y*MAX_OBJECT_COUNT;
44 | int baseIndex=(storePos.x+(storePos.y*int(gl_NumWorkGroups.x*gl_WorkGroupSize.x)))*MAX_OBJECT_COUNT+int(offset);
45 |
46 | vec4 tpos =matVP * vec4(uv.x*2.0-1.0,uv.y*2.0-1.0,0, 1.0);
47 | vec3 WorldPos = tpos.xyz/tpos.w;
48 |
49 | float dist = texture2D(positions, uv).x;
50 | vec4 normal_id_thickness =texture(normals, uv);
51 | vec3 normal = decodeNormal(normal_id_thickness.xy);
52 |
53 | vec3 eye = gEyeWorldPos.xyz;
54 | vec3 rayDirection =normalize(WorldPos - eye );
55 | vec3 pos = eye+rayDirection*dist;
56 |
57 | float occlusion = AmbientOcclude(pos,normal*-1,baseIndex);
58 |
59 | imageStore(aoBuffer, storePos, vec4(occlusion,0,0,0));
60 | }
--------------------------------------------------------------------------------
/RayMarching/shaders/baseVs.shader:
--------------------------------------------------------------------------------
1 | // Copyright (c) <2017> Michael Mroz
2 | // This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT)
3 |
4 |
5 | #version 330
6 |
7 | layout (location = 0) in vec3 Position;
8 | layout (location = 1) in vec2 TexCoord;
9 |
10 | uniform mat4 gVP;
11 | uniform mat4 gWorld;
12 |
13 | out vec2 TexCoord0;
14 | out vec3 WorldPos;
15 |
16 | void main()
17 | {
18 | vec4 tpos = gWorld * vec4(Position, 1.0);
19 | WorldPos= tpos.xyz / tpos.w;
20 | gl_Position = gVP * vec4(WorldPos, 1.0);
21 | TexCoord0 = TexCoord;
22 |
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/RayMarching/shaders/blur.shader:
--------------------------------------------------------------------------------
1 | // Copyright (c) <2017> Michael Mroz
2 | // This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT)
3 |
4 |
5 | #version 430
6 | #extension GL_ARB_compute_shader : enable
7 | #extension GL_ARB_shader_storage_buffer_object : enable
8 | #extension GL_ARB_bindless_texture : require
9 |
10 | layout (local_size_x=8,local_size_y=8,local_size_z=1) in;
11 |
12 | restrict writeonly uniform image2D blurredBuffer;
13 |
14 | uniform sampler2D colors;
15 |
16 | #include "constants.inc"
17 |
18 | void main()
19 | {
20 | ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);
21 | vec2 uvDiff = 1.0/ renderDimensions;
22 |
23 | vec2 uvTL = (vec2(gl_GlobalInvocationID.xy) ) * uvDiff;
24 | vec2 halfDist = uvDiff*0.5;
25 | vec2 uv = uvTL+halfDist;
26 |
27 | vec3 blurred = vec3(0);
28 |
29 | float weight = 0.195346;
30 |
31 | blurred+= texture(colors,uv).xyz*weight;
32 |
33 | weight = 0.123317;
34 |
35 | blurred+= texture(colors,uv+vec2(uvDiff.x,0)).xyz*weight;
36 | blurred+= texture(colors,uv+vec2(-uvDiff.x,0)).xyz*weight;
37 | blurred+= texture(colors,uv+vec2(0,uvDiff.y)).xyz*weight;
38 | blurred+= texture(colors,uv+vec2(0,-uvDiff.y)).xyz*weight;
39 |
40 | weight = 0.077847;
41 | blurred+= texture(colors,uv+vec2(uvDiff.x,uvDiff.y)).xyz*weight;
42 | blurred+= texture(colors,uv+vec2(-uvDiff.x,uvDiff.y)).xyz*weight;
43 | blurred+= texture(colors,uv+vec2(uvDiff.x,-uvDiff.y)).xyz*weight;
44 | blurred+= texture(colors,uv+vec2(-uvDiff.x,-uvDiff.y)).xyz*weight;
45 |
46 | //imageStore(blurredBuffer, storePos, vec4(blurred,0));
47 | imageStore(blurredBuffer, storePos, vec4(texture(colors,uv).xyz,0));
48 |
49 | }
--------------------------------------------------------------------------------
/RayMarching/shaders/conetracing.inc:
--------------------------------------------------------------------------------
1 | // Copyright (c) <2017> Michael Mroz
2 | // This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT)
3 |
4 | //SimpleConeTrace(res.hit,dir,20.0,0.02,30.0,0.15,0.0,8.0)
5 | float SimpleConeTrace(vec3 p, vec3 d, vec3 d2, float distance, float rIncrease, float maxSteps, float cutoff, float multiplier, float minStepSize,int cullIndex)
6 | {
7 | bool aborted = true;
8 | float lightDist = length(p - lightPos);
9 | float closestPass = 1.0;
10 | //float push = rIncrease*pow(lightDist,1.5)*0.25;
11 | //float push = rIncrease * max(1.0,lightDist-10.0);
12 | float push = rIncrease;
13 | float radius = push;
14 | float maxPush = 0.8;
15 | vec3 P = p;
16 | //maxSteps=155;
17 | maxSteps+=16.0;
18 | //float dist = distance;
19 | float maxDist = 50.0;
20 | float minS = 0.0;
21 |
22 | P += d*push;
23 | int steps = 0;
24 | float dist = push;
25 |
26 | int tries = 0;
27 | {
28 |
29 | for (int i = 0; i= lightDist || dist>maxDist ) {
41 | break;
42 | }
43 |
44 | if(S < cutoff)
45 | {
46 | closestPass =0.0;
47 | break;
48 | }
49 | }
50 | }
51 |
52 | return clamp(closestPass, 0, 1);
53 | }
54 |
55 | float AoConeTrace(vec3 p, vec3 d, float distance, float rIncrease, float maxSteps, float cutoff, float multiplier)
56 | {
57 | float closestPass = 1.0;
58 | float radius = rIncrease;
59 | vec3 P = p;
60 | float maxDist = distance;
61 |
62 | P += d*rIncrease;
63 | float dist = rIncrease;
64 |
65 | for (int i = 0; i= maxDist || S < cutoff ) {
75 | break;
76 | }
77 | }
78 |
79 | return clamp(closestPass, 0, 1);
80 | }
--------------------------------------------------------------------------------
/RayMarching/shaders/constants.inc:
--------------------------------------------------------------------------------
1 | // Copyright (c) <2017> Michael Mroz
2 | // This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT)
3 |
4 | layout(std140, binding = 1) uniform params {
5 | mat4 matVP;
6 | vec4 gEyeWorldPos;
7 | vec4 varParams;
8 | vec3 lightPos;
9 | int objectLength;
10 | };
11 |
12 | uniform vec2 renderDimensions;
13 |
14 | const float PLANE = -3,
15 | OBJ = 1,
16 | COLS = -1,
17 | SKY = -4,
18 | WALLS = -2,
19 | SUN = -5;
20 |
21 | const float MAX = 100.0;
22 | const int OFFSET = 4;
23 | float PRE = 0.01;
24 | const float MAX_DIST = 350.0;
25 | const bool RENDER_2D = false;
26 |
27 | const int MAX_OBJECT_COUNT = 128;
28 |
29 | const float PI = 3.141592653;
30 |
31 | struct SDF {
32 | vec4 resolution;
33 | vec4 color;
34 | vec4 fillColor;
35 | vec4 lightParams;
36 | int fieldId;
37 | float texSize;
38 | int transId;
39 | int texId;
40 | };
41 |
42 | // normal packing/ unpacking with octahedron encoding
43 | // https://knarkowicz.wordpress.com/2014/04/16/octahedron-normal-vector-encoding/
44 |
45 | vec2 signNotZero(vec2 v) {
46 | return vec2((v.x >= 0.0) ? +1.0 : -1.0, (v.y >= 0.0) ? +1.0 : -1.0);
47 | }
48 | vec2 OctWrap( vec2 v )
49 | {
50 | return ( 1.0 - abs( v.yx ) ) * signNotZero(v.xy);
51 | }
52 |
53 | vec4 encodeNormal (vec3 n)
54 | {
55 | n /= ( abs( n.x ) + abs( n.y ) + abs( n.z ) );
56 | n.xy = n.z >= 0.0 ? n.xy : OctWrap( n.xy );
57 | n.xy = n.xy * 0.5 + 0.5;
58 | return vec4(n.xy,0,0);
59 | }
60 |
61 | vec3 decodeNormal (vec2 encN)
62 | {
63 | encN = encN * 2.0 - 1.0;
64 | vec3 n;
65 | n.z = 1.0 - abs( encN.x ) - abs( encN.y );
66 | n.xy = n.z >= 0.0 ? encN.xy : OctWrap( encN.xy );
67 | n = normalize( n );
68 | return n;
69 | }
--------------------------------------------------------------------------------
/RayMarching/shaders/defaultVs.shader:
--------------------------------------------------------------------------------
1 | // Copyright (c) <2017> Michael Mroz
2 | // This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT)
3 |
4 |
5 | #version 330
6 |
7 | layout (location = 0) in vec3 Position;
8 | layout (location = 1) in vec2 TexCoord;
9 |
10 | uniform mat4 gVP;
11 | uniform mat4 gWorld;
12 |
13 | out vec2 TexCoord0;
14 | out vec3 WorldPos;
15 |
16 | void main()
17 | {
18 |
19 | gl_Position = vec4(Position.xy,10000.0, 1.0);
20 | vec4 tpos = gVP * vec4(Position, 1.0);
21 | WorldPos= tpos.xyz / tpos.w;
22 | TexCoord0 = TexCoord;
23 |
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/RayMarching/shaders/helper.inc:
--------------------------------------------------------------------------------
1 | // Copyright (c) <2017> Michael Mroz
2 | // This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT)
3 |
4 |
5 | vec3 triplanarMapping(sampler2D tex,vec3 normal, vec3 p,float zoom)
6 | {
7 | vec3 blending = abs(normal);
8 | blending = normalize(blending); // Force weights to sum to 1.0
9 | float b = (blending.x + blending.y + blending.z);
10 | blending /= vec3(b, b, b);
11 | vec4 xaxis = texture(tex, p.zy*zoom);
12 | vec4 yaxis = texture(tex, p.xz*zoom);
13 | vec4 zaxis = texture(tex, p.xy*zoom);
14 | return (xaxis * blending.x + yaxis * blending.y + zaxis * blending.z).xyz;
15 | }
16 |
17 | vec3 normalMapping(sampler2D tex,vec3 normal, vec3 p,float zoom)
18 | {
19 | float weight = 0.5;
20 | vec2 lookup = vec2(weight,weight);
21 |
22 | vec2 xaxis = texture(tex, p.zy*zoom).xy-weight;
23 | vec2 yaxis = texture(tex, p.xz*zoom).xy-weight;
24 | vec2 zaxis = texture(tex, p.xy*zoom).xy-weight;
25 |
26 |
27 | vec3 bumpNormal1 = vec3(0,xaxis.x,xaxis.y);
28 | vec3 bumpNormal2 = vec3(yaxis.y,0,yaxis.x);
29 | vec3 bumpNormal3 = vec3(zaxis.x,zaxis.y,0);
30 |
31 | vec3 blending = abs(normal);
32 | blending = normalize(blending); // Force weights to sum to 1.0
33 | float b = (blending.x + blending.y + blending.z);
34 | blending /= vec3(b, b, b);
35 | vec3 blended_bump = bumpNormal1 * blending.x +
36 | bumpNormal2 * blending.y +
37 | bumpNormal3 * blending.z;
38 |
39 | return normalize(normal+blended_bump);
40 | }
41 |
42 |
43 |
--------------------------------------------------------------------------------
/RayMarching/shaders/lighting.inc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/RayMarching/shaders/lighting.inc
--------------------------------------------------------------------------------
/RayMarching/shaders/noise.inc:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) <2015> L.Pedersen, MIT Licence
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 |
22 | */
23 |
24 |
25 | //Noise functions used by TAA
26 |
27 | //note: normalized random, float=[0;1[
28 | float PDnrand( vec2 n ) {
29 | return fract( sin(dot(n.xy, vec2(12.9898f, 78.233f)))* 43758.5453f );
30 | }
31 | vec2 PDnrand2( vec2 n ) {
32 | return fract( sin(dot(n.xy, vec2(12.9898f, 78.233f)))* vec2(43758.5453f, 28001.8384f) );
33 | }
34 | vec3 PDnrand3( vec2 n ) {
35 | return fract( sin(dot(n.xy, vec2(12.9898f, 78.233f)))* vec3(43758.5453f, 28001.8384f, 50849.4141f ) );
36 | }
37 | vec4 PDnrand4( vec2 n ) {
38 | return fract( sin(dot(n.xy, vec2(12.9898f, 78.233f)))* vec4(43758.5453f, 28001.8384f, 50849.4141f, 12996.89f) );
39 | }
40 |
41 | //====
42 | //note: signed random, float=[-1;1[
43 | float PDsrand( vec2 n ) {
44 | return PDnrand( n ) * 2 - 1;
45 | }
46 | vec2 PDsrand2( vec2 n ) {
47 | return PDnrand2( n ) * 2 - 1;
48 | }
49 | vec3 PDsrand3( vec2 n ) {
50 | return PDnrand3( n ) * 2 - 1;
51 | }
52 | vec4 PDsrand4( vec2 n ) {
53 | return PDnrand4( n ) * 2 - 1;
54 | }
55 |
--------------------------------------------------------------------------------
/RayMarching/shaders/shadowsCs.shader:
--------------------------------------------------------------------------------
1 | // Copyright (c) <2017> Michael Mroz
2 | // This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT)
3 | #version 430
4 | #extension GL_ARB_compute_shader : enable
5 | #extension GL_ARB_shader_storage_buffer_object : enable
6 | #extension GL_ARB_bindless_texture : require
7 |
8 | layout (local_size_x=8,local_size_y=8,local_size_z=1) in;
9 |
10 | restrict writeonly uniform image2D shadowBuffer;
11 | uniform sampler2D positions;
12 | uniform sampler2D normals;
13 |
14 | #include "constants.inc"
15 |
16 | layout(std430, binding = 3) buffer fieldbuffer {
17 | sampler3D fields[];
18 | };
19 |
20 | layout(std140, binding = 5) uniform indexbuffer {
21 | SDF objects[MAX_OBJECT_COUNT];
22 | };
23 |
24 | layout(std140, binding = 6) uniform matbuffer {
25 | mat4 transforms[MAX_OBJECT_COUNT];
26 | };
27 |
28 | layout(std430, binding = 13) buffer culledbuffer {
29 | int ids[];
30 | };
31 |
32 | #include "distanceFunctions.inc"
33 |
34 | #include "conetracing.inc"
35 |
36 |
37 | void main()
38 | {
39 | ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);
40 | vec2 totalSize =vec2(gl_NumWorkGroups.x*gl_WorkGroupSize.x,gl_NumWorkGroups.y*gl_WorkGroupSize.y);
41 | vec2 uv = (vec2(gl_GlobalInvocationID.xy)+vec2(0.5,0.5)) / renderDimensions;
42 | vec4 tpos =matVP * vec4(uv.x*2.0-1.0,uv.y*2.0-1.0,0, 1.0);
43 | vec3 WorldPos = tpos.xyz/tpos.w;
44 |
45 | float dist = textureLod(positions, uv,1).x;
46 | vec3 normal = decodeNormal(textureLod(normals, uv,0).xy);
47 |
48 | vec3 eye = gEyeWorldPos.xyz;
49 | vec3 rayDirection =normalize(WorldPos - eye );
50 | vec3 pos = eye+rayDirection*dist;
51 | vec3 mSun=normalize(pos-lightPos);
52 | vec3 dir = -mSun;
53 |
54 | int baseIndex=int(int(storePos.x*0.5)+int(storePos.y*0.5)*int(float(gl_NumWorkGroups.x*gl_WorkGroupSize.x)*0.5))*MAX_OBJECT_COUNT;
55 |
56 |
57 | float shadow = 1.0;
58 | {
59 | shadow = SimpleConeTrace(pos,dir,rayDirection,50.0,0.1,40.0,0.001,6.0,0.1,baseIndex);
60 | }
61 | imageStore(shadowBuffer, storePos, vec4(shadow,0,0,0));
62 | }
--------------------------------------------------------------------------------
/RayMarching/shaders/shadowsFieldCullingCs.shader:
--------------------------------------------------------------------------------
1 | // Copyright (c) <2017> Michael Mroz
2 | // This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT)
3 | #version 430
4 | #extension GL_ARB_compute_shader : enable
5 | #extension GL_ARB_shader_storage_buffer_object : enable
6 | #extension GL_ARB_bindless_texture : require
7 |
8 | layout (local_size_x=8,local_size_y=8,local_size_z=1) in;
9 |
10 | #include "constants.inc"
11 | #include "cullingHelper.inc"
12 |
13 | struct Bound {
14 | vec4 sphere;
15 | vec4 forward;
16 | vec4 up;
17 | vec4 right;
18 | };
19 |
20 | layout(std140, binding = 10) uniform indexbuffer {
21 | Bound bounds[MAX_OBJECT_COUNT];
22 | };
23 |
24 | layout(std430, binding = 13) buffer fieldbuffer {
25 | int ids[];
26 | };
27 |
28 | uniform sampler2D positions;
29 |
30 | void main()
31 | {
32 |
33 | ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);
34 | vec2 uv = (vec2(gl_GlobalInvocationID.xy)+vec2(0.5,0.5)) / renderDimensions;
35 |
36 | int baseIndex=(storePos.x+(storePos.y*int(gl_NumWorkGroups.x*gl_WorkGroupSize.x)))*MAX_OBJECT_COUNT;
37 | uint offset = gl_NumWorkGroups.x*gl_WorkGroupSize.x*gl_NumWorkGroups.y*gl_WorkGroupSize.y*MAX_OBJECT_COUNT;
38 | vec4 tpos =matVP * vec4(uv.x*2.0-1.0,uv.y*2.0-1.0,0, 1.0);
39 | vec3 WorldPos = tpos.xyz/tpos.w;
40 | vec2 pixelDim = (1.0/renderDimensions)*0.5;
41 |
42 | float dist = textureLod(positions, uv,1).x;
43 | vec3 eye = gEyeWorldPos.xyz;
44 | vec3 rayDirection =normalize(WorldPos - eye );
45 | vec3 pos = eye+rayDirection*dist;
46 | vec3 mSun=lightPos-pos;
47 | vec3 dir = normalize(mSun);
48 |
49 | int currentIndex=1;
50 | int aoIndex=1;
51 | vec4 posSphere = vec4(pos,1.0);
52 |
53 | for(int i = 1; i < objectLength ; ++i)
54 | {
55 | vec4 newSphere = bounds[i].sphere;
56 | newSphere.w+=0.2;
57 | if(intersectsNR(newSphere,pos,dir,mSun))
58 | {
59 | ids[baseIndex+currentIndex]=i;
60 | ++currentIndex;
61 | }
62 | if(intersectsSphere(bounds[i].sphere,posSphere))
63 | {
64 | ids[baseIndex+aoIndex+offset]=i;
65 | ++aoIndex;
66 | }
67 | }
68 |
69 | ids[baseIndex]= currentIndex-1;
70 | ids[baseIndex+offset]= aoIndex-1;
71 | //ids[baseIndex]=1;
72 | }
--------------------------------------------------------------------------------
/RayMarching/shaders/velocityCs.shader:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) <2015> L.Pedersen, MIT Licence
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 |
22 | */
23 | #version 430
24 | #extension GL_ARB_compute_shader : enable
25 | #extension GL_ARB_shader_storage_buffer_object : enable
26 | #extension GL_ARB_bindless_texture : require
27 |
28 | layout (local_size_x=8,local_size_y=8,local_size_z=1) in;
29 |
30 | restrict writeonly uniform image2D velocityBuffer;
31 | uniform sampler2D positions;
32 | uniform mat4 historyVP;
33 |
34 | #include "constants.inc"
35 |
36 | void main()
37 | {
38 | ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);
39 | vec2 uv = (vec2(gl_GlobalInvocationID.xy)+vec2(0.5,0.5)) / renderDimensions;
40 |
41 | vec4 tpos =matVP * vec4(uv.x*2.0-1.0,uv.y*2.0-1.0,0, 1.0);
42 | vec3 WorldPos = tpos.xyz/tpos.w;
43 |
44 | float dist = texture2D(positions, uv).x;
45 | vec3 eye = gEyeWorldPos.xyz;
46 | vec3 rayDirection =normalize(WorldPos - eye );
47 | vec3 pos = eye+rayDirection*dist;
48 |
49 |
50 | // reproject into previous frame
51 | vec4 rp_cs_pos = historyVP * vec4(pos,1.0);
52 | vec2 rp_ss_ndc = rp_cs_pos.xy / rp_cs_pos.w;
53 | vec2 rp_ss_txc = 0.5 * rp_ss_ndc + 0.5;
54 |
55 | // estimate velocity
56 | vec2 ss_vel = uv - rp_ss_txc;
57 |
58 | imageStore(velocityBuffer, storePos, vec4(ss_vel,0,0));
59 |
60 | //imageStore(velocityBuffer, storePos, vec4(1,1,1,1));
61 |
62 | }
--------------------------------------------------------------------------------
/RayMarching/shaders/worldSdfCs.shader:
--------------------------------------------------------------------------------
1 | // Copyright (c) <2017> Michael Mroz
2 | // This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT)
3 | #version 430
4 | #extension GL_ARB_compute_shader : enable
5 | #extension GL_ARB_shader_storage_buffer_object : enable
6 | #extension GL_ARB_bindless_texture : require
7 |
8 | layout (local_size_x=4,local_size_y=4,local_size_z=4) in;
9 |
10 | #include "constants.inc"
11 | #include "cullingHelper.inc"
12 |
13 | layout(std430, binding = 3) buffer fieldbuffer {
14 | sampler3D fields[];
15 | };
16 |
17 | layout(std140, binding = 5) uniform indexbuffer {
18 | SDF objects[MAX_OBJECT_COUNT];
19 | };
20 |
21 | layout(std140, binding = 6) uniform matbuffer {
22 | mat4 transforms[MAX_OBJECT_COUNT];
23 | };
24 |
25 | restrict writeonly uniform image3D worldSdf;
26 | restrict writeonly uniform iimage3D worldSdf2;
27 |
28 | uniform ivec3 offset;
29 | uniform ivec3 totalGroups;
30 |
31 | int ids[1];
32 |
33 | #include "distanceFunctions.inc"
34 |
35 | void main()
36 | {
37 | ivec3 storePos = ivec3(gl_GlobalInvocationID.xyz+offset*gl_WorkGroupSize);
38 | vec3 uvDist = 1.0/ vec3(totalGroups*gl_WorkGroupSize);
39 | vec3 uv = (vec3(storePos)+vec3(0.5,0.5,0.5)) *uvDist;
40 | //uv-=vec3(0.5);
41 | //uv*=2.0;
42 |
43 |
44 | vec3 eye = vec3(0, 20, 0);
45 |
46 | vec3 maxDist= vec3(86,43,86);
47 | vec3 origin = eye-(maxDist*0.5);
48 | vec3 pos = origin+uv*maxDist;
49 | storePos+=ivec3(2);
50 |
51 | //imageStore(worldSdf, storePos, vec4(box(uv).x,1,1,1));
52 | float dist =combinedSDF(pos);
53 | imageStore(worldSdf, storePos, vec4(dist,1,1,1)-0.1);
54 | // imageStore(worldSdf, storePos, vec4(uv.x,1,1,1));
55 |
56 | int vals;
57 |
58 | vals = int(GetSDF(pos));
59 |
60 | //if(dist > 0.0) val = 0;
61 | imageStore(worldSdf2, storePos, ivec4(vals,1,1,1));
62 | //imageStore(worldSdf2, storePos, ivec4(int(GetSDF(pos)),1,1,1));
63 | //imageStore(worldSdf2, storePos, ivec4(1,1,1,1));
64 |
65 | return;
66 | }
--------------------------------------------------------------------------------
/talk_notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/talk_notes.pdf
--------------------------------------------------------------------------------
/talk_slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/talk_slides.pdf
--------------------------------------------------------------------------------
/µTec/AssetManager.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/AssetManager.cpp
--------------------------------------------------------------------------------
/µTec/AssetManager.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/AssetManager.h
--------------------------------------------------------------------------------
/µTec/Camera.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Camera.cpp
--------------------------------------------------------------------------------
/µTec/Camera.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Camera.h
--------------------------------------------------------------------------------
/µTec/Event.cpp:
--------------------------------------------------------------------------------
1 | #include "Event.h"
2 |
3 |
--------------------------------------------------------------------------------
/µTec/Event.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Event.h
--------------------------------------------------------------------------------
/µTec/Fields.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Fields.cpp
--------------------------------------------------------------------------------
/µTec/Fields.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Fields.h
--------------------------------------------------------------------------------
/µTec/GameLoop.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/GameLoop.cpp
--------------------------------------------------------------------------------
/µTec/GameLoop.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/GameLoop.h
--------------------------------------------------------------------------------
/µTec/Gametime.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Gametime.cpp
--------------------------------------------------------------------------------
/µTec/Gametime.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Gametime.h
--------------------------------------------------------------------------------
/µTec/GlobalShader.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/GlobalShader.cpp
--------------------------------------------------------------------------------
/µTec/GlobalShader.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/GlobalShader.h
--------------------------------------------------------------------------------
/µTec/Input.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Input.cpp
--------------------------------------------------------------------------------
/µTec/Input.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Input.h
--------------------------------------------------------------------------------
/µTec/InputManager.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/InputManager.cpp
--------------------------------------------------------------------------------
/µTec/InputManager.h:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/µTec/ObjectLoader.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/ObjectLoader.cpp
--------------------------------------------------------------------------------
/µTec/ObjectLoader.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/ObjectLoader.h
--------------------------------------------------------------------------------
/µTec/Raycaster.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Raycaster.cpp
--------------------------------------------------------------------------------
/µTec/Raycaster.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Raycaster.h
--------------------------------------------------------------------------------
/µTec/Renderable.cpp:
--------------------------------------------------------------------------------
1 | #include "Renderable.h"
2 |
--------------------------------------------------------------------------------
/µTec/Renderable.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Renderable.h
--------------------------------------------------------------------------------
/µTec/RenderableFactory.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/RenderableFactory.h
--------------------------------------------------------------------------------
/µTec/Renderer.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Renderer.cpp
--------------------------------------------------------------------------------
/µTec/Renderer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Renderer.h
--------------------------------------------------------------------------------
/µTec/RenderingHelperFunctions.cpp:
--------------------------------------------------------------------------------
1 | #include "RenderingHelperFunctions.h"
2 | #include "wglext.h"
3 |
4 | bool WGLExtensionSupported(const char *extension_name)
5 | {
6 | // this is pointer to function which returns pointer to string with list of all wgl extensions
7 | PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglGetExtensionsStringEXT = NULL;
8 |
9 | // determine pointer to wglGetExtensionsStringEXT function
10 | _wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)wglGetProcAddress("wglGetExtensionsStringEXT");
11 |
12 | if (strstr(_wglGetExtensionsStringEXT(), extension_name) == NULL)
13 | {
14 | // string was not found
15 | return false;
16 | }
17 |
18 | // extension is supported
19 | return true;
20 | }
21 |
22 | bool SetVsync(int val)
23 | {
24 | PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
25 |
26 | if (WGLExtensionSupported("WGL_EXT_swap_control"))
27 | {
28 | // Extension is supported, init pointers.
29 | wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
30 |
31 | wglSwapIntervalEXT(val);
32 | return true;
33 | }
34 | return false;
35 | }
36 |
--------------------------------------------------------------------------------
/µTec/RenderingHelperFunctions.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 |
5 |
6 | bool WGLExtensionSupported(const char *extension_name);
7 |
8 | bool SetVsync(int val);
9 |
10 |
11 |
--------------------------------------------------------------------------------
/µTec/Shader.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Shader.cpp
--------------------------------------------------------------------------------
/µTec/Shader.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Shader.h
--------------------------------------------------------------------------------
/µTec/TextureLoader.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/TextureLoader.cpp
--------------------------------------------------------------------------------
/µTec/TextureLoader.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/TextureLoader.h
--------------------------------------------------------------------------------
/µTec/Vertex.cpp:
--------------------------------------------------------------------------------
1 | #include "Vertex.h"
2 |
--------------------------------------------------------------------------------
/µTec/Vertex.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/Vertex.h
--------------------------------------------------------------------------------
/µTec/default.fs:
--------------------------------------------------------------------------------
1 | #version 330
2 |
3 | in vec2 TexCoord0;
4 |
5 | out vec4 FragColor;
6 |
7 | uniform sampler2D Texture0;
8 | uniform sampler2D Texture1;
9 | uniform int texnr;
10 | void main()
11 | {
12 | vec4 texel0, texel1, resultColor;
13 | if(texnr == 2)
14 | {
15 | texel0 = texture2D(Texture0, TexCoord0);
16 | texel1 = texture2D(Texture1, TexCoord0);
17 | resultColor = mix(texel0, texel1, texel1.a);
18 | }
19 | else
20 | {
21 | resultColor=texture2D(Texture0, TexCoord0.xy);
22 | }
23 |
24 | FragColor = resultColor;
25 | }
--------------------------------------------------------------------------------
/µTec/default.vs:
--------------------------------------------------------------------------------
1 | #version 330
2 |
3 | layout (location = 0) in vec2 Position;
4 | layout (location = 1) in vec2 TexCoord;
5 |
6 | uniform mat4 gWVP;
7 | uniform vec4 SpriteFrame;
8 |
9 | out vec2 TexCoord0;
10 |
11 | void main()
12 | {
13 |
14 | gl_Position = gWVP * vec4(Position,0.0, 1.0);
15 | TexCoord0 = SpriteFrame.xy + (TexCoord * SpriteFrame.zw);
16 |
17 | }
--------------------------------------------------------------------------------
/µTec/glm/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(NAME glm_dummy)
2 |
3 | file(GLOB ROOT_SOURCE *.cpp)
4 | file(GLOB ROOT_INLINE *.inl)
5 | file(GLOB ROOT_HEADER *.hpp)
6 | file(GLOB ROOT_TEXT ../*.txt)
7 |
8 | file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp)
9 | file(GLOB_RECURSE CORE_INLINE ./detail/*.inl)
10 | file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp)
11 |
12 | file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp)
13 | file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl)
14 | file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp)
15 |
16 | file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp)
17 | file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl)
18 | file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp)
19 |
20 | source_group("Text Files" FILES ${ROOT_TEXT})
21 | source_group("Core Files" FILES ${CORE_SOURCE})
22 | source_group("Core Files" FILES ${CORE_INLINE})
23 | source_group("Core Files" FILES ${CORE_HEADER})
24 | source_group("GTC Files" FILES ${GTC_SOURCE})
25 | source_group("GTC Files" FILES ${GTC_INLINE})
26 | source_group("GTC Files" FILES ${GTC_HEADER})
27 | source_group("GTX Files" FILES ${GTX_SOURCE})
28 | source_group("GTX Files" FILES ${GTX_INLINE})
29 | source_group("GTX Files" FILES ${GTX_HEADER})
30 |
31 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
32 |
33 | if(GLM_TEST_ENABLE)
34 | add_executable(${NAME} ${ROOT_TEXT}
35 | ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
36 | ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
37 | ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
38 | ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER})
39 | endif(GLM_TEST_ENABLE)
40 |
41 | #add_library(glm STATIC glm.cpp)
42 | #add_library(glm_shared SHARED glm.cpp)
43 |
--------------------------------------------------------------------------------
/µTec/glm/common.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/common.hpp
25 | /// @date 2013-12-24 / 2013-12-24
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_COMMON_INCLUDED
30 | #define GLM_COMMON_INCLUDED
31 |
32 | #include "detail/func_common.hpp"
33 |
34 | #endif//GLM_COMMON_INCLUDED
35 |
--------------------------------------------------------------------------------
/µTec/glm/detail/_fixes.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/_fixes.hpp
25 | /// @date 2011-02-21 / 2011-11-22
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #include
30 |
31 | //! Workaround for compatibility with other libraries
32 | #ifdef max
33 | #undef max
34 | #endif
35 |
36 | //! Workaround for compatibility with other libraries
37 | #ifdef min
38 | #undef min
39 | #endif
40 |
41 | //! Workaround for Android
42 | #ifdef isnan
43 | #undef isnan
44 | #endif
45 |
46 | //! Workaround for Android
47 | #ifdef isinf
48 | #undef isinf
49 | #endif
50 |
51 | //! Workaround for Chrone Native Client
52 | #ifdef log2
53 | #undef log2
54 | #endif
55 |
56 |
--------------------------------------------------------------------------------
/µTec/glm/detail/_literals.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/_literals.hpp
25 | /// @date 2013-05-06 / 2013-05-06
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef glm_core_literals
30 | #define glm_core_literals
31 |
32 | namespace glm
33 | {
34 | #define GLM_CXX11_USER_LITERALS
35 | #ifdef GLM_CXX11_USER_LITERALS
36 | /*
37 | GLM_FUNC_QUALIFIER detail::half operator "" _h(long double const s)
38 | {
39 | return detail::half(s);
40 | }
41 |
42 | GLM_FUNC_QUALIFIER float operator "" _f(long double const s)
43 | {
44 | return static_cast(s);
45 | }
46 | */
47 | #endif//GLM_CXX11_USER_LITERALS
48 |
49 | }//namespace glm
50 |
51 | #endif//glm_core_literals
52 |
--------------------------------------------------------------------------------
/µTec/glm/detail/dummy.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/glm/detail/dummy.cpp
--------------------------------------------------------------------------------
/µTec/glm/detail/hint.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/hint.hpp
25 | /// @date 2008-08-14 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef glm_core_type
30 | #define glm_core_type
31 |
32 | namespace glm
33 | {
34 | // Use dont_care, nicest and fastest to optimize implementations.
35 | class dont_care {};
36 | class nicest {};
37 | class fastest {};
38 | }//namespace glm
39 |
40 | #endif//glm_core_type
41 |
--------------------------------------------------------------------------------
/µTec/glm/detail/intrinsic_exponential.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/intrinsic_exponential.inl
25 | /// @date 2011-06-15 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
--------------------------------------------------------------------------------
/µTec/glm/detail/intrinsic_geometric.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/intrinsic_geometric.hpp
25 | /// @date 2009-05-08 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef glm_core_intrinsic_geometric
30 | #define glm_core_intrinsic_geometric
31 |
32 | #include "setup.hpp"
33 |
34 | #if(!(GLM_ARCH & GLM_ARCH_SSE2))
35 | # error "SSE2 instructions not supported or enabled"
36 | #else
37 |
38 | #include "intrinsic_common.hpp"
39 |
40 | namespace glm{
41 | namespace detail
42 | {
43 | //length
44 | __m128 sse_len_ps(__m128 x);
45 |
46 | //distance
47 | __m128 sse_dst_ps(__m128 p0, __m128 p1);
48 |
49 | //dot
50 | __m128 sse_dot_ps(__m128 v1, __m128 v2);
51 |
52 | // SSE1
53 | __m128 sse_dot_ss(__m128 v1, __m128 v2);
54 |
55 | //cross
56 | __m128 sse_xpd_ps(__m128 v1, __m128 v2);
57 |
58 | //normalize
59 | __m128 sse_nrm_ps(__m128 v);
60 |
61 | //faceforward
62 | __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref);
63 |
64 | //reflect
65 | __m128 sse_rfe_ps(__m128 I, __m128 N);
66 |
67 | //refract
68 | __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta);
69 |
70 | }//namespace detail
71 | }//namespace glm
72 |
73 | #include "intrinsic_geometric.inl"
74 |
75 | #endif//GLM_ARCH
76 | #endif//glm_core_intrinsic_geometric
77 |
--------------------------------------------------------------------------------
/µTec/glm/detail/intrinsic_integer.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/intrinsic_integer.hpp
25 | /// @date 2009-05-11 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef glm_detail_intrinsic_integer
30 | #define glm_detail_intrinsic_integer
31 |
32 | #include "glm/glm.hpp"
33 |
34 | #if(!(GLM_ARCH & GLM_ARCH_SSE2))
35 | # error "SSE2 instructions not supported or enabled"
36 | #else
37 |
38 | namespace glm{
39 | namespace detail
40 | {
41 | __m128i _mm_bit_interleave_si128(__m128i x);
42 | __m128i _mm_bit_interleave_si128(__m128i x, __m128i y);
43 |
44 | }//namespace detail
45 | }//namespace glm
46 |
47 | #include "intrinsic_integer.inl"
48 |
49 | #endif//GLM_ARCH
50 | #endif//glm_detail_intrinsic_integer
51 |
--------------------------------------------------------------------------------
/µTec/glm/detail/intrinsic_matrix.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/intrinsic_common.hpp
25 | /// @date 2009-06-05 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef glm_detail_intrinsic_matrix
30 | #define glm_detail_intrinsic_matrix
31 |
32 | #include "setup.hpp"
33 |
34 | #if(!(GLM_ARCH & GLM_ARCH_SSE2))
35 | # error "SSE2 instructions not supported or enabled"
36 | #else
37 |
38 | #include "intrinsic_geometric.hpp"
39 |
40 | namespace glm{
41 | namespace detail
42 | {
43 | void sse_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]);
44 |
45 | void sse_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]);
46 |
47 | __m128 sse_mul_ps(__m128 m[4], __m128 v);
48 |
49 | __m128 sse_mul_ps(__m128 v, __m128 m[4]);
50 |
51 | void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]);
52 |
53 | void sse_transpose_ps(__m128 const in[4], __m128 out[4]);
54 |
55 | void sse_inverse_ps(__m128 const in[4], __m128 out[4]);
56 |
57 | void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]);
58 |
59 | __m128 sse_det_ps(__m128 const m[4]);
60 |
61 | __m128 sse_slow_det_ps(__m128 const m[4]);
62 |
63 | }//namespace detail
64 | }//namespace glm
65 |
66 | #include "intrinsic_matrix.inl"
67 |
68 | #endif//GLM_ARCH
69 | #endif//glm_detail_intrinsic_matrix
70 |
--------------------------------------------------------------------------------
/µTec/glm/detail/intrinsic_trigonometric.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/intrinsic_trigonometric.hpp
25 | /// @date 2009-06-09 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef glm_detail_intrinsic_trigonometric
30 | #define glm_detail_intrinsic_trigonometric
31 |
32 | #include "setup.hpp"
33 |
34 | #if(!(GLM_ARCH & GLM_ARCH_SSE2))
35 | # error "SSE2 instructions not supported or enabled"
36 | #else
37 |
38 | namespace glm{
39 | namespace detail
40 | {
41 |
42 | }//namespace detail
43 | }//namespace glm
44 |
45 | #include "intrinsic_trigonometric.inl"
46 |
47 | #endif//GLM_ARCH
48 | #endif//glm_detail_intrinsic_trigonometric
49 |
--------------------------------------------------------------------------------
/µTec/glm/detail/intrinsic_trigonometric.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/intrinsic_trigonometric.inl
25 | /// @date 2011-06-15 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
--------------------------------------------------------------------------------
/µTec/glm/detail/intrinsic_vector_relational.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/intrinsic_vector_relational.hpp
25 | /// @date 2009-06-09 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef glm_detail_intrinsic_vector_relational
30 | #define glm_detail_intrinsic_vector_relational
31 |
32 | #include "setup.hpp"
33 |
34 | #if(!(GLM_ARCH & GLM_ARCH_SSE2))
35 | # error "SSE2 instructions not supported or enabled"
36 | #else
37 |
38 | namespace glm{
39 | namespace detail
40 | {
41 |
42 | }//namespace detail
43 | }//namespace glm
44 |
45 | #include "intrinsic_vector_relational.inl"
46 |
47 | #endif//GLM_ARCH
48 | #endif//glm_detail_intrinsic_vector_relational
49 |
--------------------------------------------------------------------------------
/µTec/glm/detail/precision.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/precision.hpp
25 | /// @date 2013-04-01 / 2013-04-01
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_CORE_PRECISION_INCLUDED
30 | #define GLM_CORE_PRECISION_INCLUDED
31 |
32 | namespace glm
33 | {
34 | enum precision
35 | {
36 | highp,
37 | mediump,
38 | lowp,
39 | defaultp = highp
40 | };
41 | }//namespace glm
42 |
43 | #endif//GLM_CORE_PRECISION_INCLUDED
44 |
--------------------------------------------------------------------------------
/µTec/glm/detail/precision.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xx3000/mTec/8cd32d102f1ed6af5585f815437a54d6663a238c/µTec/glm/detail/precision.inl
--------------------------------------------------------------------------------
/µTec/glm/detail/type_half.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/type_half.hpp
25 | /// @date 2008-08-17 / 2011-09-20
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef glm_core_type_half
30 | #define glm_core_type_half
31 |
32 | #include "setup.hpp"
33 |
34 | namespace glm{
35 | namespace detail
36 | {
37 | typedef int hdata;
38 |
39 | GLM_FUNC_DECL float toFloat32(hdata value);
40 | GLM_FUNC_DECL hdata toFloat16(float const & value);
41 |
42 | }//namespace detail
43 |
44 | /// half-precision floating-point numbers.
45 | //typedef detail::hdata half;
46 |
47 | }//namespace glm
48 |
49 | #include "type_half.inl"
50 |
51 | #endif//glm_core_type_half
52 |
--------------------------------------------------------------------------------
/µTec/glm/detail/type_mat.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/type_mat.inl
25 | /// @date 2011-06-15 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
--------------------------------------------------------------------------------
/µTec/glm/detail/type_vec.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/core/type_vec.inl
25 | /// @date 2011-06-15 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
--------------------------------------------------------------------------------
/µTec/glm/exponential.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/exponential.hpp
25 | /// @date 2013-12-24 / 2013-12-24
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_EXPONENTIAL_INCLUDED
30 | #define GLM_EXPONENTIAL_INCLUDED
31 |
32 | #include "detail/func_exponential.hpp"
33 |
34 | #endif//GLM_EXPONENTIAL_INCLUDED
35 |
--------------------------------------------------------------------------------
/µTec/glm/geometric.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/geometric.hpp
25 | /// @date 2013-12-24 / 2013-12-24
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_GEOMETRIC_INCLUDED
30 | #define GLM_GEOMETRIC_INCLUDED
31 |
32 | #include "detail/func_geometric.hpp"
33 |
34 | #endif//GLM_GEOMETRIC_INCLUDED
35 |
--------------------------------------------------------------------------------
/µTec/glm/gtc/type_precision.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtc_swizzle
24 | /// @file glm/gtc/swizzle.inl
25 | /// @date 2009-06-14 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | namespace glm
30 | {
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/closest_point.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_bit
24 | /// @file glm/gtx/bit.hpp
25 | /// @date 2005-12-30 / 2011-06-07
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | ///
30 | /// @defgroup gtx_closest_point GLM_GTX_closest_point
31 | /// @ingroup gtx
32 | ///
33 | /// @brief Find the point on a straight line which is the closet of a point.
34 | ///
35 | /// need to be included to use these functionalities.
36 | ///////////////////////////////////////////////////////////////////////////////////
37 |
38 | #ifndef GLM_GTX_closest_point
39 | #define GLM_GTX_closest_point
40 |
41 | // Dependency:
42 | #include "../glm.hpp"
43 |
44 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
45 | # pragma message("GLM: GLM_GTX_closest_point extension included")
46 | #endif
47 |
48 | namespace glm
49 | {
50 | /// @addtogroup gtx_closest_point
51 | /// @{
52 |
53 | /// Find the point on a straight line which is the closet of a point.
54 | /// @see gtx_closest_point
55 | template
56 | GLM_FUNC_DECL detail::tvec3 closestPointOnLine(
57 | detail::tvec3 const & point,
58 | detail::tvec3 const & a,
59 | detail::tvec3 const & b);
60 |
61 | /// @}
62 | }// namespace glm
63 |
64 | #include "closest_point.inl"
65 |
66 | #endif//GLM_GTX_closest_point
67 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/closest_point.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2005-12-30
5 | // Updated : 2008-10-05
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/closest_point.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | #ifndef glm_gtx_closest_point
11 | #define glm_gtx_closest_point
12 |
13 | namespace glm
14 | {
15 | template
16 | GLM_FUNC_QUALIFIER detail::tvec3 closestPointOnLine
17 | (
18 | detail::tvec3 const & point,
19 | detail::tvec3 const & a,
20 | detail::tvec3 const & b
21 | )
22 | {
23 | T LineLength = distance(a, b);
24 | detail::tvec3 Vector = point - a;
25 | detail::tvec3 LineDirection = (b - a) / LineLength;
26 |
27 | // Project Vector to LineDirection to get the distance of point from a
28 | T Distance = dot(Vector, LineDirection);
29 |
30 | if(Distance <= T(0)) return a;
31 | if(Distance >= LineLength) return b;
32 | return a + LineDirection * Distance;
33 | }
34 | }//namespace glm
35 |
36 | #endif//glm_gtx_closest_point
37 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/color_space_YCoCg.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2008-10-28
5 | // Updated : 2008-10-28
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/color_space_YCoCg.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER detail::tvec3 rgb2YCoCg
14 | (
15 | detail::tvec3 const & rgbColor
16 | )
17 | {
18 | detail::tvec3 result;
19 | result.x/*Y */ = rgbColor.r / T(4) + rgbColor.g / T(2) + rgbColor.b / T(4);
20 | result.y/*Co*/ = rgbColor.r / T(2) + rgbColor.g * T(0) - rgbColor.b / T(2);
21 | result.z/*Cg*/ = - rgbColor.r / T(4) + rgbColor.g / T(2) - rgbColor.b / T(4);
22 | return result;
23 | }
24 |
25 | template
26 | GLM_FUNC_QUALIFIER detail::tvec3 rgb2YCoCgR
27 | (
28 | detail::tvec3 const & rgbColor
29 | )
30 | {
31 | detail::tvec3 result;
32 | result.x/*Y */ = rgbColor.g / T(2) + (rgbColor.r + rgbColor.b) / T(4);
33 | result.y/*Co*/ = rgbColor.r - rgbColor.b;
34 | result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) / T(2);
35 | return result;
36 | }
37 |
38 | template
39 | GLM_FUNC_QUALIFIER detail::tvec3 YCoCg2rgb
40 | (
41 | detail::tvec3 const & YCoCgColor
42 | )
43 | {
44 | detail::tvec3 result;
45 | result.r = YCoCgColor.x + YCoCgColor.y - YCoCgColor.z;
46 | result.g = YCoCgColor.x + YCoCgColor.z;
47 | result.b = YCoCgColor.x - YCoCgColor.y - YCoCgColor.z;
48 | return result;
49 | }
50 |
51 | template
52 | GLM_FUNC_QUALIFIER detail::tvec3 YCoCgR2rgb
53 | (
54 | detail::tvec3 const & YCoCgRColor
55 | )
56 | {
57 | detail::tvec3 result;
58 | T tmp = YCoCgRColor.x - (YCoCgRColor.z / T(2));
59 | result.g = YCoCgRColor.z + tmp;
60 | result.b = tmp - (YCoCgRColor.y / T(2));
61 | result.r = result.b + YCoCgRColor.y;
62 | return result;
63 | }
64 | }//namespace glm
65 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/compatibility.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2007-03-16
5 | // Updated : 2008-10-24
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/compatibility.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | // isfinite
13 | template
14 | GLM_FUNC_QUALIFIER bool isfinite(
15 | genType const & x)
16 | {
17 | # if(GLM_LANG & GLM_LANG_CXX11_FLAG)
18 | return std::isfinite(x) != 0;
19 | # elif(GLM_COMPILER & GLM_COMPILER_VC)
20 | return _finite(x);
21 | # elif(GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID)
22 | return _isfinite(x) != 0;
23 | # else
24 | return isfinite(x) != 0;
25 | # endif
26 | }
27 |
28 | template
29 | GLM_FUNC_QUALIFIER detail::tvec2 isfinite(
30 | detail::tvec2 const & x)
31 | {
32 | return detail::tvec2(
33 | isfinite(x.x),
34 | isfinite(x.y));
35 | }
36 |
37 | template
38 | GLM_FUNC_QUALIFIER detail::tvec3 isfinite(
39 | detail::tvec3 const & x)
40 | {
41 | return detail::tvec3(
42 | isfinite(x.x),
43 | isfinite(x.y),
44 | isfinite(x.z));
45 | }
46 |
47 | template
48 | GLM_FUNC_QUALIFIER detail::tvec4 isfinite(
49 | detail::tvec4 const & x)
50 | {
51 | return detail::tvec4(
52 | isfinite(x.x),
53 | isfinite(x.y),
54 | isfinite(x.z),
55 | isfinite(x.w));
56 | }
57 |
58 | }//namespace glm
59 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/component_wise.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2007-05-21
5 | // Updated : 2010-02-12
6 | // Licence : This source is under MIT License
7 | // File : gtx_component_wise.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template class vecType>
13 | GLM_FUNC_QUALIFIER T compAdd(vecType const & v)
14 | {
15 | T result(0);
16 | for(length_t i = 0; i < v.length(); ++i)
17 | result += v[i];
18 | return result;
19 | }
20 |
21 | template class vecType>
22 | GLM_FUNC_QUALIFIER T compMul(vecType const & v)
23 | {
24 | T result(1);
25 | for(length_t i = 0; i < v.length(); ++i)
26 | result *= v[i];
27 | return result;
28 | }
29 |
30 | template class vecType>
31 | GLM_FUNC_QUALIFIER T compMin(vecType const & v)
32 | {
33 | T result(v[0]);
34 | for(length_t i = 1; i < v.length(); ++i)
35 | result = min(result, v[i]);
36 | return result;
37 | }
38 |
39 | template class vecType>
40 | GLM_FUNC_QUALIFIER T compMax(vecType const & v)
41 | {
42 | T result(v[0]);
43 | for(length_t i = 1; i < v.length(); ++i)
44 | result = max(result, v[i]);
45 | return result;
46 | }
47 | }//namespace glm
48 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/constants.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///////////////////////////////////////////////////////////////////////////////////
23 |
24 | #ifndef GLM_GTX_constants
25 | #define GLM_GTX_constants
26 |
27 | #include "../gtc/constants.hpp"
28 |
29 | #if(defined(GLM_MESSAGES))
30 | # pragma message("GLM: GLM_GTX_constants extension is deprecated, include GLM_GTC_constants (glm/gtc/constants.hpp) instead")
31 | #endif
32 |
33 | #endif//GLM_GTX_constants
34 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/epsilon.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///////////////////////////////////////////////////////////////////////////////////
23 |
24 | #if(defined(GLM_MESSAGES))
25 | # pragma message("GLM: GLM_GTX_epsilon extension is deprecated, include GLM_GTC_epsilon (glm/gtc/epsilon) instead")
26 | #endif
27 |
28 | // Promoted:
29 | #include "../gtc/epsilon.hpp"
30 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/extend.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_extend
24 | /// @file glm/gtx/extend.hpp
25 | /// @date 2006-01-07 / 2011-06-07
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | ///
30 | /// @defgroup gtx_extend GLM_GTX_extend
31 | /// @ingroup gtx
32 | ///
33 | /// @brief Extend a position from a source to a position at a defined length.
34 | ///
35 | /// need to be included to use these functionalities.
36 | ///////////////////////////////////////////////////////////////////////////////////
37 |
38 | #ifndef GLM_GTX_extend
39 | #define GLM_GTX_extend
40 |
41 | // Dependency:
42 | #include "../glm.hpp"
43 |
44 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
45 | # pragma message("GLM: GLM_GTX_extend extension included")
46 | #endif
47 |
48 | namespace glm
49 | {
50 | /// @addtogroup gtx_extend
51 | /// @{
52 |
53 | /// Extends of Length the Origin position using the (Source - Origin) direction.
54 | /// @see gtx_extend
55 | template
56 | GLM_FUNC_DECL genType extend(
57 | genType const & Origin,
58 | genType const & Source,
59 | typename genType::value_type const Length);
60 |
61 | /// @}
62 | }//namespace glm
63 |
64 | #include "extend.inl"
65 |
66 | #endif//GLM_GTX_extend
67 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/extend.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2006-01-07
5 | // Updated : 2008-10-05
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/extend.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER genType extend
14 | (
15 | genType const & Origin,
16 | genType const & Source,
17 | genType const & Distance
18 | )
19 | {
20 | return Origin + (Source - Origin) * Distance;
21 | }
22 |
23 | template
24 | GLM_FUNC_QUALIFIER detail::tvec2 extend
25 | (
26 | detail::tvec2 const & Origin,
27 | detail::tvec2 const & Source,
28 | T const & Distance
29 | )
30 | {
31 | return Origin + (Source - Origin) * Distance;
32 | }
33 |
34 | template
35 | GLM_FUNC_QUALIFIER detail::tvec3 extend
36 | (
37 | detail::tvec3 const & Origin,
38 | detail::tvec3 const & Source,
39 | T const & Distance
40 | )
41 | {
42 | return Origin + (Source - Origin) * Distance;
43 | }
44 |
45 | template
46 | GLM_FUNC_QUALIFIER detail::tvec4 extend
47 | (
48 | detail::tvec4 const & Origin,
49 | detail::tvec4 const & Source,
50 | T const & Distance
51 | )
52 | {
53 | return Origin + (Source - Origin) * Distance;
54 | }
55 | }//namespace glm
56 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/fast_trigonometry.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2006-01-08
5 | // Updated : 2011-10-14
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/fast_trigonometry.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | // sin
13 | template
14 | GLM_FUNC_QUALIFIER T fastSin(T const & x)
15 | {
16 | return x - ((x * x * x) / T(6)) + ((x * x * x * x * x) / T(120)) - ((x * x * x * x * x * x * x) / T(5040));
17 | }
18 |
19 | VECTORIZE_VEC(fastSin)
20 |
21 | // cos
22 | template
23 | GLM_FUNC_QUALIFIER T fastCos(T const & x)
24 | {
25 | return T(1) - (x * x * T(0.5)) + (x * x * x * x * T(0.041666666666)) - (x * x * x * x * x * x * T(0.00138888888888));
26 | }
27 |
28 | VECTORIZE_VEC(fastCos)
29 |
30 | // tan
31 | template
32 | GLM_FUNC_QUALIFIER T fastTan(T const & x)
33 | {
34 | return x + (x * x * x * T(0.3333333333)) + (x * x * x * x * x * T(0.1333333333333)) + (x * x * x * x * x * x * x * T(0.0539682539));
35 | }
36 |
37 | VECTORIZE_VEC(fastTan)
38 |
39 | // asin
40 | template
41 | GLM_FUNC_QUALIFIER T fastAsin(T const & x)
42 | {
43 | return x + (x * x * x * T(0.166666667)) + (x * x * x * x * x * T(0.075)) + (x * x * x * x * x * x * x * T(0.0446428571)) + (x * x * x * x * x * x * x * x * x * T(0.0303819444));// + (x * x * x * x * x * x * x * x * x * x * x * T(0.022372159));
44 | }
45 |
46 | VECTORIZE_VEC(fastAsin)
47 |
48 | // acos
49 | template
50 | GLM_FUNC_QUALIFIER T fastAcos(T const & x)
51 | {
52 | return T(1.5707963267948966192313216916398) - fastAsin(x); //(PI / 2)
53 | }
54 |
55 | VECTORIZE_VEC(fastAcos)
56 |
57 | // atan
58 | template
59 | GLM_FUNC_QUALIFIER T fastAtan(T const & y, T const & x)
60 | {
61 | T sgn = sign(y) * sign(x);
62 | return abs(fastAtan(y / x)) * sgn;
63 | }
64 |
65 | VECTORIZE_VEC_VEC(fastAtan)
66 |
67 | template
68 | GLM_FUNC_QUALIFIER T fastAtan(T const & x)
69 | {
70 | return x - (x * x * x * T(0.333333333333)) + (x * x * x * x * x * T(0.2)) - (x * x * x * x * x * x * x * T(0.1428571429)) + (x * x * x * x * x * x * x * x * x * T(0.111111111111)) - (x * x * x * x * x * x * x * x * x * x * x * T(0.0909090909));
71 | }
72 |
73 | VECTORIZE_VEC(fastAtan)
74 |
75 | }//namespace glm
76 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/gradient_paint.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2009-03-06
5 | // Updated : 2013-04-09
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/gradient_paint.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER T radialGradient
14 | (
15 | detail::tvec2 const & Center,
16 | T const & Radius,
17 | detail::tvec2 const & Focal,
18 | detail::tvec2 const & Position
19 | )
20 | {
21 | detail::tvec2 F = Focal - Center;
22 | detail::tvec2 D = Position - Focal;
23 | T Radius2 = pow2(Radius);
24 | T Fx2 = pow2(F.x);
25 | T Fy2 = pow2(F.y);
26 |
27 | T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x));
28 | T Denominator = Radius2 - (Fx2 + Fy2);
29 | return Numerator / Denominator;
30 | }
31 |
32 | template
33 | GLM_FUNC_QUALIFIER T linearGradient
34 | (
35 | detail::tvec2 const & Point0,
36 | detail::tvec2 const & Point1,
37 | detail::tvec2 const & Position
38 | )
39 | {
40 | detail::tvec2 Dist = Point1 - Point0;
41 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist);
42 | }
43 | }//namespace glm
44 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/handed_coordinate_space.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2005-12-21
5 | // Updated : 2009-02-19
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/handed_coordinate_space.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER bool rightHanded
14 | (
15 | detail::tvec3 const & tangent,
16 | detail::tvec3 const & binormal,
17 | detail::tvec3 const & normal
18 | )
19 | {
20 | return dot(cross(normal, tangent), binormal) > T(0);
21 | }
22 |
23 | template
24 | GLM_FUNC_QUALIFIER bool leftHanded
25 | (
26 | detail::tvec3 const & tangent,
27 | detail::tvec3 const & binormal,
28 | detail::tvec3 const & normal
29 | )
30 | {
31 | return dot(cross(normal, tangent), binormal) < T(0);
32 | }
33 | }//namespace glm
34 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/int_10_10_10_2.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///////////////////////////////////////////////////////////////////////////////////
23 |
24 | #ifndef GLM_GTX_int_10_10_10_2
25 | #define GLM_GTX_int_10_10_10_2
26 |
27 | // Dependency:
28 | #include "../glm.hpp"
29 | #include "../gtx/raw_data.hpp"
30 |
31 | #if(defined(GLM_MESSAGES))
32 | # pragma message("GLM: GLM_GTX_int_10_10_10_2 extension is deprecated, include GLM_GTC_packing (glm/gtc/packing.hpp) instead")
33 | #endif
34 |
35 | namespace glm
36 | {
37 | //! Deprecated, use packUnorm3x10_1x2 instead.
38 | GLM_DEPRECATED GLM_FUNC_DECL dword uint10_10_10_2_cast(glm::vec4 const & v);
39 |
40 | }//namespace glm
41 |
42 | #include "int_10_10_10_2.inl"
43 |
44 | #endif//GLM_GTX_int_10_10_10_2
45 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/int_10_10_10_2.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///////////////////////////////////////////////////////////////////////////////////
23 |
24 | namespace glm
25 | {
26 | GLM_FUNC_QUALIFIER dword uint10_10_10_2_cast
27 | (
28 | glm::vec4 const & v
29 | )
30 | {
31 | return dword(uint(v.x * 2047.f) << 0 | uint(v.y * 2047.f) << 10 | uint(v.z * 2047.f) << 20 | uint(v.w * 3.f) << 30);
32 | }
33 | }//namespace glm
34 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/log_base.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_log_base
24 | /// @file glm/gtx/log_base.hpp
25 | /// @date 2008-10-24 / 2011-06-07
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | ///
30 | /// @defgroup gtx_log_base GLM_GTX_log_base
31 | /// @ingroup gtx
32 | ///
33 | /// @brief Logarithm for any base. base can be a vector or a scalar.
34 | ///
35 | /// need to be included to use these functionalities.
36 | ///////////////////////////////////////////////////////////////////////////////////
37 |
38 | #ifndef GLM_GTX_log_base
39 | #define GLM_GTX_log_base
40 |
41 | // Dependency:
42 | #include "../glm.hpp"
43 |
44 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
45 | # pragma message("GLM: GLM_GTX_log_base extension included")
46 | #endif
47 |
48 | namespace glm
49 | {
50 | /// @addtogroup gtx_log_base
51 | /// @{
52 |
53 | //! Logarithm for any base.
54 | //! From GLM_GTX_log_base.
55 | template
56 | GLM_FUNC_DECL genType log(
57 | genType const & x,
58 | genType const & base);
59 |
60 | /// @}
61 | }//namespace glm
62 |
63 | #include "log_base.inl"
64 |
65 | #endif//GLM_GTX_log_base
66 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/log_base.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2008-10-24
5 | // Updated : 2008-10-24
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/log_base.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER genType log(
14 | genType const & x,
15 | genType const & base)
16 | {
17 | assert(x != genType(0));
18 |
19 | return glm::log(x) / glm::log(base);
20 | }
21 |
22 | VECTORIZE_VEC_SCA(log)
23 | VECTORIZE_VEC_VEC(log)
24 | }//namespace glm
25 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/matrix_cross_product.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2005-12-21
5 | // Updated : 2005-12-21
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/matrix_cross_product.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER detail::tmat3x3 matrixCross3
14 | (
15 | detail::tvec3 const & x
16 | )
17 | {
18 | detail::tmat3x3 Result(T(0));
19 | Result[0][1] = x.z;
20 | Result[1][0] = -x.z;
21 | Result[0][2] = -x.y;
22 | Result[2][0] = x.y;
23 | Result[1][2] = x.x;
24 | Result[2][1] = -x.x;
25 | return Result;
26 | }
27 |
28 | template
29 | GLM_FUNC_QUALIFIER detail::tmat4x4 matrixCross4
30 | (
31 | detail::tvec3 const & x
32 | )
33 | {
34 | detail::tmat4x4 Result(T(0));
35 | Result[0][1] = x.z;
36 | Result[1][0] = -x.z;
37 | Result[0][2] = -x.y;
38 | Result[2][0] = x.y;
39 | Result[1][2] = x.x;
40 | Result[2][1] = -x.x;
41 | return Result;
42 | }
43 |
44 | }//namespace glm
45 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/mixed_product.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_mixed_product
24 | /// @file glm/gtx/mixed_product.hpp
25 | /// @date 2007-04-03 / 2011-06-07
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | ///
30 | /// @defgroup gtx_mixed_product GLM_GTX_mixed_producte
31 | /// @ingroup gtx
32 | ///
33 | /// @brief Mixed product of 3 vectors.
34 | ///
35 | /// need to be included to use these functionalities.
36 | ///////////////////////////////////////////////////////////////////////////////////
37 |
38 | #ifndef GLM_GTX_mixed_product
39 | #define GLM_GTX_mixed_product
40 |
41 | // Dependency:
42 | #include "../glm.hpp"
43 |
44 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
45 | # pragma message("GLM: GLM_GTX_mixed_product extension included")
46 | #endif
47 |
48 | namespace glm
49 | {
50 | /// @addtogroup gtx_mixed_product
51 | /// @{
52 |
53 | /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension)
54 | template
55 | GLM_FUNC_DECL T mixedProduct(
56 | detail::tvec3 const & v1,
57 | detail::tvec3 const & v2,
58 | detail::tvec3 const & v3);
59 |
60 | /// @}
61 | }// namespace glm
62 |
63 | #include "mixed_product.inl"
64 |
65 | #endif//GLM_GTX_mixed_product
66 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/mixed_product.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2007-04-03
5 | // Updated : 2008-09-17
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/mixed_product.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER T mixedProduct
14 | (
15 | detail::tvec3 const & v1,
16 | detail::tvec3 const & v2,
17 | detail::tvec3 const & v3
18 | )
19 | {
20 | return dot(cross(v1, v2), v3);
21 | }
22 | }//namespace glm
23 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/noise.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///////////////////////////////////////////////////////////////////////////////////
23 |
24 | #if(defined(GLM_MESSAGES))
25 | # pragma message("GLM: GLM_GTX_random extension is deprecated, include GLM_GTC_random (glm/gtc/noise.hpp) instead")
26 | #endif
27 |
28 | // Promoted:
29 | #include "../gtc/noise.hpp"
30 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/normal.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_normal
24 | /// @file glm/gtx/normal.hpp
25 | /// @date 2005-12-21 / 2011-06-07
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | /// @see gtx_extented_min_max (dependence)
30 | ///
31 | /// @defgroup gtx_normal GLM_GTX_normal
32 | /// @ingroup gtx
33 | ///
34 | /// @brief Compute the normal of a triangle.
35 | ///
36 | /// need to be included to use these functionalities.
37 | ///////////////////////////////////////////////////////////////////////////////////
38 |
39 | #ifndef GLM_GTX_normal
40 | #define GLM_GTX_normal
41 |
42 | // Dependency:
43 | #include "../glm.hpp"
44 |
45 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
46 | # pragma message("GLM: GLM_GTX_normal extension included")
47 | #endif
48 |
49 | namespace glm
50 | {
51 | /// @addtogroup gtx_normal
52 | /// @{
53 |
54 | //! Computes triangle normal from triangle points.
55 | //! From GLM_GTX_normal extension.
56 | template
57 | GLM_FUNC_DECL detail::tvec3 triangleNormal(
58 | detail::tvec3 const & p1,
59 | detail::tvec3 const & p2,
60 | detail::tvec3 const & p3);
61 |
62 | /// @}
63 | }//namespace glm
64 |
65 | #include "normal.inl"
66 |
67 | #endif//GLM_GTX_normal
68 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/normal.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2005-12-21
5 | // Updated : 2011-06-07
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/normal.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER detail::tvec3 triangleNormal
14 | (
15 | detail::tvec3 const & p1,
16 | detail::tvec3 const & p2,
17 | detail::tvec3 const & p3
18 | )
19 | {
20 | return normalize(cross(p1 - p2, p1 - p3));
21 | }
22 | }//namespace glm
23 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/number_precision.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2007-05-10
5 | // Updated : 2007-05-10
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/number_precision.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/optimum_pow.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2005-12-21
5 | // Updated : 2005-12-27
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/optimum_pow.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER genType pow2(genType const & x)
14 | {
15 | return x * x;
16 | }
17 |
18 | template
19 | GLM_FUNC_QUALIFIER genType pow3(genType const & x)
20 | {
21 | return x * x * x;
22 | }
23 |
24 | template
25 | GLM_FUNC_QUALIFIER genType pow4(genType const & x)
26 | {
27 | return (x * x) * (x * x);
28 | }
29 |
30 | GLM_FUNC_QUALIFIER bool powOfTwo(int x)
31 | {
32 | return !(x & (x - 1));
33 | }
34 |
35 | template
36 | GLM_FUNC_QUALIFIER detail::tvec2 powOfTwo(detail::tvec2 const & x)
37 | {
38 | return detail::tvec2(
39 | powOfTwo(x.x),
40 | powOfTwo(x.y));
41 | }
42 |
43 | template
44 | GLM_FUNC_QUALIFIER detail::tvec3 powOfTwo(detail::tvec3 const & x)
45 | {
46 | return detail::tvec3(
47 | powOfTwo(x.x),
48 | powOfTwo(x.y),
49 | powOfTwo(x.z));
50 | }
51 |
52 | template
53 | GLM_FUNC_QUALIFIER detail::tvec4 powOfTwo(detail::tvec4 const & x)
54 | {
55 | return detail::tvec4(
56 | powOfTwo(x.x),
57 | powOfTwo(x.y),
58 | powOfTwo(x.z),
59 | powOfTwo(x.w));
60 | }
61 | }//namespace glm
62 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/orthonormalize.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_orthonormalize
24 | /// @file glm/gtx/orthonormalize.hpp
25 | /// @date 2005-12-21 / 2011-06-07
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | /// @see gtx_extented_min_max (dependence)
30 | ///
31 | /// @defgroup gtx_orthonormalize GLM_GTX_orthonormalize
32 | /// @ingroup gtx
33 | ///
34 | /// @brief Orthonormalize matrices.
35 | ///
36 | /// need to be included to use these functionalities.
37 | ///////////////////////////////////////////////////////////////////////////////////
38 |
39 | #ifndef GLM_GTX_orthonormalize
40 | #define GLM_GTX_orthonormalize
41 |
42 | // Dependency:
43 | #include "../glm.hpp"
44 |
45 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
46 | # pragma message("GLM: GLM_GTX_orthonormalize extension included")
47 | #endif
48 |
49 | namespace glm
50 | {
51 | /// @addtogroup gtx_orthonormalize
52 | /// @{
53 |
54 | //! Returns the orthonormalized matrix of m.
55 | //! From GLM_GTX_orthonormalize extension.
56 | template
57 | GLM_FUNC_DECL detail::tmat3x3 orthonormalize(
58 | const detail::tmat3x3& m);
59 |
60 | //! Orthonormalizes x according y.
61 | //! From GLM_GTX_orthonormalize extension.
62 | template
63 | GLM_FUNC_DECL detail::tvec3 orthonormalize(
64 | const detail::tvec3& x,
65 | const detail::tvec3& y);
66 |
67 | /// @}
68 | }//namespace glm
69 |
70 | #include "orthonormalize.inl"
71 |
72 | #endif//GLM_GTX_orthonormalize
73 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/orthonormalize.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2005-12-21
5 | // Updated : 2005-12-21
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/orthonormalize.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER detail::tmat3x3 orthonormalize
14 | (
15 | const detail::tmat3x3& m
16 | )
17 | {
18 | detail::tmat3x3 r = m;
19 |
20 | r[0] = normalize(r[0]);
21 |
22 | float d0 = dot(r[0], r[1]);
23 | r[1] -= r[0] * d0;
24 | r[1] = normalize(r[1]);
25 |
26 | float d1 = dot(r[1], r[2]);
27 | d0 = dot(r[0], r[2]);
28 | r[2] -= r[0] * d0 + r[1] * d1;
29 | r[2] = normalize(r[2]);
30 |
31 | return r;
32 | }
33 |
34 | template
35 | GLM_FUNC_QUALIFIER detail::tvec3 orthonormalize
36 | (
37 | const detail::tvec3& x,
38 | const detail::tvec3& y
39 | )
40 | {
41 | return normalize(x - y * dot(y, x));
42 | }
43 | }//namespace glm
44 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/perpendicular.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_perpendicular
24 | /// @file glm/gtx/perpendicular.hpp
25 | /// @date 2005-12-21 / 2011-06-07
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | /// @see gtx_projection (dependence)
30 | ///
31 | /// @defgroup gtx_perpendicular GLM_GTX_perpendicular
32 | /// @ingroup gtx
33 | ///
34 | /// @brief Perpendicular of a vector from other one
35 | ///
36 | /// need to be included to use these functionalities.
37 | ///////////////////////////////////////////////////////////////////////////////////
38 |
39 | #ifndef GLM_GTX_perpendicular
40 | #define GLM_GTX_perpendicular
41 |
42 | // Dependency:
43 | #include "../glm.hpp"
44 | #include "../gtx/projection.hpp"
45 |
46 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
47 | # pragma message("GLM: GLM_GTX_perpendicular extension included")
48 | #endif
49 |
50 | namespace glm
51 | {
52 | /// @addtogroup gtx_perpendicular
53 | /// @{
54 |
55 | //! Projects x a perpendicular axis of Normal.
56 | //! From GLM_GTX_perpendicular extension.
57 | template
58 | GLM_FUNC_DECL vecType perp(
59 | vecType const & x,
60 | vecType const & Normal);
61 |
62 | /// @}
63 | }//namespace glm
64 |
65 | #include "perpendicular.inl"
66 |
67 | #endif//GLM_GTX_perpendicular
68 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/perpendicular.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2005-12-21
5 | // Updated : 2009-03-06
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/perpendicular.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER vecType perp
14 | (
15 | vecType const & x,
16 | vecType const & Normal
17 | )
18 | {
19 | return x - proj(x, Normal);
20 | }
21 | }//namespace glm
22 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/polar_coordinates.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2007-03-06
5 | // Updated : 2009-05-01
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/polar_coordinates.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER detail::tvec3 polar
14 | (
15 | detail::tvec3 const & euclidean
16 | )
17 | {
18 | T const Length(length(euclidean));
19 | detail::tvec3 const tmp(euclidean / Length);
20 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z));
21 |
22 | #ifdef GLM_FORCE_RADIANS
23 | return detail::tvec3(
24 | atan(xz_dist, tmp.y), // latitude
25 | atan(tmp.x, tmp.z), // longitude
26 | xz_dist); // xz distance
27 | #else
28 | # pragma message("GLM: polar function returning degrees is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.")
29 | return detail::tvec3(
30 | degrees(atan(xz_dist, tmp.y)), // latitude
31 | degrees(atan(tmp.x, tmp.z)), // longitude
32 | xz_dist); // xz distance
33 | #endif
34 | }
35 |
36 | template
37 | GLM_FUNC_QUALIFIER detail::tvec3 euclidean
38 | (
39 | detail::tvec2 const & polar
40 | )
41 | {
42 | #ifdef GLM_FORCE_RADIANS
43 | T const latitude(polar.x);
44 | T const longitude(polar.y);
45 | #else
46 | # pragma message("GLM: euclidean function taking degrees as parameters is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove this message.")
47 | T const latitude(radians(polar.x));
48 | T const longitude(radians(polar.y));
49 | #endif
50 |
51 | return detail::tvec3(
52 | cos(latitude) * sin(longitude),
53 | sin(latitude),
54 | cos(latitude) * cos(longitude));
55 | }
56 |
57 | }//namespace glm
58 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/projection.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_projection
24 | /// @file glm/gtx/projection.hpp
25 | /// @date 2005-12-21 / 2011-06-07
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | ///
30 | /// @defgroup gtx_projection GLM_GTX_projection
31 | /// @ingroup gtx
32 | ///
33 | /// @brief Projection of a vector to other one
34 | ///
35 | /// need to be included to use these functionalities.
36 | ///////////////////////////////////////////////////////////////////////////////////
37 |
38 | #ifndef GLM_GTX_projection
39 | #define GLM_GTX_projection
40 |
41 | // Dependency:
42 | #include "../glm.hpp"
43 |
44 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
45 | # pragma message("GLM: GLM_GTX_projection extension included")
46 | #endif
47 |
48 | namespace glm
49 | {
50 | /// @addtogroup gtx_projection
51 | /// @{
52 |
53 | //! Projects x on Normal.
54 | //! From GLM_GTX_projection extension.
55 | template
56 | GLM_FUNC_DECL vecType proj(
57 | vecType const & x,
58 | vecType const & Normal);
59 |
60 | /// @}
61 | }//namespace glm
62 |
63 | #include "projection.inl"
64 |
65 | #endif//GLM_GTX_projection
66 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/projection.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2005-12-21
5 | // Updated : 2009-03-06
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/projection.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER vecType proj
14 | (
15 | vecType const & x,
16 | vecType const & Normal
17 | )
18 | {
19 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal;
20 | }
21 | }//namespace glm
22 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/random.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///////////////////////////////////////////////////////////////////////////////////
23 |
24 | #if(defined(GLM_MESSAGES))
25 | # pragma message("GLM: GLM_GTX_random extension is deprecated, include GLM_GTC_random instead")
26 | #endif
27 |
28 | // Promoted:
29 | #include "../gtc/random.hpp"
30 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/raw_data.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_raw_data
24 | /// @file glm/gtx/raw_data.hpp
25 | /// @date 2008-11-19 / 2011-06-07
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | ///
30 | /// @defgroup gtx_raw_data GLM_GTX_raw_data
31 | /// @ingroup gtx
32 | ///
33 | /// @brief Projection of a vector to other one
34 | ///
35 | /// need to be included to use these functionalities.
36 | ///////////////////////////////////////////////////////////////////////////////////
37 |
38 | #ifndef GLM_GTX_raw_data
39 | #define GLM_GTX_raw_data
40 |
41 | // Dependencies
42 | #include "../detail/setup.hpp"
43 | #include "../detail/type_int.hpp"
44 |
45 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
46 | # pragma message("GLM: GLM_GTX_raw_data extension included")
47 | #endif
48 |
49 | namespace glm
50 | {
51 | /// @addtogroup gtx_raw_data
52 | /// @{
53 |
54 | //! Type for byte numbers.
55 | //! From GLM_GTX_raw_data extension.
56 | typedef detail::uint8 byte;
57 |
58 | //! Type for word numbers.
59 | //! From GLM_GTX_raw_data extension.
60 | typedef detail::uint16 word;
61 |
62 | //! Type for dword numbers.
63 | //! From GLM_GTX_raw_data extension.
64 | typedef detail::uint32 dword;
65 |
66 | //! Type for qword numbers.
67 | //! From GLM_GTX_raw_data extension.
68 | typedef detail::uint64 qword;
69 |
70 | /// @}
71 | }// namespace glm
72 |
73 | #include "raw_data.inl"
74 |
75 | #endif//GLM_GTX_raw_data
76 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/raw_data.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2008-11-19
5 | // Updated : 2008-11-19
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/raw_data.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 | // Dependency:
10 | // - GLM core
11 | ///////////////////////////////////////////////////////////////////////////////////////////////////
12 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/reciprocal.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///////////////////////////////////////////////////////////////////////////////////
23 |
24 | #if(defined(GLM_MESSAGES))
25 | # pragma message("GLM: GLM_GTX_reciprocal extension is deprecated, include GLM_GTC_reciprocal instead")
26 | #endif
27 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/scalar_relational.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_scalar_relational
24 | /// @file glm/gtx/scalar_relational.hpp
25 | /// @date 2013-02-04 / 2013-02-04
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | ///
30 | /// @defgroup gtx_extend GLM_GTX_scalar_relational
31 | /// @ingroup gtx
32 | ///
33 | /// @brief Extend a position from a source to a position at a defined length.
34 | ///
35 | /// need to be included to use these functionalities.
36 | ///////////////////////////////////////////////////////////////////////////////////
37 |
38 | #ifndef GLM_GTX_scalar_relational
39 | #define GLM_GTX_scalar_relational
40 |
41 | // Dependency:
42 | #include "../glm.hpp"
43 |
44 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
45 | # pragma message("GLM: GLM_GTX_extend extension included")
46 | #endif
47 |
48 | namespace glm
49 | {
50 | /// @addtogroup gtx_scalar_relational
51 | /// @{
52 |
53 |
54 |
55 | /// @}
56 | }//namespace glm
57 |
58 | #include "scalar_relational.inl"
59 |
60 | #endif//GLM_GTX_scalar_relational
61 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/scalar_relational.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2013-02-04
5 | // Updated : 2013-02-04
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/scalar_relational.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER bool lessThan
14 | (
15 | T const & x,
16 | T const & y
17 | )
18 | {
19 | return x < y;
20 | }
21 |
22 | template
23 | GLM_FUNC_QUALIFIER bool lessThanEqual
24 | (
25 | T const & x,
26 | T const & y
27 | )
28 | {
29 | return x <= y;
30 | }
31 |
32 | template
33 | GLM_FUNC_QUALIFIER bool greaterThan
34 | (
35 | T const & x,
36 | T const & y
37 | )
38 | {
39 | return x > y;
40 | }
41 |
42 | template
43 | GLM_FUNC_QUALIFIER bool greaterThanEqual
44 | (
45 | T const & x,
46 | T const & y
47 | )
48 | {
49 | return x >= y;
50 | }
51 |
52 | template
53 | GLM_FUNC_QUALIFIER bool equal
54 | (
55 | T const & x,
56 | T const & y
57 | )
58 | {
59 | return x == y;
60 | }
61 |
62 | template
63 | GLM_FUNC_QUALIFIER bool notEqual
64 | (
65 | T const & x,
66 | T const & y
67 | )
68 | {
69 | return x != y;
70 | }
71 |
72 | GLM_FUNC_QUALIFIER bool any
73 | (
74 | bool const & x
75 | )
76 | {
77 | return x;
78 | }
79 |
80 | GLM_FUNC_QUALIFIER bool all
81 | (
82 | bool const & x
83 | )
84 | {
85 | return x;
86 | }
87 |
88 | GLM_FUNC_QUALIFIER bool not_
89 | (
90 | bool const & x
91 | )
92 | {
93 | return !x;
94 | }
95 | }//namespace glm
96 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/spline.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2007-01-25
5 | // Updated : 2009-02-19
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/spline.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm{
11 |
12 | template
13 | GLM_FUNC_QUALIFIER genType catmullRom
14 | (
15 | genType const & v1,
16 | genType const & v2,
17 | genType const & v3,
18 | genType const & v4,
19 | typename genType::value_type const & s
20 | )
21 | {
22 | typename genType::value_type s1 = s;
23 | typename genType::value_type s2 = pow2(s);
24 | typename genType::value_type s3 = pow3(s);
25 |
26 | typename genType::value_type f1 = -s3 + typename genType::value_type(2) * s2 - s;
27 | typename genType::value_type f2 = typename genType::value_type(3) * s3 - typename genType::value_type(5) * s2 + typename genType::value_type(2);
28 | typename genType::value_type f3 = typename genType::value_type(-3) * s3 + typename genType::value_type(4) * s2 + s;
29 | typename genType::value_type f4 = s3 - s2;
30 |
31 | return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / typename genType::value_type(2);
32 |
33 | }
34 |
35 | template
36 | GLM_FUNC_QUALIFIER genType hermite
37 | (
38 | genType const & v1,
39 | genType const & t1,
40 | genType const & v2,
41 | genType const & t2,
42 | typename genType::value_type const & s
43 | )
44 | {
45 | typename genType::value_type s1 = s;
46 | typename genType::value_type s2 = pow2(s);
47 | typename genType::value_type s3 = pow3(s);
48 |
49 | typename genType::value_type f1 = typename genType::value_type(2) * s3 - typename genType::value_type(3) * s2 + typename genType::value_type(1);
50 | typename genType::value_type f2 = typename genType::value_type(-2) * s3 + typename genType::value_type(3) * s2;
51 | typename genType::value_type f3 = s3 - typename genType::value_type(2) * s2 + s;
52 | typename genType::value_type f4 = s3 - s2;
53 |
54 | return f1 * v1 + f2 * v2 + f3 * t1 + f4 * t2;
55 | }
56 |
57 | template
58 | GLM_FUNC_QUALIFIER genType cubic
59 | (
60 | genType const & v1,
61 | genType const & v2,
62 | genType const & v3,
63 | genType const & v4,
64 | typename genType::value_type const & s
65 | )
66 | {
67 | return ((v1 * s + v2) * s + v3) * s + v4;
68 | }
69 |
70 | }//namespace glm
71 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/std_based_type.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2008-06-08
5 | // Updated : 2008-06-08
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/std_based_type.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/string_cast.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_string_cast
24 | /// @file glm/gtx/string_cast.hpp
25 | /// @date 2008-04-26 / 2011-06-07
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | /// @see gtc_half_float (dependence)
30 | /// @see gtx_integer (dependence)
31 | /// @see gtx_quaternion (dependence)
32 | ///
33 | /// @defgroup gtx_string_cast GLM_GTX_string_cast
34 | /// @ingroup gtx
35 | ///
36 | /// @brief Setup strings for GLM type values
37 | ///
38 | /// need to be included to use these functionalities.
39 | /// This extension is not supported with CUDA
40 | ///////////////////////////////////////////////////////////////////////////////////
41 |
42 | #ifndef GLM_GTX_string_cast
43 | #define GLM_GTX_string_cast
44 |
45 | // Dependency:
46 | #include "../glm.hpp"
47 | #include "../gtx/integer.hpp"
48 | #include "../gtx/quaternion.hpp"
49 | #include
50 |
51 | #if(GLM_COMPILER & GLM_COMPILER_CUDA)
52 | # error "GLM_GTX_string_cast is not supported on CUDA compiler"
53 | #endif
54 |
55 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
56 | # pragma message("GLM: GLM_GTX_string_cast extension included")
57 | #endif
58 |
59 | namespace glm
60 | {
61 | /// @addtogroup gtx_string_cast
62 | /// @{
63 |
64 | /// Create a string from a GLM type value.
65 | /// @see gtx_string_cast extension.
66 | template
67 | GLM_FUNC_DECL std::string to_string(genType const & x);
68 |
69 | /// @}
70 | }//namespace glm
71 |
72 | #include "string_cast.inl"
73 |
74 | #endif//GLM_GTX_string_cast
75 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/transform.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2005-12-21
5 | // Updated : 2009-04-29
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/transform.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 | template
13 | GLM_FUNC_QUALIFIER detail::tmat4x4 translate(
14 | detail::tvec3 const & v)
15 | {
16 | return translate(
17 | detail::tmat4x4(1.0f), v);
18 | }
19 |
20 | template
21 | GLM_FUNC_QUALIFIER detail::tmat4x4 rotate(
22 | T angle,
23 | detail::tvec3 const & v)
24 | {
25 | return rotate(
26 | detail::tmat4x4(1), angle, v);
27 | }
28 |
29 | template
30 | GLM_FUNC_QUALIFIER detail::tmat4x4 scale(
31 | detail::tvec3 const & v)
32 | {
33 | return scale(
34 | detail::tmat4x4(1.0f), v);
35 | }
36 |
37 | }//namespace glm
38 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/ulp.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///////////////////////////////////////////////////////////////////////////////////
23 |
24 | #if(defined(GLM_MESSAGES))
25 | # pragma message("GLM: GLM_GTX_ulp extension is deprecated, include GLM_GTC_ulp (glm/gtc/ulp.hpp) instead")
26 | #endif
27 |
28 | // Promoted:
29 | #include "../gtc/ulp.hpp"
30 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/unsigned_int.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///////////////////////////////////////////////////////////////////////////////////
23 |
24 | #if(defined(GLM_MESSAGES))
25 | # pragma message("GLM: GLM_GTX_unsigned_int extension is deprecated, include GLM_GTX_integer instead")
26 | #endif
27 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/unsigned_int.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
2 | // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////
4 | // Created : 2005-12-24
5 | // Updated : 2008-10-07
6 | // Licence : This source is under MIT License
7 | // File : glm/gtx/unsigned_int.inl
8 | ///////////////////////////////////////////////////////////////////////////////////////////////////
9 |
10 | namespace glm
11 | {
12 |
13 | }//namespace glm
14 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/vec1.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_vec1
24 | /// @file glm/gtx/vec1.inl
25 | /// @date 2013-03-16 / 2013-03-16
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
--------------------------------------------------------------------------------
/µTec/glm/gtx/wrap.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref gtx_wrap
24 | /// @file glm/gtx/wrap.hpp
25 | /// @date 2009-11-25 / 2011-06-07
26 | /// @author Christophe Riccio
27 | ///
28 | /// @see core (dependence)
29 | ///
30 | /// @defgroup gtx_wrap GLM_GTX_wrap
31 | /// @ingroup gtx
32 | ///
33 | /// @brief Wrapping mode of texture coordinates.
34 | ///
35 | /// need to be included to use these functionalities.
36 | ///////////////////////////////////////////////////////////////////////////////////
37 |
38 | #ifndef GLM_GTX_wrap
39 | #define GLM_GTX_wrap
40 |
41 | // Dependency:
42 | #include "../glm.hpp"
43 |
44 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
45 | # pragma message("GLM: GLM_GTX_wrap extension included")
46 | #endif
47 |
48 | namespace glm
49 | {
50 | /// @addtogroup gtx_wrap
51 | /// @{
52 |
53 | /// Simulate GL_CLAMP OpenGL wrap mode
54 | /// @see gtx_wrap extension.
55 | template
56 | GLM_FUNC_DECL genType clamp(genType const & Texcoord);
57 |
58 | /// Simulate GL_REPEAT OpenGL wrap mode
59 | /// @see gtx_wrap extension.
60 | template
61 | GLM_FUNC_DECL genType repeat(genType const & Texcoord);
62 |
63 | /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode
64 | /// @see gtx_wrap extension.
65 | template
66 | GLM_FUNC_DECL genType mirrorRepeat(genType const & Texcoord);
67 |
68 | /// @}
69 | }// namespace glm
70 |
71 | #include "wrap.inl"
72 |
73 | #endif//GLM_GTX_wrap
74 |
--------------------------------------------------------------------------------
/µTec/glm/integer.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/integer.hpp
25 | /// @date 2013-12-24 / 2013-12-24
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_INTEGER_INCLUDED
30 | #define GLM_INTEGER_INCLUDED
31 |
32 | #include "detail/func_integer.hpp"
33 |
34 | #endif//GLM_INTEGER_INCLUDED
35 |
--------------------------------------------------------------------------------
/µTec/glm/matrix.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/matrix.hpp
25 | /// @date 2013-12-24 / 2013-12-24
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_MATRIX_INCLUDED
30 | #define GLM_MATRIX_INCLUDED
31 |
32 | #include "detail/func_matrix.hpp"
33 |
34 | #endif//GLM_MATRIX_INCLUDED
35 |
--------------------------------------------------------------------------------
/µTec/glm/packing.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/packing.hpp
25 | /// @date 2013-12-24 / 2013-12-24
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_PACKING_INCLUDED
30 | #define GLM_PACKING_INCLUDED
31 |
32 | #include "detail/func_packing.hpp"
33 |
34 | #endif//GLM_PACKING_INCLUDED
35 |
--------------------------------------------------------------------------------
/µTec/glm/trigonometric.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/trigonometric.hpp
25 | /// @date 2013-12-24 / 2013-12-24
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_TRIGONOMETRIC_INCLUDED
30 | #define GLM_TRIGONOMETRIC_INCLUDED
31 |
32 | #include "detail/func_trigonometric.hpp"
33 |
34 | #endif//GLM_TRIGONOMETRIC_INCLUDED
35 |
--------------------------------------------------------------------------------
/µTec/glm/vec2.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/vec2.hpp
25 | /// @date 2013-12-24 / 2013-12-24
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_VEC2_INCLUDED
30 | #define GLM_VEC2_INCLUDED
31 |
32 | #include "detail/type_vec2.hpp"
33 |
34 | #endif//GLM_VEC2_INCLUDED
35 |
--------------------------------------------------------------------------------
/µTec/glm/vec3.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/vec3.hpp
25 | /// @date 2013-12-24 / 2013-12-24
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_VEC3_INCLUDED
30 | #define GLM_VEC3_INCLUDED
31 |
32 | #include "detail/type_vec3.hpp"
33 |
34 | #endif//GLM_VEC3_INCLUDED
35 |
--------------------------------------------------------------------------------
/µTec/glm/vec4.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/vec4.hpp
25 | /// @date 2013-12-24 / 2013-12-24
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_VEC4_INCLUDED
30 | #define GLM_VEC4_INCLUDED
31 |
32 | #include "detail/type_vec4.hpp"
33 |
34 | #endif//GLM_VEC4_INCLUDED
35 |
--------------------------------------------------------------------------------
/µTec/glm/vector_relational.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/vector_relational.hpp
25 | /// @date 2013-12-24 / 2013-12-24
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #ifndef GLM_VECTOR_RELATIONAL_INCLUDED
30 | #define GLM_VECTOR_RELATIONAL_INCLUDED
31 |
32 | #include "detail/func_vector_relational.hpp"
33 |
34 | #endif//GLM_VECTOR_RELATIONAL_INCLUDED
35 |
--------------------------------------------------------------------------------
/µTec/rapidjson/internal/strfunc.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_
16 | #define RAPIDJSON_INTERNAL_STRFUNC_H_
17 |
18 | #include "../stream.h"
19 |
20 | RAPIDJSON_NAMESPACE_BEGIN
21 | namespace internal {
22 |
23 | //! Custom strlen() which works on different character types.
24 | /*! \tparam Ch Character type (e.g. char, wchar_t, short)
25 | \param s Null-terminated input string.
26 | \return Number of characters in the string.
27 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints.
28 | */
29 | template
30 | inline SizeType StrLen(const Ch* s) {
31 | RAPIDJSON_ASSERT(s != 0);
32 | const Ch* p = s;
33 | while (*p) ++p;
34 | return SizeType(p - s);
35 | }
36 |
37 | //! Returns number of code points in a encoded string.
38 | template
39 | bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) {
40 | RAPIDJSON_ASSERT(s != 0);
41 | RAPIDJSON_ASSERT(outCount != 0);
42 | GenericStringStream is(s);
43 | const typename Encoding::Ch* end = s + length;
44 | SizeType count = 0;
45 | while (is.src_ < end) {
46 | unsigned codepoint;
47 | if (!Encoding::Decode(is, &codepoint))
48 | return false;
49 | count++;
50 | }
51 | *outCount = count;
52 | return true;
53 | }
54 |
55 | } // namespace internal
56 | RAPIDJSON_NAMESPACE_END
57 |
58 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_
59 |
--------------------------------------------------------------------------------
/µTec/rapidjson/internal/swap.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_
16 | #define RAPIDJSON_INTERNAL_SWAP_H_
17 |
18 | #include "../rapidjson.h"
19 |
20 | #if defined(__clang__)
21 | RAPIDJSON_DIAG_PUSH
22 | RAPIDJSON_DIAG_OFF(c++98-compat)
23 | #endif
24 |
25 | RAPIDJSON_NAMESPACE_BEGIN
26 | namespace internal {
27 |
28 | //! Custom swap() to avoid dependency on C++ header
29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only.
30 | \note This has the same semantics as std::swap().
31 | */
32 | template
33 | inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT {
34 | T tmp = a;
35 | a = b;
36 | b = tmp;
37 | }
38 |
39 | } // namespace internal
40 | RAPIDJSON_NAMESPACE_END
41 |
42 | #if defined(__clang__)
43 | RAPIDJSON_DIAG_POP
44 | #endif
45 |
46 | #endif // RAPIDJSON_INTERNAL_SWAP_H_
47 |
--------------------------------------------------------------------------------
/µTec/rapidjson/memorybuffer.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_MEMORYBUFFER_H_
16 | #define RAPIDJSON_MEMORYBUFFER_H_
17 |
18 | #include "stream.h"
19 | #include "internal/stack.h"
20 |
21 | RAPIDJSON_NAMESPACE_BEGIN
22 |
23 | //! Represents an in-memory output byte stream.
24 | /*!
25 | This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream.
26 |
27 | It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file.
28 |
29 | Differences between MemoryBuffer and StringBuffer:
30 | 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer.
31 | 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator.
32 |
33 | \tparam Allocator type for allocating memory buffer.
34 | \note implements Stream concept
35 | */
36 | template
37 | struct GenericMemoryBuffer {
38 | typedef char Ch; // byte
39 |
40 | GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}
41 |
42 | void Put(Ch c) { *stack_.template Push() = c; }
43 | void Flush() {}
44 |
45 | void Clear() { stack_.Clear(); }
46 | void ShrinkToFit() { stack_.ShrinkToFit(); }
47 | Ch* Push(size_t count) { return stack_.template Push(count); }
48 | void Pop(size_t count) { stack_.template Pop(count); }
49 |
50 | const Ch* GetBuffer() const {
51 | return stack_.template Bottom();
52 | }
53 |
54 | size_t GetSize() const { return stack_.GetSize(); }
55 |
56 | static const size_t kDefaultCapacity = 256;
57 | mutable internal::Stack stack_;
58 | };
59 |
60 | typedef GenericMemoryBuffer<> MemoryBuffer;
61 |
62 | //! Implement specialized version of PutN() with memset() for better performance.
63 | template<>
64 | inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) {
65 | std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c));
66 | }
67 |
68 | RAPIDJSON_NAMESPACE_END
69 |
70 | #endif // RAPIDJSON_MEMORYBUFFER_H_
71 |
--------------------------------------------------------------------------------
/µTec/rapidjson/ostreamwrapper.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_OSTREAMWRAPPER_H_
16 | #define RAPIDJSON_OSTREAMWRAPPER_H_
17 |
18 | #include "stream.h"
19 | #include
20 |
21 | #ifdef __clang__
22 | RAPIDJSON_DIAG_PUSH
23 | RAPIDJSON_DIAG_OFF(padded)
24 | #endif
25 |
26 | RAPIDJSON_NAMESPACE_BEGIN
27 |
28 | //! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept.
29 | /*!
30 | The classes can be wrapped including but not limited to:
31 |
32 | - \c std::ostringstream
33 | - \c std::stringstream
34 | - \c std::wpstringstream
35 | - \c std::wstringstream
36 | - \c std::ifstream
37 | - \c std::fstream
38 | - \c std::wofstream
39 | - \c std::wfstream
40 |
41 | \tparam StreamType Class derived from \c std::basic_ostream.
42 | */
43 |
44 | template
45 | class BasicOStreamWrapper {
46 | public:
47 | typedef typename StreamType::char_type Ch;
48 | BasicOStreamWrapper(StreamType& stream) : stream_(stream) {}
49 |
50 | void Put(Ch c) {
51 | stream_.put(c);
52 | }
53 |
54 | void Flush() {
55 | stream_.flush();
56 | }
57 |
58 | // Not implemented
59 | char Peek() const { RAPIDJSON_ASSERT(false); return 0; }
60 | char Take() { RAPIDJSON_ASSERT(false); return 0; }
61 | size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
62 | char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
63 | size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; }
64 |
65 | private:
66 | BasicOStreamWrapper(const BasicOStreamWrapper&);
67 | BasicOStreamWrapper& operator=(const BasicOStreamWrapper&);
68 |
69 | StreamType& stream_;
70 | };
71 |
72 | typedef BasicOStreamWrapper OStreamWrapper;
73 | typedef BasicOStreamWrapper WOStreamWrapper;
74 |
75 | #ifdef __clang__
76 | RAPIDJSON_DIAG_POP
77 | #endif
78 |
79 | RAPIDJSON_NAMESPACE_END
80 |
81 | #endif // RAPIDJSON_OSTREAMWRAPPER_H_
82 |
--------------------------------------------------------------------------------
/µTec/µTec.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------