diff --git a/copying b/copying new file mode 100644 index 00000000..b4905ab7 --- /dev/null +++ b/copying @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2005 - 2009 G-Truc Creation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/doc/about.html b/doc/about.html new file mode 100644 index 00000000..84674fb4 --- /dev/null +++ b/doc/about.html @@ -0,0 +1,15 @@ + + +OpenGL Mathematics : About
OpenGL Mathematics

GLSL + Optional features = OpenGL Mathematics (GLM).
A C++ mathematics library for 3D graphics.


+ OpenGL Mathematics (GLM) is a C++ mathematics library for 3D software based on the OpenGL Shading Language (GLSL) specification. +

+ The goal of the project is to provide to 3D programmers math classes and functions that miss in C++ when we use to program with GLSL or any high level GPU language. With GLM, the idea is to have a library that works the same way that GLSL which imply a strict following of GLSL specification for the implementation. +

+ However, this project isn't limited by GLSL features. An extension system allows to extend GLSL capabilities. It allows GLM to be a great subtitute for some OpenGL 3 deprecated functions, to work following a clean programmable approach. +

+ GLM is release under MIT license and available for all version of GCC from version 3.4 and Visual Studio from version 8.0 as a platform independent library. +

+ You can checkout SVN development sources from https://glf.svn.sourceforge.net/svnroot/glf/sdk. +

_________________

_________________

+ Copyright © 2005-2008 G-Truc Creation
\ No newline at end of file diff --git a/doc/bug.html b/doc/bug.html new file mode 100644 index 00000000..556f3524 --- /dev/null +++ b/doc/bug.html @@ -0,0 +1,6 @@ + + +OpenGL Mathematics : Bugs
OpenGL Mathematics
Bugs

3) _xvec* class data and ISO C++ standard non compliance
DISCUTION: 'union' keyword is here to allow access to vector components with several different variables names. Moreover, templates are also used to create two vector type categories : _vec* and _ivec*. Eventually, anonymous structures are not allowed in ISO C++ norm.
DISCUTION: Problem might come from the lack of supporting both templates and unions from Visual C++ 7.1.
RESOLUTION: If -pedantic isn't used with G++, then code compiles correctly. As we are waiting for a better compromise, the code stays that way. As notified for the bug #4, the ultimate solution might be to avoid templates in vector definition.

+ STATUE : Resolved, 2005-02-15

2) 'not' is a GCC keyword
DISCUTION: GCC supports all C++ keywords that includes 'not', which is equivalent to '!' operator. So there is a problem with GLM because GLSL defines the 'not' function.
PROPOSITION: Overloading the '!' operator or the 'not' keyword we can partly resolve the problem but leaving as ignored the GLM namespace concept. If the source code contains 'glm:not' string, then GCC gives an error.
PROPOSITION: 'not' is a C++ keyword so GLM mustn't define a 'not' function. However, all the compilers don't support this keyword (VC7.1). Does this name has to be changed ? For now, it is recommended to avoid using 'not'.

+ STATUE : Partly resolved, 2005-03-03

1) *vec* doesn't allow multiple components selection.
DISCUTION: The GLSL specifications grant access to multiple components for vector types. i.e. with GLSL the following lines are correct : vec3 MyVector = vec4(1.0, 1.0, 1.0, 0.0).xyz.
DISCUTION: It seems difficult to create an equal feature in C++ because 'x', 'y', and 'z' according to the previous example can be sorted in any order and be repeated from zero to four to a max of four components.

+ STATUE : Unresolved, 2005-01-30

Copyright © 2005-2008 G-Truc Creation
\ No newline at end of file diff --git a/doc/changelog.html b/doc/changelog.html new file mode 100644 index 00000000..5c5b45c4 --- /dev/null +++ b/doc/changelog.html @@ -0,0 +1,708 @@ + + +OpenGL Mathematics : Changelog
OpenGL Mathematics

GLSL + Optional features = OpenGL Mathematics (GLM).
A C++ mathematics library for 3D graphics.


2009-11-16:
+ - GLM 0.8.4.3 released.
_________________

2009-11-12:
+ - Fixed half arithmetic.
_________________

2009-11-11:
+ - Added scalars support for GLM_IMG_multiple.
_________________

2009-11-05:
+ - Fixed setup defines.
_________________

2009-10-27:
+ - Added GLM_IMG_multiple extensions and unit tests.
_________________

2009-10-19:
+ - GLM 0.8.4.2 released.
_________________

2009-10-10:
+ - Fixed half.
_________________

2009-10-05:
+ - GLM 0.8.4.1 released.
_________________

2009-10-02:
+ - Updated documentation.
_________________

2009-09-30:
+ - Updated manual.
+ - Added static assert implementation.
+ - Removed unuse GLM_SWIZZLE_FUNC.
_________________

2009-09-23:
+ - Some progress on fixing GLM for MacOSX comflics.
_________________

2009-09-22:
+ - Fixed GLM_GTX_quaternion extension: cross and intermediate.
_________________

2009-09-17:
+ - Fixed quaternion angle.
_________________

2009-09-16:
+ - Updated documentation.
+ - GLM 0.8.4.0 released.
_________________

2009-09-14:
+ - Added Visual Studio 2010 support.
+ - Fixed build on GCC.
+ - Added GCC 4.4 support.
_________________

2009-09-03:
+ - Added no initilization constructor to vec4.
_________________

2009-09-01:
+ - Added no initilization constructor to mat4.
+ - Updated GLM_GTC_matrix_transform: faster rotate.
_________________

2009-08-29:
+ - Added GLM_GTX_matrix_operation: build diagonal matrix.
+ - Updated GLM_GTC_matrix_transform: faster scaling.
_________________

2009-08-28:
+ - Fixed transpose function for mat4x3.
+ - Optimized translate function for mat4 matrix: ~184 cycles instead of ~592 cycles on Q6600.
_________________

2009-08-24:
+ - Fixed OpenGL dependence.
+ - Added OpenGL 3 dependence.
_________________

2009-08-23:
+ - Fixed parameter definition and definition mismatch.
_________________

2009-08-11:
+ - Fixed GLM_GTC_matrix_projection.
+ - Updated GLM_GTX_transform: Added missing entry points.
+ - GLM 0.8.3.5 released.
_________________

2009-08-10:
+ - Move inverse function to core following GLSL 1.4 specification.
+ - Move determinant function to core following GLSL 1.5 specification.
+ - GLM 0.8.3.4 released.
_________________

2009-07-22:
+ - Fixed GLM_GTX_matrix_query extension: Fixed row_size and col_size() calls.
+ - Fixed GLM_GTX_matrix_access extension: Fixed row_size calls.
_________________

2009-07-03:
+ - Fixed GLM_GTX_string_cast extension: Build on GCC 4.
+ - Fixed GLM_GTC_quaternion extension: rotate function build.
_________________

2009-06-25:
+ - Fixed GLM_GTC_matrix_transform extension: Fixed matrix operation order; like OpenGL instead of like Direct3D.
+ - GLM 0.8.3.3 released.
_________________

2009-06-16:
+ - Fixed GLM_GTX_rotate_vector extension: Fixed rotate function.
_________________

2009-06-09:
+ - Fixed matrix external operators.
_________________

2009-06-04:
+ - Added GLM_GTC_type_precision extension.
+ - GLM 0.8.3.2 released.
_________________

2009-06-02:
+ - Fixed GLM_GTC_matrix_transform: Fixed mat4 inverse function.
_________________

2009-05-22:
+ - Added GLM_GTC_quaternion extension.
+ - Updated GLM_GTC_quaternion extension.
+ - Fixed GLM_GTC_matrix_transform extension.
_________________

2009-05-21:
+ - GLM 0.8.3.1 released.
_________________

2009-05-20:
+ - Updated GLM_GTX_bit extension: Added lowestBit functions.
+ - Fixed old extention inclusion method.
_________________

2009-05-19:
+ - Updated sse mat4 implementation.
_________________

2009-05-18:
+ - Updated GLM_GTX_bit extension: Added bitRevert, bitRotateRight and bitRotateLeft functions.
_________________

2009-05-17:
+ - Added intrinsic like functions for mat4 product and inverse.
_________________

2009-05-15:
+ - Added intrinsic like functions for mat4 and vec4 products.
_________________

2009-05-06:
+ - Fixed GLM_GTX_type_ptr extension.
+ - GLM 0.8.3.0 released.
_________________

2009-05-06:
+ - Fixed GLM_GTC_matrix_projection: glm::project build.
_________________

2009-05-05:
+ - Added new extensions inclusion system.
_________________

2009-05-01:
+ - Fixed GLM_GTX_determinant extension.
+ - Reorganized extensions.
+ - Removed GLM_GTX_vector_comp_mult and GLM_GTX_mat4x3 extensions.
+ - Renamed .h files to .hpp.
_________________

2009-04-30:
+ - Added GLM_GTC_half_float.
_________________

2009-04-29:
+ - Fixed GLM_GTX_perpendicular extension.
+ - Fixed GLM_GTX_matrix_projection extension.
+ - Fixed GLM_GTX_transform2 extension.
_________________

2009-04-27:
+ - Added GLM_GTC_matrix_operation.
+ - Added GLM_GTC_matrix_transform.
+ - Added GLM_GTC_matrix_projection.
+ - Added GLM_GTC_double_float.
_________________

2009-04-20:
+ - Fixed bug 2774738.
+ - Fixed bug 2774015.
_________________

2009-04-01:
+ - GLM 0.8.2.3 released.
_________________

2009-03-30:
+ - Updaded mix function: Makes it more flexible, types wise.
_________________

2009-03-06:
+ - Fixed GLM_GTX_perpendicular and GLM_GTX_projection.
+ - Added GLM_GTX_radial_gradient extensions.
_________________

2009-02-24:
+ - Fixed GCC 4.3 pedantic build.
+ - GLM 0.8.2.2 released.
_________________

2009-02-19:
+ - Removed all deprecated ARB conventions.
_________________

2009-02-18:
+ - Fixed highp_int_t and highp_uint_t with Linux 64.
+ - Fixed GCC 4.3 'extra ;' with pedentic build.
_________________

2009-02-13:
+ - Fixed build.
+ - GLM 0.8.2.1 released.
_________________

2009-02-02:
+ - Fixed build.
+ - Added extensions build test.
_________________

2009-01-21:
+ - GLM 0.8.2 released.
_________________

2009-01-20:
+ - Fixed GLM_GTX_intersect: intersectRayTriangle.
_________________

2009-01-17:
+ - Fixed vectors access operators.
+ - Fixed unresolved with quaternions.
_________________

2009-01-16:
+ - Fixed GLM_GTX_norm: Include issue.
_________________

2009-01-01:
+ - Fixed left value swizzle operators.
_________________

2008-12-03:
+ - Fixed GLM_GTX intersect extension: intersectRayTriangleGTX with GCC.
+ - Typo.
_________________

2008-12-02:
+ - Fixed GLM_GTX inverse_transpose extension.
_________________

2008-11-27:
+ - Updated quaternion implementation.
_________________

2008-11-19:
+ - Added GLM_GTX_raw_data extension.
_________________

2008-11-18:
+ - Updated GLM_GTX_bit extension: Added mask function.
_________________

2008-11-14:
+ - Updated GLM_GTX_bit extension: Added extractField function.
+ - Fixed STATIC_ASSERT with 64bits integers.
_________________

2008-10-30:
+ - GLM 0.8.1 released.
_________________

2008-10-29:
+ - Fixed mix function with boolean parameter.
+ - Fixed value_size issue.
_________________

2008-10-28:
+ - Fixed GLM_GTX_component_wise extension.
+ - Added GLM_GTX_color_space_YCoCg extension.
_________________

2008-10-27:
+ - Added GLM_GTX_comparison extension: Defined comparison operators for vectors.
_________________

2008-10-25:
+ - Added GLM_GTX_log_base extension.
_________________

2008-10-24:
+ - Fixed 64 bits integers with GCC.
+ - Deleted deprecated half number setup options.
+ - Updated GLM_GTX_number_precision: Clean up and added missing type definitions.
+ - Updated GLM_GTX_color_cast: Clean up and fixes.
_________________

2008-10-23:
+ - Updated manuel and documentation.
+ - GLM 0.8.0 final released.
_________________

2008-10-22:
+ - Fixed glm::size_t possible collisions with std::size_t. glm::size_t is now named glm::sizeType.
+ - Updated GLM_VIRTREV_address extension: Added none const fonctions.
+ - Updated GLM_GTX_double_float extension: Typo.
+ - Added new API to use extension.
_________________

2008-10-18:
+ - Added logos in varius resolutions.
_________________

2008-10-17:
+ - Updated website.
+ - Added website builder.
_________________

2008-10-15:
+ - Updated GLM_GTX_number_precision: No more warning with type size tests.
+ - Fixed none consistent size_t.
_________________

2008-10-12:
+ - Updated website.
_________________

2008-10-10:
+ - Fixed build.
+ - Updated manual.
+ - GLM 0.8.0 beta3 released.
_________________

2008-10-09:
+ - Added GLM_GTX_reciprocal extension: Define sec, csc, cot, asec, acsc, acot, sech, csch, coth, asech, acsch and acoth functions.
_________________

2008-10-08:
+ - Updated GLM_GTX_euler_angles extension: Added functions to build rotation matrices.
_________________

2008-10-07:
+ - Fixed GLM_GTX_color_space: Fixed conflits with swizzle operators.
+ - Fixed virtrev.h, didn't build.
+ - Fixed genType build.
+ - Fixed GLM_GTX_compatibility build.
+ - Added GLM_VIRTREV_address: Get the address of internal vector or matrix contents.
+ - Fixed code typo and clean up.
_________________

2008-10-06:
+ - Added genType class. For long term base class for all types though template specialization.
+ - Updated project directory.
+ - Added CMakeFile in test directory.
+ - Fixed code typo and clean up.
+ - Fixed GLM_GTX_string_cast: Missing some matrix definitions, some wrong behaviours with matrices.
_________________

2008-10-05:
+ - Added glm::sizeType type which is used to defined size of all vectors and matrices. Defined as std::size_t.
+ - row_size, col_size and is_matrix are now functions.
+ - Fixed use inline on *mat4 function declaration.
+ - Deleted auto cast from *mat4x3.
+ - Fixed missing ++ -- and - operators to some matrix types.
+ - Fixed typo.
_________________

2008-10-04:
+ - GLM 0.8.0 beta2 released.
_________________

2008-10-03:
+ - value_size and is_vector are now functions.
_________________

2008-10-02:
+ - Added GLM_USE_ANONYMOUS_UNION: To use anonymous union to provide multiple component names access for class valType. Visual C++ only.
+ - Removed noise function from documentation.
_________________

2008-10-01:
+ - Fixed build with GCC.
+ - Updated manual.
_________________

2008-09-30:
+ - Updated GLM_GTX_bit implementation.
+ - Added GLM_USE_ONLY_XYZW to disable multiple component names.
+ - Updated GLM_GTX_euler_angles extension: added yawPitchRoll function.
_________________

2008-09-29:
+ - Fixed half vector build.
+ - Updated GLM_GTX_vector_angle: Added orientedAngleFromRef function.
+ - Deprecated GLM_GTX_mul extension. Features moved in GLM_GTX_verbose_operator.
+ - Updated GLM_GTX_verbose_operator: Added mad function.
_________________

2008-09-28:
+ - Fixed missing inline in tvec3 and tvec4 definisions.
+ - New implementation of hvec3 thought specialisation of tvec3 template.
+ - New implementation of hvec4 thought specialisation of tvec4 template.
+ - Fixed tvec4 operators than where applied just on 3 components.
_________________

2008-09-27:
+ - Added build option for build that support anonymous structure.
+ - Fixed missing inline in tvec2 definision.
+ - New implementation of hvec2 thought specialisation of tvec2 template.
_________________

2008-09-26:
+ - Updated documentation.
+ - GLM 0.8.0 beta1 released.
_________________

2008-09-25:
+ - Fixed static asserts within vector and matrix types.
+ - Updated mix function implementation, support for boolean vectors.
_________________

2008-09-24:
+ - Fixed static asserts.
+ - Added some asserts.
+ - Updated matrices operator[].
_________________

2008-09-23:
+ - Added GLM_VIRTREV_equal_operator: Operators that compare vectors.
+ - Fixed build errors from static asserts.
_________________

2008-09-22:
+ - Fixed build errors with GCC.
+ - Fixed func_trigonometric.h encoding.
_________________

2008-09-21:
+ - Deleted GLM_GTX_INCLUDED.
+ - Fixed build errors.
+ - Fixed GLM_GTX_random: Bad assert definition.
_________________

2008-09-20:
+ - Updated manual.
+ - Updated swizzle operators with swizzle function.
+ - Added modf definition.
_________________

2008-09-17:
+ - Added namespaces to sort type and function in the API documentation.
+ - Deleted some documentations from {__}*GTX types and functions from extensions.
+ - Updated vectors and matrices documentation.
+ - Updated scalars and precisions documentation.
+ - Fixed some vectors and matrices declaration missing in some cases.
+ - Updated overall documentation.
_________________

2008-09-16:
+ - Included all types in type namespace.
_________________

2008-09-15:
+ - Added type namespace in glm namespace for documentation purpose.
_________________

2008-09-14:
+ - Added modf definition for vec2, vec3 and vec4.
+ - Updated static assert to exponential, geometric, matrix, noise, trigonometric and vector relational functions.
+ - Added GLM_GTC_matrix_transformation extensions: API and translate, rotate and scale definisions.
+ - Deprecated GLM_GTX_gpu_shader4, GLM_GTX_hyperbolic, GLM_GTX_flexible_mix, GLM_GTX_round.
+ - Added definition of mix with last parameter being booleans.
+ - Added hint classes.
+ - Updated GLM_GTX_integer, GLM_GTX_unsigned_int, GLM_GTX_half and GLM_GTX_double_float extensions.
_________________

2008-09-13:
+ - Added trait code (class type) to detect bool, float, int and uint numbers.
+ - Updated static assert to common functions.
_________________

2008-09-12:
+ - Updated noise function definitions... Still unsure for staying in GLM 0.8.0.
_________________

2008-09-11:
+ - Updated overall documentation, doxygen documentation.
_________________

2008-09-10:
+ - Updated documentation and implementation of all matrix functions.
+ - Added declaration of main functions for each function group namespace.
+ - Updated documentation and API of all noise functions... Should be deleted becose of bad implementation?
_________________

2008-09-09:
+ - Updated documentation and implementation of all vector relational functions.
+ - Added transpose_type typedef to all matrix types.
+ - Added is_matrix static constantes to all matrix types for static assert usage.
+ - Added is_vector static constantes to all vector types for static assert usage.
_________________

2008-09-08:
+ - Updated documentation and implementation of all geometric functions.
_________________

2008-09-07:
+ - Updated documentation and implementation of all exponential functions.
_________________

2008-09-06:
+ - Added isinf and isnan GLSL 1.3 functions.
+ - Updated common functions code, mostly syntax.
+ - Added trunc, round and roundEven GLSL 1.3 functions.
+ - Added sinh, cosh, tanh, asinh, acosh and atanh GLSL 1.3 functions.
+ - Updated documentation and implementation of all trigonometric functions.
_________________

2008-09-05:
+ - Added bool_type implementation detail to vector types.
_________________

2008-09-04:
+ - Added API and documentation of all common functions.
_________________

2008-09-03:
+ - Updated GLM_GTX_extensions: Define operator* as a cross product. Still in WIP...
_________________

2008-09-02:
+ - Updated *vec2 and *vec3 with precision types missed and documentation.
_________________

2008-09-01:
+ - Fixed 2085925 bug: rotateGTX didn't use it quaternion parameter.
_________________

2008-08-31:
+ - Added test files.
+ - Updated *vec4 with precision types missed and documentation.
_________________

2008-08-30:
+ - Renamed implementation files.
+ - Updated type pre-declarations.
_________________

2008-08-25:
+ - Fixed GLM_GTX_matrix_projection extension: frustum function gave a wrong result.
_________________

2008-08-24:
+ - Updated matrix types functions and extensions according new vectors types.
_________________

2008-08-23:
+ - Added new vector types implementation.
_________________

2008-08-22:
+ - Added support for new GLSL 1.30 precision model.
_________________

2008-08-19:
+ - Added GLSL 1.30.08 unsigned int types support
_________________

2008-08-17:
+ - Added detail::vec1 type.
+ - Added detail::desc for types description and higher templatisation.
_________________

2008-08-11:
+ - Started work on GLM 0.8.x based on GLSL 1.3 specification.
+ - Visual Studio .NET 2003 (7.1) is now deprecated.
+ - GLM_FORCE_HALF_COMPATIBILITY is now deprecated.
+ - GLM_AUTO_CAST is now deprecated.
_________________

2008-08-09:
+ - Updated GLM_GTX_fast_square_root implementation: Updated fastInverseSqrt
_________________

2008-08-08:
+ - Updated documentation.
+ - GLM 0.7.6 released.
_________________

2008-08-06:
+ - gl_svec* (for GLshort) added in GLM_virtrev_gl extension.
+ - Updated detail implementation of vector types.
+ - Make Visual C++ build with Visual C++ extensions disabled.
+ - Rename "not" to "not_" for compatibility.
+ - Fixed GLM_GTX_fast_square_root build.
_________________

2008-07-31:
+ - Fixed GLM_GTX_component_wise extension.
_________________

2008-07-29:
+ - Updated mix functions for optimization purpose.
+ - Fixed mix functions static assert.
+ - Updated test files.
+ - Updated GLM_GTX_statistics_operation.
_________________

2008-07-24:
+ - Fixed GLM_GTX_bit extension: isPowerOfTwoGTX works for signed int too.
+ - Updated GLM_GTX_norm extension: Added distance2, l2norm and lxNorm functions.
+ - Added some boost static assert.
_________________

2008-07-23:
+ - Added GLM_GTX_std_based_type: Types based on C++ conventions.
+ - Added files for extension tests.
_________________

2008-07-22:
+ - Fixed GLM_GTX_fast_square_root: Updated fastDistance.
_________________

2008-07-16:
+ - Fixed GLM_GTX_fast_square_root: Wrong const and updated fastLenght.
+ - Optimized mix core function
_________________

2008-07-14:
+ - Fixed GLM_GTX_epsilon: Wrong function definitions for y, z and w components.
_________________

2008-07-10:
+ - Fixed GLM_GTX_flexible: Flexible with scalar only failed.
+ - Fixed GLM_GTX_quaternion: One rotate overloaded function undefined.
_________________

2008-07-08:
+ - Some fixes on GLM_GTX_intersect extension.
_________________

2008-07-05:
+ - GLM 0.7.5 released.
_________________

2008-07-03:
+ - Updated documentation.
_________________

2008-07-01:
+ - Updated message system.
_________________

2008-06-26:
+ - Added new message system.
_________________

2008-06-13:
+ - Fixed GLM_GTX_normal extension.
_________________

2008-06-07:
+ - Updated GLM_GTX_unsigned_int extension. (New typedef extensions)
_________________

2008-06-06:
+ - Added new precompiler system.
_________________

2008-06-04:
+ - Increase C++ conformance.
_________________

2008-06-01:
+ - Fixed build errors.
+ - GLM 0.7.4 released.
_________________

2008-05-30:
+ - Updated external dependencies system.
+ - Updated manual.
+ - Fixed GLM_GTX_random extension: Fixed build with GCC.
+ - Fixed GLM_GTX_string_cast extension: Fixed build with GCC 3.4 due to GCC anonymuous namespace bug.
_________________

2008-05-29:
+ - Fixed GLM_GTX_transform2 extension: scaleBias didn't built.
_________________

2008-05-26:
+ - Added GLM_VIRTREV_xstream extension: XML output for GLM types.
+ - Added external library system
_________________

2008-05-24:
+ - Updated GLM_GTX_string_cast extension: Support of non-square matrices.
+ - GLM 0.7.3 released.
_________________

2008-05-23:
+ - Fixed mat2 product.
_________________

2008-05-18:
+ - Fixed GLM_GTX_transform2 dependencies.
_________________

2008-05-01:
+ - Added GLM_VIRTREV_gl extension: Vector and matrix integration with OpenGL.
_________________

2008-04-28:
+ - Updated GLM_GTX_number_precision extension: Added uint type.
+ - Added GLM_GTX_string_cast extension: Create formated string from GLM type instances.
+ - Updated GLM_GTX_transform2: added scaleBias matrix build
_________________

2008-04-27:
+ - GLM 0.7.2 released.
_________________

2008-04-26:
+ - Added GLM_AUTO_CAST setup option.
+ - Updated documentation
_________________

2008-04-23:
+ - Updated GLM_GTX_inverse, added affine inverse functions for fast matrix inverts.
+ - Updated overall documentation
+ - Added trait typedef to all GLM data types
_________________

2008-04-22:
+ - Updated GLM_GTX_compatibility documentation.
+ - Fixed GLM_GTX_random, gauss functions didn't build.
_________________

2008-04-13:
+ - Added few SSE code.
+ - Fixed matrix projections.
_________________

2008-04-07:
+ - Added GLM_SWIZZLE_FUNC swizzle option.
_________________

2008-04-06:
+ - Updated GLM_GTX_euler_angles documentation.
_________________

2008-03-26:
+ - Updated documentation.
_________________

2008-03-24:
+ - Fixed GLM_GTX_associated_min_max build on GCC.
+ - Updated GLM_GTX_matrix_projection.
+ - GLM 0.7.1 released.
_________________

2008-03-22:
+ - GLM 0.7.0 released.
_________________

2008-03-20:
+ - Updated manual.
_________________

2008-03-16:
+ - Updated documentation.
+ - Added GLM_GTX_associated_min_max extension.
_________________

2008-03-15:
+ - Fixed not function with GCC.
_________________

2008-03-12:
+ - Fixed interger pow function for the case of a null power.
_________________

2008-02-20:
+ - Fixed mat4x2 and mat4x3 GCC build.
+ - Updated documentation.
+ - Reseted glmsetup.h to default values.
_________________

2008-02-17:
+ - Fixed missing xvec4 constructor with bool argument definition.
+ - Fixed namespace collision in quaternion inverse function.
+ - Fixed swizzle operators involved in operations.
+ - Change license from GNU LGPL to MIT.
_________________

2008-02-16:
+ - Fixed missing xvec4 ++ and -- operator definition.
_________________

2008-01-05:
+ - Move some implementation details into detail namespace.
_________________

2008-01-04:
+ - Fixed cast between matrices of different sizes.
_________________

2008-01-02:
+ - Fixed matNxM type cast to other matNxM type.
_________________

2007-12-15:
+ - Fixed GLM_GTX_matrix_projection extension.
_________________

2007-12-13:
+ - GLM 0.6.4 released.
_________________

2007-12-09:
+ - Fixed swizzle operators.
_________________

2007-11-21:
+ - Fixed GLM_GTX_matrix_selection extension.
_________________

2007-11-14:
+ - Updated GLM_GTX_color_space extension. Added luminosity function.
_________________

2007-11-05:
+ - GLM 0.6.3 released.
_________________

2007-10-31:
+ - Fixed 3DSMax SDK conflict with GLM.
_________________

2007-10-29:
+ - Updated GLM_GTX_quaternion. Added sqrt function.
_________________

2007-10-28:
+ - Updated GLM_GTX_random extension.
+ - Updated GLM_GTX_half extension.
_________________

2007-10-21:
+ - Fixed matrices operator const T*() const.
_________________

2007-10-08:
+ - Fixed GLM_GTX_normalize_dot extension.
+ - GLM 0.6.2 released.
_________________

2007-10-07:
+ - GLM 0.6.1 released.
_________________

2007-10-02:
+ - Added GLM_GTX_normalize_dot extension: Faster way to normalize parameters before a dot product
_________________

2007-09-22:
+ - Fixed namespace error on GLM_GTX_matx extension
_________________

2007-09-21:
+ - Added GLM_GTX_flexible_mix extension: mix function can take different types parameters
_________________

2007-09-16:
+ - Updated documentation.
+ - GLM 0.6.0 released.
_________________

2007-09-15:
+ - Added GLM_SINGLE_COMP_NAME to fixed multiple component names on half types with GCC.
_________________

2007-09-10:
+ - Added #define GLM_GTX_INCLUDED to automatically include all GTX extensions in the language.
_________________

2007-09-09:
+ - Updated extensions documentation.
+ - Updated GLM_GTX_quaternion extension: squad, euler angles conversions
_________________

2007-09-06:
+ - Updated GLM_GTX_compatibility extension: Added isfinite isinf, and isnan.
_________________

2007-08-26:
+ - Updated GLM_GTX_random extension: Gauss distribution, spherical distribution, linear distribution.
_________________

2007-08-21:
+ - Fixed namespace issues with Visual Studio 8.0 SP1.
_________________

2007-08-20:
+ - Updated GLM_GTX_gpu_shader4 extension: Add bit operators.
+ - Updated GLM_GTX_integer extension: Delete some code duplications.
+ - Added GLM_GTX_unsigned_int extension.
_________________

2007-08-19:
+ - Fixed namespace issues with Visual Studio 8.0 SP1.
+ - Added new namespace management for extensions.
+ - Added automatic compiler ditection, no more compiler setup.
_________________

2007-07-31:
+ - Updated GLM_GTX_number_precision extension.
+ - Updated usertype.dat for Visual Studio.
+ - Updated GLM_GTX_random extension.
_________________

2007-06-21:
+ - Added GLM_GTX_color_cast extension.
+ - Updated GLM_GTX_quaternion extension.
_________________

2007-05-22:
+ - Added GLM_GTX_verbose_operator extension.
_________________

2007-05-21:
+ - Added GLM_GTX_component_wise extension.
_________________

2007-05-10:
+ - Added GLM_GTX_number_precision extension.
_________________

2007-04-16:
+ - Updated GLM_GTX_bit extension.
_________________

2007-04-10:
+ - Updated GLM_GTX_bit extension.
_________________

2007-04-04:
+ - Updated GLM_GTX_fast_square_root extension.
+ - Updated GLM_GTX_fast_trigonometry extension.
+ - Updated GLM_GTX_fast_exponential extension.
+ - Added GLM_GTX_mul extension.
+ - Fixed GLM_GTX_epsilon extension.
_________________

2007-04-03:
+ - Added GLM_GTX_mixed_product extension.
+ - Added GLM_GTX_intersect extension.
+ - Updated GLM_GTX_matrix_access extension.
_________________

2007-03-20:
+ - Added bits operators in comment for vec2, vec3 and vec4.
+ - Fixed friendly conformance to GLM_GTX_double.
_________________

2007-03-18:
+ - Fixed size_type errors.
_________________

2007-03-14:
+ - Updated GLM_GTX_quaternion extension.
+ - Added GLM_GTX_bit extension.
+ - Added value_type, size_type and value_size typedefs and value to all types.
_________________

2007-03-09:
+ - Updated GLM_GTX_compatibility extension.
+ - Fixed GLM_GTX_color_space extension.
_________________

2007-03-06:
+ - Added GLM_GTX_polar_coordinates extension.
_________________

2007-03-05:
+ - Added GLM_GTX_vector_query extension.
+ - Added GLM_GTX_matrix_query extension.
_________________

2007-03-01:
+ - Fixed square matrices division operators.
_________________

2007-02-28:
+ - Added GLM_GTX_mat_mn extension.
_________________

2007-02-22:
+ - Updated GLM_GTX_color_space extension.
_________________

2007-02-21:
+ - Added GLM_GTX_vecx extension.
+ - Added GLM_GTX_matx extension.
_________________

2007-02-19:
+ - GLM 0.5.1 released.
_________________

2006-02-08:
+ - Updated Visual Studio projects.
_________________

2006-02-01:
+ - Updated GLM_GTX_compatibility extension.
_________________

2006-01-26:
+ - Added GLM_GTX_hyperbolic extension.
+ - Added GLM_GTX_spline extension.
+ - Fixed unProject and project functions from GLM_GTX_matrix_projection extension.
_________________

2006-01-24:
+ - Added GLM_GTX_compatibility extension.
_________________

2006-01-19:
+ - Add some undefined write swizzle operators from bvec*
+ - Fixed vectors component access operators[] from bvec*
+ - Fixed bvec* equal operators with write swizzle operators
+ - Fixed various vector constructors
+ - Updated swizzle operators, _xvec* and _bvec* share the same code
_________________

2006-01-11:
+ - Add some undefined write swizzle operators from xvec*
+ - Fixed some write operator considered as read operator from xvec*
+ - Fixed vectors component access operators[] from xvec*
+ - Fixed not function setup according compilers
_________________

2006-01-06:
+ - Added user manual.
+ - GLM 0.5.0 released.
_________________

2006-01-05:
+ - Updated overloaded functions of matrixCompMult.
+ - Added transpose and outerProduct functions in the GLM core.
_________________

2006-12-15:
+ - Fixed GLM_GTX_rotate_vector extension.
_________________

2006-12-07:
+ - Fixed GLM_GTX_interger extension conformance.
_________________

2006-12-06:
+ - Improved "friendly conformance" support.
+ - Improved quaternion implementation.
_________________

2006-12-03:
+ - Updated setup options.
_________________

2006-11-26:
+ - Added new setup options for swizzle operators.
_________________

2006-11-14:
+ - Updated GLM_GTX_integer extension.
_________________

2006-11-13:
+ - Added GLM_GTX_gpu_shader4 extension.
+ - Added extension errors management.
+ - Added compilers management.
+ - Added conformance management.
_________________

2006-11-02:
+ - Added GLM_GTX_rotate_vector extension.
_________________

2006-10-15:
+ - Updated product operators to non-squared matrices
_________________

2006-10-01:
+ - Updated tmat4x3 and tmat3x4 types
+ - Added tmat2x3, tmat3x2, tmat2x4 and tmat4x2
+ - Clarified ToDo comments for missing operators with non-squared matrices types
_________________

2006-08-05:
+ - Added GLSL 1.2 mat4x3 and mat3x4
+ - Added missing declaration of mat* operators
+ - Added _xmat* with _xvec* division operators
_________________

2006-08-04:
+ - Added GLSL 1.2 non-squared matrices files
_________________

2006-07-17:
+ - fastCos and fastSin are defined between -2 pi and 2 pi
_________________

2006-06-18:
+ - Added swizzle operators for xvec4
+ - Added swizzle operators for bvec4
_________________

2006-06-17:
+ - Added swizzle operators for bvec2>
+ - Implicit conversion from *ref* to *vec*
+ - Added swizzles operators for xvec3
+ - Added swizzles operators for bvec3
_________________

2006-05-29:
+ - Separated _*ref* types in different files
+ - Added _bref* types
+ - Updated _xref* types
_________________

2006-05-28:
+ - Added operators for tvec2 swizzles operators management
_________________

2006-05-23:
+ - GLM 0.4.1 released.
_________________

2006-05-22:
+ - Add 4 examples of use with OpenGL under Windows and Linux
_________________

2006-05-17:
+ - GLM 0.4.0 released.
_________________

2006-05-16:
+ - It's not anymore required to include windows.h before glm.h whether windows.h is required
_________________

2006-05-04:
+ - Improved tvec3 conversions
+ - Improved tvec2 conversions
+ - Added left hand side vec2 swizzle operators
+ - Improved bvec4 conversions
+ - Improved bvec3 conversions
+ - Improved bvec2 conversions
_________________

2006-04-28:
+ - Added _xref* structures for swizzle operators implementation
+ - Seperated bvec* and xvec* types in different files
+ - Updated core functions code
_________________

2006-04-22:
+ - Fixed texture coordinate components access
+ - Added GLM_GTX_mul extension.
+ - Added GLM_GTX_inertia extension.
+ - GLM 0.3.2 released.
_________________

2006-04-21:
+ - Added right hand side vec2 swizzle operators
+ - Improved tvec4 conversions
_________________

2006-04-20:
+ - Updated GLM_GTX_quaterion, added log and exp functions
+ - Added GLM_GTX_matrix_major_storage extension.
_________________

2006-04-19:
+ - Reorganize types code
+ - Complete addition and subtraction vertrices operators
_________________

2006-04-18:
+ - Complete addition and subtraction matrices operators
+ - Optimize increment and decrement operators
_________________

2006-04-17:
+ - Fixed tmat4x4 division
_________________

2006-03-30:
+ - Added GLM_GTX_outer_product extension.
_________________

2006-03-28:
+ - GLM 0.3.1 released.
_________________

2006-03-27:
+ - Added Linux support under GCC 4.0 and 4.1.
_________________

2006-03-26:
+ - Optimisation of increment and decrement operators.
_________________

2006-03-20:
+ - Added MacOS X support under GCC 4.0.
_________________

2006-02-19:
+ - Added GLM_GTX_extend extension to wishlist in position 27.
+ - Added GLM_GTX_euler_angles extension to wishlist in position 28.
+ - Added Doxygen documentation.
+ - GLM 0.3.0 released.
_________________

2006-01-30:
+ - Optimized GLM_GTX_integer implementation.
_________________

2006-01-27:
+ - Deleted explicit conversions from array to type to prevent unespected conversions.
_________________

2006-01-16:
+ - Fixed bugs
+ - Improved types conversions.
+ - Added GLM_GTX_vector_access extension to wishlist in position 25.
+ - Added GLM_GTX_random extension to wishlist in position 26.
_________________

2006-01-13:
+ - Fixed bugs
_________________

2006-01-10:
+ - Updated GLM_GTX_integer extension.
_________________

2006-01-09:
+ - Added GLM_GTX_fast_exponential extension to wishlist in position 24.
_________________

2006-01-08:
+ - Optimized _xvec* copy.
_________________

2006-01-07:
+ - Added GLM_GTX_fast_trigonometry extension to wishlist in position 23.
+ - Added factorial function to GLM_GTX_integer extension.
_________________

2006-01-05:
+ - Added GLM_GTX_half extension to wishlist in position 21.
+ - Optimized normalize function.
+ - Global optimisation for debugging time
+ - Added GLM_GTX_integer extension to wishlist in position 18.
+ - Optimized clamp function.
_________________

2006-01-04:
+ - Added GLM_GTX_fast_square_root extension to wishlist in position 19.
+ - Added GLM_GTX_inverse_transpose extension to wishlist in position 20.
+ - Fixed missing of vec4 * mat4 operator.
_________________

2005-12-23:
+ - Reorganization of extensions.
+ - Fixed vec2 constructeur bug.
_________________

2005-11-22:
+ - Updated GLM_GTX_length2 extension.
+ - Renamed GLM_GTX_length2 extension to GLM_GTX_norm.
_________________

2005-11-12:
+ - Fixed GLM_GTX_quaterion implémentation bugs.
_________________

2005-11-09:
+ - Updated GLM_GTX_projection extension.
_________________

2005-10-30:
+ - Added GLM_GTX_transform2 extension to wishlist in position 18.
_________________

2005-09-28:
+ - Updated for GCC 4.0.
_________________

2005-08-12:
+ - Fixed normalization bug with LookAtGTX.
_________________

2005-07-15:
+ - Add array conversion to GLM types.
_________________

2005-07-02:
+ - Added GL_GTX_euler_angles extension to wishlist in position 17.
_________________

2005-06-24:
+ - Added GLM_GTX_matrix_selection extension to wishlist in position 16.
+ - Added GLM_GTX_matrix_selection extension support.
_________________

2005-06-22:
+ - Updated GLM_GTX_projection extension to wishlist in position 15.
_________________

2005-06-21:
+ - Added GLM_GTX_projection extension to wishlist in position 15.
_________________

2005-06-09:
+ - Fixed bug from rotateGTX with quaternion.
+ - Fixed matrix vector product.
+ - Add vector usage to describe transformations axis.
_________________

2005-05-05:
+ - Added GLM_GTX_quaternion extension support
+ - GLM 0.2 released.
_________________

2005-05-02:
+ - Add GLM_GTX_transform 2D transform support
_________________

2005-05-01:
+ - Add GLM_GTX_transform 3D transform support
_________________

2005-04-29:
+ - Updated GLM_GTX_transform extension to wishlist in position 2
_________________

2005-04-23:
+ - Added GLM_GTX_vector_comp_mult extension to whislist in position 14
+ - Added GLM_GTX_vector_comp_mult extension support
_________________

2005-04-22:
+ - Added GLM_GTX_color_space extension to whislist in position 13
+ - Added GLM_GTX_color_space extension support
+ - Added GLM_GTX_double extension support
_________________

2005-04-10:
+ - Overload of GLSL functions used by extentions instead of create new functions
_________________

2005-04-08:
+ - Added GLM_GTX_optimum_pow extension to whislist in position 11
+ - Added GLM_GTX_double extension to wishlist in position 12
_________________

2005-04-03:
+ - Updated GLM_GTX_matrix_cross_product extension to wishlist in position 8
+ - Added GLM_GTX_matrix_cross_product extension support
+ - Added GLM_GTX_projection extension to whislist in position 9
+ - Added GLM_GTX_perpendicular extension to wishlist in position 10
+ - Added GLM_GTX_projection extension support
+ - Added GLM_GTX_perpendicular extension support
+ - Changed extensions organisation
_________________

2005-03-27:
+ - Added *vec* by *mat* product
+ - Updated GLM_GTX_determinant extension to wishlist in position 4
+ - Updated GLM_GTX_inverse extension to wishlist in position 5
+ - Updated GLM_GTX_length2 extension to wishlist in position 6
+ - Updated GLM_GTX_orthonormalize extension to wishlist in position 7
+ - Added GLM_GTX_determinant extension support
+ - Added GLM_GTX_inverse extension support
+ - Added GLM_GTX_length2 extension support
+ - Added GLM_GTX_orthonormalize extension support
_________________

2005-03-21:
+ - Added bug #7 : Vector constructor non conform
+ - Updated issue #13 : Only ARB can allow extensions adding new operators
_________________

2005-03-13:
+ - Added GLM_GTX_orthonormalize extension to wishlist in position 7
+ - Added GLM_GTX_matrix_cross_product extension to wishlist in position 8
+ - Updated issue #10 : Using template functions members
+ - Updated *vec* types following issue #10 guidance
_________________

2005-03-06:
+ - Fixed bug #2 with '#error'
_________________

2005-03-05:
+ - Updated issue #4
_________________

2005-03-04:
+ - Updated issue #13
+ - Updated issue #8
+ - Updated issue #6
+ - Updated issue #4
_________________

2005-03-03:
+ - Bugs #2 and #5 are now one
+ - Updated / operator for vec* types with support of the divisibility of two vectors, and the divisibility term to term
_________________

2005-02-28:
+ - Updated GLM_GTX_transpose extension to wishlist in position 8
+ - Added GLM_GTX_transpose extension support
+ - Fixed mat* types constructor scalar-parameted
_________________

2005-02-27:
+ - Fixed mat* types product by a scalar
_________________

2005-02-25:
+ - Updated function 'not'
+ - Defined identificators following compilers
+ - Added GLM_GTX_length2 extension to wishlist in position 6
+ - Optimized mat3 type divide operator
_________________

2005-02-21:
+ - GLM 0.1 released
_________________

2005-02-18:
+ - Updated issue #4
+ - Updated issue #6
+ - Updated issue #9
+ - Updated issue #12
+ - Updated issue #13
+ - Updated issues ordering
_________________

2005-02-17:
+ - Updated vec* types + operator. Can now add a vector and a scalar, term by term
+ - Updated vec* types - operator. Can now minus a vector and a scalar, term by term
+ - Updated vec* types * operator. Can now multiply a vector and a scalar, term by term
+ - Deleted issue #11, which was erroneous
_________________

2005-02-15:
+ - Deleted from wishlist extension #6 : refract function is defined by version 1.10.59 from GLSL specs
+ - Updated reflect function tests
+ - Added fucntion reflect with its tests
+ - Using typename 'genType' for functions templates
+ - Added bug #5
+ - Updated function sqrt
+ - Added function log with its tests
+ - Added function exp with its tests
+ - Added function log2 with its tests
+ - Updated cross function
+ - Updated bvec* types data implementation
+ - Added bug #6
_________________

2005-02-14:
+ - Updated issue #13
+ - Converted text files into XML
+ - Modified files hierarchy
_________________

2005-02-13:
+ - Updated clamp function
+ - Added function noise1 with its tests
+ - Added function noise2 with its tests
+ - Added function noise3 with its tests
+ - Added function noise4 with its tests
_________________

2005-02-08:
+ - Enhanced mat4 type division operator
+ - Added function sqrt with its tests
+ - Added function inversesqrt with its tests
+ - Added function exp2 with its tests
+ - Added function log2 with its tests
_________________

2005-02-07:
+ - Modified *vec* types constructors implementation, chooses initialisation instead of affectation
+ - Added function reflect with its tests
+ - Updated tan function
+ - Fixed mat4 type * operator
_________________

2005-02-05:
+ - Added GLM_GTX_refract extension to wishlist in position 5.
_________________

2005-02-03:
+ - Added default constructor for mat* types
_________________

2005-02-02:
+ - Added mat2 and vec2 type * operator
+ - Added mat3 and vec3 type * operator
+ - Added mat4 and vec4 type * operator
_________________

2005-02-01:
+ - Added GLM_GTX_transpose extension to wishlist in position 3
+ - Added GLM_GTX_determinant extension to wishlist in position 4
+ - Added GLM_GTX_inverse extension to wishlist in position 5
+ - Added / operator for two mat3 types
+ - Enhanced *vec* types conception
+ - Enhanced *mat* types conception
_________________

2005-01-31:
+ - Updated bug #3
+ - Updated issue #10
+ - Added function matrixCompMult with its tests
+ - Updated mat* type constant access operators
+ - Added bug #4 : Conversion problem between two different *vec* types
_________________

2005-01-30:
+ - Added bug #1 : Inability to select multiple components
+ - Added bug #2 : Some *vec* types conversions are not available
+ - Added bug #3 : 'not' is a C++ ISO keyword
+ - Added * operator for two mat3 types
+ - Added * operator for two mat4 types
+ - Updated mat* types
+ - Updated GLM_GTX_quaternion extension to wishlist in position 1
+ - Updated GLM_GTX_transform extension to wishlist in position 2
_________________

2005-01-27:
+ - Added mat2 type
+ - Added * operator for two mat2 types
+ - Added issue #14
+ - Added issue #15
+ - Added mat3 type
+ - Added mat4 type
_________________

2005-01-26:
+ - Added function mix with its tests
+ - Added function step with its tests
+ - Added function smoothstep with its tests
+ - Updated issue #10
+ - Updated issue #12
+ - Updated issue #8
+ - Added type bvec4 forgotten declaration
+ - Added function lessThan with its tests
+ - Added function lessThanEqual with its tests
+ - Added function greaterThan with its tests
+ - Added function greaterThanEqual with its tests
+ - Added function equal with its tests
+ - Added function notEqual with its tests
+ - Added function any with its tests
+ - Added function all with its tests
+ - Added function not with its tests
_________________

2005-01-24:
+ - Added function fract with its tests
+ - Added function mod with its tests
+ - Added function clamp with its tests
_________________

2005-01-23:
+ - Added function mod with its tests
+ - Added function abs with its tests
+ - Added function sign with its tests
+ - Added function floor with its tests
+ - Added function ceil with its tests
+ - Added function min with its tests
+ - Added function max with its tests
_________________

2005-01-22:
+ - Updated issue #13
+ - Added temporary namespace called 'glm'
+ - Added function pow with its tests
_________________

2005-01-19:
+ - Updated sin function tests
+ - Enhanced trigonometrics functions
+ - Enhanced geometric functions
_________________

2005-01-18:
+ - Added xvec* type constructor taking a single scalar as parameter.
+ - Added xvec* into xvec3 type conversion
+ - Added xvec* into xvec4 type conversion
+ - Added xvec* into bvec2 type conversion
+ - Added xvec* into bvec3 type conversion
+ - Added xvec* into bvec4 type conversion
+ - Added function sin with its tests
+ - Added function cos with its tests
+ - Added function tan with its tests
+ - Added function asin with its tests
+ - Added function acos with its tests
+ - Added function atan with its tests
+ - Added issue #13
_________________

2005-01-17:
+ - Added function radians with its tests
+ - Added function degrees with its tests
+ - Added issue #9
_________________

2005-01-16:
+ - Separated *vec* types definition from declaration
+ - Added xvec* into xvec2 type conversion
+ - Updated issue #11
+ - Added issue #12
_________________

2005-01-15:
+ - Using 'union' for multiple access to *vec* types components
+ - Added issue #11
+ - Deleted __*vec1GT following issue #11 guidance
+ - Closed issue #2
_________________

2005-01-13:
+ - Added function normalize with its tests
+ - Added function faceforward with its tests
_________________

2005-01-12:
+ - Added function cross with its tests
+ - Added a function that can determine *vec* types size, and write beyond GLSL 1.051 specs
+ - Added function lenght with its tests
+ - Added function distance with its tests
+ - Added function dot with its tests
+ - Closed issue #1
_________________

2005-01-10:
+ - Renamed intern types _vec* into _xvec*
+ - Separated _xvec* types data, operators and accesses
+ - Added bvec2 type
+ - Added __bvec1GT type beyond GLSL 1.051 specs
_________________

2005-01-09:
+ - Added types vec2 and ivec2
+ - Added types vec3 and ivec3
+ - Added types vec4 and ivec4
+ - Added types __vec1GT and __ivec1GT, write beyond GLSL 1.051 specs
_________________

+ Copyright © 2005-2008 G-Truc Creation
\ No newline at end of file diff --git a/doc/code.html b/doc/code.html new file mode 100644 index 00000000..b459675d --- /dev/null +++ b/doc/code.html @@ -0,0 +1,5 @@ + + +OpenGL Mathematics: Code
OpenGL Mathematics
GLSL + Optional features = OpenGL Mathematics (GLM).
A C++ mathematics library for 3D graphics.


06/05/2009 | Compute face normals
Compute face normals
_________________

06/05/2009 | OpenGL render
Compute face normals
_________________

06/05/2009 | Point light computation
Compute face normals
_________________

+ Copyright © 2005-2009 G-Truc Creation
\ No newline at end of file diff --git a/doc/code/01.png b/doc/code/01.png new file mode 100644 index 00000000..2099e56f Binary files /dev/null and b/doc/code/01.png differ diff --git a/doc/code/02.png b/doc/code/02.png new file mode 100644 index 00000000..83412c00 Binary files /dev/null and b/doc/code/02.png differ diff --git a/doc/code/03.png b/doc/code/03.png new file mode 100644 index 00000000..6774fc77 Binary files /dev/null and b/doc/code/03.png differ diff --git a/doc/common/email.png b/doc/common/email.png new file mode 100644 index 00000000..a5c71db1 Binary files /dev/null and b/doc/common/email.png differ diff --git a/doc/common/g-truc.jpg b/doc/common/g-truc.jpg new file mode 100644 index 00000000..50e2f8db Binary files /dev/null and b/doc/common/g-truc.jpg differ diff --git a/doc/common/logo.png b/doc/common/logo.png new file mode 100644 index 00000000..f7454290 Binary files /dev/null and b/doc/common/logo.png differ diff --git a/doc/common/opengl.jpg b/doc/common/opengl.jpg new file mode 100644 index 00000000..7819935a Binary files /dev/null and b/doc/common/opengl.jpg differ diff --git a/doc/common/sourceforge.gif b/doc/common/sourceforge.gif new file mode 100644 index 00000000..f4a98c6d Binary files /dev/null and b/doc/common/sourceforge.gif differ diff --git a/doc/common/style.css b/doc/common/style.css new file mode 100644 index 00000000..688a92b8 --- /dev/null +++ b/doc/common/style.css @@ -0,0 +1,166 @@ +table.principale +{ + background-color:#ff8000; + border-style:none; + border-width:0px; + border-spacing:0px; + margin-top: 0px; + margin-bottom: 0px; + margin-right: 0px; + margin-left: 0px; + padding-right: 0px; + padding-left: 0px; + padding-bottom: 0px; + padding-top: 0px; + width:100%; +} + +tr.principale +{ + background-color:#ff8000; + border-style:none; + border-width:0px; + border-spacing:0px; + margin-top: 0px; + margin-bottom: 0px; + margin-right: 0px; + margin-left: 0px; + padding-right: 0px; + padding-left: 0px; + padding-bottom: 0px; + padding-top: 0px; +} + +div.title1 +{ + text-align:center; + font-size:48px; + border-style:solid; + border-width:0px; + color:#000000; +} + +div.title2 +{ + text-align:left; + font-size:20px; + font-weight:bold; + color:#000000; +} + +div.title3 +{ + text-align:center; + font-size:16px; + border-style:none; + border-width:1px; +} + +div.title4 +{ + text-align:left; + font-size:16px; + font-weight:bolder; + color:#FF8000; +} + +div.title-date +{ + text-align:right; + font-size:16px; + font-weight:bolder; + color:#FF8000; +} + +div.menu1 +{ + text-align:center; + font-size:16px; + font-weight:bolder; +} + +div.menu2 +{ + text-align:center; + font-size:16px; +} + +div.news-separator +{ + text-align:center; + color:#FF8000; +} + +div.email +{ + text-align:center; +} + +div.image +{ + text-align:right; +} + +img.menu-img +{ + text-align:center; + font-size:16px; + border-color:#000000; + border-style:solid; + border-width:0px; +} + +div.paragraph +{ + text-indent:32px; +} + +td.page +{ + vertical-align:top; + padding-right: 32px; + padding-left: 32px; + padding-bottom: 0px; + padding-top: 0px; + width:100%; +} + +td.menu +{ + vertical-align:top; + text-align:right; + border-width:0px; + border-right-style:solid; + border-color:#000000; + width:160px; + padding-right: 32px; + padding-left: 0px; + padding-bottom: 0px; + padding-top: 0px; +} +/* +a.menu +{ + color:#FF8000; + font-weight:bolder; +} +*/ +a.menu +{ + color:#008000; +} + +a +{ + color:#008000; +} + +div.issue-content +{ + text-indent:32px; +} + +div.issue-title +{ + font-weight:bold; +} diff --git a/doc/common/title.png b/doc/common/title.png new file mode 100644 index 00000000..76129551 Binary files /dev/null and b/doc/common/title.png differ diff --git a/doc/download.html b/doc/download.html new file mode 100644 index 00000000..258e92a4 --- /dev/null +++ b/doc/download.html @@ -0,0 +1,87 @@ + + +OpenGL Mathematics : Downloads
OpenGL Mathematics

GLSL + Optional features = OpenGL Mathematics (GLM).
A C++ mathematics library for 3D graphics.


Current release
14/11/2009: + GLM 0.8.4.3 + (1.1 MB) +
_________________

GLM - zip files
14/11/2009: GLM 0.8.4.3 (1.1 MB) +
19/10/2009: GLM 0.8.4.2 (1.1 MB) +
03/10/2009: GLM 0.8.4.1 (1.1 MB) +
16/09/2009: GLM 0.8.4.0 (1.1 MB) +
11/08/2009: GLM 0.8.3.5 (971 KB) +
10/08/2009: GLM 0.8.3.4 (971 KB) +
25/06/2009: GLM 0.8.3.3 (971 KB) +
04/06/2009: GLM 0.8.3.2 (971 KB) +
21/05/2009: GLM 0.8.3.1 (945 KB) +
06/05/2009: GLM 0.8.3.0 (896 KB) +
01/04/2009: GLM 0.8.2.3 (961 KB) +
24/02/2009: GLM 0.8.2.2 (961 KB) +
13/02/2009: GLM 0.8.2.1 (963 KB) +
21/01/2009: GLM 0.8.2.0 (963 KB) +
30/10/2008: GLM 0.8.1.0 (938 KB) +
23/10/2008: GLM 0.8.0.0 (936 KB) +
08/08/2008: GLM 0.7.6.0 (907 KB) +
05/07/2008: GLM 0.7.5.0 (852 KB) +
06/01/2008: GLM 0.7.4.0 (859 KB) +
05/24/2008: GLM 0.7.3.0 (1.8 MB) +
04/27/2008: GLM 0.7.2.0 (1.8 MB) +
03/24/2008: GLM 0.7.1.0 (1.8 MB) +
03/22/2008: GLM 0.7.0.0 (1.8 MB) +
12/10/2007: GLM 0.6.4.0 (1.8 MB) +
11/05/2007: GLM 0.6.3.0 (1.8 MB) +
10/08/2007: GLM 0.6.2.0 (1.8 MB) +
10/07/2007: GLM 0.6.1.0 (1.8 MB) +
09/16/2007: GLM 0.6.0.0 (1.8 MB) +
02/19/2007: GLM 0.5.1.0 (2.3 MB) +
01/06/2007: GLM 0.5.0.0 (2.4 MB) +
05/22/2006: GLM 0.4.1.0 (1.6 MB) +
05/17/2006: GLM 0.4.0.0 (905 KB) +
04/22/2006: GLM 0.3.2.0 (955 KB) +
03/28/2006: GLM 0.3.1.0 (963 KB) +
02/19/2006: GLM 0.3.0.0 (945 KB) +
05/05/2005: GLM 0.2.0.0 (194 KB) +
02/21/2005: GLM 0.1.0.0 (29.2 KB) +
_________________

GLM - 7z files
14/11/2009: GLM 0.8.4.3 (443 KB) +
19/10/2009: GLM 0.8.4.2 (443 KB) +
03/10/2009: GLM 0.8.4.1 (443 KB) +
16/09/2009: GLM 0.8.4.0 (439 KB) +
11/08/2009: GLM 0.8.3.5 (405 KB) +
10/08/2009: GLM 0.8.3.4 (405 KB) +
25/06/2009: GLM 0.8.3.3 (405 KB) +
04/06/2009: GLM 0.8.3.2 (405 KB) +
21/05/2009: GLM 0.8.3.1 (399 KB) +
06/05/2009: GLM 0.8.3.0 (359 KB) +
01/04/2009: GLM 0.8.2.3 (378 KB) +
24/02/2009: GLM 0.8.2.2 (378 KB) +
13/02/2009: GLM 0.8.2.1 (381 KB) +
21/01/2009: GLM 0.8.2.0 (381 KB) +
30/10/2008: GLM 0.8.1.0 (372 KB) +
23/10/2008: GLM 0.8.0.0 (370 KB) +
08/08/2008: GLM 0.7.6.0 (387 KB) +
05/07/2008: GLM 0.7.5.0 (366 KB) +
06/01/2008: GLM 0.7.4.0 (372 KB) +
05/24/2008: GLM 0.7.3.0 (657 KB) +
04/27/2008: GLM 0.7.2.0 (646 KB) +
03/24/2008: GLM 0.7.1.0 (635 KB) +
03/22/2008: GLM 0.7.0.0 (635 KB) +
12/10/2007: GLM 0.6.4.0 (612 KB) +
11/05/2007: GLM 0.6.3.0 (633 KB) +
10/08/2007: GLM 0.6.2.0 (645 KB) +
10/07/2007: GLM 0.6.1.0 (645 KB) +
09/16/2007: GLM 0.6.0.0 (646 KB) +
02/19/2007: GLM 0.5.1.0 (807 KB) +
01/06/2007: GLM 0.5.0.0 (862 KB) +
05/22/2006: GLM 0.4.1.0 (533 KB) +
05/17/2006: GLM 0.4.0.0 (262 KB) +
_________________

Raytrace
16-09-2007: Raytrace v1.0 (exe) (766 KB) +
16-09-2007: Raytrace v1.0 (zip) (1.4 MB) +
06-01-2007: Raytrace b3.0 (exe) (751 KB) +
06-01-2007: Raytrace b3.0 (zip) (1.1 MB) +
19-02-2006: Raytrace b2.0 (exe) (1.0 MB) +
19-02-2006: Raytrace b2.0 (zip) (1.4 MB) +
05-05-2005: Raytrace b1.0 (zip) (1.3 MB) +
05-05-2005: Raytrace b1.0 (7z ) (808 KB) +
_________________

Humus's Framework
22-10-2008: AmbientApertureLighting (zip) (2.38 MB) +
_________________

Philip Rideout's Catmull-Clark Subdivision
24-01-2007: CatmullClark (zip) (605 KB) +
_________________

_________________

+ Copyright © 2005-2008 G-Truc Creation
\ No newline at end of file diff --git a/doc/doxyfile b/doc/doxyfile new file mode 100644 index 00000000..5bdc0489 --- /dev/null +++ b/doc/doxyfile @@ -0,0 +1,1529 @@ +# Doxyfile 1.6.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = GLM + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = "Version 0.8.4" + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class " \ + "The $name widget " \ + "The $name file " \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = "C:/Documents and Settings/Groove/ " + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = YES + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set +# FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = YES + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = YES + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = YES + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = YES + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = NO + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = YES + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = YES + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = NO + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ../../include/glm + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = *.hpp + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = ../../include/glm/gtx/vecx.hpp \ + ../../include/glm/gtx/matx.hpp \ + ../../include/glm/gtx/statistics_operation.hpp + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = detail + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = YES + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# When the SEARCHENGINE tag is enable doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) +# there is already a search function so this one should typically +# be disabled. + +SEARCHENGINE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = YES + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = glm.rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = YES + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = NO + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = YES + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = YES + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 1000 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/doc/glm-manual.pdf b/doc/glm-manual.pdf new file mode 100644 index 00000000..fe02e167 Binary files /dev/null and b/doc/glm-manual.pdf differ diff --git a/doc/goodies.html b/doc/goodies.html new file mode 100644 index 00000000..7ff2c1a6 --- /dev/null +++ b/doc/goodies.html @@ -0,0 +1,5 @@ + + +OpenGL Mathematics: Goodies
OpenGL Mathematics

GLSL + Optional features = OpenGL Mathematics (GLM).
A C++ mathematics library for 3D graphics.


16/10/2008
GLM Logo

Download: 2560x1600
Download: 1920x1200
Download: 1600x1000
Download: 1280x0800
Download: 1024x0640
_________________

16/10/2008
GLM Font

Download: Font (.otf)
_________________

_________________

+ Copyright © 2005-2008 G-Truc Creation
\ No newline at end of file diff --git a/doc/html/a00001_source.html b/doc/html/a00001_source.html new file mode 100644 index 00000000..15eeb2a5 --- /dev/null +++ b/doc/html/a00001_source.html @@ -0,0 +1,346 @@ + + + + +GLM: _detail.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00002_source.html b/doc/html/a00002_source.html new file mode 100644 index 00000000..fd2bd067 --- /dev/null +++ b/doc/html/a00002_source.html @@ -0,0 +1,1112 @@ + + + + +GLM: _swizzle.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00003_source.html b/doc/html/a00003_source.html new file mode 100644 index 00000000..09ab7b89 --- /dev/null +++ b/doc/html/a00003_source.html @@ -0,0 +1,192 @@ + + + + +GLM: address.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00004_source.html b/doc/html/a00004_source.html new file mode 100644 index 00000000..cd0f4827 --- /dev/null +++ b/doc/html/a00004_source.html @@ -0,0 +1,105 @@ + + + + +GLM: associated_min_max.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00005_source.html b/doc/html/a00005_source.html new file mode 100644 index 00000000..42b726d2 --- /dev/null +++ b/doc/html/a00005_source.html @@ -0,0 +1,106 @@ + + + + +GLM: bit.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00006_source.html b/doc/html/a00006_source.html new file mode 100644 index 00000000..b0e8412d --- /dev/null +++ b/doc/html/a00006_source.html @@ -0,0 +1,71 @@ + + + + +GLM: closest_point.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00007_source.html b/doc/html/a00007_source.html new file mode 100644 index 00000000..4b6df693 --- /dev/null +++ b/doc/html/a00007_source.html @@ -0,0 +1,128 @@ + + + + +GLM: color_cast.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00008_source.html b/doc/html/a00008_source.html new file mode 100644 index 00000000..7f939d94 --- /dev/null +++ b/doc/html/a00008_source.html @@ -0,0 +1,91 @@ + + + + +GLM: color_space.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00009_source.html b/doc/html/a00009_source.html new file mode 100644 index 00000000..9b094762 --- /dev/null +++ b/doc/html/a00009_source.html @@ -0,0 +1,81 @@ + + + + +GLM: color_space_YCoCg.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00010_source.html b/doc/html/a00010_source.html new file mode 100644 index 00000000..978efd3f --- /dev/null +++ b/doc/html/a00010_source.html @@ -0,0 +1,71 @@ + + + + +GLM: comparison.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00011_source.html b/doc/html/a00011_source.html new file mode 100644 index 00000000..866a8f89 --- /dev/null +++ b/doc/html/a00011_source.html @@ -0,0 +1,199 @@ + + + + +GLM: compatibility.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00012_source.html b/doc/html/a00012_source.html new file mode 100644 index 00000000..1f10830b --- /dev/null +++ b/doc/html/a00012_source.html @@ -0,0 +1,81 @@ + + + + +GLM: component_wise.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00013_source.html b/doc/html/a00013_source.html new file mode 100644 index 00000000..dcc011c3 --- /dev/null +++ b/doc/html/a00013_source.html @@ -0,0 +1,68 @@ + + + + +GLM: determinant.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00014_source.html b/doc/html/a00014_source.html new file mode 100644 index 00000000..76424812 --- /dev/null +++ b/doc/html/a00014_source.html @@ -0,0 +1,92 @@ + + + + +GLM: double_float.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00015_source.html b/doc/html/a00015_source.html new file mode 100644 index 00000000..80a7e249 --- /dev/null +++ b/doc/html/a00015_source.html @@ -0,0 +1,76 @@ + + + + +GLM: double_float.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00016_source.html b/doc/html/a00016_source.html new file mode 100644 index 00000000..ea95f815 --- /dev/null +++ b/doc/html/a00016_source.html @@ -0,0 +1,81 @@ + + + + +GLM: epsilon.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00017_source.html b/doc/html/a00017_source.html new file mode 100644 index 00000000..8582b263 --- /dev/null +++ b/doc/html/a00017_source.html @@ -0,0 +1,95 @@ + + + + +GLM: equal_operator.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00018_source.html b/doc/html/a00018_source.html new file mode 100644 index 00000000..ad0375e2 --- /dev/null +++ b/doc/html/a00018_source.html @@ -0,0 +1,133 @@ + + + + +GLM: euler_angles.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00019_source.html b/doc/html/a00019_source.html new file mode 100644 index 00000000..b1106628 --- /dev/null +++ b/doc/html/a00019_source.html @@ -0,0 +1,54 @@ + + + + +GLM: ext.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00020_source.html b/doc/html/a00020_source.html new file mode 100644 index 00000000..74a68e46 --- /dev/null +++ b/doc/html/a00020_source.html @@ -0,0 +1,71 @@ + + + + +GLM: extend.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00021_source.html b/doc/html/a00021_source.html new file mode 100644 index 00000000..3b54c128 --- /dev/null +++ b/doc/html/a00021_source.html @@ -0,0 +1,107 @@ + + + + +GLM: extented_min_max.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00022_source.html b/doc/html/a00022_source.html new file mode 100644 index 00000000..b4b4e0aa --- /dev/null +++ b/doc/html/a00022_source.html @@ -0,0 +1,97 @@ + + + + +GLM: fast_exponential.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00023_source.html b/doc/html/a00023_source.html new file mode 100644 index 00000000..25575f3c --- /dev/null +++ b/doc/html/a00023_source.html @@ -0,0 +1,83 @@ + + + + +GLM: fast_square_root.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00024_source.html b/doc/html/a00024_source.html new file mode 100644 index 00000000..c748cec0 --- /dev/null +++ b/doc/html/a00024_source.html @@ -0,0 +1,86 @@ + + + + +GLM: fast_trigonometry.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00025_source.html b/doc/html/a00025_source.html new file mode 100644 index 00000000..10fbec56 --- /dev/null +++ b/doc/html/a00025_source.html @@ -0,0 +1,125 @@ + + + + +GLM: func_common.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00026_source.html b/doc/html/a00026_source.html new file mode 100644 index 00000000..e8f40443 --- /dev/null +++ b/doc/html/a00026_source.html @@ -0,0 +1,80 @@ + + + + +GLM: func_exponential.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00027_source.html b/doc/html/a00027_source.html new file mode 100644 index 00000000..09a59cbf --- /dev/null +++ b/doc/html/a00027_source.html @@ -0,0 +1,83 @@ + + + + +GLM: func_geometric.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00028_source.html b/doc/html/a00028_source.html new file mode 100644 index 00000000..11d6722c --- /dev/null +++ b/doc/html/a00028_source.html @@ -0,0 +1,76 @@ + + + + +GLM: func_matrix.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00029_source.html b/doc/html/a00029_source.html new file mode 100644 index 00000000..232080d3 --- /dev/null +++ b/doc/html/a00029_source.html @@ -0,0 +1,80 @@ + + + + +GLM: func_noise.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00030_source.html b/doc/html/a00030_source.html new file mode 100644 index 00000000..c146daa7 --- /dev/null +++ b/doc/html/a00030_source.html @@ -0,0 +1,106 @@ + + + + +GLM: func_trigonometric.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00031_source.html b/doc/html/a00031_source.html new file mode 100644 index 00000000..c2d471fd --- /dev/null +++ b/doc/html/a00031_source.html @@ -0,0 +1,86 @@ + + + + +GLM: func_vector_relational.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00032_source.html b/doc/html/a00032_source.html new file mode 100644 index 00000000..b03e2491 --- /dev/null +++ b/doc/html/a00032_source.html @@ -0,0 +1,88 @@ + + + + +GLM: gl.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00033_source.html b/doc/html/a00033_source.html new file mode 100644 index 00000000..bab876e8 --- /dev/null +++ b/doc/html/a00033_source.html @@ -0,0 +1,161 @@ + + + + +GLM: glm.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00034_source.html b/doc/html/a00034_source.html new file mode 100644 index 00000000..aed2fa22 --- /dev/null +++ b/doc/html/a00034_source.html @@ -0,0 +1,81 @@ + + + + +GLM: gradient_paint.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00035_source.html b/doc/html/a00035_source.html new file mode 100644 index 00000000..0016026a --- /dev/null +++ b/doc/html/a00035_source.html @@ -0,0 +1,52 @@ + + + + +GLM: gtc.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00036_source.html b/doc/html/a00036_source.html new file mode 100644 index 00000000..f91e1b41 --- /dev/null +++ b/doc/html/a00036_source.html @@ -0,0 +1,109 @@ + + + + +GLM: gtx.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00037_source.html b/doc/html/a00037_source.html new file mode 100644 index 00000000..d08ba5e7 --- /dev/null +++ b/doc/html/a00037_source.html @@ -0,0 +1,366 @@ + + + + +GLM: half_float.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00038_source.html b/doc/html/a00038_source.html new file mode 100644 index 00000000..da3ea92c --- /dev/null +++ b/doc/html/a00038_source.html @@ -0,0 +1,71 @@ + + + + +GLM: half_float.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00039_source.html b/doc/html/a00039_source.html new file mode 100644 index 00000000..97fea681 --- /dev/null +++ b/doc/html/a00039_source.html @@ -0,0 +1,73 @@ + + + + +GLM: handed_coordinate_space.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00040_source.html b/doc/html/a00040_source.html new file mode 100644 index 00000000..81d8bec5 --- /dev/null +++ b/doc/html/a00040_source.html @@ -0,0 +1,48 @@ + + + + +GLM: hint.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00041_source.html b/doc/html/a00041_source.html new file mode 100644 index 00000000..39c437f8 --- /dev/null +++ b/doc/html/a00041_source.html @@ -0,0 +1,44 @@ + + + + +GLM: img.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00042_source.html b/doc/html/a00042_source.html new file mode 100644 index 00000000..ccb3e24a --- /dev/null +++ b/doc/html/a00042_source.html @@ -0,0 +1,101 @@ + + + + +GLM: inertia.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00043_source.html b/doc/html/a00043_source.html new file mode 100644 index 00000000..6a5a8985 --- /dev/null +++ b/doc/html/a00043_source.html @@ -0,0 +1,70 @@ + + + + +GLM: integer.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00044_source.html b/doc/html/a00044_source.html new file mode 100644 index 00000000..5569baaf --- /dev/null +++ b/doc/html/a00044_source.html @@ -0,0 +1,91 @@ + + + + +GLM: intersect.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00045_source.html b/doc/html/a00045_source.html new file mode 100644 index 00000000..dfdca88f --- /dev/null +++ b/doc/html/a00045_source.html @@ -0,0 +1,87 @@ + + + + +GLM: intrinsic_common.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00046_source.html b/doc/html/a00046_source.html new file mode 100644 index 00000000..30329f9d --- /dev/null +++ b/doc/html/a00046_source.html @@ -0,0 +1,29 @@ + + + + +GLM: intrinsic_exponential.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00047_source.html b/doc/html/a00047_source.html new file mode 100644 index 00000000..502fc42f --- /dev/null +++ b/doc/html/a00047_source.html @@ -0,0 +1,72 @@ + + + + +GLM: intrinsic_geometric.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00048_source.html b/doc/html/a00048_source.html new file mode 100644 index 00000000..3b5339ca --- /dev/null +++ b/doc/html/a00048_source.html @@ -0,0 +1,63 @@ + + + + +GLM: intrinsic_matrix.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00049_source.html b/doc/html/a00049_source.html new file mode 100644 index 00000000..2fb3a287 --- /dev/null +++ b/doc/html/a00049_source.html @@ -0,0 +1,29 @@ + + + + +GLM: intrinsic_trigonometric.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00050_source.html b/doc/html/a00050_source.html new file mode 100644 index 00000000..a1f4b5b9 --- /dev/null +++ b/doc/html/a00050_source.html @@ -0,0 +1,45 @@ + + + + +GLM: intrinsic_vector_relational.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00051_source.html b/doc/html/a00051_source.html new file mode 100644 index 00000000..7961e859 --- /dev/null +++ b/doc/html/a00051_source.html @@ -0,0 +1,66 @@ + + + + +GLM: inverse.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00052_source.html b/doc/html/a00052_source.html new file mode 100644 index 00000000..4ff847c9 --- /dev/null +++ b/doc/html/a00052_source.html @@ -0,0 +1,65 @@ + + + + +GLM: inverse_transpose.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00053_source.html b/doc/html/a00053_source.html new file mode 100644 index 00000000..5fd7df16 --- /dev/null +++ b/doc/html/a00053_source.html @@ -0,0 +1,70 @@ + + + + +GLM: log_base.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00054_source.html b/doc/html/a00054_source.html new file mode 100644 index 00000000..5c60e3c0 --- /dev/null +++ b/doc/html/a00054_source.html @@ -0,0 +1,29 @@ + + + + +GLM: matrix_access.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00055_source.html b/doc/html/a00055_source.html new file mode 100644 index 00000000..2f53489f --- /dev/null +++ b/doc/html/a00055_source.html @@ -0,0 +1,72 @@ + + + + +GLM: matrix_access.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00056_source.html b/doc/html/a00056_source.html new file mode 100644 index 00000000..bf2c768c --- /dev/null +++ b/doc/html/a00056_source.html @@ -0,0 +1,73 @@ + + + + +GLM: matrix_cross_product.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00057_source.html b/doc/html/a00057_source.html new file mode 100644 index 00000000..36b81d96 --- /dev/null +++ b/doc/html/a00057_source.html @@ -0,0 +1,121 @@ + + + + +GLM: matrix_major_storage.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00058_source.html b/doc/html/a00058_source.html new file mode 100644 index 00000000..7d74d6bb --- /dev/null +++ b/doc/html/a00058_source.html @@ -0,0 +1,61 @@ + + + + +GLM: matrix_operation.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00059_source.html b/doc/html/a00059_source.html new file mode 100644 index 00000000..a8b548f9 --- /dev/null +++ b/doc/html/a00059_source.html @@ -0,0 +1,101 @@ + + + + +GLM: matrix_operation.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00060_source.html b/doc/html/a00060_source.html new file mode 100644 index 00000000..2e79976a --- /dev/null +++ b/doc/html/a00060_source.html @@ -0,0 +1,115 @@ + + + + +GLM: matrix_projection.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00061_source.html b/doc/html/a00061_source.html new file mode 100644 index 00000000..1fda8b5a --- /dev/null +++ b/doc/html/a00061_source.html @@ -0,0 +1,83 @@ + + + + +GLM: matrix_projection.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00062_source.html b/doc/html/a00062_source.html new file mode 100644 index 00000000..eca5d4ec --- /dev/null +++ b/doc/html/a00062_source.html @@ -0,0 +1,107 @@ + + + + +GLM: matrix_query.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00063_source.html b/doc/html/a00063_source.html new file mode 100644 index 00000000..2d6caee2 --- /dev/null +++ b/doc/html/a00063_source.html @@ -0,0 +1,95 @@ + + + + +GLM: matrix_selection.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00064_source.html b/doc/html/a00064_source.html new file mode 100644 index 00000000..91a06e65 --- /dev/null +++ b/doc/html/a00064_source.html @@ -0,0 +1,85 @@ + + + + +GLM: matrix_transform.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00065_source.html b/doc/html/a00065_source.html new file mode 100644 index 00000000..ca053071 --- /dev/null +++ b/doc/html/a00065_source.html @@ -0,0 +1,207 @@ + + + + +GLM: matx.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00066_source.html b/doc/html/a00066_source.html new file mode 100644 index 00000000..d41402f3 --- /dev/null +++ b/doc/html/a00066_source.html @@ -0,0 +1,70 @@ + + + + +GLM: mixed_product.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00067_source.html b/doc/html/a00067_source.html new file mode 100644 index 00000000..c03b1326 --- /dev/null +++ b/doc/html/a00067_source.html @@ -0,0 +1,76 @@ + + + + +GLM: multiple.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00068_source.html b/doc/html/a00068_source.html new file mode 100644 index 00000000..5ff0cb02 --- /dev/null +++ b/doc/html/a00068_source.html @@ -0,0 +1,140 @@ + + + + +GLM: norm.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00069_source.html b/doc/html/a00069_source.html new file mode 100644 index 00000000..bc789420 --- /dev/null +++ b/doc/html/a00069_source.html @@ -0,0 +1,71 @@ + + + + +GLM: normal.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00070_source.html b/doc/html/a00070_source.html new file mode 100644 index 00000000..f1d19ed5 --- /dev/null +++ b/doc/html/a00070_source.html @@ -0,0 +1,73 @@ + + + + +GLM: normalize_dot.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00071_source.html b/doc/html/a00071_source.html new file mode 100644 index 00000000..9526c083 --- /dev/null +++ b/doc/html/a00071_source.html @@ -0,0 +1,87 @@ + + + + +GLM: number_precision.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00072_source.html b/doc/html/a00072_source.html new file mode 100644 index 00000000..23befbbc --- /dev/null +++ b/doc/html/a00072_source.html @@ -0,0 +1,130 @@ + + + + +GLM: ocl_type.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00073_source.html b/doc/html/a00073_source.html new file mode 100644 index 00000000..57ecd450 --- /dev/null +++ b/doc/html/a00073_source.html @@ -0,0 +1,82 @@ + + + + +GLM: optimum_pow.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00074_source.html b/doc/html/a00074_source.html new file mode 100644 index 00000000..1cc9902b --- /dev/null +++ b/doc/html/a00074_source.html @@ -0,0 +1,74 @@ + + + + +GLM: orthonormalize.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00075_source.html b/doc/html/a00075_source.html new file mode 100644 index 00000000..a20a5841 --- /dev/null +++ b/doc/html/a00075_source.html @@ -0,0 +1,82 @@ + + + + +GLM: perpendicular.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00076_source.html b/doc/html/a00076_source.html new file mode 100644 index 00000000..ea540476 --- /dev/null +++ b/doc/html/a00076_source.html @@ -0,0 +1,67 @@ + + + + +GLM: polar_coordinates.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00077_source.html b/doc/html/a00077_source.html new file mode 100644 index 00000000..668c4e4d --- /dev/null +++ b/doc/html/a00077_source.html @@ -0,0 +1,80 @@ + + + + +GLM: projection.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00078_source.html b/doc/html/a00078_source.html new file mode 100644 index 00000000..98b8e358 --- /dev/null +++ b/doc/html/a00078_source.html @@ -0,0 +1,193 @@ + + + + +GLM: quaternion.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00079_source.html b/doc/html/a00079_source.html new file mode 100644 index 00000000..6db2253f --- /dev/null +++ b/doc/html/a00079_source.html @@ -0,0 +1,175 @@ + + + + +GLM: quaternion.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00080_source.html b/doc/html/a00080_source.html new file mode 100644 index 00000000..52075cc4 --- /dev/null +++ b/doc/html/a00080_source.html @@ -0,0 +1,108 @@ + + + + +GLM: random.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00081_source.html b/doc/html/a00081_source.html new file mode 100644 index 00000000..2ef9bc8d --- /dev/null +++ b/doc/html/a00081_source.html @@ -0,0 +1,70 @@ + + + + +GLM: raw_data.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00082_source.html b/doc/html/a00082_source.html new file mode 100644 index 00000000..d2e4996a --- /dev/null +++ b/doc/html/a00082_source.html @@ -0,0 +1,99 @@ + + + + +GLM: reciprocal.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00083_source.html b/doc/html/a00083_source.html new file mode 100644 index 00000000..7b38c985 --- /dev/null +++ b/doc/html/a00083_source.html @@ -0,0 +1,115 @@ + + + + +GLM: rotate_vector.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00084_source.html b/doc/html/a00084_source.html new file mode 100644 index 00000000..2748783d --- /dev/null +++ b/doc/html/a00084_source.html @@ -0,0 +1,376 @@ + + + + +GLM: setup.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00085_source.html b/doc/html/a00085_source.html new file mode 100644 index 00000000..29d234ee --- /dev/null +++ b/doc/html/a00085_source.html @@ -0,0 +1,29 @@ + + + + +GLM: simd_common.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00086_source.html b/doc/html/a00086_source.html new file mode 100644 index 00000000..91a027f3 --- /dev/null +++ b/doc/html/a00086_source.html @@ -0,0 +1,29 @@ + + + + +GLM: simd_geometric.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00087_source.html b/doc/html/a00087_source.html new file mode 100644 index 00000000..2044f649 --- /dev/null +++ b/doc/html/a00087_source.html @@ -0,0 +1,168 @@ + + + + +GLM: simd_mat4.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00088_source.html b/doc/html/a00088_source.html new file mode 100644 index 00000000..3b4b63da --- /dev/null +++ b/doc/html/a00088_source.html @@ -0,0 +1,145 @@ + + + + +GLM: simd_vec4.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00089_source.html b/doc/html/a00089_source.html new file mode 100644 index 00000000..41698625 --- /dev/null +++ b/doc/html/a00089_source.html @@ -0,0 +1,87 @@ + + + + +GLM: spline.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00090_source.html b/doc/html/a00090_source.html new file mode 100644 index 00000000..2d1ac45a --- /dev/null +++ b/doc/html/a00090_source.html @@ -0,0 +1,95 @@ + + + + +GLM: statistics_operation.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00091_source.html b/doc/html/a00091_source.html new file mode 100644 index 00000000..2b71394f --- /dev/null +++ b/doc/html/a00091_source.html @@ -0,0 +1,102 @@ + + + + +GLM: std_based_type.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00092_source.html b/doc/html/a00092_source.html new file mode 100644 index 00000000..27d8f384 --- /dev/null +++ b/doc/html/a00092_source.html @@ -0,0 +1,84 @@ + + + + +GLM: string_cast.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00093_source.html b/doc/html/a00093_source.html new file mode 100644 index 00000000..86ae3a93 --- /dev/null +++ b/doc/html/a00093_source.html @@ -0,0 +1,111 @@ + + + + +GLM: transform.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00094_source.html b/doc/html/a00094_source.html new file mode 100644 index 00000000..a8d8b39c --- /dev/null +++ b/doc/html/a00094_source.html @@ -0,0 +1,132 @@ + + + + +GLM: transform2.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00095_source.html b/doc/html/a00095_source.html new file mode 100644 index 00000000..acdc93f3 --- /dev/null +++ b/doc/html/a00095_source.html @@ -0,0 +1,61 @@ + + + + +GLM: type.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00096_source.html b/doc/html/a00096_source.html new file mode 100644 index 00000000..e8a0325e --- /dev/null +++ b/doc/html/a00096_source.html @@ -0,0 +1,92 @@ + + + + +GLM: type_float.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00097_source.html b/doc/html/a00097_source.html new file mode 100644 index 00000000..0b105102 --- /dev/null +++ b/doc/html/a00097_source.html @@ -0,0 +1,116 @@ + + + + +GLM: type_gentype.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00098_source.html b/doc/html/a00098_source.html new file mode 100644 index 00000000..49694d14 --- /dev/null +++ b/doc/html/a00098_source.html @@ -0,0 +1,112 @@ + + + + +GLM: type_half.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00099_source.html b/doc/html/a00099_source.html new file mode 100644 index 00000000..a2b4962d --- /dev/null +++ b/doc/html/a00099_source.html @@ -0,0 +1,136 @@ + + + + +GLM: type_int.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00100_source.html b/doc/html/a00100_source.html new file mode 100644 index 00000000..d7a8846b --- /dev/null +++ b/doc/html/a00100_source.html @@ -0,0 +1,233 @@ + + + + +GLM: type_mat2x2.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00101_source.html b/doc/html/a00101_source.html new file mode 100644 index 00000000..4896c107 --- /dev/null +++ b/doc/html/a00101_source.html @@ -0,0 +1,227 @@ + + + + +GLM: type_mat2x3.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00102_source.html b/doc/html/a00102_source.html new file mode 100644 index 00000000..ccc7dac2 --- /dev/null +++ b/doc/html/a00102_source.html @@ -0,0 +1,223 @@ + + + + +GLM: type_mat2x4.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00103_source.html b/doc/html/a00103_source.html new file mode 100644 index 00000000..8d53f31e --- /dev/null +++ b/doc/html/a00103_source.html @@ -0,0 +1,224 @@ + + + + +GLM: type_mat3x2.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00104_source.html b/doc/html/a00104_source.html new file mode 100644 index 00000000..0a30b71d --- /dev/null +++ b/doc/html/a00104_source.html @@ -0,0 +1,232 @@ + + + + +GLM: type_mat3x3.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00105_source.html b/doc/html/a00105_source.html new file mode 100644 index 00000000..4891f42c --- /dev/null +++ b/doc/html/a00105_source.html @@ -0,0 +1,224 @@ + + + + +GLM: type_mat3x4.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00106_source.html b/doc/html/a00106_source.html new file mode 100644 index 00000000..30603229 --- /dev/null +++ b/doc/html/a00106_source.html @@ -0,0 +1,226 @@ + + + + +GLM: type_mat4x2.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00107_source.html b/doc/html/a00107_source.html new file mode 100644 index 00000000..d8920d71 --- /dev/null +++ b/doc/html/a00107_source.html @@ -0,0 +1,231 @@ + + + + +GLM: type_mat4x3.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00108_source.html b/doc/html/a00108_source.html new file mode 100644 index 00000000..3bcb5dfe --- /dev/null +++ b/doc/html/a00108_source.html @@ -0,0 +1,237 @@ + + + + +GLM: type_mat4x4.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00109_source.html b/doc/html/a00109_source.html new file mode 100644 index 00000000..a3ef6430 --- /dev/null +++ b/doc/html/a00109_source.html @@ -0,0 +1,223 @@ + + + + +GLM: type_precision.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00110_source.html b/doc/html/a00110_source.html new file mode 100644 index 00000000..e5dc734e --- /dev/null +++ b/doc/html/a00110_source.html @@ -0,0 +1,210 @@ + + + + +GLM: type_ptr.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00111_source.html b/doc/html/a00111_source.html new file mode 100644 index 00000000..ed9c7dfb --- /dev/null +++ b/doc/html/a00111_source.html @@ -0,0 +1,56 @@ + + + + +GLM: type_size.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00112_source.html b/doc/html/a00112_source.html new file mode 100644 index 00000000..99fdf12b --- /dev/null +++ b/doc/html/a00112_source.html @@ -0,0 +1,261 @@ + + + + +GLM: type_vec1.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00113_source.html b/doc/html/a00113_source.html new file mode 100644 index 00000000..4d93651c --- /dev/null +++ b/doc/html/a00113_source.html @@ -0,0 +1,282 @@ + + + + +GLM: type_vec2.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00114_source.html b/doc/html/a00114_source.html new file mode 100644 index 00000000..441a6b09 --- /dev/null +++ b/doc/html/a00114_source.html @@ -0,0 +1,280 @@ + + + + +GLM: type_vec3.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00115_source.html b/doc/html/a00115_source.html new file mode 100644 index 00000000..39216b3a --- /dev/null +++ b/doc/html/a00115_source.html @@ -0,0 +1,290 @@ + + + + +GLM: type_vec4.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00116_source.html b/doc/html/a00116_source.html new file mode 100644 index 00000000..7cf2d8c9 --- /dev/null +++ b/doc/html/a00116_source.html @@ -0,0 +1,75 @@ + + + + +GLM: unsigned_int.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00117_source.html b/doc/html/a00117_source.html new file mode 100644 index 00000000..a01eae98 --- /dev/null +++ b/doc/html/a00117_source.html @@ -0,0 +1,86 @@ + + + + +GLM: vector_access.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00118_source.html b/doc/html/a00118_source.html new file mode 100644 index 00000000..2daa0c84 --- /dev/null +++ b/doc/html/a00118_source.html @@ -0,0 +1,84 @@ + + + + +GLM: vector_angle.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00119_source.html b/doc/html/a00119_source.html new file mode 100644 index 00000000..1c7407ee --- /dev/null +++ b/doc/html/a00119_source.html @@ -0,0 +1,107 @@ + + + + +GLM: vector_query.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00120_source.html b/doc/html/a00120_source.html new file mode 100644 index 00000000..4852de31 --- /dev/null +++ b/doc/html/a00120_source.html @@ -0,0 +1,243 @@ + + + + +GLM: vecx.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00121_source.html b/doc/html/a00121_source.html new file mode 100644 index 00000000..17b5e8dd --- /dev/null +++ b/doc/html/a00121_source.html @@ -0,0 +1,79 @@ + + + + +GLM: verbose_operator.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00122_source.html b/doc/html/a00122_source.html new file mode 100644 index 00000000..54c35dd2 --- /dev/null +++ b/doc/html/a00122_source.html @@ -0,0 +1,55 @@ + + + + +GLM: virtrev.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00123_source.html b/doc/html/a00123_source.html new file mode 100644 index 00000000..28703e88 --- /dev/null +++ b/doc/html/a00123_source.html @@ -0,0 +1,171 @@ + + + + +GLM: xstream.hpp Source File + + + + + + +
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00124.html b/doc/html/a00124.html new file mode 100644 index 00000000..4900c6bf --- /dev/null +++ b/doc/html/a00124.html @@ -0,0 +1,60 @@ + + + + +GLM: glm Namespace Reference + + + + + + +
+

glm Namespace Reference

+

GLM namespace, it contains all GLSL based features. +More...

+ + + + +

+

+ + +

+

+ + +

+

+ + +

+

+

Namespaces

namespace  core
 

GLM core. Namespace that includes all the feature define by GLSL 1.30.8 specification. This namespace is included in glm namespace.

+
namespace  gtc
 

GLM stable extensions.

+
namespace  gtx
 

GLM experimental extensions. The interface could change between releases.

+
namespace  img
 

IMG extensions.

+
+

Detailed Description

+

GLM namespace, it contains all GLSL based features.

+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00125.html b/doc/html/a00125.html new file mode 100644 index 00000000..bae25ab5 --- /dev/null +++ b/doc/html/a00125.html @@ -0,0 +1,52 @@ + + + + +GLM: glm::core Namespace Reference + + + + + + +
+

glm::core Namespace Reference

+

GLM core. Namespace that includes all the feature define by GLSL 1.30.8 specification. This namespace is included in glm namespace. +More...

+ + + + +

+

+ + +

+

+

Namespaces

namespace  function
 

Some of the functions defined in section 8 Built-in Functions of GLSL 1.30.8 specification.

+
namespace  type
 

Scalar, vectors and matrices from section 4.1.2 Booleans, 4.1.3 Integers section, 4.1.4 Floats section, 4.1.5 Vectors and section 4.1.6 Matrices of GLSL 1.30.8 specification.

+
+

Detailed Description

+

GLM core. Namespace that includes all the feature define by GLSL 1.30.8 specification. This namespace is included in glm namespace.

+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00126.html b/doc/html/a00126.html new file mode 100644 index 00000000..a016af69 --- /dev/null +++ b/doc/html/a00126.html @@ -0,0 +1,73 @@ + + + + +GLM: glm::core::function Namespace Reference + + + + + + +
+

glm::core::function Namespace Reference

+

Some of the functions defined in section 8 Built-in Functions of GLSL 1.30.8 specification. +More...

+ + + + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+

Namespaces

namespace  common
 

Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace.

+
namespace  exponential
 

Define all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace.

+
namespace  geometric
 

Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace.

+
namespace  matrix
 

Define all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace.

+
namespace  trigonometric
 

Define Angle and trigonometry functions from Section 8.1 of GLSL 1.30.8 specification.

+
namespace  vector_relational
 

Define vector relational functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace.

+
+

Detailed Description

+

Some of the functions defined in section 8 Built-in Functions of GLSL 1.30.8 specification.

+

Angle and trigonometry, exponential, common, geometric, matrix and vector relational functions.

+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00127.html b/doc/html/a00127.html new file mode 100644 index 00000000..f7d2eea0 --- /dev/null +++ b/doc/html/a00127.html @@ -0,0 +1,577 @@ + + + + +GLM: glm::core::function::common Namespace Reference + + + + + + +
+

glm::core::function::common Namespace Reference

+

Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename genFIType >
genFIType abs (genFIType const &x)
 Returns x if x >= 0; otherwise, it returns -x.
template<typename genType >
genType ceil (genType const &x)
 Returns a value equal to the nearest integer that is greater than or equal to x.
template<typename genUIFTypeT , typename genUIFTypeU >
genUIFTypeT clamp (genUIFTypeT const &x, genUIFTypeU const &minVal, genUIFTypeU const &maxVal)
 Returns min(max(x, minVal), maxVal) for each component in x.
template<typename genType >
genType floor (genType const &x)
 Returns a value equal to the nearest integer that is less then or equal to x.
template<typename genType >
genType fract (genType const &x)
 Return x - floor(x).
template<typename genType >
genType::bool_type isinf (genType const &x)
 Returns true if x holds a positive infinity or negative infinity representation in the underlying implementation's set of floating point representations.
template<typename genType >
genType::bool_type isnan (genType const &x)
 Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of floating point representations.
template<typename genUIFTypeT , typename genUIFTypeU >
genUIFTypeT max (genUIFTypeT const &x, genUIFTypeU const &y)
 Returns y if x < y; otherwise, it returns x.
template<typename genUIFTypeT , typename genUIFTypeU >
genUIFTypeT min (genUIFTypeT const &x, genUIFTypeU const &y)
 Returns y if y < x; otherwise, it returns x.
template<typename genTypeT , typename genTypeU >
genTypeT mix (genTypeT const &x, genTypeT const &y, genTypeU const &a)
template<typename genTypeT , typename genTypeU >
genTypeT mod (genTypeT const &x, genTypeU const &y)
 Modulus.
template<typename genType >
genType modf (genType const &x, genType &i)
 Returns the fractional part of x and sets i to the integer part (as a whole number floating point value).
template<typename genType >
genType round (genType const &x)
 Returns a value equal to the nearest integer to x.
template<typename genType >
genType roundEven (genType const &x)
 Returns a value equal to the nearest integer to x.
template<typename genFIType >
genFIType sign (genFIType const &x)
 Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0.
template<typename genTypeT , typename genTypeU >
genTypeU smoothstep (genTypeT const &edge0, genTypeT const &edge1, genTypeU const &x)
 Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x < edge1.
template<typename genTypeT , typename genTypeU >
genTypeU step (genTypeT const &edge, genTypeU const &x)
 Returns 0.0 if x < edge, otherwise it returns 1.0.
template<typename genType >
genType trunc (genType const &x)
 Returns a value equal to the nearest integer to x whose absolute value is not larger than the absolute value of x.
+

Detailed Description

+

Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace.

+

Function Documentation

+ +
+
+ + + + + + + + + +
genFIType glm::core::function::common::abs (genFIType const &  x ) 
+
+
+ +

Returns x if x >= 0; otherwise, it returns -x.

+

(From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::common::ceil (genType const &  x ) 
+
+
+ +

Returns a value equal to the nearest integer that is greater than or equal to x.

+

(From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
genUIFTypeT glm::core::function::common::clamp (genUIFTypeT const &  x,
genUIFTypeU const &  minVal,
genUIFTypeU const &  maxVal 
)
+
+
+ +

Returns min(max(x, minVal), maxVal) for each component in x.

+

using the floating-point values minVal and maxVal. (From GLSL 1.30.08 specification, section 8.3)

+ +

Referenced by glm::gtx::compatibility::saturate().

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::common::floor (genType const &  x ) 
+
+
+ +

Returns a value equal to the nearest integer that is less then or equal to x.

+

(From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::common::fract (genType const &  x ) 
+
+
+ +

Return x - floor(x).

+

(From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + +
genType::bool_type glm::core::function::common::isinf (genType const &  x ) 
+
+
+ +

Returns true if x holds a positive infinity or negative infinity representation in the underlying implementation's set of floating point representations.

+

Returns false otherwise, including for implementations with no infinity representations. (From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + +
genType::bool_type glm::core::function::common::isnan (genType const &  x ) 
+
+
+ +

Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of floating point representations.

+

Returns false otherwise, including for implementations with no NaN representations. (From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genUIFTypeT glm::core::function::common::max (genUIFTypeT const &  x,
genUIFTypeU const &  y 
)
+
+
+ +

Returns y if x < y; otherwise, it returns x.

+

(From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genUIFTypeT glm::core::function::common::min (genUIFTypeT const &  x,
genUIFTypeU const &  y 
)
+
+
+ +

Returns y if y < x; otherwise, it returns x.

+

(From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
genTypeT glm::core::function::common::mix (genTypeT const &  x,
genTypeT const &  y,
genTypeU const &  a 
)
+
+
+
Returns:
If genTypeU is a floating scalar or vector: Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1].
+
+If genTypeU is a boolean scalar or vector: Selects which vector each returned component comes from. For a component of a that is false, the corresponding component of x is returned. For a component of a that is true, the corresponding component of y is returned. Components of x and y that are not selected are allowed to be invalid floating point values and will have no effect on the results. Thus, this provides different functionality than genType mix(genType x, genType y, genType(a)) where a is a Boolean vector.
+

From GLSL 1.30.08 specification, section 8.3

+
Parameters:
+ + + + +
[in] x Floating point scalar or vector.
[in] y Floating point scalar or vector.
[in] a Floating point or boolean scalar or vector.
+
+
+ +

Referenced by glm::gtx::compatibility::lerp().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genTypeT glm::core::function::common::mod (genTypeT const &  x,
genTypeU const &  y 
)
+
+
+ +

Modulus.

+

Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genType glm::core::function::common::modf (genType const &  x,
genType &  i 
)
+
+
+ +

Returns the fractional part of x and sets i to the integer part (as a whole number floating point value).

+

Both the return value and the output parameter will have the same sign as x. (From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::common::round (genType const &  x ) 
+
+
+ +

Returns a value equal to the nearest integer to x.

+

The fraction 0.5 will round in a direction chosen by the implementation, presumably the direction that is fastest. This includes the possibility that round(x) returns the same value as roundEven(x) for all values of x. (From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::common::roundEven (genType const &  x ) 
+
+
+ +

Returns a value equal to the nearest integer to x.

+

A fractional part of 0.5 will round toward the nearest even integer. (Both 3.5 and 4.5 for x will return 4.0.) (From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + +
genFIType glm::core::function::common::sign (genFIType const &  x ) 
+
+
+ +

Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0.

+

(From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
genTypeU glm::core::function::common::smoothstep (genTypeT const &  edge0,
genTypeT const &  edge1,
genTypeU const &  x 
)
+
+
+ +

Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x < edge1.

+

This is useful in cases where you would want a threshold function with a smooth transition. This is equivalent to: genType t; t = clamp ((x – edge0) / (edge1 – edge0), 0, 1); return t * t * (3 – 2 * t); Results are undefined if edge0 >= edge1. (From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genTypeU glm::core::function::common::step (genTypeT const &  edge,
genTypeU const &  x 
)
+
+
+ +

Returns 0.0 if x < edge, otherwise it returns 1.0.

+

(From GLSL 1.30.08 specification, section 8.3)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::common::trunc (genType const &  x ) 
+
+
+ +

Returns a value equal to the nearest integer to x whose absolute value is not larger than the absolute value of x.

+

(From GLSL 1.30.08 specification, section 8.3)

+ +
+
+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00128.html b/doc/html/a00128.html new file mode 100644 index 00000000..eb77adf6 --- /dev/null +++ b/doc/html/a00128.html @@ -0,0 +1,220 @@ + + + + +GLM: glm::core::function::exponential Namespace Reference + + + + + + +
+

glm::core::function::exponential Namespace Reference

+

Define all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace. +More...

+ + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename genType >
genType exp (genType const &x)
 Returns the natural exponentiation of x, i.e., e^x.
template<typename genType >
genType exp2 (genType const &x)
 Returns 2 raised to the x power.
template<typename genType >
genType inversesqrt (genType const &x)
 Returns the reciprocal of the positive square root of x.
template<typename genType >
genType log (genType const &x)
 Returns the natural logarithm of x, i.e., returns the value y which satisfies the equation x = e^y.
template<typename genType >
genType log2 (genType const &x)
 Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y.
template<typename genType >
genType pow (genType const &x, genType const &y)
 Returns x raised to the y power.
template<typename genType >
genType sqrt (genType const &x)
 Returns the positive square root of x.
+

Detailed Description

+

Define all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace.

+

Function Documentation

+ +
+
+ + + + + + + + + +
genType glm::core::function::exponential::exp (genType const &  x ) 
+
+
+ +

Returns the natural exponentiation of x, i.e., e^x.

+

(From GLSL 1.30.08 specification, section 8.2)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::exponential::exp2 (genType const &  x ) 
+
+
+ +

Returns 2 raised to the x power.

+

(From GLSL 1.30.08 specification, section 8.2)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::exponential::inversesqrt (genType const &  x ) 
+
+
+ +

Returns the reciprocal of the positive square root of x.

+

(From GLSL 1.30.08 specification, section 8.2)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::exponential::log (genType const &  x ) 
+
+
+ +

Returns the natural logarithm of x, i.e., returns the value y which satisfies the equation x = e^y.

+

Results are undefined if x <= 0. (From GLSL 1.30.08 specification, section 8.2)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::exponential::log2 (genType const &  x ) 
+
+
+ +

Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y.

+

(From GLSL 1.30.08 specification, section 8.2)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genType glm::core::function::exponential::pow (genType const &  x,
genType const &  y 
)
+
+
+ +

Returns x raised to the y power.

+

(From GLSL 1.30.08 specification, section 8.2)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::exponential::sqrt (genType const &  x ) 
+
+
+ +

Returns the positive square root of x.

+

(From GLSL 1.30.08 specification, section 8.2)

+ +
+
+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00129.html b/doc/html/a00129.html new file mode 100644 index 00000000..2e4eca0c --- /dev/null +++ b/doc/html/a00129.html @@ -0,0 +1,301 @@ + + + + +GLM: glm::core::function::geometric Namespace Reference + + + + + + +
+

glm::core::function::geometric Namespace Reference

+

Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename valType >
detail::tvec3< valType > cross (detail::tvec3< valType > const &x, detail::tvec3< valType > const &y)
 Returns the cross product of x and y.
template<typename genType >
genType::value_type distance (genType const &p0, genType const &p1)
 Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
template<typename genType >
genType::value_type dot (genType const &x, genType const &y)
 Returns the dot product of x and y, i.e., result = x * y.
template<typename genType >
genType faceforward (genType const &N, genType const &I, genType const &Nref)
 If dot(Nref, I) < 0.0, return N, otherwise, return -N.
template<typename genType >
genType::value_type length (genType const &x)
 Returns the length of x, i.e., sqrt(x * x).
template<typename genType >
genType normalize (genType const &x)
 Returns a vector in the same direction as x but with length of 1.
template<typename genType >
genType reflect (genType const &I, genType const &N)
 For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
template<typename genType >
genType refract (genType const &I, genType const &N, typename genType::value_type const &eta)
 For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector.
+

Detailed Description

+

Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<valType> glm::core::function::geometric::cross (detail::tvec3< valType > const &  x,
detail::tvec3< valType > const &  y 
)
+
+
+ +

Returns the cross product of x and y.

+

(From GLSL 1.30.08 specification, section 8.4)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genType::value_type glm::core::function::geometric::distance (genType const &  p0,
genType const &  p1 
)
+
+
+ +

Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).

+

(From GLSL 1.30.08 specification, section 8.4)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genType::value_type glm::core::function::geometric::dot (genType const &  x,
genType const &  y 
)
+
+
+ +

Returns the dot product of x and y, i.e., result = x * y.

+

(From GLSL 1.30.08 specification, section 8.4)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
genType glm::core::function::geometric::faceforward (genType const &  N,
genType const &  I,
genType const &  Nref 
)
+
+
+ +

If dot(Nref, I) < 0.0, return N, otherwise, return -N.

+

(From GLSL 1.30.08 specification, section 8.4)

+ +
+
+ +
+
+ + + + + + + + + +
genType::value_type glm::core::function::geometric::length (genType const &  x ) 
+
+
+ +

Returns the length of x, i.e., sqrt(x * x).

+

(From GLSL 1.30.08 specification, section 8.4)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::geometric::normalize (genType const &  x ) 
+
+
+ +

Returns a vector in the same direction as x but with length of 1.

+

(From GLSL 1.30.08 specification, section 8.4)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genType glm::core::function::geometric::reflect (genType const &  I,
genType const &  N 
)
+
+
+ +

For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N.

+

(From GLSL 1.30.08 specification, section 8.4)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
genType glm::core::function::geometric::refract (genType const &  I,
genType const &  N,
typename genType::value_type const &  eta 
)
+
+
+ +

For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector.

+

(From GLSL 1.30.08 specification, section 8.4)

+ +
+
+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00130.html b/doc/html/a00130.html new file mode 100644 index 00000000..551191ce --- /dev/null +++ b/doc/html/a00130.html @@ -0,0 +1,161 @@ + + + + +GLM: glm::core::function::matrix Namespace Reference + + + + + + +
+

glm::core::function::matrix Namespace Reference

+

Define all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace. +More...

+ + + + + + + + + + + + + + + + + +

Functions

template<typename genType >
genType::value_type determinant (genType const &m)
 Return the determinant of a matrix.
template<typename genType >
genType inverse (genType const &m)
 Return the inverse of a matrix.
template<typename matType >
matType matrixCompMult (matType const &x, matType const &y)
 Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j].
template<typename vecType , typename matType >
matType outerProduct (vecType const &c, vecType const &r)
 Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r.
+template<typename matType >
matType::transpose_type transpose (matType const &x)
 Returns the transposed matrix of x (From GLSL 1.30.08 specification, section 8.5).
+

Detailed Description

+

Define all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace.

+

Function Documentation

+ +
+
+ + + + + + + + + +
genType::value_type glm::core::function::matrix::determinant (genType const &  m ) 
+
+
+ +

Return the determinant of a matrix.

+

(From GLSL 1.50.09 specification, section 8.5). genType: mat2, mat3, mat4.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::matrix::inverse (genType const &  m ) 
+
+
+ +

Return the inverse of a matrix.

+

(From GLSL 1.40.07 specification, section 8.5). genType: mat2, mat3, mat4.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
matType glm::core::function::matrix::matrixCompMult (matType const &  x,
matType const &  y 
)
+
+
+ +

Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j].

+

(From GLSL 1.30.08 specification, section 8.5)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
matType glm::core::function::matrix::outerProduct (vecType const &  c,
vecType const &  r 
)
+
+
+ +

Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r.

+

(From GLSL 1.30.08 specification, section 8.5)

+ +
+
+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00132.html b/doc/html/a00132.html new file mode 100644 index 00000000..bf46ef97 --- /dev/null +++ b/doc/html/a00132.html @@ -0,0 +1,355 @@ + + + + +GLM: glm::core::function::trigonometric Namespace Reference + + + + + + +
+

glm::core::function::trigonometric Namespace Reference

+

Define Angle and trigonometry functions from Section 8.1 of GLSL 1.30.8 specification. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename genType >
genType acos (genType const &x)
 Arc cosine.
template<typename genType >
genType acosh (genType const &x)
 Arc hyperbolic cosine; returns the non-negative inverse of cosh.
template<typename genType >
genType asin (genType const &x)
 Arc sine.
template<typename genType >
genType asinh (genType const &x)
 Arc hyperbolic sine; returns the inverse of sinh.
template<typename genType >
genType atan (genType const &y_over_x)
 Arc tangent.
template<typename genType >
genType atan (genType const &y, genType const &x)
 Arc tangent.
template<typename genType >
genType atanh (genType const &x)
 Arc hyperbolic tangent; returns the inverse of tanh.
template<typename genType >
genType cos (genType const &angle)
 The standard trigonometric cosine function.
+template<typename genType >
genType cosh (genType const &angle)
 Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 (From GLSL 1.30.08 specification, section 8.1).
template<typename genType >
genType degrees (genType const &radians)
 Converts radians to degrees and returns the result.
template<typename genType >
genType radians (genType const &degrees)
 Converts degrees to radians and returns the result.
template<typename genType >
genType sin (genType const &angle)
 The standard trigonometric sine function.
+template<typename genType >
genType sinh (genType const &angle)
 Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 (From GLSL 1.30.08 specification, section 8.1).
template<typename genType >
genType tan (genType const &angle)
 The standard trigonometric tangent function.
+template<typename genType >
genType tanh (genType const &angle)
 Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) (From GLSL 1.30.08 specification, section 8.1).
+

Detailed Description

+

Define Angle and trigonometry functions from Section 8.1 of GLSL 1.30.8 specification.

+

Included in glm namespace.

+

Function Documentation

+ +
+
+ + + + + + + + + +
genType glm::core::function::trigonometric::acos (genType const &  x ) 
+
+
+ +

Arc cosine.

+

Returns an angle whose sine is x. The range of values returned by this function is [0, PI]. Results are undefined if |x| > 1. (From GLSL 1.30.08 specification, section 8.1)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::trigonometric::acosh (genType const &  x ) 
+
+
+ +

Arc hyperbolic cosine; returns the non-negative inverse of cosh.

+

Results are undefined if x < 1. (From GLSL 1.30.08 specification, section 8.1)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::trigonometric::asin (genType const &  x ) 
+
+
+ +

Arc sine.

+

Returns an angle whose sine is x. The range of values returned by this function is [-PI/2, PI/2]. Results are undefined if |x| > 1. (From GLSL 1.30.08 specification, section 8.1)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::trigonometric::asinh (genType const &  x ) 
+
+
+ +

Arc hyperbolic sine; returns the inverse of sinh.

+

(From GLSL 1.30.08 specification, section 8.1)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::trigonometric::atan (genType const &  y_over_x ) 
+
+
+ +

Arc tangent.

+

Returns an angle whose tangent is y_over_x. The range of values returned by this function is [-PI/2, PI/2]. (From GLSL 1.30.08 specification, section 8.1)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genType glm::core::function::trigonometric::atan (genType const &  y,
genType const &  x 
)
+
+
+ +

Arc tangent.

+

Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLSL 1.30.08 specification, section 8.1)

+ +

Referenced by glm::gtx::compatibility::atan2().

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::trigonometric::atanh (genType const &  x ) 
+
+
+ +

Arc hyperbolic tangent; returns the inverse of tanh.

+

Results are undefined if abs(x) >= 1. (From GLSL 1.30.08 specification, section 8.1)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::trigonometric::cos (genType const &  angle ) 
+
+
+ +

The standard trigonometric cosine function.

+

The values returned by this function will range from [-1, 1]. (From GLSL 1.30.08 specification, section 8.1)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::trigonometric::degrees (genType const &  radians ) 
+
+
+ +

Converts radians to degrees and returns the result.

+

(From GLSL 1.30.08 specification, section 8.1)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::trigonometric::radians (genType const &  degrees ) 
+
+
+ +

Converts degrees to radians and returns the result.

+

(From GLSL 1.30.08 specification, section 8.1)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::trigonometric::sin (genType const &  angle ) 
+
+
+ +

The standard trigonometric sine function.

+

The values returned by this function will range from [-1, 1]. (From GLSL 1.30.08 specification, section 8.1)

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::core::function::trigonometric::tan (genType const &  angle ) 
+
+
+ +

The standard trigonometric tangent function.

+

(From GLSL 1.30.08 specification, section 8.1)

+ +
+
+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00133.html b/doc/html/a00133.html new file mode 100644 index 00000000..d12d388f --- /dev/null +++ b/doc/html/a00133.html @@ -0,0 +1,313 @@ + + + + +GLM: glm::core::function::vector_relational Namespace Reference + + + + + + +
+

glm::core::function::vector_relational Namespace Reference

+

Define vector relational functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename vecType >
bool all (vecType const &x)
 Returns true if all components of x are true.
template<typename vecType >
bool any (vecType const &x)
 Returns true if any component of x is true.
template<typename vecType >
vecType::bool_type equal (vecType const &x, vecType const &y)
 Returns the component-wise compare of x == y.
template<typename vecType >
vecType::bool_type greaterThan (vecType const &x, vecType const &y)
 Returns the component-wise compare of x > y.
template<typename vecType >
vecType::bool_type greaterThanEqual (vecType const &x, vecType const &y)
 Returns the component-wise compare of x >= y.
template<typename vecType >
vecType::bool_type lessThan (vecType const &x, vecType const &y)
 Returns the component-wise compare of x < y.
template<typename vecType >
vecType::bool_type lessThanEqual (vecType const &x, vecType const &y)
 Returns the component-wise compare of x <= y.
template<typename vecType >
vecType::bool_type not_ (vecType const &x)
 Returns the component-wise logical complement of x.
template<typename vecType >
vecType::bool_type notEqual (vecType const &x, vecType const &y)
 Returns the component-wise compare of x != y.
+

Detailed Description

+

Define vector relational functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace.

+

Function Documentation

+ +
+
+ + + + + + + + + +
bool glm::core::function::vector_relational::all (vecType const &  x ) 
+
+
+ +

Returns true if all components of x are true.

+

(From GLSL 1.30.08 specification, section 8.6)

+ +
+
+ +
+
+ + + + + + + + + +
bool glm::core::function::vector_relational::any (vecType const &  x ) 
+
+
+ +

Returns true if any component of x is true.

+

(From GLSL 1.30.08 specification, section 8.6)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
vecType::bool_type glm::core::function::vector_relational::equal (vecType const &  x,
vecType const &  y 
)
+
+
+ +

Returns the component-wise compare of x == y.

+

(From GLSL 1.30.08 specification, section 8.6)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
vecType::bool_type glm::core::function::vector_relational::greaterThan (vecType const &  x,
vecType const &  y 
)
+
+
+ +

Returns the component-wise compare of x > y.

+

(From GLSL 1.30.08 specification, section 8.6)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
vecType::bool_type glm::core::function::vector_relational::greaterThanEqual (vecType const &  x,
vecType const &  y 
)
+
+
+ +

Returns the component-wise compare of x >= y.

+

(From GLSL 1.30.08 specification, section 8.6)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
vecType::bool_type glm::core::function::vector_relational::lessThan (vecType const &  x,
vecType const &  y 
)
+
+
+ +

Returns the component-wise compare of x < y.

+

(From GLSL 1.30.08 specification, section 8.6)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
vecType::bool_type glm::core::function::vector_relational::lessThanEqual (vecType const &  x,
vecType const &  y 
)
+
+
+ +

Returns the component-wise compare of x <= y.

+

(From GLSL 1.30.08 specification, section 8.6)

+ +
+
+ +
+
+ + + + + + + + + +
vecType::bool_type glm::core::function::vector_relational::not_ (vecType const &  x ) 
+
+
+ +

Returns the component-wise logical complement of x.

+

(From GLSL 1.30.08 specification, section 8.6)

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
vecType::bool_type glm::core::function::vector_relational::notEqual (vecType const &  x,
vecType const &  y 
)
+
+
+ +

Returns the component-wise compare of x != y.

+

(From GLSL 1.30.08 specification, section 8.6)

+ +
+
+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00134.html b/doc/html/a00134.html new file mode 100644 index 00000000..6367549d --- /dev/null +++ b/doc/html/a00134.html @@ -0,0 +1,58 @@ + + + + +GLM: glm::core::type Namespace Reference + + + + + + +
+

glm::core::type Namespace Reference

+

Scalar, vectors and matrices from section 4.1.2 Booleans, 4.1.3 Integers section, 4.1.4 Floats section, 4.1.5 Vectors and section 4.1.6 Matrices of GLSL 1.30.8 specification. +More...

+ + + + +

+

+ + +

+

+ + +

+

+

Namespaces

namespace  matrix
 

Matrix types from section 4.1.6 of GLSL 1.30.8 specification.

+
namespace  scalar
 

Scalar types from section 4.1.2 Booleans, 4.1.3 Integers and 4.1.4 Floats of GLSL 1.30.8 specification.

+
namespace  vector
 

Vector types from section 4.1.5 of GLSL 1.30.8 specification.

+
+

Detailed Description

+

Scalar, vectors and matrices from section 4.1.2 Booleans, 4.1.3 Integers section, 4.1.4 Floats section, 4.1.5 Vectors and section 4.1.6 Matrices of GLSL 1.30.8 specification.

+

This namespace resolves precision qualifier define in section 4.5 of GLSL 1.30.8 specification.

+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00135.html b/doc/html/a00135.html new file mode 100644 index 00000000..0bb5c2d0 --- /dev/null +++ b/doc/html/a00135.html @@ -0,0 +1,299 @@ + + + + +GLM: glm::core::type::matrix Namespace Reference + + + + + + +
+

glm::core::type::matrix Namespace Reference

+

Matrix types from section 4.1.6 of GLSL 1.30.8 specification. +More...

+ + + + +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +

Namespaces

namespace  precision
 

Matrix types with precision qualifier.

+

Typedefs

typedef mat2x2 mat2
 2 columns of 2 components matrix of floating-point numbers.
typedef detail::tmat2x2
+< mediump_float > 
mat2x2
 2 columns of 2 components matrix of floating-point numbers.
typedef detail::tmat2x3
+< mediump_float > 
mat2x3
 2 columns of 3 components matrix of floating-point numbers.
typedef detail::tmat2x4
+< mediump_float > 
mat2x4
 2 columns of 4 components matrix of floating-point numbers.
typedef mat3x3 mat3
 3 columns of 3 components matrix of floating-point numbers.
typedef detail::tmat3x2
+< mediump_float > 
mat3x2
 3 columns of 2 components matrix of floating-point numbers.
typedef detail::tmat3x3
+< mediump_float > 
mat3x3
 3 columns of 3 components matrix of floating-point numbers.
typedef detail::tmat3x4
+< mediump_float > 
mat3x4
 3 columns of 4 components matrix of floating-point numbers.
typedef mat4x4 mat4
 4 columns of 4 components matrix of floating-point numbers.
typedef detail::tmat4x2
+< mediump_float > 
mat4x2
 4 columns of 2 components matrix of floating-point numbers.
typedef detail::tmat4x3
+< mediump_float > 
mat4x3
 4 columns of 3 components matrix of floating-point numbers.
typedef detail::tmat4x4
+< mediump_float > 
mat4x4
 4 columns of 4 components matrix of floating-point numbers.
+

Detailed Description

+

Matrix types from section 4.1.6 of GLSL 1.30.8 specification.

+

This namespace is included in glm namespace.

+

Typedef Documentation

+ +
+
+ + + + +
typedef mat2x2 mat2
+
+
+ +

2 columns of 2 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 212 of file type_mat2x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x2<mediump_float> mat2x2
+
+
+ +

2 columns of 2 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 199 of file type_mat2x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x3<mediump_float> mat2x3
+
+
+ +

2 columns of 3 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 194 of file type_mat2x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x4<mediump_float> mat2x4
+
+
+ +

2 columns of 4 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 190 of file type_mat2x4.hpp.

+ +
+
+ +
+
+ + + + +
typedef mat3x3 mat3
+
+
+ +

3 columns of 3 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 210 of file type_mat3x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x2<mediump_float> mat3x2
+
+
+ +

3 columns of 2 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 191 of file type_mat3x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x3<mediump_float> mat3x3
+
+
+ +

3 columns of 3 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 197 of file type_mat3x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x4<mediump_float> mat3x4
+
+
+ +

3 columns of 4 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 191 of file type_mat3x4.hpp.

+ +
+
+ +
+
+ + + + +
typedef mat4x4 mat4
+
+
+ +

4 columns of 4 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 215 of file type_mat4x4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x2<mediump_float> mat4x2
+
+
+ +

4 columns of 2 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 193 of file type_mat4x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x3<mediump_float> mat4x3
+
+
+ +

4 columns of 3 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 198 of file type_mat4x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x4<mediump_float> mat4x4
+
+
+ +

4 columns of 4 components matrix of floating-point numbers.

+

(From GLSL 1.30.8 specification, section 4.1.6 Matrices)

+ +

Definition at line 202 of file type_mat4x4.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00136.html b/doc/html/a00136.html new file mode 100644 index 00000000..aefe65fd --- /dev/null +++ b/doc/html/a00136.html @@ -0,0 +1,611 @@ + + + + +GLM: glm::core::type::matrix::precision Namespace Reference + + + + + + +
+

glm::core::type::matrix::precision Namespace Reference

+

Matrix types with precision qualifier. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Typedefs

typedef detail::tmat2x2
+< highp_float > 
highp_mat2x2
 2 columns of 2 components matrix of high precision floating-point numbers.
typedef detail::tmat2x3
+< highp_float > 
highp_mat2x3
 2 columns of 3 components matrix of high precision floating-point numbers.
typedef detail::tmat2x4
+< highp_float > 
highp_mat2x4
 2 columns of 4 components matrix of high precision floating-point numbers.
typedef detail::tmat3x2
+< highp_float > 
highp_mat3x2
 3 columns of 2 components matrix of high precision floating-point numbers.
typedef detail::tmat3x3
+< highp_float > 
highp_mat3x3
 3 columns of 3 components matrix of high precision floating-point numbers.
typedef detail::tmat3x4
+< highp_float > 
highp_mat3x4
 3 columns of 4 components matrix of high precision floating-point numbers.
typedef detail::tmat4x2
+< highp_float > 
highp_mat4x2
 4 columns of 2 components matrix of high precision floating-point numbers.
typedef detail::tmat4x3
+< highp_float > 
highp_mat4x3
 4 columns of 3 components matrix of high precision floating-point numbers.
typedef detail::tmat4x4
+< highp_float > 
highp_mat4x4
 4 columns of 4 components matrix of high precision floating-point numbers.
typedef detail::tmat2x2
+< lowp_float > 
lowp_mat2x2
 2 columns of 2 components matrix of low precision floating-point numbers.
typedef detail::tmat2x3
+< lowp_float > 
lowp_mat2x3
 2 columns of 3 components matrix of low precision floating-point numbers.
typedef detail::tmat2x4
+< lowp_float > 
lowp_mat2x4
 2 columns of 4 components matrix of low precision floating-point numbers.
typedef detail::tmat3x2
+< lowp_float > 
lowp_mat3x2
 3 columns of 2 components matrix of low precision floating-point numbers.
typedef detail::tmat3x3
+< lowp_float > 
lowp_mat3x3
 3 columns of 3 components matrix of low precision floating-point numbers.
typedef detail::tmat3x4
+< lowp_float > 
lowp_mat3x4
 3 columns of 4 components matrix of low precision floating-point numbers.
typedef detail::tmat4x2
+< lowp_float > 
lowp_mat4x2
 4 columns of 2 components matrix of low precision floating-point numbers.
typedef detail::tmat4x3
+< lowp_float > 
lowp_mat4x3
 4 columns of 3 components matrix of low precision floating-point numbers.
typedef detail::tmat4x4
+< lowp_float > 
lowp_mat4x4
 4 columns of 4 components matrix of low precision floating-point numbers.
typedef detail::tmat2x2
+< mediump_float > 
mediump_mat2x2
 2 columns of 2 components matrix of medium precision floating-point numbers.
typedef detail::tmat2x3
+< mediump_float > 
mediump_mat2x3
 2 columns of 3 components matrix of medium precision floating-point numbers.
typedef detail::tmat2x4
+< mediump_float > 
mediump_mat2x4
 2 columns of 4 components matrix of medium precision floating-point numbers.
typedef detail::tmat3x2
+< mediump_float > 
mediump_mat3x2
 3 columns of 2 components matrix of medium precision floating-point numbers.
typedef detail::tmat3x3
+< mediump_float > 
mediump_mat3x3
 3 columns of 3 components matrix of medium precision floating-point numbers.
typedef detail::tmat3x4
+< mediump_float > 
mediump_mat3x4
 3 columns of 4 components matrix of medium precision floating-point numbers.
typedef detail::tmat4x2
+< mediump_float > 
mediump_mat4x2
 4 columns of 2 components matrix of medium precision floating-point numbers.
typedef detail::tmat4x3
+< mediump_float > 
mediump_mat4x3
 4 columns of 3 components matrix of medium precision floating-point numbers.
typedef detail::tmat4x4
+< mediump_float > 
mediump_mat4x4
 4 columns of 4 components matrix of medium precision floating-point numbers.
+

Detailed Description

+

Matrix types with precision qualifier.

+

This namespace is included in glm namespace.

+

Typedef Documentation

+ +
+
+ + + + +
typedef detail::tmat2x2<highp_float> highp_mat2x2
+
+
+ +

2 columns of 2 components matrix of high precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 192 of file type_mat2x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x3<highp_float> highp_mat2x3
+
+
+ +

2 columns of 3 components matrix of high precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 187 of file type_mat2x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x4<highp_float> highp_mat2x4
+
+
+ +

2 columns of 4 components matrix of high precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 183 of file type_mat2x4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x2<highp_float> highp_mat3x2
+
+
+ +

3 columns of 2 components matrix of high precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 184 of file type_mat3x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x3<highp_float> highp_mat3x3
+
+
+ +

3 columns of 3 components matrix of high precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 190 of file type_mat3x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x4<highp_float> highp_mat3x4
+
+
+ +

3 columns of 4 components matrix of high precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 184 of file type_mat3x4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x2<highp_float> highp_mat4x2
+
+
+ +

4 columns of 2 components matrix of high precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 186 of file type_mat4x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x3<highp_float> highp_mat4x3
+
+
+ +

4 columns of 3 components matrix of high precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 191 of file type_mat4x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x4<highp_float> highp_mat4x4
+
+
+ +

4 columns of 4 components matrix of high precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 195 of file type_mat4x4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x2<lowp_float> lowp_mat2x2
+
+
+ +

2 columns of 2 components matrix of low precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 184 of file type_mat2x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x3<lowp_float> lowp_mat2x3
+
+
+ +

2 columns of 3 components matrix of low precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 179 of file type_mat2x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x4<lowp_float> lowp_mat2x4
+
+
+ +

2 columns of 4 components matrix of low precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 175 of file type_mat2x4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x2<lowp_float> lowp_mat3x2
+
+
+ +

3 columns of 2 components matrix of low precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 176 of file type_mat3x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x3<lowp_float> lowp_mat3x3
+
+
+ +

3 columns of 3 components matrix of low precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 182 of file type_mat3x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x4<lowp_float> lowp_mat3x4
+
+
+ +

3 columns of 4 components matrix of low precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 176 of file type_mat3x4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x2<lowp_float> lowp_mat4x2
+
+
+ +

4 columns of 2 components matrix of low precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 178 of file type_mat4x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x3<lowp_float> lowp_mat4x3
+
+
+ +

4 columns of 3 components matrix of low precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 183 of file type_mat4x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x4<lowp_float> lowp_mat4x4
+
+
+ +

4 columns of 4 components matrix of low precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 187 of file type_mat4x4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x2<mediump_float> mediump_mat2x2
+
+
+ +

2 columns of 2 components matrix of medium precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 188 of file type_mat2x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x3<mediump_float> mediump_mat2x3
+
+
+ +

2 columns of 3 components matrix of medium precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 183 of file type_mat2x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x4<mediump_float> mediump_mat2x4
+
+
+ +

2 columns of 4 components matrix of medium precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 179 of file type_mat2x4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x2<mediump_float> mediump_mat3x2
+
+
+ +

3 columns of 2 components matrix of medium precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 180 of file type_mat3x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x3<mediump_float> mediump_mat3x3
+
+
+ +

3 columns of 3 components matrix of medium precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 186 of file type_mat3x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x4<mediump_float> mediump_mat3x4
+
+
+ +

3 columns of 4 components matrix of medium precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 180 of file type_mat3x4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x2<mediump_float> mediump_mat4x2
+
+
+ +

4 columns of 2 components matrix of medium precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 182 of file type_mat4x2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x3<mediump_float> mediump_mat4x3
+
+
+ +

4 columns of 3 components matrix of medium precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 187 of file type_mat4x3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x4<mediump_float> mediump_mat4x4
+
+
+ +

4 columns of 4 components matrix of medium precision floating-point numbers.

+

There is no garanty on the actual precision. (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)

+ +

Definition at line 191 of file type_mat4x4.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00137.html b/doc/html/a00137.html new file mode 100644 index 00000000..4aad0652 --- /dev/null +++ b/doc/html/a00137.html @@ -0,0 +1,70 @@ + + + + +GLM: glm::core::type::scalar Namespace Reference + + + + + + +
+

glm::core::type::scalar Namespace Reference

+

Scalar types from section 4.1.2 Booleans, 4.1.3 Integers and 4.1.4 Floats of GLSL 1.30.8 specification. +More...

+ + + + +

+

+ + + +

Namespaces

namespace  precision
 

Scalar types with precision qualifier.

+

Typedefs

typedef uint_t uint
 Unsigned integer.
+

Detailed Description

+

Scalar types from section 4.1.2 Booleans, 4.1.3 Integers and 4.1.4 Floats of GLSL 1.30.8 specification.

+

This namespace is included in glm namespace.

+

Typedef Documentation

+ +
+
+ + + + +
typedef uint_t uint
+
+
+ +

Unsigned integer.

+

From GLSL 1.30.8 specification section 4.1.3 Integers.

+ +

Definition at line 122 of file type_int.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00138.html b/doc/html/a00138.html new file mode 100644 index 00000000..d738bf55 --- /dev/null +++ b/doc/html/a00138.html @@ -0,0 +1,224 @@ + + + + +GLM: glm::core::type::scalar::precision Namespace Reference + + + + + + +
+

glm::core::type::scalar::precision Namespace Reference

+

Scalar types with precision qualifier. +More...

+ + + + + + + + + + + + + + + + + + + + +

Typedefs

typedef highp_float_t highp_float
 High precision floating-point numbers.
typedef highp_int_t highp_int
 High precision signed integer.
typedef highp_uint_t highp_uint
 High precision unsigned integer.
typedef lowp_float_t lowp_float
 Low precision floating-point numbers.
typedef lowp_int_t lowp_int
 Low precision signed integer.
typedef lowp_uint_t lowp_uint
 Low precision unsigned integer.
typedef mediump_float_t mediump_float
 Medium precision floating-point numbers.
typedef mediump_int_t mediump_int
 Medium precision signed integer.
typedef mediump_uint_t mediump_uint
 Medium precision unsigned integer.
+

Detailed Description

+

Scalar types with precision qualifier.

+

This namespace is included in glm namespace.

+

Typedef Documentation

+ +
+
+ + + + +
typedef highp_float_t highp_float
+
+
+ +

High precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification

+ +

Definition at line 52 of file type_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef highp_int_t highp_int
+
+
+ +

High precision signed integer.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification.

+ +

Definition at line 77 of file type_int.hpp.

+ +
+
+ +
+
+ + + + +
typedef highp_uint_t highp_uint
+
+
+ +

High precision unsigned integer.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification.

+ +

Definition at line 90 of file type_int.hpp.

+ +
+
+ +
+
+ + + + +
typedef lowp_float_t lowp_float
+
+
+ +

Low precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification

+ +

Definition at line 44 of file type_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef lowp_int_t lowp_int
+
+
+ +

Low precision signed integer.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification.

+ +

Definition at line 69 of file type_int.hpp.

+ +
+
+ +
+
+ + + + +
typedef lowp_uint_t lowp_uint
+
+
+ +

Low precision unsigned integer.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification.

+ +

Definition at line 82 of file type_int.hpp.

+ +
+
+ +
+
+ + + + +
typedef mediump_float_t mediump_float
+
+
+ +

Medium precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification

+ +

Definition at line 48 of file type_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef mediump_int_t mediump_int
+
+
+ +

Medium precision signed integer.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification.

+ +

Definition at line 73 of file type_int.hpp.

+ +
+
+ +
+
+ + + + +
typedef mediump_uint_t mediump_uint
+
+
+ +

Medium precision unsigned integer.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification.

+ +

Definition at line 86 of file type_int.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00139.html b/doc/html/a00139.html new file mode 100644 index 00000000..96fba2ea --- /dev/null +++ b/doc/html/a00139.html @@ -0,0 +1,299 @@ + + + + +GLM: glm::core::type::vector Namespace Reference + + + + + + +
+

glm::core::type::vector Namespace Reference

+

Vector types from section 4.1.5 of GLSL 1.30.8 specification. +More...

+ + + + +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +

Namespaces

namespace  precision
 

Vector types with precision qualifier.

+

Typedefs

typedef detail::tvec2< bool > bvec2
 2 components vector of boolean.
typedef detail::tvec3< bool > bvec3
 3 components vector of boolean.
typedef detail::tvec4< bool > bvec4
 4 components vector of boolean.
typedef detail::tvec2
+< mediump_int > 
ivec2
 2 components vector of signed integer numbers.
typedef detail::tvec3
+< mediump_int > 
ivec3
 3 components vector of signed integer numbers.
typedef detail::tvec4
+< mediump_int > 
ivec4
 4 components vector of signed integer numbers.
typedef detail::tvec2
+< mediump_uint > 
uvec2
 2 components vector of unsigned integer numbers.
typedef detail::tvec3
+< mediump_uint > 
uvec3
 3 components vector of unsigned integer numbers.
typedef detail::tvec4
+< mediump_uint > 
uvec4
 4 components vector of unsigned integer numbers.
typedef detail::tvec2
+< mediump_float > 
vec2
 2 components vector of floating-point numbers.
typedef detail::tvec3
+< mediump_float > 
vec3
 3 components vector of floating-point numbers.
typedef detail::tvec4
+< mediump_float > 
vec4
 4 components vector of floating-point numbers.
+

Detailed Description

+

Vector types from section 4.1.5 of GLSL 1.30.8 specification.

+

This namespace is included in glm namespace.

+

Typedef Documentation

+ +
+
+ + + + +
typedef detail::tvec2<bool> bvec2
+
+
+ +

2 components vector of boolean.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 200 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<bool> bvec3
+
+
+ +

3 components vector of boolean.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 199 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<bool> bvec4
+
+
+ +

4 components vector of boolean.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 215 of file type_vec4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<mediump_int> ivec2
+
+
+ +

2 components vector of signed integer numbers.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 242 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<mediump_int> ivec3
+
+
+ +

3 components vector of signed integer numbers.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 241 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<mediump_int> ivec4
+
+
+ +

4 components vector of signed integer numbers.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 255 of file type_vec4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<mediump_uint> uvec2
+
+
+ +

2 components vector of unsigned integer numbers.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 276 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<mediump_uint> uvec3
+
+
+ +

3 components vector of unsigned integer numbers.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 275 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<mediump_uint> uvec4
+
+
+ +

4 components vector of unsigned integer numbers.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 287 of file type_vec4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<mediump_float> vec2
+
+
+ +

2 components vector of floating-point numbers.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 208 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<mediump_float> vec3
+
+
+ +

3 components vector of floating-point numbers.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 207 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<mediump_float> vec4
+
+
+ +

4 components vector of floating-point numbers.

+

From GLSL 1.30.8 specification, section 4.1.5 Vectors.

+ +

Definition at line 223 of file type_vec4.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00140.html b/doc/html/a00140.html new file mode 100644 index 00000000..305bdfdb --- /dev/null +++ b/doc/html/a00140.html @@ -0,0 +1,596 @@ + + + + +GLM: glm::core::type::vector::precision Namespace Reference + + + + + + +
+

glm::core::type::vector::precision Namespace Reference

+

Vector types with precision qualifier. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Typedefs

typedef detail::tvec2< highp_int > highp_ivec2
 2 components vector of high precision signed integer numbers.
typedef detail::tvec3< highp_int > highp_ivec3
 3 components vector of high precision signed integer numbers.
typedef detail::tvec4< highp_int > highp_ivec4
 4 components vector of high precision signed integer numbers.
typedef detail::tvec2< highp_uint > highp_uvec2
 2 components vector of high precision unsigned integer numbers.
typedef detail::tvec3< highp_uint > highp_uvec3
 3 components vector of high precision unsigned integer numbers.
typedef detail::tvec4< highp_uint > highp_uvec4
 4 components vector of high precision unsigned integer numbers.
typedef detail::tvec2
+< highp_float > 
highp_vec2
 2 components vector of high precision floating-point numbers.
typedef detail::tvec3
+< highp_float > 
highp_vec3
 3 components vector of high precision floating-point numbers.
typedef detail::tvec4
+< highp_float > 
highp_vec4
 4 components vector of high precision floating-point numbers.
typedef detail::tvec2< lowp_int > lowp_ivec2
 2 components vector of low precision signed integer numbers.
typedef detail::tvec3< lowp_int > lowp_ivec3
 3 components vector of low precision signed integer numbers.
typedef detail::tvec4< lowp_int > lowp_ivec4
 4 components vector of low precision signed integer numbers.
typedef detail::tvec2< lowp_uint > lowp_uvec2
 2 components vector of low precision unsigned integer numbers.
typedef detail::tvec3< lowp_uint > lowp_uvec3
 3 components vector of low precision unsigned integer numbers.
typedef detail::tvec4< lowp_uint > lowp_uvec4
 4 components vector of low precision unsigned integer numbers.
typedef detail::tvec2< lowp_float > lowp_vec2
 2 components vector of low precision floating-point numbers.
typedef detail::tvec3< lowp_float > lowp_vec3
 3 components vector of low precision floating-point numbers.
typedef detail::tvec4< lowp_float > lowp_vec4
 4 components vector of low precision floating-point numbers.
typedef detail::tvec2
+< mediump_int > 
mediump_ivec2
 2 components vector of medium precision signed integer numbers.
typedef detail::tvec3
+< mediump_int > 
mediump_ivec3
 3 components vector of medium precision signed integer numbers.
typedef detail::tvec4
+< mediump_int > 
mediump_ivec4
 4 components vector of medium precision signed integer numbers.
typedef detail::tvec2
+< mediump_uint > 
mediump_uvec2
 2 components vector of medium precision unsigned integer numbers.
typedef detail::tvec3
+< mediump_uint > 
mediump_uvec3
 3 components vector of medium precision unsigned integer numbers.
typedef detail::tvec4
+< mediump_uint > 
mediump_uvec4
 4 components vector of medium precision unsigned integer numbers.
typedef detail::tvec2
+< mediump_float > 
mediump_vec2
 2 components vector of medium precision floating-point numbers.
typedef detail::tvec3
+< mediump_float > 
mediump_vec3
 3 components vector of medium precision floating-point numbers.
typedef detail::tvec4
+< mediump_float > 
mediump_vec4
 4 components vector of medium precision floating-point numbers.
+

Detailed Description

+

Vector types with precision qualifier.

+

This namespace is included in glm namespace.

+

Typedef Documentation

+ +
+
+ + + + +
typedef detail::tvec2<highp_int> highp_ivec2
+
+
+ +

2 components vector of high precision signed integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 258 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<highp_int> highp_ivec3
+
+
+ +

3 components vector of high precision signed integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 257 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<highp_int> highp_ivec4
+
+
+ +

4 components vector of high precision signed integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 269 of file type_vec4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<highp_uint> highp_uvec2
+
+
+ +

2 components vector of high precision unsigned integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 292 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<highp_uint> highp_uvec3
+
+
+ +

3 components vector of high precision unsigned integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 291 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<highp_uint> highp_uvec4
+
+
+ +

4 components vector of high precision unsigned integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 301 of file type_vec4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<highp_float> highp_vec2
+
+
+ +

2 components vector of high precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.

+ +

Definition at line 224 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<highp_float> highp_vec3
+
+
+ +

3 components vector of high precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.

+ +

Definition at line 223 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<highp_float> highp_vec4
+
+
+ +

4 components vector of high precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.

+ +

Definition at line 237 of file type_vec4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<lowp_int> lowp_ivec2
+
+
+ +

2 components vector of low precision signed integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 266 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<lowp_int> lowp_ivec3
+
+
+ +

3 components vector of low precision signed integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 265 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<lowp_int> lowp_ivec4
+
+
+ +

4 components vector of low precision signed integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 277 of file type_vec4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<lowp_uint> lowp_uvec2
+
+
+ +

2 components vector of low precision unsigned integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 300 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<lowp_uint> lowp_uvec3
+
+
+ +

3 components vector of low precision unsigned integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 299 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<lowp_uint> lowp_uvec4
+
+
+ +

4 components vector of low precision unsigned integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 309 of file type_vec4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<lowp_float> lowp_vec2
+
+
+ +

2 components vector of low precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.

+ +

Definition at line 232 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<lowp_float> lowp_vec3
+
+
+ +

3 components vector of low precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.

+ +

Definition at line 231 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<lowp_float> lowp_vec4
+
+
+ +

4 components vector of low precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.

+ +

Definition at line 245 of file type_vec4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<mediump_int> mediump_ivec2
+
+
+ +

2 components vector of medium precision signed integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 262 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<mediump_int> mediump_ivec3
+
+
+ +

3 components vector of medium precision signed integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 261 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<mediump_int> mediump_ivec4
+
+
+ +

4 components vector of medium precision signed integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 273 of file type_vec4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<mediump_uint> mediump_uvec2
+
+
+ +

2 components vector of medium precision unsigned integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 296 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<mediump_uint> mediump_uvec3
+
+
+ +

3 components vector of medium precision unsigned integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 295 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<mediump_uint> mediump_uvec4
+
+
+ +

4 components vector of medium precision unsigned integer numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.

+ +

Definition at line 305 of file type_vec4.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<mediump_float> mediump_vec2
+
+
+ +

2 components vector of medium precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.

+ +

Definition at line 228 of file type_vec2.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<mediump_float> mediump_vec3
+
+
+ +

3 components vector of medium precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.

+ +

Definition at line 227 of file type_vec3.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<mediump_float> mediump_vec4
+
+
+ +

4 components vector of medium precision floating-point numbers.

+

There is no garanty on the actual precision. From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.

+ +

Definition at line 241 of file type_vec4.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00142.html b/doc/html/a00142.html new file mode 100644 index 00000000..a5a6b28d --- /dev/null +++ b/doc/html/a00142.html @@ -0,0 +1,77 @@ + + + + +GLM: glm::gtc Namespace Reference + + + + + + +
+

glm::gtc Namespace Reference

+

GLM stable extensions. +More...

+ + + + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+

Namespaces

namespace  double_float
 

GLM_GTC_double_float extension: Add support for double precision floating-point types.

+
namespace  half_float
 

GLM_GTC_half_float extension: Add support for half precision floating-point types.

+
namespace  matrix_operation
 

GLM_GTC_matrix_operation extension: Matrix operation functions.

+
namespace  matrix_projection
 

GLM_GTC_matrix_projection: Varius ways to build and operate on projection matrices.

+
namespace  matrix_transform
 

GLM_GTC_matrix_transform extension: Add transformation matrices.

+
namespace  quaternion
 

GLM_GTC_quaternion extension: Quaternion types and functions.

+
namespace  type_precision
 

GLM_GTC_type_precision extension: Defined types with specific size.

+
+

Detailed Description

+

GLM stable extensions.

+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00143.html b/doc/html/a00143.html new file mode 100644 index 00000000..d167cac9 --- /dev/null +++ b/doc/html/a00143.html @@ -0,0 +1,283 @@ + + + + +GLM: glm::gtc::double_float Namespace Reference + + + + + + +
+

glm::gtc::double_float Namespace Reference

+

GLM_GTC_double_float extension: Add support for double precision floating-point types. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Typedefs

typedef detail::tmat2x2< double > dmat2
 2 * 2 matrix of double-precision floating-point numbers.
typedef detail::tmat3x3< double > dmat3
 3 * 3 matrix of double-precision floating-point numbers.
typedef detail::tmat4x4< double > dmat4
 4 * 4 matrix of double-precision floating-point numbers.
typedef detail::tvec2< double > dvec2
 Vector of 2 double-precision floating-point numbers.
typedef detail::tvec3< double > dvec3
 Vector of 3 double-precision floating-point numbers.
typedef detail::tvec4< double > dvec4
 Vector of 4 double-precision floating-point numbers.
typedef detail::tmat2x2< float > fmat2
 2 * 2 matrix of single-precision floating-point numbers.
typedef detail::tmat3x3< float > fmat3
 3 * 3 matrix of single-precision floating-point numbers.
typedef detail::tmat4x4< float > fmat4
 4 * 4 matrix of single-precision floating-point numbers.
typedef detail::tvec2< float > fvec2
 Vector of 2 single-precision floating-point numbers.
typedef detail::tvec3< float > fvec3
 Vector of 3 single-precision floating-point numbers.
typedef detail::tvec4< float > fvec4
 Vector of 4 single-precision floating-point numbers.
+

Detailed Description

+

GLM_GTC_double_float extension: Add support for double precision floating-point types.

+

Typedef Documentation

+ +
+
+ + + + +
typedef detail::tmat2x2<double> dmat2
+
+
+ +

2 * 2 matrix of double-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 71 of file gtc/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x3<double> dmat3
+
+
+ +

3 * 3 matrix of double-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 75 of file gtc/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x4<double> dmat4
+
+
+ +

4 * 4 matrix of double-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 79 of file gtc/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<double> dvec2
+
+
+ +

Vector of 2 double-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 59 of file gtc/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<double> dvec3
+
+
+ +

Vector of 3 double-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 63 of file gtc/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<double> dvec4
+
+
+ +

Vector of 4 double-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 67 of file gtc/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x2<float> fmat2
+
+
+ +

2 * 2 matrix of single-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 47 of file gtc/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x3<float> fmat3
+
+
+ +

3 * 3 matrix of single-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 51 of file gtc/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x4<float> fmat4
+
+
+ +

4 * 4 matrix of single-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 55 of file gtc/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<float> fvec2
+
+
+ +

Vector of 2 single-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 35 of file gtc/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<float> fvec3
+
+
+ +

Vector of 3 single-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 39 of file gtc/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<float> fvec4
+
+
+ +

Vector of 4 single-precision floating-point numbers.

+

From GLM_GTC_double_float extension.

+ +

Definition at line 43 of file gtc/double_float.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00144.html b/doc/html/a00144.html new file mode 100644 index 00000000..2b3dc1ab --- /dev/null +++ b/doc/html/a00144.html @@ -0,0 +1,189 @@ + + + + +GLM: glm::gtc::half_float Namespace Reference + + + + + + +
+

glm::gtc::half_float Namespace Reference

+

GLM_GTC_half_float extension: Add support for half precision floating-point types. +More...

+ + + + + + + + + + + + + + + + +

Typedefs

typedef detail::thalf half
 Type for half-precision floating-point numbers.
typedef detail::tmat2x2
+< detail::thalf > 
hmat2
 2 * 2 matrix of half-precision floating-point numbers.
typedef detail::tmat3x3
+< detail::thalf > 
hmat3
 3 * 3 matrix of half-precision floating-point numbers.
typedef detail::tmat4x4
+< detail::thalf > 
hmat4
 4 * 4 matrix of half-precision floating-point numbers.
typedef detail::tvec2
+< detail::thalf > 
hvec2
 Vector of 2 half-precision floating-point numbers.
typedef detail::tvec3
+< detail::thalf > 
hvec3
 Vector of 3 half-precision floating-point numbers.
typedef detail::tvec4
+< detail::thalf > 
hvec4
 Vector of 4 half-precision floating-point numbers.
+

Detailed Description

+

GLM_GTC_half_float extension: Add support for half precision floating-point types.

+

Typedef Documentation

+ +
+
+ + + + +
typedef detail::thalf half
+
+
+ +

Type for half-precision floating-point numbers.

+

From GLM_GTC_half_float extension.

+ +

Definition at line 370 of file gtc/half_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat2x2<detail::thalf> hmat2
+
+
+ +

2 * 2 matrix of half-precision floating-point numbers.

+

From GLM_GTC_half_float extension.

+ +

Definition at line 386 of file gtc/half_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat3x3<detail::thalf> hmat3
+
+
+ +

3 * 3 matrix of half-precision floating-point numbers.

+

From GLM_GTC_half_float extension.

+ +

Definition at line 390 of file gtc/half_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tmat4x4<detail::thalf> hmat4
+
+
+ +

4 * 4 matrix of half-precision floating-point numbers.

+

From GLM_GTC_half_float extension.

+ +

Definition at line 394 of file gtc/half_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec2<detail::thalf> hvec2
+
+
+ +

Vector of 2 half-precision floating-point numbers.

+

From GLM_GTC_half_float extension.

+ +

Definition at line 374 of file gtc/half_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec3<detail::thalf> hvec3
+
+
+ +

Vector of 3 half-precision floating-point numbers.

+

From GLM_GTC_half_float extension.

+ +

Definition at line 378 of file gtc/half_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tvec4<detail::thalf> hvec4
+
+
+ +

Vector of 4 half-precision floating-point numbers.

+

From GLM_GTC_half_float extension.

+ +

Definition at line 382 of file gtc/half_float.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00145.html b/doc/html/a00145.html new file mode 100644 index 00000000..958cbd29 --- /dev/null +++ b/doc/html/a00145.html @@ -0,0 +1,41 @@ + + + + +GLM: glm::gtc::matrix_operation Namespace Reference + + + + + + +
+

glm::gtc::matrix_operation Namespace Reference

+

GLM_GTC_matrix_operation extension: Matrix operation functions. +More...

+ +
+

Detailed Description

+

GLM_GTC_matrix_operation extension: Matrix operation functions.

+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00146.html b/doc/html/a00146.html new file mode 100644 index 00000000..33cae9d9 --- /dev/null +++ b/doc/html/a00146.html @@ -0,0 +1,337 @@ + + + + +GLM: glm::gtc::matrix_projection Namespace Reference + + + + + + +
+

glm::gtc::matrix_projection Namespace Reference

+

GLM_GTC_matrix_projection: Varius ways to build and operate on projection matrices. +More...

+ + + + + + + + + + + + + + + + + + + + +

Functions

template<typename valType >
detail::tmat4x4< valType > frustum (valType const &left, valType const &right, valType const &bottom, valType const &top, valType const &nearVal, valType const &farVal)
 Creates a frustum matrix.
template<typename valType >
detail::tmat4x4< valType > ortho (valType const &left, valType const &right, valType const &bottom, valType const &top, valType const &zNear, valType const &zFar)
 Creates a matrix for an orthographic parallel viewing volume.
template<typename valType >
detail::tmat4x4< valType > ortho (valType const &left, valType const &right, valType const &bottom, valType const &top)
 Creates a matrix for projecting two-dimensional coordinates onto the screen.
template<typename valType >
detail::tmat4x4< valType > perspective (valType const &fovy, valType const &aspect, valType const &zNear, valType const &zFar)
 Creates a matrix for a symetric perspective-view frustum.
template<typename valTypeT , typename valTypeU >
detail::tvec3< valTypeT > project (detail::tvec3< valTypeT > const &obj, detail::tmat4x4< valTypeT > const &model, detail::tmat4x4< valTypeT > const &proj, detail::tvec4< valTypeU > const &viewport)
 Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.
template<typename valTypeT , typename valTypeU >
detail::tvec3< valTypeT > unProject (detail::tvec3< valTypeT > const &win, detail::tmat4x4< valTypeT > const &model, detail::tmat4x4< valTypeT > const &proj, detail::tvec4< valTypeU > const &viewport)
 Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
+

Detailed Description

+

GLM_GTC_matrix_projection: Varius ways to build and operate on projection matrices.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtc::matrix_projection::frustum (valType const &  left,
valType const &  right,
valType const &  bottom,
valType const &  top,
valType const &  nearVal,
valType const &  farVal 
)
+
+
+ +

Creates a frustum matrix.

+

From GLM_GTC_matrix_projection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtc::matrix_projection::ortho (valType const &  left,
valType const &  right,
valType const &  bottom,
valType const &  top,
valType const &  zNear,
valType const &  zFar 
)
+
+
+ +

Creates a matrix for an orthographic parallel viewing volume.

+

From GLM_GTC_matrix_projection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtc::matrix_projection::ortho (valType const &  left,
valType const &  right,
valType const &  bottom,
valType const &  top 
)
+
+
+ +

Creates a matrix for projecting two-dimensional coordinates onto the screen.

+

From GLM_GTC_matrix_projection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtc::matrix_projection::perspective (valType const &  fovy,
valType const &  aspect,
valType const &  zNear,
valType const &  zFar 
)
+
+
+ +

Creates a matrix for a symetric perspective-view frustum.

+

From GLM_GTC_matrix_projection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tvec3<valTypeT> glm::gtc::matrix_projection::project (detail::tvec3< valTypeT > const &  obj,
detail::tmat4x4< valTypeT > const &  model,
detail::tmat4x4< valTypeT > const &  proj,
detail::tvec4< valTypeU > const &  viewport 
)
+
+
+ +

Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.

+

From GLM_GTC_matrix_projection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tvec3<valTypeT> glm::gtc::matrix_projection::unProject (detail::tvec3< valTypeT > const &  win,
detail::tmat4x4< valTypeT > const &  model,
detail::tmat4x4< valTypeT > const &  proj,
detail::tvec4< valTypeU > const &  viewport 
)
+
+
+ +

Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.

+

From GLM_GTC_matrix_projection extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00147.html b/doc/html/a00147.html new file mode 100644 index 00000000..3f8b4b5c --- /dev/null +++ b/doc/html/a00147.html @@ -0,0 +1,148 @@ + + + + +GLM: glm::gtc::matrix_transform Namespace Reference + + + + + + +
+

glm::gtc::matrix_transform Namespace Reference

+

GLM_GTC_matrix_transform extension: Add transformation matrices. +More...

+ + + + + + + + + + + +

Functions

template<typename valType >
detail::tmat4x4< valType > rotate (detail::tmat4x4< valType > const &m, valType const &angle, detail::tvec3< valType > const &v)
 Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees.
template<typename valType >
detail::tmat4x4< valType > scale (detail::tmat4x4< valType > const &m, detail::tvec3< valType > const &v)
 Builds a scale 4 * 4 matrix created from 3 scalars.
template<typename valType >
detail::tmat4x4< valType > translate (detail::tmat4x4< valType > const &m, detail::tvec3< valType > const &v)
 Builds a translation 4 * 4 matrix created from a vector of 3 components.
+

Detailed Description

+

GLM_GTC_matrix_transform extension: Add transformation matrices.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtc::matrix_transform::rotate (detail::tmat4x4< valType > const &  m,
valType const &  angle,
detail::tvec3< valType > const &  v 
)
+
+
+ +

Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees.

+

From GLM_GTC_matrix_transform extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtc::matrix_transform::scale (detail::tmat4x4< valType > const &  m,
detail::tvec3< valType > const &  v 
)
+
+
+ +

Builds a scale 4 * 4 matrix created from 3 scalars.

+

From GLM_GTC_matrix_transform extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtc::matrix_transform::translate (detail::tmat4x4< valType > const &  m,
detail::tvec3< valType > const &  v 
)
+
+
+ +

Builds a translation 4 * 4 matrix created from a vector of 3 components.

+

From GLM_GTC_matrix_transform extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00148.html b/doc/html/a00148.html new file mode 100644 index 00000000..e2fbb8a1 --- /dev/null +++ b/doc/html/a00148.html @@ -0,0 +1,407 @@ + + + + +GLM: glm::gtc::quaternion Namespace Reference + + + + + + +
+

glm::gtc::quaternion Namespace Reference

+

GLM_GTC_quaternion extension: Quaternion types and functions. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Typedefs

typedef detail::tquat< float > quat
 Quaternion of floating-point numbers.

Functions

template<typename valType >
detail::tquat< valType > conjugate (detail::tquat< valType > const &q)
 Returns the q conjugate.
template<typename valType >
detail::tquat< valType > cross (detail::tquat< valType > const &q1, detail::tquat< valType > const &q2)
 Returns the cross product of q1 and q2.
template<typename valType >
valType dot (detail::tquat< valType > const &q1, detail::tquat< valType > const &q2)
 Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + .
template<typename valType >
detail::tquat< valType > inverse (detail::tquat< valType > const &q)
 Returns the q inverse.
template<typename valType >
valType length (detail::tquat< valType > const &q)
 Returns the length of the quaternion x.
template<typename valType >
detail::tmat3x3< valType > mat3_cast (detail::tquat< valType > const &x)
 Converts a quaternion to a 3 * 3 matrix.
template<typename valType >
detail::tmat4x4< valType > mat4_cast (detail::tquat< valType > const &x)
 Converts a quaternion to a 4 * 4 matrix.
template<typename valType >
detail::tquat< valType > mix (detail::tquat< valType > const &x, detail::tquat< valType > const &y, valType const &a)
 Returns a LERP interpolated quaternion of x and y according a.
template<typename valType >
detail::tquat< valType > normalize (detail::tquat< valType > const &q)
 Returns the normalized quaternion of from x.
template<typename valType >
detail::tquat< valType > quat_cast (detail::tmat4x4< valType > const &x)
 Converts a 4 * 4 matrix to a quaternion.
template<typename valType >
detail::tquat< valType > quat_cast (detail::tmat3x3< valType > const &x)
 Converts a 3 * 3 matrix to a quaternion.
template<typename valType >
detail::tquat< valType > rotate (detail::tquat< valType > const &q, valType const &angle, detail::tvec3< valType > const &v)
 Rotates a quaternion from an vector of 3 components axis and an angle expressed in degrees.
+

Detailed Description

+

GLM_GTC_quaternion extension: Quaternion types and functions.

+

Typedef Documentation

+ +
+
+ + + + +
typedef detail::tquat<float> quat
+
+
+ +

Quaternion of floating-point numbers.

+

From GLM_GTC_quaternion extension.

+ +

Definition at line 185 of file gtc/quaternion.hpp.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + +
detail::tquat<valType> glm::gtc::quaternion::conjugate (detail::tquat< valType > const &  q ) 
+
+
+ +

Returns the q conjugate.

+

From GLM_GTC_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tquat<valType> glm::gtc::quaternion::cross (detail::tquat< valType > const &  q1,
detail::tquat< valType > const &  q2 
)
+
+
+ +

Returns the cross product of q1 and q2.

+

From GLM_GTC_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
valType glm::gtc::quaternion::dot (detail::tquat< valType > const &  q1,
detail::tquat< valType > const &  q2 
)
+
+
+ +

Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + .

+

.. From GLM_GTC_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tquat<valType> glm::gtc::quaternion::inverse (detail::tquat< valType > const &  q ) 
+
+
+ +

Returns the q inverse.

+

From GLM_GTC_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
valType glm::gtc::quaternion::length (detail::tquat< valType > const &  q ) 
+
+
+ +

Returns the length of the quaternion x.

+

From GLM_GTC_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat3x3<valType> glm::gtc::quaternion::mat3_cast (detail::tquat< valType > const &  x ) 
+
+
+ +

Converts a quaternion to a 3 * 3 matrix.

+

From GLM_GTC_quaternion extension.

+ +

Referenced by glm::gtx::quaternion::toMat3().

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<valType> glm::gtc::quaternion::mat4_cast (detail::tquat< valType > const &  x ) 
+
+
+ +

Converts a quaternion to a 4 * 4 matrix.

+

From GLM_GTC_quaternion extension.

+ +

Referenced by glm::gtx::quaternion::toMat4().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tquat<valType> glm::gtc::quaternion::mix (detail::tquat< valType > const &  x,
detail::tquat< valType > const &  y,
valType const &  a 
)
+
+
+ +

Returns a LERP interpolated quaternion of x and y according a.

+

From GLM_GTC_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tquat<valType> glm::gtc::quaternion::normalize (detail::tquat< valType > const &  q ) 
+
+
+ +

Returns the normalized quaternion of from x.

+

From GLM_GTC_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tquat<valType> glm::gtc::quaternion::quat_cast (detail::tmat4x4< valType > const &  x ) 
+
+
+ +

Converts a 4 * 4 matrix to a quaternion.

+

From GLM_GTC_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tquat<valType> glm::gtc::quaternion::quat_cast (detail::tmat3x3< valType > const &  x ) 
+
+
+ +

Converts a 3 * 3 matrix to a quaternion.

+

From GLM_GTC_quaternion extension.

+ +

Referenced by glm::gtx::quaternion::toQuat().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tquat<valType> glm::gtc::quaternion::rotate (detail::tquat< valType > const &  q,
valType const &  angle,
detail::tvec3< valType > const &  v 
)
+
+
+ +

Rotates a quaternion from an vector of 3 components axis and an angle expressed in degrees.

+

From GLM_GTC_quaternion extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00149.html b/doc/html/a00149.html new file mode 100644 index 00000000..82ca45e1 --- /dev/null +++ b/doc/html/a00149.html @@ -0,0 +1,324 @@ + + + + +GLM: glm::gtc::type_precision Namespace Reference + + + + + + +
+

glm::gtc::type_precision Namespace Reference

+

GLM_GTC_type_precision extension: Defined types with specific size. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Typedefs

+typedef float16 f16
 Half-precision floating-point scalar. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x2< f16f16mat2
 Half-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x2< f16f16mat2x2
 Half-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x3< f16f16mat2x3
 Half-precision floating-point 2x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x4< f16f16mat2x4
 Half-precision floating-point 2x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x3< f16f16mat3
 Half-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x2< f16f16mat3x2
 Half-precision floating-point 3x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x3< f16f16mat3x3
 Half-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x4< f16f16mat3x4
 Half-precision floating-point 3x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x4< f16f16mat4
 Half-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x2< f16f16mat4x2
 Half-precision floating-point 4x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x3< f16f16mat4x3
 Half-precision floating-point 4x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x4< f16f16mat4x4
 Half-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tquat< f16f16quat
 Half-precision floating-point quaternion. (from GLM_GTC_type_precision extension).
+typedef detail::tvec2< f16f16vec2
 Half-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension).
+typedef detail::tvec3< f16f16vec3
 Half-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension).
+typedef detail::tvec4< f16f16vec4
 Half-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension).
+typedef float32 f32
 Single-precision floating-point scalar. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x2< f32f32mat2
 Single-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x2< f32f32mat2x2
 Single-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x3< f32f32mat2x3
 Single-precision floating-point 2x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x4< f32f32mat2x4
 Single-precision floating-point 2x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x3< f32f32mat3
 Single-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x2< f32f32mat3x2
 Single-precision floating-point 3x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x3< f32f32mat3x3
 Single-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x4< f32f32mat3x4
 Single-precision floating-point 3x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x4< f32f32mat4
 Single-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x2< f32f32mat4x2
 Single-precision floating-point 4x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x3< f32f32mat4x3
 Single-precision floating-point 4x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x4< f32f32mat4x4
 Single-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tquat< f32f32quat
 Single-precision floating-point quaternion. (from GLM_GTC_type_precision extension).
+typedef detail::tvec2< f32f32vec2
 Single-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension).
+typedef detail::tvec3< f32f32vec3
 Single-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension).
+typedef detail::tvec4< f32f32vec4
 Single-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension).
+typedef float64 f64
 Double-precision floating-point scalar. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x2< f64f64mat2
 Double-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x2< f64f64mat2x2
 Double-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x3< f64f64mat2x3
 Double-precision floating-point 2x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat2x4< f64f64mat2x4
 Double-precision floating-point 2x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x3< f64f64mat3
 Double-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x2< f64f64mat3x2
 Double-precision floating-point 3x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x3< f64f64mat3x3
 Double-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat3x4< f64f64mat3x4
 Double-precision floating-point 3x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x4< f64f64mat4
 Double-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x2< f64f64mat4x2
 Double-precision floating-point 4x2 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x3< f64f64mat4x3
 Double-precision floating-point 4x3 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tmat4x4< f64f64mat4x4
 Double-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension).
+typedef detail::tquat< f64f64quat
 Double-precision floating-point quaternion. (from GLM_GTC_type_precision extension).
+typedef detail::tvec2< f64f64vec2
 Double-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension).
+typedef detail::tvec3< f64f64vec3
 Double-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension).
+typedef detail::tvec4< f64f64vec4
 Double-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension).
+typedef detail::float16 float16
 Half-precision floating-point scalar. (from GLM_GTC_type_precision extension).
+typedef detail::float32 float32
 Single-precision floating-point scalar. (from GLM_GTC_type_precision extension).
+typedef detail::float64 float64
 Double-precision floating-point scalar. (from GLM_GTC_type_precision extension).
+typedef int16 i16
 16bit signed integer. (from GLM_GTC_type_precision extension)
+typedef detail::tvec2< i16i16vec2
 16bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec3< i16i16vec3
 16bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec4< i16i16vec4
 16bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)
+typedef int32 i32
 32bit signed integer. (from GLM_GTC_type_precision extension)
+typedef detail::tvec2< i32i32vec2
 32bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec3< i32i32vec3
 32bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec4< i32i32vec4
 32bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)
+typedef int64 i64
 64bit signed integer. (from GLM_GTC_type_precision extension)
+typedef detail::tvec2< i64i64vec2
 64bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec3< i64i64vec3
 64bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec4< i64i64vec4
 64bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)
+typedef int8 i8
 8bit signed integer. (from GLM_GTC_type_precision extension)
+typedef detail::tvec2< i8i8vec2
 8bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec3< i8i8vec3
 8bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec4< i8i8vec4
 8bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)
+typedef detail::int16 int16
 16bit signed integer. (from GLM_GTC_type_precision extension)
+typedef detail::int32 int32
 32bit signed integer. (from GLM_GTC_type_precision extension)
+typedef detail::int64 int64
 64bit signed integer. (from GLM_GTC_type_precision extension)
+typedef detail::int8 int8
 8bit signed integer. (from GLM_GTC_type_precision extension)
+typedef uint16 u16
 16bit unsigned integer. (from GLM_GTC_type_precision extension)
+typedef detail::tvec2< u16u16vec2
 16bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec3< u16u16vec3
 16bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec4< u16u16vec4
 16bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)
+typedef uint32 u32
 32bit unsigned integer. (from GLM_GTC_type_precision extension)
+typedef detail::tvec2< u32u32vec2
 32bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec3< u32u32vec3
 32bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec4< u32u32vec4
 32bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)
+typedef uint64 u64
 64bit unsigned integer. (from GLM_GTC_type_precision extension)
+typedef detail::tvec2< u64u64vec2
 64bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec3< u64u64vec3
 64bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec4< u64u64vec4
 64bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)
+typedef uint8 u8
 8bit unsigned integer. (from GLM_GTC_type_precision extension)
+typedef detail::tvec2< u8u8vec2
 8bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec3< u8u8vec3
 8bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)
+typedef detail::tvec4< u8u8vec4
 8bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)
+typedef detail::uint16 uint16
 16bit unsigned integer. (from GLM_GTC_type_precision extension)
+typedef detail::uint32 uint32
 32bit unsigned integer. (from GLM_GTC_type_precision extension)
+typedef detail::uint64 uint64
 64bit unsigned integer. (from GLM_GTC_type_precision extension)
+typedef detail::uint8 uint8
 8bit unsigned integer. (from GLM_GTC_type_precision extension)
+

Detailed Description

+

GLM_GTC_type_precision extension: Defined types with specific size.

+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00150.html b/doc/html/a00150.html new file mode 100644 index 00000000..45fcf5b0 --- /dev/null +++ b/doc/html/a00150.html @@ -0,0 +1,372 @@ + + + + +GLM: glm::gtx Namespace Reference + + + + + + +
+

glm::gtx Namespace Reference

+

GLM experimental extensions. The interface could change between releases. +More...

+ + + + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+

Namespaces

namespace  associated_min_max
 

GLM_GTX_associated_min_max extension: Min and max functions that return associated values not the compared onces.

+
namespace  bit
 

GLM_GTX_bit extension: Allow to perform bit operations on integer values.

+
namespace  closest_point
 

GLM_GTX_closest_point extension: Find the point on a straight line which is the closet of a point.

+
namespace  color_cast
 

GLM_GTX_color_cast extension: Conversion between two color types.

+
namespace  color_space
 

GLM_GTX_color_space extension: Related to RGB to HSV conversions and operations.

+
namespace  color_space_YCoCg
 

GLM_GTX_color_space_YCoCg extension: RGB to YCoCg conversions and operations.

+
namespace  comparison
 

GLM_GTX_comparison extension: Defined comparison operators for vectors.

+
namespace  compatibility
 

GLM_GTX_compatibility extension: Provide functions to increase the compatibility with Cg and HLSL languages.

+
namespace  component_wise
 

GLM_GTX_component_wise extension: Operations between components of a type.

+
namespace  determinant
 

GLM_GTX_determinant extension: Compute the determinant of a matrix.

+
namespace  double_float
 

GLM_GTX_double_float extension: Add support for double precision flotting-point types.

+
namespace  epsilon
 

GLM_GTX_epsilon extension: Comparaison functions for a user defined epsilon values.

+
namespace  euler_angles
 

GLM_GTX_euler_angles extension: Build matrices from euler angles.

+
namespace  extend
 

GLM_GTX_extend extension: Extend a position from a source to a position at a defined length.

+
namespace  extented_min_max
 

GLM_GTX_extented_min_max extension: Min and max functions for 3 to 4 parameters.

+
namespace  fast_exponential
 

GLM_GTX_fast_exponential extension: Fast but less accurate implementations of exponential based functions.

+
namespace  fast_square_root
 

GLM_GTX_fast_square_root extension: Fast but less accurate implementations of square root based functions.

+
namespace  fast_trigonometry
 

GLM_GTX_fast_trigonometry extension: Fast but less accurate implementations of trigonometric functions.

+
namespace  gradient_paint
 

GLM_GTX_gradient_paint extension: Compute a radient gradient according section OpenVG 1.1 specifications, 9.3.2 Radial Gradients.

+
namespace  half_float
 

GLM_GTX_half_float extension: Add support for half precision flotting-point types.

+
namespace  handed_coordinate_space
 

GLM_GTX_handed_coordinate_space extension: To know if a triedron is right or left handed.

+
namespace  inertia
 

GLM_GTX_inertia extension: Create inertia matrices.

+
namespace  integer
 

GLM_GTX_integer extension: Add support for integer for core functions.

+
namespace  intersect
 

GLM_GTX_intersect extension: Add intersection functions.

+
namespace  inverse
 

GLM_GTX_inverse extension: Inverse matrix functions.

+
namespace  inverse_transpose
 

GLM_GTX_inverse_transpose extension: Inverse transpose matrix functions.

+
namespace  log_base
 

GLM_GTX_log_base extension: Logarithm for any base. base can be a vector or a scalar.

+
namespace  matrix_access
 

GLM_GTX_matrix_access extension: Set a column or a row of a matrix.

+
namespace  matrix_cross_product
 

GLM_GTX_matrix_cross_product: Build cross product matrices.

+
namespace  matrix_major_storage
 

GLM_GTX_matrix_cross_product: Build matrices with specific matrix order, row or column.

+
namespace  matrix_operation
 

GLM_GTX_matrix_operation: Build cross product matrices.

+
namespace  matrix_projection
 

GLM_GTX_matrix_projection: Varius ways to build and operate on projection matrices.

+
namespace  matrix_query
 

GLM_GTX_matrix_query: Query to evaluate matrices properties.

+
namespace  matrix_selection
 

GLM_GTX_matrix_selection extension: Access to matrix columns or rows.

+
namespace  matx
 

GLM_GTX_matx extension: - Work in progress - NxN matrix types.

+
namespace  mixed_product
 

GLM_GTX_mixed_product extension: Mixed product of 3 vectors.

+
namespace  norm
 

GLM_GTX_norm extension: Varius way to compute vector norms.

+
namespace  normal
 

GLM_GTX_normal extension: Compute the normal of a triangle.

+
namespace  normalize_dot
 

GLM_GTX_normalize_dot extension: Dot product of vectors that need to be normalize with a single square root.

+
namespace  number_precision
 

GLM_GTX_number_precision extension: Defined size types.

+
namespace  ocl_type
 

GLM_GTX_ocl_type extension: OpenCL types.

+
namespace  optimum_pow
 

GLM_GTX_optimum_pow extension: Integer exponenciation of power functions.

+
namespace  orthonormalize
 

GLM_GTX_orthonormalize extension: Orthonormalize matrices.

+
namespace  perpendicular
 

GLM_GTX_perpendicular extension: Perpendicular of a vector from other one.

+
namespace  polar_coordinates
 

GLM_GTX_polar_coordinates extension: Conversion from Euclidean space to polar space and revert.

+
namespace  projection
 

GLM_GTX_projection extension: Projection of a vector to other one.

+
namespace  quaternion
 

GLM_GTX_quaternion extension: Quaternion types and functions.

+
namespace  random
 

GLM_GTX_random extension: Generate random number from varius distribution methods.

+
namespace  raw_data
 

GLM_GTX_raw_data extension: Projection of a vector to other one.

+
namespace  reciprocal
 

GLM_GTX_reciprocal extension: Define secant, cosecant and cotangent functions.

+
namespace  rotate_vector
 

GLM_GTX_rotate_vector extension: Function to directly rotate a vector.

+
namespace  simd_mat4
 

GLM_GTX_simd_mat4 extension: SIMD implementation of vec4 type.

+
namespace  simd_vec4
 

GLM_GTX_simd_vec4 extension: SIMD implementation of vec4 type.

+
namespace  spline
 

GLM_GTX_spline extension: Spline functions.

+
namespace  statistics_operation
 

GLM_GTX_statistics_operation extension: - Work in progress - Statistics functions.

+
namespace  std_based_type
 

GLM_GTX_std_based_type extension: Add support vector types based on C++ standard type.

+
namespace  string_cast
 

GLM_GTX_string_cast extension: Setup strings for GLM type values.

+
namespace  transform
 

GLM_GTX_transform extension: Add transformation matrices.

+
namespace  transform2
 

GLM_GTX_transform2 extension: Add extra transformation matrices.

+
namespace  type_ptr
 

GLM_GTX_type_ptr extension: Get access to vectors & matrices value type address.

+
namespace  unsigned_int
 

GLM_GTX_unsigned_int extension: Add support for unsigned integer for core functions.

+
namespace  vector_access
 

GLM_GTX_vector_access extension: Function to set values to vectors.

+
namespace  vector_angle
 

GLM_GTX_vector_angle extension: Compute angle between vectors.

+
namespace  vector_query
 

GLM_GTX_vector_query extension: Query informations of vector types.

+
namespace  vecx
 

GLM_GTX_vecx extension: - Work in progress - Add custom size vectors.

+
namespace  verbose_operator
 

GLM_GTX_verbose_operator extension: Use words to replace operators.

+
+

Detailed Description

+

GLM experimental extensions. The interface could change between releases.

+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00151.html b/doc/html/a00151.html new file mode 100644 index 00000000..8c701dd9 --- /dev/null +++ b/doc/html/a00151.html @@ -0,0 +1,66 @@ + + + + +GLM: glm::gtx::associated_min_max Namespace Reference + + + + + + +
+

glm::gtx::associated_min_max Namespace Reference

+

GLM_GTX_associated_min_max extension: Min and max functions that return associated values not the compared onces. +More...

+ + + + + + + + + + + + + + + + + + + + +

Functions

+template<typename genTypeT , typename genTypeU >
genTypeU associatedMax (const genTypeT &x, const genTypeU &a, const genTypeT &y, const genTypeU &b, const genTypeT &z, const genTypeU &c, const genTypeT &w, const genTypeU &d)
 Max comparison between 4 variables.
+template<typename genTypeT , typename genTypeU >
genTypeU associatedMax (const genTypeT &x, const genTypeU &a, const genTypeT &y, const genTypeU &b, const genTypeT &z, const genTypeU &c)
 Max comparison between 3 variables.
+template<typename genTypeT , typename genTypeU >
genTypeU associatedMax (const genTypeT &x, const genTypeU &a, const genTypeT &y, const genTypeU &b)
 Max comparison between 2 variables.
+template<typename genTypeT , typename genTypeU >
genTypeU associatedMin (const genTypeT &x, const genTypeU &a, const genTypeT &y, const genTypeU &b, const genTypeT &z, const genTypeU &c, const genTypeT &w, const genTypeU &d)
 Min comparison between 4 variables.
+template<typename genTypeT , typename genTypeU >
genTypeU associatedMin (const genTypeT &x, const genTypeU &a, const genTypeT &y, const genTypeU &b, const genTypeT &z, const genTypeU &c)
 Min comparison between 3 variables.
+template<typename genTypeT , typename genTypeU >
genTypeU associatedMin (const genTypeT &x, const genTypeU &a, const genTypeT &y, const genTypeU &b)
 Min comparison between 2 variables.
+

Detailed Description

+

GLM_GTX_associated_min_max extension: Min and max functions that return associated values not the compared onces.

+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00152.html b/doc/html/a00152.html new file mode 100644 index 00000000..645fdcbb --- /dev/null +++ b/doc/html/a00152.html @@ -0,0 +1,363 @@ + + + + +GLM: glm::gtx::bit Namespace Reference + + + + + + +
+

glm::gtx::bit Namespace Reference

+

GLM_GTX_bit extension: Allow to perform bit operations on integer values. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename genType >
genType bitRevert (genType const &value)
 Revert all bits of any integer based type.
template<typename genType >
genType bitRotateLeft (genType const &In, std::size_t Shift)
 Rotate all bits to the left.
template<typename genType >
genType bitRotateRight (genType const &In, std::size_t Shift)
 Rotate all bits to the right.
template<typename genType , typename genIType >
genIType extractField (genType const &v, genIType const &first, genIType const &count)
 Component wise extraction of bit fields.
template<typename genType >
int highestBit (genType const &value)
 Find the highest bit set to 1 in a integer variable.
template<typename genType >
genType highestBitValue (genType const &value)
 Find the highest bit set to 1 in a integer variable and return its value.
template<typename genType >
bool isPowerOfTwo (genType const &value)
 Return true if the value is a power of two number.
template<typename genType >
int lowestBit (genType const &value)
 Find the lowest bit set to 1 in a integer variable.
template<typename genIType >
genIType mask (genIType const &count)
 Build a mask of 'count' bits From GLM_GTX_bit extension.
template<typename genType >
genType powerOfTwoAbove (genType const &value)
 Return the power of two number which value is just higher the input value.
template<typename genType >
genType powerOfTwoBelow (genType const &value)
 Return the power of two number which value is just lower the input value.
template<typename genType >
genType powerOfTwoNearest (genType const &value)
 Return the power of two number which value is the closet to the input value.
+

Detailed Description

+

GLM_GTX_bit extension: Allow to perform bit operations on integer values.

+

Function Documentation

+ +
+
+ + + + + + + + + +
genType glm::gtx::bit::bitRevert (genType const &  value ) 
+
+
+ +

Revert all bits of any integer based type.

+

From GLM_GTX_bit extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genType glm::gtx::bit::bitRotateLeft (genType const &  In,
std::size_t  Shift 
)
+
+
+ +

Rotate all bits to the left.

+

From GLM_GTX_bit extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genType glm::gtx::bit::bitRotateRight (genType const &  In,
std::size_t  Shift 
)
+
+
+ +

Rotate all bits to the right.

+

From GLM_GTX_bit extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
genIType glm::gtx::bit::extractField (genType const &  v,
genIType const &  first,
genIType const &  count 
)
+
+
+ +

Component wise extraction of bit fields.

+

genType and genIType could be a scalar or a vector. From GLM_GTX_bit extension.

+ +
+
+ +
+
+ + + + + + + + + +
int glm::gtx::bit::highestBit (genType const &  value ) 
+
+
+ +

Find the highest bit set to 1 in a integer variable.

+

From GLM_GTX_bit extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::bit::highestBitValue (genType const &  value ) 
+
+
+ +

Find the highest bit set to 1 in a integer variable and return its value.

+

From GLM_GTX_bit extension.

+ +
+
+ +
+
+ + + + + + + + + +
bool glm::gtx::bit::isPowerOfTwo (genType const &  value ) 
+
+
+ +

Return true if the value is a power of two number.

+

From GLM_GTX_bit extension.

+ +
+
+ +
+
+ + + + + + + + + +
int glm::gtx::bit::lowestBit (genType const &  value ) 
+
+
+ +

Find the lowest bit set to 1 in a integer variable.

+

From GLM_GTX_bit extension.

+ +
+
+ +
+
+ + + + + + + + + +
genIType glm::gtx::bit::mask (genIType const &  count ) 
+
+
+ +

Build a mask of 'count' bits From GLM_GTX_bit extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::bit::powerOfTwoAbove (genType const &  value ) 
+
+
+ +

Return the power of two number which value is just higher the input value.

+

From GLM_GTX_bit extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::bit::powerOfTwoBelow (genType const &  value ) 
+
+
+ +

Return the power of two number which value is just lower the input value.

+

From GLM_GTX_bit extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::bit::powerOfTwoNearest (genType const &  value ) 
+
+
+ +

Return the power of two number which value is the closet to the input value.

+

From GLM_GTX_bit extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00153.html b/doc/html/a00153.html new file mode 100644 index 00000000..28ab5172 --- /dev/null +++ b/doc/html/a00153.html @@ -0,0 +1,82 @@ + + + + +GLM: glm::gtx::closest_point Namespace Reference + + + + + + +
+

glm::gtx::closest_point Namespace Reference

+

GLM_GTX_closest_point extension: Find the point on a straight line which is the closet of a point. +More...

+ + + + + +

Functions

template<typename T >
detail::tvec3< T > closestPointOnLine (detail::tvec3< T > const &point, detail::tvec3< T > const &a, detail::tvec3< T > const &b)
 Find the point on a straight line which is the closet of a point.
+

Detailed Description

+

GLM_GTX_closest_point extension: Find the point on a straight line which is the closet of a point.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tvec3<T> glm::gtx::closest_point::closestPointOnLine (detail::tvec3< T > const &  point,
detail::tvec3< T > const &  a,
detail::tvec3< T > const &  b 
)
+
+
+ +

Find the point on a straight line which is the closet of a point.

+

From GLM_GTX_closest_point extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00154.html b/doc/html/a00154.html new file mode 100644 index 00000000..378aa773 --- /dev/null +++ b/doc/html/a00154.html @@ -0,0 +1,263 @@ + + + + +GLM: glm::gtx::color_cast Namespace Reference + + + + + + +
+

glm::gtx::color_cast Namespace Reference

+

GLM_GTX_color_cast extension: Conversion between two color types. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

+template<typename T >
gtc::type_precision::f16vec4 f16_abgr_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f16vec4 f16_argb_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f16vec4 f16_bgra_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f16vec3 f16_bgrx_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtx::number_precision::f16vec1 f16_channel_cast (T a)
 Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f16vec4 f16_rgba_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f16vec3 f16_rgbx_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f16vec3 f16_xbgr_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f16vec3 f16_xrgb_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f32vec4 f32_abgr_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f32vec4 f32_argb_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f32vec4 f32_bgra_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f32vec3 f32_bgrx_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtx::number_precision::f32vec1 f32_channel_cast (T a)
 Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f32vec4 f32_rgba_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f32vec3 f32_rgbx_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f32vec3 f32_xbgr_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f32vec3 f32_xrgb_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f64vec4 f64_abgr_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f64vec4 f64_argb_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f64vec4 f64_bgra_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f64vec3 f64_bgrx_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtx::number_precision::f64vec1 f64_channel_cast (T a)
 Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f64vec4 f64_rgba_cast (T c)
 Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f64vec3 f64_rgbx_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f64vec3 f64_xbgr_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::f64vec3 f64_xrgb_cast (T c)
 Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension).
template<typename valType >
gtc::type_precision::uint16 u16channel_cast (valType a)
 Conversion of a floating value into a 16bit unsigned int value.
+template<typename T >
gtc::type_precision::uint32 u32_abgr_cast (const detail::tvec4< T > &c)
 Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint32 u32_argb_cast (const detail::tvec4< T > &c)
 Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint32 u32_bgra_cast (const detail::tvec4< T > &c)
 Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint32 u32_bgrx_cast (const detail::tvec3< T > &c)
 Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint32 u32_rgba_cast (const detail::tvec4< T > &c)
 Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint32 u32_rgbx_cast (const detail::tvec3< T > &c)
 Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint32 u32_xbgr_cast (const detail::tvec3< T > &c)
 Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint32 u32_xrgb_cast (const detail::tvec3< T > &c)
 Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint64 u64_abgr_cast (const detail::tvec4< T > &c)
 Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint64 u64_argb_cast (const detail::tvec4< T > &c)
 Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint64 u64_bgra_cast (const detail::tvec4< T > &c)
 Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint64 u64_bgrx_cast (const detail::tvec3< T > &c)
 Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint64 u64_rgba_cast (const detail::tvec4< T > &c)
 Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint64 u64_rgbx_cast (const detail::tvec3< T > &c)
 Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint64 u64_xbgr_cast (const detail::tvec3< T > &c)
 Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension).
+template<typename T >
gtc::type_precision::uint64 u64_xrgb_cast (const detail::tvec3< T > &c)
 Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension).
template<typename valType >
gtc::type_precision::uint8 u8channel_cast (valType a)
 Conversion of a floating value into a 8bit unsigned int value.
+

Detailed Description

+

GLM_GTX_color_cast extension: Conversion between two color types.

+

Function Documentation

+ +
+
+ + + + + + + + + +
gtc::type_precision::uint16 glm::gtx::color_cast::u16channel_cast (valType  a ) 
+
+
+ +

Conversion of a floating value into a 16bit unsigned int value.

+

From GLM_GTX_color_cast extension.

+ +
+
+ +
+
+ + + + + + + + + +
gtc::type_precision::uint8 glm::gtx::color_cast::u8channel_cast (valType  a ) 
+
+
+ +

Conversion of a floating value into a 8bit unsigned int value.

+

From GLM_GTX_color_cast extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00155.html b/doc/html/a00155.html new file mode 100644 index 00000000..756aa2bb --- /dev/null +++ b/doc/html/a00155.html @@ -0,0 +1,205 @@ + + + + +GLM: glm::gtx::color_space Namespace Reference + + + + + + +
+

glm::gtx::color_space Namespace Reference

+

GLM_GTX_color_space extension: Related to RGB to HSV conversions and operations. +More...

+ + + + + + + + + + + + + + + + + + + + +

Functions

template<typename valType >
detail::tvec3< valType > hsvColor (detail::tvec3< valType > const &rgbValue)
 Converts a color from RGB color space to its color in HSV color space.
template<typename valType >
valType luminosity (detail::tvec3< valType > const &color)
 Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals.
template<typename valType >
detail::tvec3< valType > rgbColor (detail::tvec3< valType > const &hsvValue)
 Converts a color from HSV color space to its color in RGB color space.
template<typename valType >
detail::tvec4< valType > saturation (valType const s, detail::tvec4< valType > const &color)
 Modify the saturation of a color.
template<typename valType >
detail::tvec3< valType > saturation (valType const s, detail::tvec3< valType > const &color)
 Modify the saturation of a color.
template<typename valType >
detail::tmat4x4< valType > saturation (valType const s)
 Build a saturation matrix.
+

Detailed Description

+

GLM_GTX_color_space extension: Related to RGB to HSV conversions and operations.

+

Function Documentation

+ +
+
+ + + + + + + + + +
detail::tvec3<valType> glm::gtx::color_space::hsvColor (detail::tvec3< valType > const &  rgbValue ) 
+
+
+ +

Converts a color from RGB color space to its color in HSV color space.

+

From GLM_GTX_color_space extension.

+ +
+
+ +
+
+ + + + + + + + + +
valType glm::gtx::color_space::luminosity (detail::tvec3< valType > const &  color ) 
+
+
+ +

Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals.

+

From GLM_GTX_color_space extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tvec3<valType> glm::gtx::color_space::rgbColor (detail::tvec3< valType > const &  hsvValue ) 
+
+
+ +

Converts a color from HSV color space to its color in RGB color space.

+

From GLM_GTX_color_space extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec4<valType> glm::gtx::color_space::saturation (valType const   s,
detail::tvec4< valType > const &  color 
)
+
+
+ +

Modify the saturation of a color.

+

From GLM_GTX_color_space extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<valType> glm::gtx::color_space::saturation (valType const   s,
detail::tvec3< valType > const &  color 
)
+
+
+ +

Modify the saturation of a color.

+

From GLM_GTX_color_space extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::color_space::saturation (valType const   s ) 
+
+
+ +

Build a saturation matrix.

+

From GLM_GTX_color_space extension

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00156.html b/doc/html/a00156.html new file mode 100644 index 00000000..ee1ab468 --- /dev/null +++ b/doc/html/a00156.html @@ -0,0 +1,139 @@ + + + + +GLM: glm::gtx::color_space_YCoCg Namespace Reference + + + + + + +
+

glm::gtx::color_space_YCoCg Namespace Reference

+

GLM_GTX_color_space_YCoCg extension: RGB to YCoCg conversions and operations. +More...

+ + + + + + + + + + + + + + +

Functions

template<typename valType >
detail::tvec3< valType > rgb2YCoCg (detail::tvec3< valType > const &rgbColor)
 Convert a color from RGB color space to YCoCg color space.
template<typename valType >
detail::tvec3< valType > rgb2YCoCgR (detail::tvec3< valType > const &rgbColor)
 Convert a color from RGB color space to YCoCgR color space.
template<typename valType >
detail::tvec3< valType > YCoCg2rgb (detail::tvec3< valType > const &YCoCgColor)
 Convert a color from YCoCg color space to RGB color space.
template<typename valType >
detail::tvec3< valType > YCoCgR2rgb (detail::tvec3< valType > const &YCoCgColor)
 Convert a color from YCoCgR color space to RGB color space.
+

Detailed Description

+

GLM_GTX_color_space_YCoCg extension: RGB to YCoCg conversions and operations.

+

Function Documentation

+ +
+
+ + + + + + + + + +
detail::tvec3<valType> glm::gtx::color_space_YCoCg::rgb2YCoCg (detail::tvec3< valType > const &  rgbColor ) 
+
+
+ +

Convert a color from RGB color space to YCoCg color space.

+

From GLM_GTX_color_space_YCoCg extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tvec3<valType> glm::gtx::color_space_YCoCg::rgb2YCoCgR (detail::tvec3< valType > const &  rgbColor ) 
+
+
+ +

Convert a color from RGB color space to YCoCgR color space.

+
See also:
"YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" From GLM_GTX_color_space_YCoCg extension.
+ +
+
+ +
+
+ + + + + + + + + +
detail::tvec3<valType> glm::gtx::color_space_YCoCg::YCoCg2rgb (detail::tvec3< valType > const &  YCoCgColor ) 
+
+
+ +

Convert a color from YCoCg color space to RGB color space.

+

From GLM_GTX_color_space_YCoCg extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tvec3<valType> glm::gtx::color_space_YCoCg::YCoCgR2rgb (detail::tvec3< valType > const &  YCoCgColor ) 
+
+
+ +

Convert a color from YCoCgR color space to RGB color space.

+
See also:
"YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" From GLM_GTX_color_space_YCoCg extension.
+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00157.html b/doc/html/a00157.html new file mode 100644 index 00000000..79954917 --- /dev/null +++ b/doc/html/a00157.html @@ -0,0 +1,107 @@ + + + + +GLM: glm::gtx::comparison Namespace Reference + + + + + + +
+

glm::gtx::comparison Namespace Reference

+

GLM_GTX_comparison extension: Defined comparison operators for vectors. +More...

+ + + + + + + + +

Functions

template<typename vecType >
bool operator!= (vecType const &x, vecType const &y)
 Define != operator for vectors From GLM_GTX_comparison extension.
template<typename vecType >
bool operator== (vecType const &x, vecType const &y)
 Define == operator for vectors From GLM_GTX_comparison extension.
+

Detailed Description

+

GLM_GTX_comparison extension: Defined comparison operators for vectors.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::comparison::operator!= (vecType const &  x,
vecType const &  y 
)
+
+
+ +

Define != operator for vectors From GLM_GTX_comparison extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::comparison::operator== (vecType const &  x,
vecType const &  y 
)
+
+
+ +

Define == operator for vectors From GLM_GTX_comparison extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00158.html b/doc/html/a00158.html new file mode 100644 index 00000000..5557f37f --- /dev/null +++ b/doc/html/a00158.html @@ -0,0 +1,373 @@ + + + + +GLM: glm::gtx::compatibility Namespace Reference + + + + + + +
+

glm::gtx::compatibility Namespace Reference

+

GLM_GTX_compatibility extension: Provide functions to increase the compatibility with Cg and HLSL languages. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Typedefs

+typedef bool bool1
 boolean type with 1 component. (From GLM_GTX_compatibility extension)
+typedef bool bool1x1
 boolean matrix with 1 x 1 component. (From GLM_GTX_compatibility extension)
+typedef detail::tvec2< bool > bool2
 boolean type with 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x2< bool > bool2x2
 boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x3< bool > bool2x3
 boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x4< bool > bool2x4
 boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tvec3< bool > bool3
 boolean type with 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x2< bool > bool3x2
 boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x3< bool > bool3x3
 boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x4< bool > bool3x4
 boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tvec4< bool > bool4
 boolean type with 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x2< bool > bool4x2
 boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x3< bool > bool4x3
 boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x4< bool > bool4x4
 boolean matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
+typedef double double1
 double-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension)
+typedef double double1x1
 double-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension)
+typedef detail::tvec2< double > double2
 double-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x2< double > double2x2
 double-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x3< double > double2x3
 double-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x4< double > double2x4
 double-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tvec3< double > double3
 double-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x2< double > double3x2
 double-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x3< double > double3x3
 double-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x4< double > double3x4
 double-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tvec4< double > double4
 double-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x2< double > double4x2
 double-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x3< double > double4x3
 double-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x4< double > double4x4
 double-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
+typedef float float1
 single-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension)
+typedef float float1x1
 single-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension)
+typedef detail::tvec2< float > float2
 single-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x2< float > float2x2
 single-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x3< float > float2x3
 single-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x4< float > float2x4
 single-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tvec3< float > float3
 single-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x2< float > float3x2
 single-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x3< float > float3x3
 single-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x4< float > float3x4
 single-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tvec4< float > float4
 single-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x2< float > float4x2
 single-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x3< float > float4x3
 single-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x4< float > float4x4
 single-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
+typedef gtc::half_float::half half1
 half-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension)
+typedef gtc::half_float::half half1x1
 half-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension)
+typedef detail::tvec2
+< gtc::half_float::half
half2
 half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x2
+< gtc::half_float::half
half2x2
 half-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x3
+< gtc::half_float::half
half2x3
 half-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x4
+< gtc::half_float::half
half2x4
 half-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tvec3
+< gtc::half_float::half
half3
 half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x2
+< gtc::half_float::half
half3x2
 half-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x3
+< gtc::half_float::half
half3x3
 half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x4
+< gtc::half_float::half
half3x4
 half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tvec4
+< gtc::half_float::half
half4
 half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x2
+< gtc::half_float::half
half4x2
 half-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x3
+< gtc::half_float::half
half4x3
 half-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x4
+< gtc::half_float::half
half4x4
 half-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
+typedef int int1
 integer vector with 1 component. (From GLM_GTX_compatibility extension)
+typedef int int1x1
 integer matrix with 1 component. (From GLM_GTX_compatibility extension)
+typedef detail::tvec2< int > int2
 integer vector with 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x2< int > int2x2
 integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x3< int > int2x3
 integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat2x4< int > int2x4
 integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tvec3< int > int3
 integer vector with 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x2< int > int3x2
 integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x3< int > int3x3
 integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat3x4< int > int3x4
 integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tvec4< int > int4
 integer vector with 4 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x2< int > int4x2
 integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x3< int > int4x3
 integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
+typedef detail::tmat4x4< int > int4x4
 integer matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)

Functions

+template<typename T >
detail::tvec4< T > atan2 (const detail::tvec4< T > &x, const detail::tvec4< T > &y)
 Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility).
+template<typename T >
detail::tvec3< T > atan2 (const detail::tvec3< T > &x, const detail::tvec3< T > &y)
 Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility).
+template<typename T >
detail::tvec2< T > atan2 (const detail::tvec2< T > &x, const detail::tvec2< T > &y)
 Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility).
+template<typename T >
atan2 (T x, T y)
 Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility).
+template<typename valType >
detail::tvec4< bool > isfinite (const detail::tvec4< valType > &x)
 Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility).
+template<typename valType >
detail::tvec3< bool > isfinite (const detail::tvec3< valType > &x)
 Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility).
+template<typename valType >
detail::tvec2< bool > isfinite (const detail::tvec2< valType > &x)
 Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility).
+template<typename genType >
bool isfinite (genType const &x)
 Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility).
+template<typename genType >
detail::tvec4< bool > isinf (const detail::tvec4< genType > &x)
 Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension).
+template<typename genType >
detail::tvec3< bool > isinf (const detail::tvec3< genType > &x)
 Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension).
+template<typename genType >
detail::tvec2< bool > isinf (const detail::tvec2< genType > &x)
 Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension).
+template<typename genType >
bool isinf (genType const &x)
 Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension).
+template<typename genType >
detail::tvec4< bool > isnan (const detail::tvec4< genType > &x)
 Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension).
+template<typename genType >
detail::tvec3< bool > isnan (const detail::tvec3< genType > &x)
 Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension).
+template<typename genType >
detail::tvec2< bool > isnan (const detail::tvec2< genType > &x)
 Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension).
+template<typename genType >
bool isnan (genType const &x)
 Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension).
+template<typename T >
detail::tvec4< T > lerp (const detail::tvec4< T > &x, const detail::tvec4< T > &y, const detail::tvec4< T > &a)
 Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility).
+template<typename T >
detail::tvec3< T > lerp (const detail::tvec3< T > &x, const detail::tvec3< T > &y, const detail::tvec3< T > &a)
 Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility).
+template<typename T >
detail::tvec2< T > lerp (const detail::tvec2< T > &x, const detail::tvec2< T > &y, const detail::tvec2< T > &a)
 Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility).
+template<typename T >
detail::tvec4< T > lerp (const detail::tvec4< T > &x, const detail::tvec4< T > &y, T a)
 Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility).
+template<typename T >
detail::tvec3< T > lerp (const detail::tvec3< T > &x, const detail::tvec3< T > &y, T a)
 Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility).
+template<typename T >
detail::tvec2< T > lerp (const detail::tvec2< T > &x, const detail::tvec2< T > &y, T a)
 Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility).
+template<typename T >
lerp (T x, T y, T a)
 Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility).
+template<typename T >
detail::tvec4< T > saturate (const detail::tvec4< T > &x)
 Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility).
+template<typename T >
detail::tvec3< T > saturate (const detail::tvec3< T > &x)
 Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility).
+template<typename T >
detail::tvec2< T > saturate (const detail::tvec2< T > &x)
 Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility).
+template<typename T >
saturate (T x)
 Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility).
+

Detailed Description

+

GLM_GTX_compatibility extension: Provide functions to increase the compatibility with Cg and HLSL languages.

+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00159.html b/doc/html/a00159.html new file mode 100644 index 00000000..e840d7ba --- /dev/null +++ b/doc/html/a00159.html @@ -0,0 +1,139 @@ + + + + +GLM: glm::gtx::component_wise Namespace Reference + + + + + + +
+

glm::gtx::component_wise Namespace Reference

+

GLM_GTX_component_wise extension: Operations between components of a type. +More...

+ + + + + + + + + + + + + + +

Functions

template<typename genType >
genType::value_type compAdd (genType const &v)
 Add all vector components together.
template<typename genType >
genType::value_type compMax (genType const &v)
 Find the maximum value between single vector components.
template<typename genType >
genType::value_type compMin (genType const &v)
 Find the minimum value between single vector components.
template<typename genType >
genType::value_type compMul (genType const &v)
 Multiply all vector components together.
+

Detailed Description

+

GLM_GTX_component_wise extension: Operations between components of a type.

+

Function Documentation

+ +
+
+ + + + + + + + + +
genType::value_type glm::gtx::component_wise::compAdd (genType const &  v ) 
+
+
+ +

Add all vector components together.

+

From GLM_GTX_component_wise extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType::value_type glm::gtx::component_wise::compMax (genType const &  v ) 
+
+
+ +

Find the maximum value between single vector components.

+

From GLM_GTX_component_wise extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType::value_type glm::gtx::component_wise::compMin (genType const &  v ) 
+
+
+ +

Find the minimum value between single vector components.

+

From GLM_GTX_component_wise extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType::value_type glm::gtx::component_wise::compMul (genType const &  v ) 
+
+
+ +

Multiply all vector components together.

+

From GLM_GTX_component_wise extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00160.html b/doc/html/a00160.html new file mode 100644 index 00000000..a5500e7b --- /dev/null +++ b/doc/html/a00160.html @@ -0,0 +1,41 @@ + + + + +GLM: glm::gtx::determinant Namespace Reference + + + + + + +
+

glm::gtx::determinant Namespace Reference

+

GLM_GTX_determinant extension: Compute the determinant of a matrix. +More...

+ +
+

Detailed Description

+

GLM_GTX_determinant extension: Compute the determinant of a matrix.

+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00161.html b/doc/html/a00161.html new file mode 100644 index 00000000..83e5c383 --- /dev/null +++ b/doc/html/a00161.html @@ -0,0 +1,83 @@ + + + + +GLM: glm::gtx::double_float Namespace Reference + + + + + + +
+

glm::gtx::double_float Namespace Reference

+

GLM_GTX_double_float extension: Add support for double precision flotting-point types. +More...

+ + + + + + +

Typedefs

typedef detail::tquat< double > dquat
 Quaternion of double-precision floating-point numbers.
typedef detail::tquat< float > fquat
 Quaternion of single-precision floating-point numbers.
+

Detailed Description

+

GLM_GTX_double_float extension: Add support for double precision flotting-point types.

+

Typedef Documentation

+ +
+
+ + + + +
typedef detail::tquat<double> dquat
+
+
+ +

Quaternion of double-precision floating-point numbers.

+

From GLM_GTX_double extension.

+ +

Definition at line 43 of file gtx/double_float.hpp.

+ +
+
+ +
+
+ + + + +
typedef detail::tquat<float> fquat
+
+
+ +

Quaternion of single-precision floating-point numbers.

+

From GLM_GTX_double extension.

+ +

Definition at line 39 of file gtx/double_float.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00162.html b/doc/html/a00162.html new file mode 100644 index 00000000..31754a88 --- /dev/null +++ b/doc/html/a00162.html @@ -0,0 +1,121 @@ + + + + +GLM: glm::gtx::epsilon Namespace Reference + + + + + + +
+

glm::gtx::epsilon Namespace Reference

+

GLM_GTX_epsilon extension: Comparaison functions for a user defined epsilon values. +More...

+ + + + + + + + +

Functions

template<typename genTypeT , typename genTypeU >
bool equalEpsilon (genTypeT const &x, genTypeT const &y, genTypeU const &epsilon)
 Returns the component-wise compare of |x - y| < epsilon.
template<typename genTypeT , typename genTypeU >
bool notEqualEpsilon (genTypeT const &x, genTypeT const &y, genTypeU const &epsilon)
 Returns the component-wise compare of |x - y| >= epsilon.
+

Detailed Description

+

GLM_GTX_epsilon extension: Comparaison functions for a user defined epsilon values.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::epsilon::equalEpsilon (genTypeT const &  x,
genTypeT const &  y,
genTypeU const &  epsilon 
)
+
+
+ +

Returns the component-wise compare of |x - y| < epsilon.

+

From GLM_GTX_epsilon extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::epsilon::notEqualEpsilon (genTypeT const &  x,
genTypeT const &  y,
genTypeU const &  epsilon 
)
+
+
+ +

Returns the component-wise compare of |x - y| >= epsilon.

+

From GLM_GTX_epsilon extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00163.html b/doc/html/a00163.html new file mode 100644 index 00000000..5f67f7f8 --- /dev/null +++ b/doc/html/a00163.html @@ -0,0 +1,487 @@ + + + + +GLM: glm::gtx::euler_angles Namespace Reference + + + + + + +
+

glm::gtx::euler_angles Namespace Reference

+

GLM_GTX_euler_angles extension: Build matrices from euler angles. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename valType >
detail::tmat4x4< valType > eulerAngleX (valType const &angleX)
 Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X.
template<typename valType >
detail::tmat4x4< valType > eulerAngleXY (valType const &angleX, valType const &angleY)
 Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y).
template<typename valType >
detail::tmat4x4< valType > eulerAngleXZ (valType const &angleX, valType const &angleZ)
 Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z).
template<typename valType >
detail::tmat4x4< valType > eulerAngleY (valType const &angleY)
 Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y.
template<typename valType >
detail::tmat4x4< valType > eulerAngleYX (valType const &angleY, valType const &angleX)
 Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X).
template<typename valType >
detail::tmat4x4< valType > eulerAngleYXZ (valType const &yaw, valType const &pitch, valType const &roll)
 Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
template<typename valType >
detail::tmat4x4< valType > eulerAngleYZ (valType const &angleY, valType const &angleZ)
 Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z).
template<typename valType >
detail::tmat4x4< valType > eulerAngleZ (valType const &angleZ)
 Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z.
template<typename valType >
detail::tmat4x4< valType > eulerAngleZX (valType const &angleZ, valType const &angleX)
 Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X).
template<typename valType >
detail::tmat4x4< valType > eulerAngleZY (valType const &angleZ, valType const &angleY)
 Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y).
template<typename T >
detail::tmat2x2< T > orientate2 (T const &angle)
 Creates a 2D 2 * 2 rotation matrix from an euler angle.
template<typename T >
detail::tmat3x3< T > orientate3 (detail::tvec3< T > const &angles)
 Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z).
template<typename T >
detail::tmat3x3< T > orientate3 (T const &angle)
 Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle.
template<typename T >
detail::tmat4x4< T > orientate4 (detail::tvec3< T > const &angles)
 Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
template<typename valType >
detail::tmat4x4< valType > yawPitchRoll (valType const &yaw, valType const &pitch, valType const &roll)
 Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
+

Detailed Description

+

GLM_GTX_euler_angles extension: Build matrices from euler angles.

+

Function Documentation

+ +
+
+ + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::euler_angles::eulerAngleX (valType const &  angleX ) 
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X.

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::euler_angles::eulerAngleXY (valType const &  angleX,
valType const &  angleY 
)
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y).

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::euler_angles::eulerAngleXZ (valType const &  angleX,
valType const &  angleZ 
)
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z).

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::euler_angles::eulerAngleY (valType const &  angleY ) 
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y.

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::euler_angles::eulerAngleYX (valType const &  angleY,
valType const &  angleX 
)
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X).

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::euler_angles::eulerAngleYXZ (valType const &  yaw,
valType const &  pitch,
valType const &  roll 
)
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::euler_angles::eulerAngleYZ (valType const &  angleY,
valType const &  angleZ 
)
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z).

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::euler_angles::eulerAngleZ (valType const &  angleZ ) 
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z.

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::euler_angles::eulerAngleZX (valType const &  angleZ,
valType const &  angleX 
)
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X).

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::euler_angles::eulerAngleZY (valType const &  angleZ,
valType const &  angleY 
)
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y).

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat2x2<T> glm::gtx::euler_angles::orientate2 (T const &  angle ) 
+
+
+ +

Creates a 2D 2 * 2 rotation matrix from an euler angle.

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat3x3<T> glm::gtx::euler_angles::orientate3 (detail::tvec3< T > const &  angles ) 
+
+
+ +

Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z).

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat3x3<T> glm::gtx::euler_angles::orientate3 (T const &  angle ) 
+
+
+ +

Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle.

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<T> glm::gtx::euler_angles::orientate4 (detail::tvec3< T > const &  angles ) 
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).

+

From GLM_GTX_euler_angles extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::euler_angles::yawPitchRoll (valType const &  yaw,
valType const &  pitch,
valType const &  roll 
)
+
+
+ +

Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).

+

From GLM_GTX_euler_angles extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00164.html b/doc/html/a00164.html new file mode 100644 index 00000000..71fa15ee --- /dev/null +++ b/doc/html/a00164.html @@ -0,0 +1,82 @@ + + + + +GLM: glm::gtx::extend Namespace Reference + + + + + + +
+

glm::gtx::extend Namespace Reference

+

GLM_GTX_extend extension: Extend a position from a source to a position at a defined length. +More...

+ + + + + +

Functions

template<typename genType >
genType extend (genType const &Origin, genType const &Source, typename genType::value_type const Length)
 Extends of Length the Origin position using the (Source - Origin) direction.
+

Detailed Description

+

GLM_GTX_extend extension: Extend a position from a source to a position at a defined length.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
genType glm::gtx::extend::extend (genType const &  Origin,
genType const &  Source,
typename genType::value_type const   Length 
)
+
+
+ +

Extends of Length the Origin position using the (Source - Origin) direction.

+

From GLM_GTX_extend extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00165.html b/doc/html/a00165.html new file mode 100644 index 00000000..83f7d487 --- /dev/null +++ b/doc/html/a00165.html @@ -0,0 +1,154 @@ + + + + +GLM: glm::gtx::extented_min_max Namespace Reference + + + + + + +
+

glm::gtx::extented_min_max Namespace Reference

+

GLM_GTX_extented_min_max extension: Min and max functions for 3 to 4 parameters. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

+template<typename T >
detail::tvec4< T > max (const detail::tvec4< T > &x, const detail::tvec4< T > &y, const detail::tvec4< T > &z, const detail::tvec4< T > &w)
 Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec3< T > max (const detail::tvec3< T > &x, const detail::tvec3< T > &y, const detail::tvec3< T > &z, const detail::tvec3< T > &w)
 Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec2< T > max (const detail::tvec2< T > &x, const detail::tvec2< T > &y, const detail::tvec2< T > &z, const detail::tvec2< T > &w)
 Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec4< T > max (const detail::tvec4< T > &x, const detail::tvec4< T > &y, const detail::tvec4< T > &z)
 Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec3< T > max (const detail::tvec3< T > &x, const detail::tvec3< T > &y, const detail::tvec3< T > &z)
 Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec2< T > max (const detail::tvec2< T > &x, const detail::tvec2< T > &y, const detail::tvec2< T > &z)
 Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec4< T > max (const detail::tvec4< T > &x, const T y, const T z, const T w)
 Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec3< T > max (const detail::tvec3< T > &x, const T y, const T z, const T w)
 Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec2< T > max (const detail::tvec2< T > &x, const T y, const T z, const T w)
 Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec4< T > max (const detail::tvec4< T > &x, const T y, const T z)
 Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec3< T > max (const detail::tvec3< T > &x, const T y, const T z)
 Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec2< T > max (const detail::tvec2< T > &x, const T y, const T z)
 Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
max (const T x, const T y, const T z, const T w)
 Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
max (const T x, const T y, const T z)
 Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec4< T > min (const detail::tvec4< T > &x, const detail::tvec4< T > &y, const detail::tvec4< T > &z, const detail::tvec4< T > &w)
 Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec3< T > min (const detail::tvec3< T > &x, const detail::tvec3< T > &y, const detail::tvec3< T > &z, const detail::tvec3< T > &w)
 Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec2< T > min (const detail::tvec2< T > &x, const detail::tvec2< T > &y, const detail::tvec2< T > &z, const detail::tvec2< T > &w)
 Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec4< T > min (const detail::tvec4< T > &x, const detail::tvec4< T > &y, const detail::tvec4< T > &z)
 Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec3< T > min (const detail::tvec3< T > &x, const detail::tvec3< T > &y, const detail::tvec3< T > &z)
 Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec2< T > min (const detail::tvec2< T > &x, const detail::tvec2< T > &y, const detail::tvec2< T > &z)
 Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec4< T > min (const detail::tvec4< T > &x, const T y, const T z, const T w)
 Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec3< T > min (const detail::tvec3< T > &x, const T y, const T z, const T w)
 Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec2< T > min (const detail::tvec2< T > &x, const T y, const T z, const T w)
 Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec4< T > min (const detail::tvec4< T > &x, const T y, const T z)
 Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec3< T > min (const detail::tvec3< T > &x, const T y, const T z)
 Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
detail::tvec2< T > min (const detail::tvec2< T > &x, const T y, const T z)
 Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
min (const T x, const T y, const T z, const T w)
 Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+template<typename T >
min (const T x, const T y, const T z)
 Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension).
+

Detailed Description

+

GLM_GTX_extented_min_max extension: Min and max functions for 3 to 4 parameters.

+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00166.html b/doc/html/a00166.html new file mode 100644 index 00000000..4a1714cb --- /dev/null +++ b/doc/html/a00166.html @@ -0,0 +1,229 @@ + + + + +GLM: glm::gtx::fast_exponential Namespace Reference + + + + + + +
+

glm::gtx::fast_exponential Namespace Reference

+

GLM_GTX_fast_exponential extension: Fast but less accurate implementations of exponential based functions. +More...

+ + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename T >
fastExp (const T &x)
 Faster than the common exp function but less accurate.
template<typename T >
fastExp2 (const T &x)
 Faster than the common exp2 function but less accurate.
template<typename T >
fastLn (const T &x)
 Faster than the common ln function but less accurate.
template<typename T >
fastLog (const T &x)
 Faster than the common log function but less accurate.
template<typename T >
fastLog2 (const T &x)
 Faster than the common log2 function but less accurate.
template<typename T , typename U >
fastPow (const T &x, const U &y)
 Faster than the common pow function but less accurate.
template<typename valType >
valType fastPow (valType const &x, valType const &y)
 Faster than the common pow function but less accurate.
+

Detailed Description

+

GLM_GTX_fast_exponential extension: Fast but less accurate implementations of exponential based functions.

+

Function Documentation

+ +
+
+ + + + + + + + + +
T glm::gtx::fast_exponential::fastExp (const T &  x ) 
+
+
+ +

Faster than the common exp function but less accurate.

+

From GLM_GTX_fast_exponential extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::fast_exponential::fastExp2 (const T &  x ) 
+
+
+ +

Faster than the common exp2 function but less accurate.

+

From GLM_GTX_fast_exponential extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::fast_exponential::fastLn (const T &  x ) 
+
+
+ +

Faster than the common ln function but less accurate.

+

From GLM_GTX_fast_exponential extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::fast_exponential::fastLog (const T &  x ) 
+
+
+ +

Faster than the common log function but less accurate.

+

From GLM_GTX_fast_exponential extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::fast_exponential::fastLog2 (const T &  x ) 
+
+
+ +

Faster than the common log2 function but less accurate.

+

From GLM_GTX_fast_exponential extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
T glm::gtx::fast_exponential::fastPow (const T &  x,
const U &  y 
)
+
+
+ +

Faster than the common pow function but less accurate.

+

From GLM_GTX_fast_exponential extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
valType glm::gtx::fast_exponential::fastPow (valType const &  x,
valType const &  y 
)
+
+
+ +

Faster than the common pow function but less accurate.

+

From GLM_GTX_fast_exponential extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00167.html b/doc/html/a00167.html new file mode 100644 index 00000000..bdb0920e --- /dev/null +++ b/doc/html/a00167.html @@ -0,0 +1,172 @@ + + + + +GLM: glm::gtx::fast_square_root Namespace Reference + + + + + + +
+

glm::gtx::fast_square_root Namespace Reference

+

GLM_GTX_fast_square_root extension: Fast but less accurate implementations of square root based functions. +More...

+ + + + + + + + + + + + + + + + + +

Functions

template<typename genType >
genType::value_type fastDistance (genType const &x, genType const &y)
 Faster than the common distance function but less accurate.
template<typename genType >
genType fastInverseSqrt (genType const &x)
 Faster than the common inversesqrt function but less accurate.
template<typename genType >
genType::value_type fastLength (genType const &x)
 Faster than the common length function but less accurate.
template<typename genType >
genType fastNormalize (genType const &x)
 Faster than the common normalize function but less accurate.
template<typename genType >
genType fastSqrt (genType const &x)
 Faster than the common sqrt function but less accurate.
+

Detailed Description

+

GLM_GTX_fast_square_root extension: Fast but less accurate implementations of square root based functions.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
genType::value_type glm::gtx::fast_square_root::fastDistance (genType const &  x,
genType const &  y 
)
+
+
+ +

Faster than the common distance function but less accurate.

+

From GLM_GTX_fast_square_root extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::fast_square_root::fastInverseSqrt (genType const &  x ) 
+
+
+ +

Faster than the common inversesqrt function but less accurate.

+

From GLM_GTX_fast_square_root extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType::value_type glm::gtx::fast_square_root::fastLength (genType const &  x ) 
+
+
+ +

Faster than the common length function but less accurate.

+

From GLM_GTX_fast_square_root extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::fast_square_root::fastNormalize (genType const &  x ) 
+
+
+ +

Faster than the common normalize function but less accurate.

+

From GLM_GTX_fast_square_root extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::fast_square_root::fastSqrt (genType const &  x ) 
+
+
+ +

Faster than the common sqrt function but less accurate.

+

From GLM_GTX_fast_square_root extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00168.html b/doc/html/a00168.html new file mode 100644 index 00000000..5421b320 --- /dev/null +++ b/doc/html/a00168.html @@ -0,0 +1,220 @@ + + + + +GLM: glm::gtx::fast_trigonometry Namespace Reference + + + + + + +
+

glm::gtx::fast_trigonometry Namespace Reference

+

GLM_GTX_fast_trigonometry extension: Fast but less accurate implementations of trigonometric functions. +More...

+ + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename T >
fastAcos (const T &angle)
 Faster than the common acos function but less accurate.
template<typename T >
fastAsin (const T &angle)
 Faster than the common asin function but less accurate.
template<typename T >
fastAtan (const T &angle)
 Faster than the common atan function but less accurate.
template<typename T >
fastAtan (const T &y, const T &x)
 Faster than the common atan function but less accurate.
template<typename T >
fastCos (const T &angle)
 Faster than the common cos function but less accurate.
template<typename T >
fastSin (const T &angle)
 Faster than the common sin function but less accurate.
template<typename T >
fastTan (const T &angle)
 Faster than the common tan function but less accurate.
+

Detailed Description

+

GLM_GTX_fast_trigonometry extension: Fast but less accurate implementations of trigonometric functions.

+

Function Documentation

+ +
+
+ + + + + + + + + +
T glm::gtx::fast_trigonometry::fastAcos (const T &  angle ) 
+
+
+ +

Faster than the common acos function but less accurate.

+

Defined between -2pi and 2pi. From GLM_GTX_fast_trigonometry extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::fast_trigonometry::fastAsin (const T &  angle ) 
+
+
+ +

Faster than the common asin function but less accurate.

+

Defined between -2pi and 2pi. From GLM_GTX_fast_trigonometry extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::fast_trigonometry::fastAtan (const T &  angle ) 
+
+
+ +

Faster than the common atan function but less accurate.

+

Defined between -2pi and 2pi. From GLM_GTX_fast_trigonometry extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
T glm::gtx::fast_trigonometry::fastAtan (const T &  y,
const T &  x 
)
+
+
+ +

Faster than the common atan function but less accurate.

+

Defined between -2pi and 2pi. From GLM_GTX_fast_trigonometry extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::fast_trigonometry::fastCos (const T &  angle ) 
+
+
+ +

Faster than the common cos function but less accurate.

+

Defined between -2pi and 2pi. From GLM_GTX_fast_trigonometry extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::fast_trigonometry::fastSin (const T &  angle ) 
+
+
+ +

Faster than the common sin function but less accurate.

+

Defined between -2pi and 2pi. From GLM_GTX_fast_trigonometry extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::fast_trigonometry::fastTan (const T &  angle ) 
+
+
+ +

Faster than the common tan function but less accurate.

+

Defined between -2pi and 2pi. From GLM_GTX_fast_trigonometry extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00169.html b/doc/html/a00169.html new file mode 100644 index 00000000..51e26d12 --- /dev/null +++ b/doc/html/a00169.html @@ -0,0 +1,41 @@ + + + + +GLM: glm::gtx::gradient_paint Namespace Reference + + + + + + +
+

glm::gtx::gradient_paint Namespace Reference

+

GLM_GTX_gradient_paint extension: Compute a radient gradient according section OpenVG 1.1 specifications, 9.3.2 Radial Gradients. +More...

+ +
+

Detailed Description

+

GLM_GTX_gradient_paint extension: Compute a radient gradient according section OpenVG 1.1 specifications, 9.3.2 Radial Gradients.

+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00170.html b/doc/html/a00170.html new file mode 100644 index 00000000..50af2107 --- /dev/null +++ b/doc/html/a00170.html @@ -0,0 +1,64 @@ + + + + +GLM: glm::gtx::half_float Namespace Reference + + + + + + +
+

glm::gtx::half_float Namespace Reference

+

GLM_GTX_half_float extension: Add support for half precision flotting-point types. +More...

+ + + + +

Typedefs

typedef detail::tquat
+< detail::thalf > 
hquat
 Quaternion of half-precision floating-point numbers.
+

Detailed Description

+

GLM_GTX_half_float extension: Add support for half precision flotting-point types.

+

Typedef Documentation

+ +
+
+ + + + +
typedef detail::tquat<detail::thalf> hquat
+
+
+ +

Quaternion of half-precision floating-point numbers.

+

From GLM_GTX_half_float extension.

+ +

Definition at line 35 of file gtx/half_float.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00171.html b/doc/html/a00171.html new file mode 100644 index 00000000..67f75a0e --- /dev/null +++ b/doc/html/a00171.html @@ -0,0 +1,121 @@ + + + + +GLM: glm::gtx::handed_coordinate_space Namespace Reference + + + + + + +
+

glm::gtx::handed_coordinate_space Namespace Reference

+

GLM_GTX_handed_coordinate_space extension: To know if a triedron is right or left handed. +More...

+ + + + + + + + +

Functions

template<typename T >
bool leftHanded (detail::tvec3< T > const &tangent, detail::tvec3< T > const &binormal, detail::tvec3< T > const &normal)
 Return if a trihedron left handed or not.
template<typename T >
bool rightHanded (detail::tvec3< T > const &tangent, detail::tvec3< T > const &binormal, detail::tvec3< T > const &normal)
 Return if a trihedron right handed or not.
+

Detailed Description

+

GLM_GTX_handed_coordinate_space extension: To know if a triedron is right or left handed.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::handed_coordinate_space::leftHanded (detail::tvec3< T > const &  tangent,
detail::tvec3< T > const &  binormal,
detail::tvec3< T > const &  normal 
)
+
+
+ +

Return if a trihedron left handed or not.

+

From GLM_GTX_handed_coordinate_space extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::handed_coordinate_space::rightHanded (detail::tvec3< T > const &  tangent,
detail::tvec3< T > const &  binormal,
detail::tvec3< T > const &  normal 
)
+
+
+ +

Return if a trihedron right handed or not.

+

From GLM_GTX_handed_coordinate_space extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00172.html b/doc/html/a00172.html new file mode 100644 index 00000000..0eba5609 --- /dev/null +++ b/doc/html/a00172.html @@ -0,0 +1,307 @@ + + + + +GLM: glm::gtx::inertia Namespace Reference + + + + + + +
+

glm::gtx::inertia Namespace Reference

+

GLM_GTX_inertia extension: Create inertia matrices. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename T >
detail::tmat3x3< T > ballInertia3 (const T Mass, const T Radius)
 Build an inertia matrix for a ball.
template<typename T >
detail::tmat4x4< T > ballInertia4 (const T Mass, const T Radius)
 Build an inertia matrix for a ball.
template<typename T >
detail::tmat3x3< T > boxInertia3 (const T Mass, const detail::tvec3< T > &Scale)
 Build an inertia matrix for a box.
template<typename T >
detail::tmat4x4< T > boxInertia4 (const T Mass, const detail::tvec3< T > &Scale)
 Build an inertia matrix for a box.
template<typename T >
detail::tmat3x3< T > diskInertia3 (const T Mass, const T Radius)
 Build an inertia matrix for a disk.
template<typename T >
detail::tmat4x4< T > diskInertia4 (const T Mass, const T Radius)
 Build an inertia matrix for a disk.
template<typename T >
detail::tmat3x3< T > sphereInertia3 (const T Mass, const T Radius)
 Build an inertia matrix for a sphere.
template<typename T >
detail::tmat4x4< T > sphereInertia4 (const T Mass, const T Radius)
 Build an inertia matrix for a sphere.
+

Detailed Description

+

GLM_GTX_inertia extension: Create inertia matrices.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat3x3<T> glm::gtx::inertia::ballInertia3 (const T  Mass,
const T  Radius 
)
+
+
+ +

Build an inertia matrix for a ball.

+

From GLM_GTX_inertia extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::inertia::ballInertia4 (const T  Mass,
const T  Radius 
)
+
+
+ +

Build an inertia matrix for a ball.

+

From GLM_GTX_inertia extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat3x3<T> glm::gtx::inertia::boxInertia3 (const T  Mass,
const detail::tvec3< T > &  Scale 
)
+
+
+ +

Build an inertia matrix for a box.

+

From GLM_GTX_inertia extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::inertia::boxInertia4 (const T  Mass,
const detail::tvec3< T > &  Scale 
)
+
+
+ +

Build an inertia matrix for a box.

+

From GLM_GTX_inertia extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat3x3<T> glm::gtx::inertia::diskInertia3 (const T  Mass,
const T  Radius 
)
+
+
+ +

Build an inertia matrix for a disk.

+

From GLM_GTX_inertia extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::inertia::diskInertia4 (const T  Mass,
const T  Radius 
)
+
+
+ +

Build an inertia matrix for a disk.

+

From GLM_GTX_inertia extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat3x3<T> glm::gtx::inertia::sphereInertia3 (const T  Mass,
const T  Radius 
)
+
+
+ +

Build an inertia matrix for a sphere.

+

From GLM_GTX_inertia extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::inertia::sphereInertia4 (const T  Mass,
const T  Radius 
)
+
+
+ +

Build an inertia matrix for a sphere.

+

From GLM_GTX_inertia extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00173.html b/doc/html/a00173.html new file mode 100644 index 00000000..48949a30 --- /dev/null +++ b/doc/html/a00173.html @@ -0,0 +1,153 @@ + + + + +GLM: glm::gtx::integer Namespace Reference + + + + + + +
+

glm::gtx::integer Namespace Reference

+

GLM_GTX_integer extension: Add support for integer for core functions. +More...

+ + + + + + + + + + + +

Functions

template<typename genType >
genType factorial (genType const &x)
 Return the factorial value of a number (!12 max, integer only) From GLM_GTX_integer extension.
int mod (int x, int y)
 Modulus.
int pow (int x, int y)
 Returns x raised to the y power.
int sqrt (int x)
 Returns the positive square root of x.
+

Detailed Description

+

GLM_GTX_integer extension: Add support for integer for core functions.

+

Function Documentation

+ +
+
+ + + + + + + + + +
genType glm::gtx::integer::factorial (genType const &  x ) 
+
+
+ +

Return the factorial value of a number (!12 max, integer only) From GLM_GTX_integer extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int glm::gtx::integer::mod (int  x,
int  y 
)
+
+
+ +

Modulus.

+

Returns x - y * floor(x / y) for each component in x using the floating point value y. From GLM_GTX_integer extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
int glm::gtx::integer::pow (int  x,
int  y 
)
+
+
+ +

Returns x raised to the y power.

+

From GLM_GTX_integer extension.

+ +
+
+ +
+
+ + + + + + + + + +
int glm::gtx::integer::sqrt (int  x ) 
+
+
+ +

Returns the positive square root of x.

+

From GLM_GTX_integer extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:24 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00174.html b/doc/html/a00174.html new file mode 100644 index 00000000..b4eac0e4 --- /dev/null +++ b/doc/html/a00174.html @@ -0,0 +1,271 @@ + + + + +GLM: glm::gtx::intersect Namespace Reference + + + + + + +
+

glm::gtx::intersect Namespace Reference

+

GLM_GTX_intersect extension: Add intersection functions. +More...

+ + + + + + + + + + + + + + +

Functions

template<typename genType >
bool intersectLineSphere (genType const &point0, genType const &point1, genType const &center, typename genType::value_type radius, genType &position, genType &normal)
 Compute the intersection of a line and a sphere.
template<typename genType >
bool intersectLineTriangle (genType const &orig, genType const &dir, genType const &vert0, genType const &vert1, genType const &vert2, genType &position)
 Compute the intersection of a line and a triangle.
template<typename genType >
bool intersectRaySphere (genType const &orig, genType const &dir, genType const &center, typename genType::value_type radius, genType &position, genType &normal)
 Compute the intersection of a ray and a sphere.
template<typename genType >
bool intersectRayTriangle (genType const &orig, genType const &dir, genType const &vert0, genType const &vert1, genType const &vert2, genType &baryPosition)
 Compute the intersection of a ray and a triangle.
+

Detailed Description

+

GLM_GTX_intersect extension: Add intersection functions.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::intersect::intersectLineSphere (genType const &  point0,
genType const &  point1,
genType const &  center,
typename genType::value_type  radius,
genType &  position,
genType &  normal 
)
+
+
+ +

Compute the intersection of a line and a sphere.

+

From GLM_GTX_intersect extension

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::intersect::intersectLineTriangle (genType const &  orig,
genType const &  dir,
genType const &  vert0,
genType const &  vert1,
genType const &  vert2,
genType &  position 
)
+
+
+ +

Compute the intersection of a line and a triangle.

+

From GLM_GTX_intersect extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::intersect::intersectRaySphere (genType const &  orig,
genType const &  dir,
genType const &  center,
typename genType::value_type  radius,
genType &  position,
genType &  normal 
)
+
+
+ +

Compute the intersection of a ray and a sphere.

+

From GLM_GTX_intersect extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::intersect::intersectRayTriangle (genType const &  orig,
genType const &  dir,
genType const &  vert0,
genType const &  vert1,
genType const &  vert2,
genType &  baryPosition 
)
+
+
+ +

Compute the intersection of a ray and a triangle.

+

From GLM_GTX_intersect extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00175.html b/doc/html/a00175.html new file mode 100644 index 00000000..d351cf71 --- /dev/null +++ b/doc/html/a00175.html @@ -0,0 +1,67 @@ + + + + +GLM: glm::gtx::inverse Namespace Reference + + + + + + +
+

glm::gtx::inverse Namespace Reference

+

GLM_GTX_inverse extension: Inverse matrix functions. +More...

+ + + + + +

Functions

template<typename genType >
genType affineInverse (genType const &m)
 Fast matrix inverse for affine matrix.
+

Detailed Description

+

GLM_GTX_inverse extension: Inverse matrix functions.

+

Function Documentation

+ +
+
+ + + + + + + + + +
genType glm::gtx::inverse::affineInverse (genType const &  m ) 
+
+
+ +

Fast matrix inverse for affine matrix.

+

From GLM_GTX_inverse extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00176.html b/doc/html/a00176.html new file mode 100644 index 00000000..dbdb1c71 --- /dev/null +++ b/doc/html/a00176.html @@ -0,0 +1,67 @@ + + + + +GLM: glm::gtx::inverse_transpose Namespace Reference + + + + + + +
+

glm::gtx::inverse_transpose Namespace Reference

+

GLM_GTX_inverse_transpose extension: Inverse transpose matrix functions. +More...

+ + + + + +

Functions

template<typename genType >
genType::value_type inverseTranspose (genType const &m)
 Compute the inverse transpose of a matrix.
+

Detailed Description

+

GLM_GTX_inverse_transpose extension: Inverse transpose matrix functions.

+

Function Documentation

+ +
+
+ + + + + + + + + +
genType::value_type glm::gtx::inverse_transpose::inverseTranspose (genType const &  m ) 
+
+
+ +

Compute the inverse transpose of a matrix.

+

From GLM_GTX_inverse extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00177.html b/doc/html/a00177.html new file mode 100644 index 00000000..1c1b64ec --- /dev/null +++ b/doc/html/a00177.html @@ -0,0 +1,76 @@ + + + + +GLM: glm::gtx::log_base Namespace Reference + + + + + + +
+

glm::gtx::log_base Namespace Reference

+

GLM_GTX_log_base extension: Logarithm for any base. base can be a vector or a scalar. +More...

+ + + + + +

Functions

template<typename genType >
genType log (genType const &x, genType const &base)
 Logarithm for any base.
+

Detailed Description

+

GLM_GTX_log_base extension: Logarithm for any base. base can be a vector or a scalar.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
genType glm::gtx::log_base::log (genType const &  x,
genType const &  base 
)
+
+
+ +

Logarithm for any base.

+

From GLM_GTX_log_base.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00178.html b/doc/html/a00178.html new file mode 100644 index 00000000..ba6c92e8 --- /dev/null +++ b/doc/html/a00178.html @@ -0,0 +1,121 @@ + + + + +GLM: glm::gtx::matrix_access Namespace Reference + + + + + + +
+

glm::gtx::matrix_access Namespace Reference

+

GLM_GTX_matrix_access extension: Set a column or a row of a matrix. +More...

+ + + + + + + + +

Functions

template<typename genType >
genType column (const genType &m, int index, typename genType::col_type const &x)
 Set a specific column to a matrix.
template<typename genType >
genType row (const genType &m, int index, typename genType::row_type const &x)
 Set a specific row to a matrix.
+

Detailed Description

+

GLM_GTX_matrix_access extension: Set a column or a row of a matrix.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
genType glm::gtx::matrix_access::column (const genType &  m,
int  index,
typename genType::col_type const &  x 
)
+
+
+ +

Set a specific column to a matrix.

+

From GLM_GTX_matrix_access extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
genType glm::gtx::matrix_access::row (const genType &  m,
int  index,
typename genType::row_type const &  x 
)
+
+
+ +

Set a specific row to a matrix.

+

From GLM_GTX_matrix_access extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00179.html b/doc/html/a00179.html new file mode 100644 index 00000000..6a6e33f3 --- /dev/null +++ b/doc/html/a00179.html @@ -0,0 +1,91 @@ + + + + +GLM: glm::gtx::matrix_cross_product Namespace Reference + + + + + + +
+

glm::gtx::matrix_cross_product Namespace Reference

+

GLM_GTX_matrix_cross_product: Build cross product matrices. +More...

+ + + + + + + + +

Functions

template<typename T >
detail::tmat3x3< T > matrixCross3 (detail::tvec3< T > const &x)
 Build a cross product matrix.
template<typename T >
detail::tmat4x4< T > matrixCross4 (detail::tvec3< T > const &x)
 Build a cross product matrix.
+

Detailed Description

+

GLM_GTX_matrix_cross_product: Build cross product matrices.

+

Function Documentation

+ +
+
+ + + + + + + + + +
detail::tmat3x3<T> glm::gtx::matrix_cross_product::matrixCross3 (detail::tvec3< T > const &  x ) 
+
+
+ +

Build a cross product matrix.

+

From GLM_GTX_matrix_cross_product extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<T> glm::gtx::matrix_cross_product::matrixCross4 (detail::tvec3< T > const &  x ) 
+
+
+ +

Build a cross product matrix.

+

From GLM_GTX_matrix_cross_product extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00180.html b/doc/html/a00180.html new file mode 100644 index 00000000..e34126d4 --- /dev/null +++ b/doc/html/a00180.html @@ -0,0 +1,421 @@ + + + + +GLM: glm::gtx::matrix_major_storage Namespace Reference + + + + + + +
+

glm::gtx::matrix_major_storage Namespace Reference

+

GLM_GTX_matrix_cross_product: Build matrices with specific matrix order, row or column. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename T >
detail::tmat2x2< T > colMajor2 (const detail::tmat2x2< T > &m)
 Build a column major matrix from other matrix.
template<typename T >
detail::tmat2x2< T > colMajor2 (const detail::tvec2< T > &v1, const detail::tvec2< T > &v2)
 Build a column major matrix from column vectors.
template<typename T >
detail::tmat3x3< T > colMajor3 (const detail::tmat3x3< T > &m)
 Build a column major matrix from other matrix.
template<typename T >
detail::tmat3x3< T > colMajor3 (const detail::tvec3< T > &v1, const detail::tvec3< T > &v2, const detail::tvec3< T > &v3)
 Build a column major matrix from column vectors.
template<typename T >
detail::tmat4x4< T > colMajor4 (const detail::tmat4x4< T > &m)
 Build a column major matrix from other matrix.
template<typename T >
detail::tmat4x4< T > colMajor4 (const detail::tvec4< T > &v1, const detail::tvec4< T > &v2, const detail::tvec4< T > &v3, const detail::tvec4< T > &v4)
 Build a column major matrix from column vectors.
template<typename T >
detail::tmat2x2< T > rowMajor2 (const detail::tmat2x2< T > &m)
 Build a row major matrix from other matrix.
template<typename T >
detail::tmat2x2< T > rowMajor2 (const detail::tvec2< T > &v1, const detail::tvec2< T > &v2)
 Build a row major matrix from row vectors.
template<typename T >
detail::tmat3x3< T > rowMajor3 (const detail::tmat3x3< T > &m)
 Build a row major matrix from other matrix.
template<typename T >
detail::tmat3x3< T > rowMajor3 (const detail::tvec3< T > &v1, const detail::tvec3< T > &v2, const detail::tvec3< T > &v3)
 Build a row major matrix from row vectors.
template<typename T >
detail::tmat4x4< T > rowMajor4 (const detail::tmat4x4< T > &m)
 Build a row major matrix from other matrix.
template<typename T >
detail::tmat4x4< T > rowMajor4 (const detail::tvec4< T > &v1, const detail::tvec4< T > &v2, const detail::tvec4< T > &v3, const detail::tvec4< T > &v4)
 Build a row major matrix from row vectors.
+

Detailed Description

+

GLM_GTX_matrix_cross_product: Build matrices with specific matrix order, row or column.

+

Function Documentation

+ +
+
+ + + + + + + + + +
detail::tmat2x2<T> glm::gtx::matrix_major_storage::colMajor2 (const detail::tmat2x2< T > &  m ) 
+
+
+ +

Build a column major matrix from other matrix.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat2x2<T> glm::gtx::matrix_major_storage::colMajor2 (const detail::tvec2< T > &  v1,
const detail::tvec2< T > &  v2 
)
+
+
+ +

Build a column major matrix from column vectors.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat3x3<T> glm::gtx::matrix_major_storage::colMajor3 (const detail::tmat3x3< T > &  m ) 
+
+
+ +

Build a column major matrix from other matrix.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat3x3<T> glm::gtx::matrix_major_storage::colMajor3 (const detail::tvec3< T > &  v1,
const detail::tvec3< T > &  v2,
const detail::tvec3< T > &  v3 
)
+
+
+ +

Build a column major matrix from column vectors.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<T> glm::gtx::matrix_major_storage::colMajor4 (const detail::tmat4x4< T > &  m ) 
+
+
+ +

Build a column major matrix from other matrix.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::matrix_major_storage::colMajor4 (const detail::tvec4< T > &  v1,
const detail::tvec4< T > &  v2,
const detail::tvec4< T > &  v3,
const detail::tvec4< T > &  v4 
)
+
+
+ +

Build a column major matrix from column vectors.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat2x2<T> glm::gtx::matrix_major_storage::rowMajor2 (const detail::tmat2x2< T > &  m ) 
+
+
+ +

Build a row major matrix from other matrix.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat2x2<T> glm::gtx::matrix_major_storage::rowMajor2 (const detail::tvec2< T > &  v1,
const detail::tvec2< T > &  v2 
)
+
+
+ +

Build a row major matrix from row vectors.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat3x3<T> glm::gtx::matrix_major_storage::rowMajor3 (const detail::tmat3x3< T > &  m ) 
+
+
+ +

Build a row major matrix from other matrix.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat3x3<T> glm::gtx::matrix_major_storage::rowMajor3 (const detail::tvec3< T > &  v1,
const detail::tvec3< T > &  v2,
const detail::tvec3< T > &  v3 
)
+
+
+ +

Build a row major matrix from row vectors.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<T> glm::gtx::matrix_major_storage::rowMajor4 (const detail::tmat4x4< T > &  m ) 
+
+
+ +

Build a row major matrix from other matrix.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::matrix_major_storage::rowMajor4 (const detail::tvec4< T > &  v1,
const detail::tvec4< T > &  v2,
const detail::tvec4< T > &  v3,
const detail::tvec4< T > &  v4 
)
+
+
+ +

Build a row major matrix from row vectors.

+

From GLM_GTX_matrix_major_storage extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00181.html b/doc/html/a00181.html new file mode 100644 index 00000000..271bec51 --- /dev/null +++ b/doc/html/a00181.html @@ -0,0 +1,259 @@ + + + + +GLM: glm::gtx::matrix_operation Namespace Reference + + + + + + +
+

glm::gtx::matrix_operation Namespace Reference

+

GLM_GTX_matrix_operation: Build cross product matrices. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename valType >
detail::tmat2x2< valType > diagonal2x2 (detail::tvec2< valType > const &v)
 Build a diagonal matrix.
template<typename valType >
detail::tmat2x3< valType > diagonal2x3 (detail::tvec2< valType > const &v)
 Build a diagonal matrix.
template<typename valType >
detail::tmat2x4< valType > diagonal2x4 (detail::tvec2< valType > const &v)
 Build a diagonal matrix.
template<typename valType >
detail::tmat3x2< valType > diagonal3x2 (detail::tvec2< valType > const &v)
 Build a diagonal matrix.
template<typename valType >
detail::tmat3x3< valType > diagonal3x3 (detail::tvec3< valType > const &v)
 Build a diagonal matrix.
template<typename valType >
detail::tmat3x4< valType > diagonal3x4 (detail::tvec3< valType > const &v)
 Build a diagonal matrix.
template<typename valType >
detail::tmat4x2< valType > diagonal4x2 (detail::tvec2< valType > const &v)
 Build a diagonal matrix.
template<typename valType >
detail::tmat4x3< valType > diagonal4x3 (detail::tvec3< valType > const &v)
 Build a diagonal matrix.
template<typename valType >
detail::tmat4x4< valType > diagonal4x4 (detail::tvec4< valType > const &v)
 Build a diagonal matrix.
+

Detailed Description

+

GLM_GTX_matrix_operation: Build cross product matrices.

+

Function Documentation

+ +
+
+ + + + + + + + + +
detail::tmat2x2<valType> glm::gtx::matrix_operation::diagonal2x2 (detail::tvec2< valType > const &  v ) 
+
+
+ +

Build a diagonal matrix.

+

From GLM_GTX_matrix_operation extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat2x3<valType> glm::gtx::matrix_operation::diagonal2x3 (detail::tvec2< valType > const &  v ) 
+
+
+ +

Build a diagonal matrix.

+

From GLM_GTX_matrix_operation extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat2x4<valType> glm::gtx::matrix_operation::diagonal2x4 (detail::tvec2< valType > const &  v ) 
+
+
+ +

Build a diagonal matrix.

+

From GLM_GTX_matrix_operation extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat3x2<valType> glm::gtx::matrix_operation::diagonal3x2 (detail::tvec2< valType > const &  v ) 
+
+
+ +

Build a diagonal matrix.

+

From GLM_GTX_matrix_operation extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat3x3<valType> glm::gtx::matrix_operation::diagonal3x3 (detail::tvec3< valType > const &  v ) 
+
+
+ +

Build a diagonal matrix.

+

From GLM_GTX_matrix_operation extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat3x4<valType> glm::gtx::matrix_operation::diagonal3x4 (detail::tvec3< valType > const &  v ) 
+
+
+ +

Build a diagonal matrix.

+

From GLM_GTX_matrix_operation extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x2<valType> glm::gtx::matrix_operation::diagonal4x2 (detail::tvec2< valType > const &  v ) 
+
+
+ +

Build a diagonal matrix.

+

From GLM_GTX_matrix_operation extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x3<valType> glm::gtx::matrix_operation::diagonal4x3 (detail::tvec3< valType > const &  v ) 
+
+
+ +

Build a diagonal matrix.

+

From GLM_GTX_matrix_operation extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::matrix_operation::diagonal4x4 (detail::tvec4< valType > const &  v ) 
+
+
+ +

Build a diagonal matrix.

+

From GLM_GTX_matrix_operation extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00182.html b/doc/html/a00182.html new file mode 100644 index 00000000..88978d17 --- /dev/null +++ b/doc/html/a00182.html @@ -0,0 +1,171 @@ + + + + +GLM: glm::gtx::matrix_projection Namespace Reference + + + + + + +
+

glm::gtx::matrix_projection Namespace Reference

+

GLM_GTX_matrix_projection: Varius ways to build and operate on projection matrices. +More...

+ + + + + + + + + + + +

Functions

template<typename T >
detail::tmat4x4< T > infinitePerspective (T fovy, T aspect, T zNear)
 Creates a matrix for a symmetric perspective-view frustum with far plane at infinite .
template<typename valType >
detail::tmat4x4< valType > perspectiveFov (valType const &fov, valType const &width, valType const &height, valType const &zNear, valType const &zFar)
 Builds a perspective projection matrix based on a field of view From GLM_GTX_matrix_projection extension.
template<typename T >
detail::tmat4x4< T > tweakedInfinitePerspective (T fovy, T aspect, T zNear)
 Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
+

Detailed Description

+

GLM_GTX_matrix_projection: Varius ways to build and operate on projection matrices.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::matrix_projection::infinitePerspective ( fovy,
aspect,
zNear 
)
+
+
+ +

Creates a matrix for a symmetric perspective-view frustum with far plane at infinite .

+

From GLM_GTX_matrix_projection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::matrix_projection::perspectiveFov (valType const &  fov,
valType const &  width,
valType const &  height,
valType const &  zNear,
valType const &  zFar 
)
+
+
+ +

Builds a perspective projection matrix based on a field of view From GLM_GTX_matrix_projection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::matrix_projection::tweakedInfinitePerspective ( fovy,
aspect,
zNear 
)
+
+
+ +

Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.

+

From GLM_GTX_matrix_projection extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00183.html b/doc/html/a00183.html new file mode 100644 index 00000000..00fe9b5f --- /dev/null +++ b/doc/html/a00183.html @@ -0,0 +1,307 @@ + + + + +GLM: glm::gtx::matrix_query Namespace Reference + + + + + + +
+

glm::gtx::matrix_query Namespace Reference

+

GLM_GTX_matrix_query: Query to evaluate matrices properties. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename genType >
bool isIdentity (const genType &m, const typename genType::value_type epsilon=std::numeric_limits< typename genType::value_type >::epsilon())
 Return if a matrix an identity matrix.
template<typename T >
bool isNormalized (const detail::tmat4x4< T > &m, const T epsilon=std::numeric_limits< T >::epsilon())
 Return if a matrix a normalized matrix.
template<typename T >
bool isNormalized (const detail::tmat3x3< T > &m, const T epsilon=std::numeric_limits< T >::epsilon())
 Return if a matrix a normalized matrix.
template<typename T >
bool isNormalized (const detail::tmat2x2< T > &m, const T epsilon=std::numeric_limits< T >::epsilon())
 Return if a matrix a normalized matrix.
template<typename T >
bool isNull (const detail::tmat4x4< T > &m, const T epsilon=std::numeric_limits< T >::epsilon())
 Return if a matrix a null matrix.
template<typename T >
bool isNull (const detail::tmat3x3< T > &m, const T epsilon=std::numeric_limits< T >::epsilon())
 Return if a matrix a null matrix.
template<typename T >
bool isNull (const detail::tmat2x2< T > &m, const T epsilon=std::numeric_limits< T >::epsilon())
 Return if a matrix a null matrix.
template<typename genType >
bool isOrthogonal (const genType &m, const typename genType::value_type epsilon=std::numeric_limits< typename genType::value_type >::epsilon())
 Return if a matrix an orthonormalized matrix.
+

Detailed Description

+

GLM_GTX_matrix_query: Query to evaluate matrices properties.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::matrix_query::isIdentity (const genType &  m,
const typename genType::value_type  epsilon = std::numeric_limits< typename genType::value_type >::epsilon() 
)
+
+
+ +

Return if a matrix an identity matrix.

+

From GLM_GTX_matrix_query extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::matrix_query::isNormalized (const detail::tmat4x4< T > &  m,
const T  epsilon = std::numeric_limits< T >::epsilon() 
)
+
+
+ +

Return if a matrix a normalized matrix.

+

From GLM_GTX_matrix_query extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::matrix_query::isNormalized (const detail::tmat3x3< T > &  m,
const T  epsilon = std::numeric_limits< T >::epsilon() 
)
+
+
+ +

Return if a matrix a normalized matrix.

+

From GLM_GTX_matrix_query extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::matrix_query::isNormalized (const detail::tmat2x2< T > &  m,
const T  epsilon = std::numeric_limits< T >::epsilon() 
)
+
+
+ +

Return if a matrix a normalized matrix.

+

From GLM_GTX_matrix_query extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::matrix_query::isNull (const detail::tmat4x4< T > &  m,
const T  epsilon = std::numeric_limits< T >::epsilon() 
)
+
+
+ +

Return if a matrix a null matrix.

+

From GLM_GTX_matrix_query extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::matrix_query::isNull (const detail::tmat3x3< T > &  m,
const T  epsilon = std::numeric_limits< T >::epsilon() 
)
+
+
+ +

Return if a matrix a null matrix.

+

From GLM_GTX_matrix_query extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::matrix_query::isNull (const detail::tmat2x2< T > &  m,
const T  epsilon = std::numeric_limits< T >::epsilon() 
)
+
+
+ +

Return if a matrix a null matrix.

+

From GLM_GTX_matrix_query extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::matrix_query::isOrthogonal (const genType &  m,
const typename genType::value_type  epsilon = std::numeric_limits< typename genType::value_type >::epsilon() 
)
+
+
+ +

Return if a matrix an orthonormalized matrix.

+

From GLM_GTX_matrix_query extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00184.html b/doc/html/a00184.html new file mode 100644 index 00000000..3a420f04 --- /dev/null +++ b/doc/html/a00184.html @@ -0,0 +1,241 @@ + + + + +GLM: glm::gtx::matrix_selection Namespace Reference + + + + + + +
+

glm::gtx::matrix_selection Namespace Reference

+

GLM_GTX_matrix_selection extension: Access to matrix columns or rows. +More...

+ + + + + + + + + + + + + + + + + + + + +

Functions

template<typename T >
detail::tvec4< T > column (const detail::tmat4x4< T > &m, int index)
 Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the column index.
template<typename T >
detail::tvec3< T > column (const detail::tmat3x3< T > &m, int index)
 Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the column index.
template<typename T >
detail::tvec2< T > column (const detail::tmat2x2< T > &m, int index)
 Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the column index.
template<typename T >
detail::tvec4< T > row (const detail::tmat4x4< T > &m, int index)
 Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the row index.
template<typename T >
detail::tvec3< T > row (const detail::tmat3x3< T > &m, int index)
 Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the row index.
template<typename T >
detail::tvec2< T > row (const detail::tmat2x2< T > &m, int index)
 Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the row index.
+

Detailed Description

+

GLM_GTX_matrix_selection extension: Access to matrix columns or rows.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec4<T> glm::gtx::matrix_selection::column (const detail::tmat4x4< T > &  m,
int  index 
)
+
+
+ +

Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the column index.

+

From GLM_GTX_matrix_selection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<T> glm::gtx::matrix_selection::column (const detail::tmat3x3< T > &  m,
int  index 
)
+
+
+ +

Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the column index.

+

From GLM_GTX_matrix_selection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec2<T> glm::gtx::matrix_selection::column (const detail::tmat2x2< T > &  m,
int  index 
)
+
+
+ +

Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the column index.

+

From GLM_GTX_matrix_selection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec4<T> glm::gtx::matrix_selection::row (const detail::tmat4x4< T > &  m,
int  index 
)
+
+
+ +

Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the row index.

+

From GLM_GTX_matrix_selection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<T> glm::gtx::matrix_selection::row (const detail::tmat3x3< T > &  m,
int  index 
)
+
+
+ +

Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the row index.

+

From GLM_GTX_matrix_selection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec2<T> glm::gtx::matrix_selection::row (const detail::tmat2x2< T > &  m,
int  index 
)
+
+
+ +

Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the row index.

+

From GLM_GTX_matrix_selection extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00185.html b/doc/html/a00185.html new file mode 100644 index 00000000..6988bfb5 --- /dev/null +++ b/doc/html/a00185.html @@ -0,0 +1,41 @@ + + + + +GLM: glm::gtx::matx Namespace Reference + + + + + + +
+

glm::gtx::matx Namespace Reference

+

GLM_GTX_matx extension: - Work in progress - NxN matrix types. +More...

+ +
+

Detailed Description

+

GLM_GTX_matx extension: - Work in progress - NxN matrix types.

+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00186.html b/doc/html/a00186.html new file mode 100644 index 00000000..512b9bdb --- /dev/null +++ b/doc/html/a00186.html @@ -0,0 +1,46 @@ + + + + +GLM: glm::gtx::mixed_product Namespace Reference + + + + + + +
+

glm::gtx::mixed_product Namespace Reference

+

GLM_GTX_mixed_product extension: Mixed product of 3 vectors. +More...

+ + + + + +

Functions

+template<typename valType >
valType mixedProduct (detail::tvec3< valType > const &v1, detail::tvec3< valType > const &v2, detail::tvec3< valType > const &v3)
 Mixed product of 3 vectors (from GLM_GTX_mixed_product extension).
+

Detailed Description

+

GLM_GTX_mixed_product extension: Mixed product of 3 vectors.

+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00187.html b/doc/html/a00187.html new file mode 100644 index 00000000..6bce77b6 --- /dev/null +++ b/doc/html/a00187.html @@ -0,0 +1,481 @@ + + + + +GLM: glm::gtx::norm Namespace Reference + + + + + + +
+

glm::gtx::norm Namespace Reference

+

GLM_GTX_norm extension: Varius way to compute vector norms. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename T >
distance2 (const detail::tvec4< T > &p0, const detail::tvec4< T > &p1)
 Returns the squared distance between p0 and p1, i.e., length(p0 - p1).
template<typename T >
distance2 (const detail::tvec3< T > &p0, const detail::tvec3< T > &p1)
 Returns the squared distance between p0 and p1, i.e., length(p0 - p1).
template<typename T >
distance2 (const detail::tvec2< T > &p0, const detail::tvec2< T > &p1)
 Returns the squared distance between p0 and p1, i.e., length(p0 - p1).
template<typename T >
distance2 (const T p0, const T p1)
 Returns the squared distance between p0 and p1, i.e., length(p0 - p1).
template<typename T >
l1Norm (const detail::tvec3< T > &v)
 Returns the L1 norm of v.
template<typename T >
l1Norm (const detail::tvec3< T > &x, const detail::tvec3< T > &y)
 Returns the L1 norm between x and y.
template<typename T >
l2Norm (const detail::tvec3< T > &x)
 Returns the L2 norm of v.
template<typename T >
l2Norm (const detail::tvec3< T > &x, const detail::tvec3< T > &y)
 Returns the L2 norm between x and y.
template<typename T >
length2 (const detail::tquat< T > &q)
 Returns the squared length of x.
template<typename T >
length2 (const detail::tvec4< T > &x)
 Returns the squared length of x.
template<typename T >
length2 (const detail::tvec3< T > &x)
 Returns the squared length of x.
template<typename T >
length2 (const detail::tvec2< T > &x)
 Returns the squared length of x.
template<typename T >
length2 (const T x)
 Returns the squared length of x.
template<typename T >
lxNorm (const detail::tvec3< T > &x, unsigned int Depth)
 Returns the L norm of v.
template<typename T >
lxNorm (const detail::tvec3< T > &x, const detail::tvec3< T > &y, unsigned int Depth)
 Returns the L norm between x and y.
+

Detailed Description

+

GLM_GTX_norm extension: Varius way to compute vector norms.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
T glm::gtx::norm::distance2 (const detail::tvec4< T > &  p0,
const detail::tvec4< T > &  p1 
)
+
+
+ +

Returns the squared distance between p0 and p1, i.e., length(p0 - p1).

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
T glm::gtx::norm::distance2 (const detail::tvec3< T > &  p0,
const detail::tvec3< T > &  p1 
)
+
+
+ +

Returns the squared distance between p0 and p1, i.e., length(p0 - p1).

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
T glm::gtx::norm::distance2 (const detail::tvec2< T > &  p0,
const detail::tvec2< T > &  p1 
)
+
+
+ +

Returns the squared distance between p0 and p1, i.e., length(p0 - p1).

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
T glm::gtx::norm::distance2 (const T  p0,
const T  p1 
)
+
+
+ +

Returns the squared distance between p0 and p1, i.e., length(p0 - p1).

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::norm::l1Norm (const detail::tvec3< T > &  v ) 
+
+
+ +

Returns the L1 norm of v.

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
T glm::gtx::norm::l1Norm (const detail::tvec3< T > &  x,
const detail::tvec3< T > &  y 
)
+
+
+ +

Returns the L1 norm between x and y.

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::norm::l2Norm (const detail::tvec3< T > &  x ) 
+
+
+ +

Returns the L2 norm of v.

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
T glm::gtx::norm::l2Norm (const detail::tvec3< T > &  x,
const detail::tvec3< T > &  y 
)
+
+
+ +

Returns the L2 norm between x and y.

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::norm::length2 (const detail::tquat< T > &  q ) 
+
+
+ +

Returns the squared length of x.

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::norm::length2 (const detail::tvec4< T > &  x ) 
+
+
+ +

Returns the squared length of x.

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::norm::length2 (const detail::tvec3< T > &  x ) 
+
+
+ +

Returns the squared length of x.

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::norm::length2 (const detail::tvec2< T > &  x ) 
+
+
+ +

Returns the squared length of x.

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + +
T glm::gtx::norm::length2 (const T  x ) 
+
+
+ +

Returns the squared length of x.

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
T glm::gtx::norm::lxNorm (const detail::tvec3< T > &  x,
unsigned int  Depth 
)
+
+
+ +

Returns the L norm of v.

+

From GLM_GTX_norm extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
T glm::gtx::norm::lxNorm (const detail::tvec3< T > &  x,
const detail::tvec3< T > &  y,
unsigned int  Depth 
)
+
+
+ +

Returns the L norm between x and y.

+

From GLM_GTX_norm extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00188.html b/doc/html/a00188.html new file mode 100644 index 00000000..9eeca7d6 --- /dev/null +++ b/doc/html/a00188.html @@ -0,0 +1,82 @@ + + + + +GLM: glm::gtx::normal Namespace Reference + + + + + + +
+

glm::gtx::normal Namespace Reference

+

GLM_GTX_normal extension: Compute the normal of a triangle. +More...

+ + + + + +

Functions

template<typename T >
detail::tvec3< T > triangleNormal (detail::tvec3< T > const &p1, detail::tvec3< T > const &p2, detail::tvec3< T > const &p3)
 Computes triangle normal from triangle points.
+

Detailed Description

+

GLM_GTX_normal extension: Compute the normal of a triangle.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tvec3<T> glm::gtx::normal::triangleNormal (detail::tvec3< T > const &  p1,
detail::tvec3< T > const &  p2,
detail::tvec3< T > const &  p3 
)
+
+
+ +

Computes triangle normal from triangle points.

+

From GLM_GTX_normal extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00189.html b/doc/html/a00189.html new file mode 100644 index 00000000..dad12401 --- /dev/null +++ b/doc/html/a00189.html @@ -0,0 +1,109 @@ + + + + +GLM: glm::gtx::normalize_dot Namespace Reference + + + + + + +
+

glm::gtx::normalize_dot Namespace Reference

+

GLM_GTX_normalize_dot extension: Dot product of vectors that need to be normalize with a single square root. +More...

+ + + + + + + + +

Functions

template<typename genType >
genType::value_type fastNormalizeDot (genType const &x, genType const &y)
 Normalize parameters and returns the dot product of x and y.
template<typename genType >
genType::value_type normalizeDot (genType const &x, genType const &y)
 Normalize parameters and returns the dot product of x and y.
+

Detailed Description

+

GLM_GTX_normalize_dot extension: Dot product of vectors that need to be normalize with a single square root.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
genType::value_type glm::gtx::normalize_dot::fastNormalizeDot (genType const &  x,
genType const &  y 
)
+
+
+ +

Normalize parameters and returns the dot product of x and y.

+

Faster that dot(fastNormalize(x), fastNormalize(y)). From GLM_GTX_normalize_dot extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genType::value_type glm::gtx::normalize_dot::normalizeDot (genType const &  x,
genType const &  y 
)
+
+
+ +

Normalize parameters and returns the dot product of x and y.

+

It's faster that dot(normalize(x), normalize(y)). From GLM_GTX_normalize_dot extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00190.html b/doc/html/a00190.html new file mode 100644 index 00000000..5d32bb92 --- /dev/null +++ b/doc/html/a00190.html @@ -0,0 +1,81 @@ + + + + +GLM: glm::gtx::number_precision Namespace Reference + + + + + + +
+

glm::gtx::number_precision Namespace Reference

+

GLM_GTX_number_precision extension: Defined size types. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Typedefs

+typedef f16 f16mat1
 Half-precision floating-point scalar. (from GLM_GTX_number_precision extension).
+typedef f16 f16mat1x1
 Half-precision floating-point scalar. (from GLM_GTX_number_precision extension).
+typedef f16 f16vec1
 Half-precision floating-point scalar. (from GLM_GTX_number_precision extension).
+typedef f32 f32mat1
 Single-precision floating-point scalar. (from GLM_GTX_number_precision extension).
+typedef f32 f32mat1x1
 Single-precision floating-point scalar. (from GLM_GTX_number_precision extension).
+typedef f32 f32vec1
 Single-precision floating-point scalar. (from GLM_GTX_number_precision extension).
+typedef f64 f64mat1
 Double-precision floating-point scalar. (from GLM_GTX_number_precision extension).
+typedef f64 f64mat1x1
 Double-precision floating-point scalar. (from GLM_GTX_number_precision extension).
+typedef f64 f64vec1
 Single-precision floating-point scalar. (from GLM_GTX_number_precision extension).
+typedef u16 u16vec1
 16bit unsigned integer scalar. (from GLM_GTX_number_precision extension)
+typedef u32 u32vec1
 32bit unsigned integer scalar. (from GLM_GTX_number_precision extension)
+typedef u64 u64vec1
 64bit unsigned integer scalar. (from GLM_GTX_number_precision extension)
+typedef u8 u8vec1
 8bit unsigned integer scalar. (from GLM_GTX_number_precision extension)
+

Detailed Description

+

GLM_GTX_number_precision extension: Defined size types.

+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00191.html b/doc/html/a00191.html new file mode 100644 index 00000000..9eea4e97 --- /dev/null +++ b/doc/html/a00191.html @@ -0,0 +1,207 @@ + + + + +GLM: glm::gtx::ocl_type Namespace Reference + + + + + + +
+

glm::gtx::ocl_type Namespace Reference

+

GLM_GTX_ocl_type extension: OpenCL types. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Typedefs

+typedef detail::int8 cl_char
 8bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::int8 cl_char1
 8bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec2
+< detail::int8 > 
cl_char2
 8bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec3
+< detail::int8 > 
cl_char3
 8bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec4
+< detail::int8 > 
cl_char4
 8bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::float32 cl_float
 Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension).
+typedef detail::float32 cl_float1
 Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension).
+typedef detail::tvec2
+< detail::float32 > 
cl_float2
 Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension).
+typedef detail::tvec3
+< detail::float32 > 
cl_float3
 Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension).
+typedef detail::tvec4
+< detail::float32 > 
cl_float4
 Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension).
+typedef detail::float16 cl_half
 Half-precision floating-point scalar. (from GLM_GTX_ocl_type extension).
+typedef detail::int32 cl_int
 32bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::int32 cl_int1
 32bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec2
+< detail::int32 > 
cl_int2
 32bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec3
+< detail::int32 > 
cl_int3
 32bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec4
+< detail::int32 > 
cl_int4
 32bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::int64 cl_long
 64bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::int64 cl_long1
 64bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec2
+< detail::int64 > 
cl_long2
 64bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec3
+< detail::int64 > 
cl_long3
 64bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec4
+< detail::int64 > 
cl_long4
 64bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::int16 cl_short
 16bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::int16 cl_short1
 16bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec2
+< detail::int16 > 
cl_short2
 16bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec3
+< detail::int16 > 
cl_short3
 16bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec4
+< detail::int16 > 
cl_short4
 16bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::uint8 cl_uchar
 8bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::uint8 cl_uchar1
 8bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec2
+< detail::uint8 > 
cl_uchar2
 8bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec3
+< detail::uint8 > 
cl_uchar3
 8bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec4
+< detail::uint8 > 
cl_uchar4
 8bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::uint32 cl_uint
 32bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::uint32 cl_uint1
 32bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec2
+< detail::uint32 > 
cl_uint2
 32bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec3
+< detail::uint32 > 
cl_uint3
 32bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec4
+< detail::uint32 > 
cl_uint4
 32bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::uint64 cl_ulong
 64bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::uint64 cl_ulong1
 64bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec2
+< detail::uint64 > 
cl_ulong2
 64bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec3
+< detail::uint64 > 
cl_ulong3
 64bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec4
+< detail::uint64 > 
cl_ulong4
 64bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::uint16 cl_ushort
 16bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::uint16 cl_ushort1
 16bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec2
+< detail::uint16 > 
cl_ushort2
 16bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec3
+< detail::uint16 > 
cl_ushort3
 16bit signed integer. (from GLM_GTX_ocl_type extension)
+typedef detail::tvec4
+< detail::uint16 > 
cl_ushort4
 16bit signed integer. (from GLM_GTX_ocl_type extension)
+

Detailed Description

+

GLM_GTX_ocl_type extension: OpenCL types.

+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00192.html b/doc/html/a00192.html new file mode 100644 index 00000000..3ce1f78d --- /dev/null +++ b/doc/html/a00192.html @@ -0,0 +1,207 @@ + + + + +GLM: glm::gtx::optimum_pow Namespace Reference + + + + + + +
+

glm::gtx::optimum_pow Namespace Reference

+

GLM_GTX_optimum_pow extension: Integer exponenciation of power functions. +More...

+ + + + + + + + + + + + + + + + + + + +

Functions

template<typename genType >
genType pow2 (const genType &x)
 Returns x raised to the power of 2.
template<typename genType >
genType pow3 (const genType &x)
 Returns x raised to the power of 3.
template<typename genType >
genType pow4 (const genType &x)
 Returns x raised to the power of 4.
detail::tvec4< bool > powOfTwo (const detail::tvec4< int > &x)
 Checks to determine if the parameter component are power of 2 numbers.
detail::tvec3< bool > powOfTwo (const detail::tvec3< int > &x)
 Checks to determine if the parameter component are power of 2 numbers.
detail::tvec2< bool > powOfTwo (const detail::tvec2< int > &x)
 Checks to determine if the parameter component are power of 2 numbers.
bool powOfTwo (int num)
 Checks if the parameter is a power of 2 number.
+

Detailed Description

+

GLM_GTX_optimum_pow extension: Integer exponenciation of power functions.

+

Function Documentation

+ +
+
+ + + + + + + + + +
genType glm::gtx::optimum_pow::pow2 (const genType &  x ) 
+
+
+ +

Returns x raised to the power of 2.

+

From GLM_GTX_optimum_pow extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::optimum_pow::pow3 (const genType &  x ) 
+
+
+ +

Returns x raised to the power of 3.

+

From GLM_GTX_optimum_pow extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::optimum_pow::pow4 (const genType &  x ) 
+
+
+ +

Returns x raised to the power of 4.

+

From GLM_GTX_optimum_pow extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tvec4<bool> glm::gtx::optimum_pow::powOfTwo (const detail::tvec4< int > &  x ) 
+
+
+ +

Checks to determine if the parameter component are power of 2 numbers.

+

From GLM_GTX_optimum_pow extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tvec3<bool> glm::gtx::optimum_pow::powOfTwo (const detail::tvec3< int > &  x ) 
+
+
+ +

Checks to determine if the parameter component are power of 2 numbers.

+

From GLM_GTX_optimum_pow extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tvec2<bool> glm::gtx::optimum_pow::powOfTwo (const detail::tvec2< int > &  x ) 
+
+
+ +

Checks to determine if the parameter component are power of 2 numbers.

+

From GLM_GTX_optimum_pow extension.

+ +
+
+ +
+
+ + + + + + + + + +
bool glm::gtx::optimum_pow::powOfTwo (int  num ) 
+
+
+ +

Checks if the parameter is a power of 2 number.

+

From GLM_GTX_optimum_pow extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00193.html b/doc/html/a00193.html new file mode 100644 index 00000000..1a90b79a --- /dev/null +++ b/doc/html/a00193.html @@ -0,0 +1,100 @@ + + + + +GLM: glm::gtx::orthonormalize Namespace Reference + + + + + + +
+

glm::gtx::orthonormalize Namespace Reference

+

GLM_GTX_orthonormalize extension: Orthonormalize matrices. +More...

+ + + + + + + + +

Functions

template<typename T >
detail::tvec3< T > orthonormalize (const detail::tvec3< T > &x, const detail::tvec3< T > &y)
 Orthonormalizes x according y.
template<typename T >
detail::tmat3x3< T > orthonormalize (const detail::tmat3x3< T > &m)
 Returns the orthonormalized matrix of m.
+

Detailed Description

+

GLM_GTX_orthonormalize extension: Orthonormalize matrices.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<T> glm::gtx::orthonormalize::orthonormalize (const detail::tvec3< T > &  x,
const detail::tvec3< T > &  y 
)
+
+
+ +

Orthonormalizes x according y.

+

From GLM_GTX_orthonormalize extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat3x3<T> glm::gtx::orthonormalize::orthonormalize (const detail::tmat3x3< T > &  m ) 
+
+
+ +

Returns the orthonormalized matrix of m.

+

From GLM_GTX_orthonormalize extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00194.html b/doc/html/a00194.html new file mode 100644 index 00000000..4669a0dd --- /dev/null +++ b/doc/html/a00194.html @@ -0,0 +1,142 @@ + + + + +GLM: glm::gtx::perpendicular Namespace Reference + + + + + + +
+

glm::gtx::perpendicular Namespace Reference

+

GLM_GTX_perpendicular extension: Perpendicular of a vector from other one. +More...

+ + + + + + + + + + + +

Functions

template<typename T >
detail::tvec4< T > perp (detail::tvec4< T > const &x, detail::tvec4< T > const &Normal)
 Projects x a perpendicular axis of Normal.
template<typename T >
detail::tvec3< T > perp (detail::tvec3< T > const &x, detail::tvec3< T > const &Normal)
 Projects x a perpendicular axis of Normal.
template<typename T >
detail::tvec2< T > perp (detail::tvec2< T > const &x, detail::tvec2< T > const &Normal)
 Projects x a perpendicular axis of Normal.
+

Detailed Description

+

GLM_GTX_perpendicular extension: Perpendicular of a vector from other one.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec4<T> glm::gtx::perpendicular::perp (detail::tvec4< T > const &  x,
detail::tvec4< T > const &  Normal 
)
+
+
+ +

Projects x a perpendicular axis of Normal.

+

From GLM_GTX_perpendicular extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<T> glm::gtx::perpendicular::perp (detail::tvec3< T > const &  x,
detail::tvec3< T > const &  Normal 
)
+
+
+ +

Projects x a perpendicular axis of Normal.

+

From GLM_GTX_perpendicular extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec2<T> glm::gtx::perpendicular::perp (detail::tvec2< T > const &  x,
detail::tvec2< T > const &  Normal 
)
+
+
+ +

Projects x a perpendicular axis of Normal.

+

From GLM_GTX_perpendicular extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00195.html b/doc/html/a00195.html new file mode 100644 index 00000000..de215cdd --- /dev/null +++ b/doc/html/a00195.html @@ -0,0 +1,91 @@ + + + + +GLM: glm::gtx::polar_coordinates Namespace Reference + + + + + + +
+

glm::gtx::polar_coordinates Namespace Reference

+

GLM_GTX_polar_coordinates extension: Conversion from Euclidean space to polar space and revert. +More...

+ + + + + + + + +

Functions

template<typename T >
detail::tvec3< T > euclidean (const detail::tvec3< T > &polar)
 Convert Polar to Euclidean coordinates.
template<typename T >
detail::tvec3< T > polar (const detail::tvec3< T > &euclidean)
 Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude.
+

Detailed Description

+

GLM_GTX_polar_coordinates extension: Conversion from Euclidean space to polar space and revert.

+

Function Documentation

+ +
+
+ + + + + + + + + +
detail::tvec3<T> glm::gtx::polar_coordinates::euclidean (const detail::tvec3< T > &  polar ) 
+
+
+ +

Convert Polar to Euclidean coordinates.

+

From GLM_GTX_polar_coordinates extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tvec3<T> glm::gtx::polar_coordinates::polar (const detail::tvec3< T > &  euclidean ) 
+
+
+ +

Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude.

+

From GLM_GTX_polar_coordinates extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00196.html b/doc/html/a00196.html new file mode 100644 index 00000000..0d568385 --- /dev/null +++ b/doc/html/a00196.html @@ -0,0 +1,142 @@ + + + + +GLM: glm::gtx::projection Namespace Reference + + + + + + +
+

glm::gtx::projection Namespace Reference

+

GLM_GTX_projection extension: Projection of a vector to other one. +More...

+ + + + + + + + + + + +

Functions

template<typename T >
detail::tvec4< T > proj (detail::tvec4< T > const &x, detail::tvec4< T > const &Normal)
 Projects x on Normal.
template<typename T >
detail::tvec3< T > proj (detail::tvec3< T > const &x, detail::tvec3< T > const &Normal)
 Projects x on Normal.
template<typename T >
detail::tvec2< T > proj (detail::tvec2< T > const &x, detail::tvec2< T > const &Normal)
 Projects x on Normal.
+

Detailed Description

+

GLM_GTX_projection extension: Projection of a vector to other one.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec4<T> glm::gtx::projection::proj (detail::tvec4< T > const &  x,
detail::tvec4< T > const &  Normal 
)
+
+
+ +

Projects x on Normal.

+

From GLM_GTX_projection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<T> glm::gtx::projection::proj (detail::tvec3< T > const &  x,
detail::tvec3< T > const &  Normal 
)
+
+
+ +

Projects x on Normal.

+

From GLM_GTX_projection extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec2<T> glm::gtx::projection::proj (detail::tvec2< T > const &  x,
detail::tvec2< T > const &  Normal 
)
+
+
+ +

Projects x on Normal.

+

From GLM_GTX_projection extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00197.html b/doc/html/a00197.html new file mode 100644 index 00000000..7b698e1c --- /dev/null +++ b/doc/html/a00197.html @@ -0,0 +1,713 @@ + + + + +GLM: glm::gtx::quaternion Namespace Reference + + + + + + +
+

glm::gtx::quaternion Namespace Reference

+

GLM_GTX_quaternion extension: Quaternion types and functions. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename valType >
valType angle (detail::tquat< valType > const &x)
 Returns the q rotation angle.
template<typename valType >
detail::tquat< valType > angleAxis (valType const &angle, detail::tvec3< valType > const &v)
 Build a quaternion from an angle and an axis.
template<typename valType >
detail::tquat< valType > angleAxis (valType const &angle, valType const &x, valType const &y, valType const &z)
 Build a quaternion from an angle and an axis.
template<typename valType >
detail::tvec3< valType > axis (detail::tquat< valType > const &x)
 Returns the q rotation axis.
template<typename valType >
detail::tvec3< valType > cross (detail::tvec3< valType > const &v, detail::tquat< valType > const &q)
 Compute a cross product between a vector and a quaternion.
template<typename valType >
detail::tvec3< valType > cross (detail::tquat< valType > const &q, detail::tvec3< valType > const &v)
 Compute a cross product between a quaternion and a vector.
template<typename valType >
detail::tvec3< valType > eularAngles (detail::tquat< valType > const &x)
 Returns euler angles, yitch as x, yaw as y, roll as z.
template<typename valType >
detail::tquat< valType > exp (detail::tquat< valType > const &q, valType const &exponent)
 Returns a exp of a quaternion.
template<typename valType >
valType extractRealComponent (detail::tquat< valType > const &q)
 Extract the real component of a quaternion.
template<typename valType >
detail::tquat< valType > intermediate (detail::tquat< valType > const &prev, detail::tquat< valType > const &curr, detail::tquat< valType > const &next)
 Returns an intermediate control point for squad interpolation.
template<typename valType >
detail::tquat< valType > log (detail::tquat< valType > const &q)
 Returns a log of a quaternion.
template<typename valType >
valType pitch (detail::tquat< valType > const &x)
 Returns pitch value of euler angles.
template<typename valType >
detail::tquat< valType > pow (detail::tquat< valType > const &x, valType const &y)
 Returns x raised to the y power.
template<typename valType >
valType roll (detail::tquat< valType > const &x)
 Returns roll value of euler angles.
template<typename valType >
detail::tvec4< valType > rotate (detail::tquat< valType > const &q, detail::tvec4< valType > const &v)
 Rotates a 4 components vector by a quaternion.
template<typename valType >
detail::tvec3< valType > rotate (detail::tquat< valType > const &q, detail::tvec3< valType > const &v)
 Returns quarternion square root.
template<typename valType >
detail::tquat< valType > squad (detail::tquat< valType > const &q1, detail::tquat< valType > const &q2, detail::tquat< valType > const &s1, detail::tquat< valType > const &s2, valType const &h)
 Compute a point on a path according squad equation.
template<typename valType >
detail::tmat3x3< valType > toMat3 (detail::tquat< valType > const &x)
 Converts a quaternion to a 3 * 3 matrix.
template<typename valType >
detail::tmat4x4< valType > toMat4 (detail::tquat< valType > const &x)
 Converts a quaternion to a 4 * 4 matrix.
template<typename valType >
detail::tquat< valType > toQuat (detail::tmat4x4< valType > const &x)
 Converts a 4 * 4 matrix to a quaternion.
template<typename valType >
detail::tquat< valType > toQuat (detail::tmat3x3< valType > const &x)
 Converts a 3 * 3 matrix to a quaternion.
template<typename valType >
valType yaw (detail::tquat< valType > const &x)
 Returns yaw value of euler angles.
+

Detailed Description

+

GLM_GTX_quaternion extension: Quaternion types and functions.

+

Function Documentation

+ +
+
+ + + + + + + + + +
valType glm::gtx::quaternion::angle (detail::tquat< valType > const &  x ) 
+
+
+ +

Returns the q rotation angle.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tquat<valType> glm::gtx::quaternion::angleAxis (valType const &  angle,
detail::tvec3< valType > const &  v 
)
+
+
+ +

Build a quaternion from an angle and an axis.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tquat<valType> glm::gtx::quaternion::angleAxis (valType const &  angle,
valType const &  x,
valType const &  y,
valType const &  z 
)
+
+
+ +

Build a quaternion from an angle and an axis.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tvec3<valType> glm::gtx::quaternion::axis (detail::tquat< valType > const &  x ) 
+
+
+ +

Returns the q rotation axis.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<valType> glm::gtx::quaternion::cross (detail::tvec3< valType > const &  v,
detail::tquat< valType > const &  q 
)
+
+
+ +

Compute a cross product between a vector and a quaternion.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<valType> glm::gtx::quaternion::cross (detail::tquat< valType > const &  q,
detail::tvec3< valType > const &  v 
)
+
+
+ +

Compute a cross product between a quaternion and a vector.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tvec3<valType> glm::gtx::quaternion::eularAngles (detail::tquat< valType > const &  x ) 
+
+
+ +

Returns euler angles, yitch as x, yaw as y, roll as z.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tquat<valType> glm::gtx::quaternion::exp (detail::tquat< valType > const &  q,
valType const &  exponent 
)
+
+
+ +

Returns a exp of a quaternion.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
valType glm::gtx::quaternion::extractRealComponent (detail::tquat< valType > const &  q ) 
+
+
+ +

Extract the real component of a quaternion.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tquat<valType> glm::gtx::quaternion::intermediate (detail::tquat< valType > const &  prev,
detail::tquat< valType > const &  curr,
detail::tquat< valType > const &  next 
)
+
+
+ +

Returns an intermediate control point for squad interpolation.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tquat<valType> glm::gtx::quaternion::log (detail::tquat< valType > const &  q ) 
+
+
+ +

Returns a log of a quaternion.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
valType glm::gtx::quaternion::pitch (detail::tquat< valType > const &  x ) 
+
+
+ +

Returns pitch value of euler angles.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tquat<valType> glm::gtx::quaternion::pow (detail::tquat< valType > const &  x,
valType const &  y 
)
+
+
+ +

Returns x raised to the y power.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
valType glm::gtx::quaternion::roll (detail::tquat< valType > const &  x ) 
+
+
+ +

Returns roll value of euler angles.

+

From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec4<valType> glm::gtx::quaternion::rotate (detail::tquat< valType > const &  q,
detail::tvec4< valType > const &  v 
)
+
+
+ +

Rotates a 4 components vector by a quaternion.

+

From GLM_GTX_transform extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<valType> glm::gtx::quaternion::rotate (detail::tquat< valType > const &  q,
detail::tvec3< valType > const &  v 
)
+
+
+ +

Returns quarternion square root.

+

From GLM_GTX_quaternion extension. Rotates a 3 components vector by a quaternion. From GLM_GTX_transform extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tquat<valType> glm::gtx::quaternion::squad (detail::tquat< valType > const &  q1,
detail::tquat< valType > const &  q2,
detail::tquat< valType > const &  s1,
detail::tquat< valType > const &  s2,
valType const &  h 
)
+
+
+ +

Compute a point on a path according squad equation.

+

q1 and q2 are control points; s1 and s2 are intermediate control points. From GLM_GTX_quaternion extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat3x3<valType> glm::gtx::quaternion::toMat3 (detail::tquat< valType > const &  x ) 
+
+
+ +

Converts a quaternion to a 3 * 3 matrix.

+

From GLM_GTX_quaternion extension.

+ +

Definition at line 166 of file gtx/quaternion.hpp.

+ +

References glm::gtc::quaternion::mat3_cast().

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::quaternion::toMat4 (detail::tquat< valType > const &  x ) 
+
+
+ +

Converts a quaternion to a 4 * 4 matrix.

+

From GLM_GTX_quaternion extension.

+ +

Definition at line 172 of file gtx/quaternion.hpp.

+ +

References glm::gtc::quaternion::mat4_cast().

+ +
+
+ +
+
+ + + + + + + + + +
detail::tquat<valType> glm::gtx::quaternion::toQuat (detail::tmat4x4< valType > const &  x ) 
+
+
+ +

Converts a 4 * 4 matrix to a quaternion.

+

From GLM_GTX_quaternion extension.

+ +

Definition at line 184 of file gtx/quaternion.hpp.

+ +

References glm::gtc::quaternion::quat_cast().

+ +
+
+ +
+
+ + + + + + + + + +
detail::tquat<valType> glm::gtx::quaternion::toQuat (detail::tmat3x3< valType > const &  x ) 
+
+
+ +

Converts a 3 * 3 matrix to a quaternion.

+

From GLM_GTX_quaternion extension.

+ +

Definition at line 178 of file gtx/quaternion.hpp.

+ +

References glm::gtc::quaternion::quat_cast().

+ +
+
+ +
+
+ + + + + + + + + +
valType glm::gtx::quaternion::yaw (detail::tquat< valType > const &  x ) 
+
+
+ +

Returns yaw value of euler angles.

+

From GLM_GTX_quaternion extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00198.html b/doc/html/a00198.html new file mode 100644 index 00000000..e4a23bb5 --- /dev/null +++ b/doc/html/a00198.html @@ -0,0 +1,210 @@ + + + + +GLM: glm::gtx::random Namespace Reference + + + + + + +
+

glm::gtx::random Namespace Reference

+

GLM_GTX_random extension: Generate random number from varius distribution methods. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

+template<typename T >
compRand1 (T Min, T Max)
 Generate a random number in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension).
+template<>
float compRand1 ()
 Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension).
+template<typename T >
compRand1 ()
 Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension).
+template<typename T >
detail::tvec2< T > compRand2 (const detail::tvec2< T > &Min, const detail::tvec2< T > &Max)
 Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension).
+template<typename T >
detail::tvec2< T > compRand2 (T Min, T Max)
 Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > compRand3 (const detail::tvec3< T > &Min, const detail::tvec3< T > &Max)
 Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > compRand3 (T Min, T Max)
 Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > compRand4 (const detail::tvec4< T > &Min, const detail::tvec4< T > &Max)
 Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension).
+template<typename T >
detail::tvec4< T > compRand4 (T Min, T Max)
 Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension).
+template<typename T >
gaussRand1 (T mean, T std_deviation)
 Gererate a random floating number according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec2< T > gaussRand2 (const detail::tvec2< T > &mean, const detail::tvec2< T > &std_deviation)
 Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec2< T > gaussRand2 (T mean, const detail::tvec2< T > &std_deviation)
 Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec2< T > gaussRand2 (const detail::tvec2< T > &mean, T std_deviation)
 Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec2< T > gaussRand2 (T mean, T std_deviation)
 Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > gaussRand3 (const detail::tvec3< T > &mean, const detail::tvec3< T > &std_deviation)
 Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > gaussRand3 (T mean, const detail::tvec3< T > &std_deviation)
 Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > gaussRand3 (const detail::tvec3< T > &mean, T std_deviation)
 Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > gaussRand3 (T mean, T std_deviation)
 Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec4< T > gaussRand4 (const detail::tvec4< T > &mean, const detail::tvec4< T > &std_deviation)
 Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec4< T > gaussRand4 (T mean, const detail::tvec4< T > &std_deviation)
 Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec4< T > gaussRand4 (const detail::tvec4< T > &mean, T std_deviation)
 Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec4< T > gaussRand4 (T mean, T std_deviation)
 Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec2< T > normalizedRand2 (T Min, T Max)
 Generate a scaled and normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension).
+template<typename T >
detail::tvec2< T > normalizedRand2 ()
 Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > normalizedRand3 (T Min, T Max)
 Generate a scaled and normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > normalizedRand3 ()
 Generate a normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension).
+template<>
float signedRand1 ()
 Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension).
template<typename T >
signedRand1 ()
 Generate a random number in the interval [-1, 1], according a linear distribution.
+template<typename T >
detail::tvec2< T > signedRand2 ()
 Generate 2 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > signedRand3 ()
 Generate 3 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension).
+template<typename T >
detail::tvec4< T > signedRand4 ()
 Generate 4 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension).
+template<typename T >
detail::tvec2< T > vecRand2 (T MinRadius, T MaxRadius)
 Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec2< T > vecRand2 ()
 Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > vecRand3 (T MinRadius, T MaxRadius)
 Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec3< T > vecRand3 ()
 Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec4< T > vecRand4 (T MinRadius, T MaxRadius)
 Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension).
+template<typename T >
detail::tvec4< T > vecRand4 ()
 Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension).
+

Detailed Description

+

GLM_GTX_random extension: Generate random number from varius distribution methods.

+

Function Documentation

+ +
+
+ + + + + + + + +
T glm::gtx::random::signedRand1 ( ) 
+
+
+ +

Generate a random number in the interval [-1, 1], according a linear distribution.

+

From GLM_GTX_random extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00199.html b/doc/html/a00199.html new file mode 100644 index 00000000..e7f46016 --- /dev/null +++ b/doc/html/a00199.html @@ -0,0 +1,123 @@ + + + + +GLM: glm::gtx::raw_data Namespace Reference + + + + + + +
+

glm::gtx::raw_data Namespace Reference

+

GLM_GTX_raw_data extension: Projection of a vector to other one. +More...

+ + + + + + + + + + +

Typedefs

typedef gtc::type_precision::uint8 byte
 Type for byte numbers.
typedef gtc::type_precision::uint32 dword
 Type for dword numbers.
typedef gtc::type_precision::uint64 qword
 Type for qword numbers.
typedef gtc::type_precision::uint16 word
 Type for word numbers.
+

Detailed Description

+

GLM_GTX_raw_data extension: Projection of a vector to other one.

+

Typedef Documentation

+ +
+
+ + + + +
typedef gtc::type_precision::uint8 byte
+
+
+ +

Type for byte numbers.

+

From GLM_GTX_raw_data extension.

+ +

Definition at line 29 of file raw_data.hpp.

+ +
+
+ +
+
+ + + + +
typedef gtc::type_precision::uint32 dword
+
+
+ +

Type for dword numbers.

+

From GLM_GTX_raw_data extension.

+ +

Definition at line 37 of file raw_data.hpp.

+ +
+
+ +
+
+ + + + +
typedef gtc::type_precision::uint64 qword
+
+
+ +

Type for qword numbers.

+

From GLM_GTX_raw_data extension.

+ +

Definition at line 41 of file raw_data.hpp.

+ +
+
+ +
+
+ + + + +
typedef gtc::type_precision::uint16 word
+
+
+ +

Type for word numbers.

+

From GLM_GTX_raw_data extension.

+ +

Definition at line 33 of file raw_data.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00200.html b/doc/html/a00200.html new file mode 100644 index 00000000..60587551 --- /dev/null +++ b/doc/html/a00200.html @@ -0,0 +1,331 @@ + + + + +GLM: glm::gtx::reciprocal Namespace Reference + + + + + + +
+

glm::gtx::reciprocal Namespace Reference

+

GLM_GTX_reciprocal extension: Define secant, cosecant and cotangent functions. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename genType >
genType acot (genType const &x)
 Inverse cotangent function.
template<typename genType >
genType acoth (genType const &x)
 Inverse cotangent hyperbolic function.
template<typename genType >
genType acsc (genType const &x)
 Inverse cosecant function.
template<typename genType >
genType acsch (genType const &x)
 Inverse cosecant hyperbolic function.
template<typename genType >
genType asec (genType const &x)
 Inverse secant function.
template<typename genType >
genType asech (genType const &x)
 Inverse secant hyperbolic function.
template<typename genType >
genType cot (genType const &angle)
 Cotangent function.
template<typename genType >
genType coth (genType const &angle)
 Cotangent hyperbolic function.
template<typename genType >
genType csc (genType const &angle)
 Cosecant function.
template<typename genType >
genType csch (genType const &angle)
 Cosecant hyperbolic function.
template<typename genType >
genType sec (genType const &angle)
 Secant function.
template<typename genType >
genType sech (genType const &angle)
 Secant hyperbolic function.
+

Detailed Description

+

GLM_GTX_reciprocal extension: Define secant, cosecant and cotangent functions.

+

Function Documentation

+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::acot (genType const &  x ) 
+
+
+ +

Inverse cotangent function.

+

From GLM_GTX_reciprocal extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::acoth (genType const &  x ) 
+
+
+ +

Inverse cotangent hyperbolic function.

+

From GLM_GTX_reciprocal extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::acsc (genType const &  x ) 
+
+
+ +

Inverse cosecant function.

+

From GLM_GTX_reciprocal extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::acsch (genType const &  x ) 
+
+
+ +

Inverse cosecant hyperbolic function.

+

From GLM_GTX_reciprocal extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::asec (genType const &  x ) 
+
+
+ +

Inverse secant function.

+

From GLM_GTX_reciprocal extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::asech (genType const &  x ) 
+
+
+ +

Inverse secant hyperbolic function.

+

From GLM_GTX_reciprocal extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::cot (genType const &  angle ) 
+
+
+ +

Cotangent function.

+

adjacent / opposite or 1 / tan(x) From GLM_GTX_reciprocal extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::coth (genType const &  angle ) 
+
+
+ +

Cotangent hyperbolic function.

+

From GLM_GTX_reciprocal extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::csc (genType const &  angle ) 
+
+
+ +

Cosecant function.

+

hypotenuse / opposite or 1 / sin(x) From GLM_GTX_reciprocal extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::csch (genType const &  angle ) 
+
+
+ +

Cosecant hyperbolic function.

+

From GLM_GTX_reciprocal extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::sec (genType const &  angle ) 
+
+
+ +

Secant function.

+

hypotenuse / adjacent or 1 / cos(x) From GLM_GTX_reciprocal extension.

+ +
+
+ +
+
+ + + + + + + + + +
genType glm::gtx::reciprocal::sech (genType const &  angle ) 
+
+
+ +

Secant hyperbolic function.

+

From GLM_GTX_reciprocal extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00201.html b/doc/html/a00201.html new file mode 100644 index 00000000..c6643d12 --- /dev/null +++ b/doc/html/a00201.html @@ -0,0 +1,385 @@ + + + + +GLM: glm::gtx::rotate_vector Namespace Reference + + + + + + +
+

glm::gtx::rotate_vector Namespace Reference

+

GLM_GTX_rotate_vector extension: Function to directly rotate a vector. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename T >
detail::tmat4x4< T > orientation (const detail::tvec3< T > &Normal, const detail::tvec3< T > &Up)
 Build a rotation matrix from a normal and a up vector.
template<typename T >
detail::tvec4< T > rotate (const detail::tvec4< T > &v, T angle, const detail::tvec3< T > &normal)
 Rotate a four dimentionnals vector around an axis.
template<typename T >
detail::tvec3< T > rotate (const detail::tvec3< T > &v, T angle, const detail::tvec3< T > &normal)
 Rotate a three dimentionnals vector around an axis.
template<typename T >
detail::tvec2< T > rotate (const detail::tvec2< T > &v, T angle)
 Rotate a two dimentionnals vector.
template<typename T >
detail::tvec4< T > rotateX (const detail::tvec4< T > &v, T angle)
 Rotate a four dimentionnals vector around the X axis.
template<typename T >
detail::tvec3< T > rotateX (const detail::tvec3< T > &v, T angle)
 Rotate a three dimentionnals vector around the X axis.
template<typename T >
detail::tvec4< T > rotateY (const detail::tvec4< T > &v, T angle)
 Rotate a four dimentionnals vector around the X axis.
template<typename T >
detail::tvec3< T > rotateY (const detail::tvec3< T > &v, T angle)
 Rotate a three dimentionnals vector around the Y axis.
template<typename T >
detail::tvec4< T > rotateZ (const detail::tvec4< T > &v, T angle)
 Rotate a four dimentionnals vector around the X axis.
template<typename T >
detail::tvec3< T > rotateZ (const detail::tvec3< T > &v, T angle)
 Rotate a three dimentionnals vector around the Z axis.
+

Detailed Description

+

GLM_GTX_rotate_vector extension: Function to directly rotate a vector.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::rotate_vector::orientation (const detail::tvec3< T > &  Normal,
const detail::tvec3< T > &  Up 
)
+
+
+ +

Build a rotation matrix from a normal and a up vector.

+

From GLM_GTX_rotate_vector extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tvec4<T> glm::gtx::rotate_vector::rotate (const detail::tvec4< T > &  v,
angle,
const detail::tvec3< T > &  normal 
)
+
+
+ +

Rotate a four dimentionnals vector around an axis.

+

From GLM_GTX_rotate_vector extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tvec3<T> glm::gtx::rotate_vector::rotate (const detail::tvec3< T > &  v,
angle,
const detail::tvec3< T > &  normal 
)
+
+
+ +

Rotate a three dimentionnals vector around an axis.

+

From GLM_GTX_rotate_vector extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec2<T> glm::gtx::rotate_vector::rotate (const detail::tvec2< T > &  v,
angle 
)
+
+
+ +

Rotate a two dimentionnals vector.

+

From GLM_GTX_rotate_vector extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec4<T> glm::gtx::rotate_vector::rotateX (const detail::tvec4< T > &  v,
angle 
)
+
+
+ +

Rotate a four dimentionnals vector around the X axis.

+

From GLM_GTX_rotate_vector extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<T> glm::gtx::rotate_vector::rotateX (const detail::tvec3< T > &  v,
angle 
)
+
+
+ +

Rotate a three dimentionnals vector around the X axis.

+

From GLM_GTX_rotate_vector extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec4<T> glm::gtx::rotate_vector::rotateY (const detail::tvec4< T > &  v,
angle 
)
+
+
+ +

Rotate a four dimentionnals vector around the X axis.

+

From GLM_GTX_rotate_vector extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<T> glm::gtx::rotate_vector::rotateY (const detail::tvec3< T > &  v,
angle 
)
+
+
+ +

Rotate a three dimentionnals vector around the Y axis.

+

From GLM_GTX_rotate_vector extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec4<T> glm::gtx::rotate_vector::rotateZ (const detail::tvec4< T > &  v,
angle 
)
+
+
+ +

Rotate a four dimentionnals vector around the X axis.

+

From GLM_GTX_rotate_vector extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tvec3<T> glm::gtx::rotate_vector::rotateZ (const detail::tvec3< T > &  v,
angle 
)
+
+
+ +

Rotate a three dimentionnals vector around the Z axis.

+

From GLM_GTX_rotate_vector extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00202.html b/doc/html/a00202.html new file mode 100644 index 00000000..30f2a74c --- /dev/null +++ b/doc/html/a00202.html @@ -0,0 +1,41 @@ + + + + +GLM: glm::gtx::simd_mat4 Namespace Reference + + + + + + +
+

glm::gtx::simd_mat4 Namespace Reference

+

GLM_GTX_simd_mat4 extension: SIMD implementation of vec4 type. +More...

+ +
+

Detailed Description

+

GLM_GTX_simd_mat4 extension: SIMD implementation of vec4 type.

+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00203.html b/doc/html/a00203.html new file mode 100644 index 00000000..4e4bd06e --- /dev/null +++ b/doc/html/a00203.html @@ -0,0 +1,41 @@ + + + + +GLM: glm::gtx::simd_vec4 Namespace Reference + + + + + + +
+

glm::gtx::simd_vec4 Namespace Reference

+

GLM_GTX_simd_vec4 extension: SIMD implementation of vec4 type. +More...

+ +
+

Detailed Description

+

GLM_GTX_simd_vec4 extension: SIMD implementation of vec4 type.

+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00204.html b/doc/html/a00204.html new file mode 100644 index 00000000..ec0bd858 --- /dev/null +++ b/doc/html/a00204.html @@ -0,0 +1,196 @@ + + + + +GLM: glm::gtx::spline Namespace Reference + + + + + + +
+

glm::gtx::spline Namespace Reference

+

GLM_GTX_spline extension: Spline functions. +More...

+ + + + + + + + + + + +

Functions

template<typename genType >
genType catmullRom (const genType &v1, const genType &v2, const genType &v3, const genType &v4, const GLMvalType &s)
 Return a point from a catmull rom curve.
template<typename genType >
genType cubic (const genType &v1, const genType &v2, const genType &v3, const genType &v4, const GLMvalType &s)
 Return a point from a cubic curve.
template<typename genType >
genType hermite (const genType &v1, const genType &t1, const genType &v2, const genType &t2, const GLMvalType &s)
 Return a point from a hermite curve.
+

Detailed Description

+

GLM_GTX_spline extension: Spline functions.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
genType glm::gtx::spline::catmullRom (const genType &  v1,
const genType &  v2,
const genType &  v3,
const genType &  v4,
const GLMvalType &  s 
)
+
+
+ +

Return a point from a catmull rom curve.

+

From GLM_GTX_spline extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
genType glm::gtx::spline::cubic (const genType &  v1,
const genType &  v2,
const genType &  v3,
const genType &  v4,
const GLMvalType &  s 
)
+
+
+ +

Return a point from a cubic curve.

+

From GLM_GTX_spline extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
genType glm::gtx::spline::hermite (const genType &  v1,
const genType &  t1,
const genType &  v2,
const genType &  t2,
const GLMvalType &  s 
)
+
+
+ +

Return a point from a hermite curve.

+

From GLM_GTX_spline extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00205.html b/doc/html/a00205.html new file mode 100644 index 00000000..85bd653e --- /dev/null +++ b/doc/html/a00205.html @@ -0,0 +1,41 @@ + + + + +GLM: glm::gtx::statistics_operation Namespace Reference + + + + + + +
+

glm::gtx::statistics_operation Namespace Reference

+

GLM_GTX_statistics_operation extension: - Work in progress - Statistics functions. +More...

+ +
+

Detailed Description

+

GLM_GTX_statistics_operation extension: - Work in progress - Statistics functions.

+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00206.html b/doc/html/a00206.html new file mode 100644 index 00000000..732f0753 --- /dev/null +++ b/doc/html/a00206.html @@ -0,0 +1,41 @@ + + + + +GLM: glm::gtx::std_based_type Namespace Reference + + + + + + +
+

glm::gtx::std_based_type Namespace Reference

+

GLM_GTX_std_based_type extension: Add support vector types based on C++ standard type. +More...

+ +
+

Detailed Description

+

GLM_GTX_std_based_type extension: Add support vector types based on C++ standard type.

+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00207.html b/doc/html/a00207.html new file mode 100644 index 00000000..0d85ac6e --- /dev/null +++ b/doc/html/a00207.html @@ -0,0 +1,67 @@ + + + + +GLM: glm::gtx::string_cast Namespace Reference + + + + + + +
+

glm::gtx::string_cast Namespace Reference

+

GLM_GTX_string_cast extension: Setup strings for GLM type values. +More...

+ + + + + +

Functions

template<typename genType >
std::string string (genType const &x)
 Create a string from a GLM type value.
+

Detailed Description

+

GLM_GTX_string_cast extension: Setup strings for GLM type values.

+

Function Documentation

+ +
+
+ + + + + + + + + +
std::string glm::gtx::string_cast::string (genType const &  x ) 
+
+
+ +

Create a string from a GLM type value.

+

From GLM_GTX_string_cast extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00208.html b/doc/html/a00208.html new file mode 100644 index 00000000..74abeb64 --- /dev/null +++ b/doc/html/a00208.html @@ -0,0 +1,388 @@ + + + + +GLM: glm::gtx::transform Namespace Reference + + + + + + +
+

glm::gtx::transform Namespace Reference

+

GLM_GTX_transform extension: Add transformation matrices. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename T >
detail::tmat4x4< T > rotate (detail::tmat4x4< T > const &m, T angle, T x, T y, T z)
 Transforms a matrix with a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.
template<typename T >
detail::tmat4x4< T > rotate (T angle, detail::tvec3< T > const &v)
 Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.
template<typename T >
detail::tmat4x4< T > rotate (T angle, T x, T y, T z)
 Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.
template<typename T >
detail::tmat4x4< T > scale (detail::tvec3< T > const &v)
 Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components.
template<typename T >
detail::tmat4x4< T > scale (detail::tmat4x4< T > const &m, T x, T y, T z)
 Transforms a matrix with a scale 4 * 4 matrix created from 3 scalars.
template<typename T >
detail::tmat4x4< T > scale (T x, T y, T z)
 Builds a scale 4 * 4 matrix created from 3 scalars.
template<typename T >
detail::tmat4x4< T > translate (detail::tvec3< T > const &v)
 Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars.
template<typename T >
detail::tmat4x4< T > translate (detail::tmat4x4< T > const &m, T x, T y, T z)
 Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars.
template<typename T >
detail::tmat4x4< T > translate (T x, T y, T z)
 Builds a translation 4 * 4 matrix created from 3 scalars.
+

Detailed Description

+

GLM_GTX_transform extension: Add transformation matrices.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform::rotate (detail::tmat4x4< T > const &  m,
angle,
x,
y,
z 
)
+
+
+ +

Transforms a matrix with a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.

+

From GLM_GTX_transform extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform::rotate ( angle,
detail::tvec3< T > const &  v 
)
+
+
+ +

Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.

+

From GLM_GTX_transform extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform::rotate ( angle,
x,
y,
z 
)
+
+
+ +

Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.

+

From GLM_GTX_transform extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform::scale (detail::tvec3< T > const &  v ) 
+
+
+ +

Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components.

+

From GLM_GTX_transform extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform::scale (detail::tmat4x4< T > const &  m,
x,
y,
z 
)
+
+
+ +

Transforms a matrix with a scale 4 * 4 matrix created from 3 scalars.

+

From GLM_GTX_transform extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform::scale ( x,
y,
z 
)
+
+
+ +

Builds a scale 4 * 4 matrix created from 3 scalars.

+

From GLM_GTX_transform extension.

+ +
+
+ +
+
+ + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform::translate (detail::tvec3< T > const &  v ) 
+
+
+ +

Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars.

+

From GLM_GTX_transform extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform::translate (detail::tmat4x4< T > const &  m,
x,
y,
z 
)
+
+
+ +

Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars.

+

From GLM_GTX_transform extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform::translate ( x,
y,
z 
)
+
+
+ +

Builds a translation 4 * 4 matrix created from 3 scalars.

+

From GLM_GTX_transform extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00209.html b/doc/html/a00209.html new file mode 100644 index 00000000..51123a76 --- /dev/null +++ b/doc/html/a00209.html @@ -0,0 +1,402 @@ + + + + +GLM: glm::gtx::transform2 Namespace Reference + + + + + + +
+

glm::gtx::transform2 Namespace Reference

+

GLM_GTX_transform2 extension: Add extra transformation matrices. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename T >
detail::tmat4x4< T > lookAt (detail::tvec3< T > const &eye, detail::tvec3< T > const &center, detail::tvec3< T > const &up)
 Build a look at view matrix.
template<typename T >
detail::tmat3x3< T > proj2D (const detail::tmat3x3< T > &m, const detail::tvec3< T > &normal)
 Build planar projection matrix along normal axis.
template<typename T >
detail::tmat4x4< T > proj3D (const detail::tmat4x4< T > &m, const detail::tvec3< T > &normal)
 Build planar projection matrix along normal axis.
template<typename valType >
detail::tmat4x4< valType > scaleBias (detail::tmat4x4< valType > const &m, valType scale, valType bias)
 Build a scale bias matrix.
template<typename valType >
detail::tmat4x4< valType > scaleBias (valType scale, valType bias)
 Build a scale bias matrix.
template<typename T >
detail::tmat3x3< T > shearX2D (detail::tmat3x3< T > const &m, T y)
 Transforms a matrix with a shearing on X axis.
template<typename T >
detail::tmat4x4< T > shearX3D (const detail::tmat4x4< T > &m, T y, T z)
 Transforms a matrix with a shearing on X axis From GLM_GTX_transform2 extension.
template<typename T >
detail::tmat3x3< T > shearY2D (detail::tmat3x3< T > const &m, T x)
 Transforms a matrix with a shearing on Y axis.
template<typename T >
detail::tmat4x4< T > shearY3D (const detail::tmat4x4< T > &m, T x, T z)
 Transforms a matrix with a shearing on Y axis.
template<typename T >
detail::tmat4x4< T > shearZ3D (const detail::tmat4x4< T > &m, T x, T y)
 Transforms a matrix with a shearing on Z axis.
+

Detailed Description

+

GLM_GTX_transform2 extension: Add extra transformation matrices.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform2::lookAt (detail::tvec3< T > const &  eye,
detail::tvec3< T > const &  center,
detail::tvec3< T > const &  up 
)
+
+
+ +

Build a look at view matrix.

+

From GLM_GTX_transform2 extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat3x3<T> glm::gtx::transform2::proj2D (const detail::tmat3x3< T > &  m,
const detail::tvec3< T > &  normal 
)
+
+
+ +

Build planar projection matrix along normal axis.

+

From GLM_GTX_transform2 extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform2::proj3D (const detail::tmat4x4< T > &  m,
const detail::tvec3< T > &  normal 
)
+
+
+ +

Build planar projection matrix along normal axis.

+

From GLM_GTX_transform2 extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::transform2::scaleBias (detail::tmat4x4< valType > const &  m,
valType  scale,
valType  bias 
)
+
+
+ +

Build a scale bias matrix.

+

From GLM_GTX_transform2 extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat4x4<valType> glm::gtx::transform2::scaleBias (valType  scale,
valType  bias 
)
+
+
+ +

Build a scale bias matrix.

+

From GLM_GTX_transform2 extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat3x3<T> glm::gtx::transform2::shearX2D (detail::tmat3x3< T > const &  m,
y 
)
+
+
+ +

Transforms a matrix with a shearing on X axis.

+

From GLM_GTX_transform2 extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform2::shearX3D (const detail::tmat4x4< T > &  m,
y,
z 
)
+
+
+ +

Transforms a matrix with a shearing on X axis From GLM_GTX_transform2 extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
detail::tmat3x3<T> glm::gtx::transform2::shearY2D (detail::tmat3x3< T > const &  m,
x 
)
+
+
+ +

Transforms a matrix with a shearing on Y axis.

+

From GLM_GTX_transform2 extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform2::shearY3D (const detail::tmat4x4< T > &  m,
x,
z 
)
+
+
+ +

Transforms a matrix with a shearing on Y axis.

+

From GLM_GTX_transform2 extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
detail::tmat4x4<T> glm::gtx::transform2::shearZ3D (const detail::tmat4x4< T > &  m,
x,
y 
)
+
+
+ +

Transforms a matrix with a shearing on Z axis.

+

From GLM_GTX_transform2 extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00210.html b/doc/html/a00210.html new file mode 100644 index 00000000..3c54e872 --- /dev/null +++ b/doc/html/a00210.html @@ -0,0 +1,667 @@ + + + + +GLM: glm::gtx::type_ptr Namespace Reference + + + + + + +
+

glm::gtx::type_ptr Namespace Reference

+

GLM_GTX_type_ptr extension: Get access to vectors & matrices value type address. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename valType >
valType * value_ptr (detail::tmat4x3< valType > &mat)
 Get the address of the matrix content.
template<typename valType >
valType const * value_ptr (detail::tmat4x3< valType > const &mat)
 Get the const address of the matrix content.
template<typename valType >
valType * value_ptr (detail::tmat3x4< valType > &mat)
 Get the address of the matrix content.
template<typename valType >
valType const * value_ptr (detail::tmat3x4< valType > const &mat)
 Get the const address of the matrix content.
template<typename valType >
valType * value_ptr (detail::tmat4x2< valType > &mat)
 Get the address of the matrix content.
template<typename valType >
valType const * value_ptr (detail::tmat4x2< valType > const &mat)
 Get the const address of the matrix content.
template<typename valType >
valType * value_ptr (detail::tmat2x4< valType > &mat)
 Get the address of the matrix content.
template<typename valType >
valType const * value_ptr (detail::tmat2x4< valType > const &mat)
 Get the const address of the matrix content.
template<typename valType >
valType * value_ptr (detail::tmat3x2< valType > &mat)
 Get the address of the matrix content.
template<typename valType >
valType const * value_ptr (detail::tmat3x2< valType > const &mat)
 Get the const address of the matrix content.
template<typename valType >
valType * value_ptr (detail::tmat2x3< valType > &mat)
 Get the address of the matrix content.
template<typename valType >
valType const * value_ptr (detail::tmat2x3< valType > const &mat)
 Get the const address of the matrix content.
template<typename valType >
valType * value_ptr (detail::tmat4x4< valType > &mat)
 Get the address of the matrix content.
template<typename valType >
valType const * value_ptr (detail::tmat4x4< valType > const &mat)
 Get the const address of the matrix content.
template<typename valType >
valType * value_ptr (detail::tmat3x3< valType > &mat)
 Get the address of the matrix content.
template<typename valType >
valType const * value_ptr (detail::tmat3x3< valType > const &mat)
 Get the const address of the matrix content.
template<typename valType >
valType * value_ptr (detail::tmat2x2< valType > &mat)
 Get the address of the matrix content.
template<typename valType >
valType const * value_ptr (detail::tmat2x2< valType > const &mat)
 Get the const address of the matrix content.
template<typename valType >
valType * value_ptr (detail::tvec4< valType > &vec)
 Get the address of the vector content.
template<typename valType >
valType const * value_ptr (detail::tvec4< valType > const &vec)
 Get the const address of the vector content.
template<typename valType >
valType * value_ptr (detail::tvec3< valType > &vec)
 Get the address of the vector content.
template<typename valType >
valType const * value_ptr (detail::tvec3< valType > const &vec)
 Get the const address of the vector content.
template<typename valType >
valType * value_ptr (detail::tvec2< valType > &vec)
 Get the address of the vector content.
template<typename valType >
valType const * value_ptr (detail::tvec2< valType > const &vec)
 Get the const address of the vector content.
+

Detailed Description

+

GLM_GTX_type_ptr extension: Get access to vectors & matrices value type address.

+

Function Documentation

+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tmat4x3< valType > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 216 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tmat4x3< valType > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 208 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tmat3x4< valType > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 200 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tmat3x4< valType > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 192 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tmat4x2< valType > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 184 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tmat4x2< valType > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 176 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tmat2x4< valType > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 168 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tmat2x4< valType > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 160 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tmat3x2< valType > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 152 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tmat3x2< valType > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 144 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tmat2x3< valType > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 136 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tmat2x3< valType > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 128 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tmat4x4< valType > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 120 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tmat4x4< valType > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 112 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tmat3x3< valType > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 104 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tmat3x3< valType > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 96 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tmat2x2< valType > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 88 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tmat2x2< valType > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 80 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tvec4< valType > &  vec ) 
+
+
+ +

Get the address of the vector content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 72 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tvec4< valType > const &  vec ) 
+
+
+ +

Get the const address of the vector content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 64 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tvec3< valType > &  vec ) 
+
+
+ +

Get the address of the vector content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 56 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tvec3< valType > const &  vec ) 
+
+
+ +

Get the const address of the vector content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 48 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType* glm::gtx::type_ptr::value_ptr (detail::tvec2< valType > &  vec ) 
+
+
+ +

Get the address of the vector content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 40 of file type_ptr.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
valType const* glm::gtx::type_ptr::value_ptr (detail::tvec2< valType > const &  vec ) 
+
+
+ +

Get the const address of the vector content.

+

From GLM_GTX_type_ptr extension.

+ +

Definition at line 32 of file type_ptr.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00211.html b/doc/html/a00211.html new file mode 100644 index 00000000..47cf296c --- /dev/null +++ b/doc/html/a00211.html @@ -0,0 +1,152 @@ + + + + +GLM: glm::gtx::unsigned_int Namespace Reference + + + + + + +
+

glm::gtx::unsigned_int Namespace Reference

+

GLM_GTX_unsigned_int extension: Add support for unsigned integer for core functions. +More...

+ + + + + + + + + + + +

Typedefs

typedef signed int sint
 32bit signed integer.

Functions

uint mod (uint x, uint y)
 Modulus.
uint pow (uint x, uint y)
 Returns x raised to the y power.
uint sqrt (uint x)
 Returns the positive square root of x.
+

Detailed Description

+

GLM_GTX_unsigned_int extension: Add support for unsigned integer for core functions.

+

Typedef Documentation

+ +
+
+ + + + +
typedef signed int sint
+
+
+ +

32bit signed integer.

+

From GLM_GTX_unsigned_int extension.

+ +

Definition at line 33 of file unsigned_int.hpp.

+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
uint glm::gtx::unsigned_int::mod (uint  x,
uint  y 
)
+
+
+ +

Modulus.

+

Returns x - y * floor(x / y) for each component in x using the floating point value y. From GLM_GTX_unsigned_int extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
uint glm::gtx::unsigned_int::pow (uint  x,
uint  y 
)
+
+
+ +

Returns x raised to the y power.

+

From GLM_GTX_unsigned_int extension.

+ +
+
+ +
+
+ + + + + + + + + +
uint glm::gtx::unsigned_int::sqrt (uint  x ) 
+
+
+ +

Returns the positive square root of x.

+

From GLM_GTX_unsigned_int extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00212.html b/doc/html/a00212.html new file mode 100644 index 00000000..b7d176e6 --- /dev/null +++ b/doc/html/a00212.html @@ -0,0 +1,178 @@ + + + + +GLM: glm::gtx::vector_access Namespace Reference + + + + + + +
+

glm::gtx::vector_access Namespace Reference

+

GLM_GTX_vector_access extension: Function to set values to vectors. +More...

+ + + + + + + + + + + +

Functions

template<typename valType >
void set (detail::tvec4< valType > &v, valType const &x, valType const &y, valType const &z, valType const &w)
 Set values to a 4 components vector.
template<typename valType >
void set (detail::tvec3< valType > &v, valType const &x, valType const &y, valType const &z)
 Set values to a 3 components vector.
template<typename valType >
void set (detail::tvec2< valType > &v, valType const &x, valType const &y)
 Set values to a 2 components vector.
+

Detailed Description

+

GLM_GTX_vector_access extension: Function to set values to vectors.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void glm::gtx::vector_access::set (detail::tvec4< valType > &  v,
valType const &  x,
valType const &  y,
valType const &  z,
valType const &  w 
)
+
+
+ +

Set values to a 4 components vector.

+

From GLM_GTX_vector_access extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void glm::gtx::vector_access::set (detail::tvec3< valType > &  v,
valType const &  x,
valType const &  y,
valType const &  z 
)
+
+
+ +

Set values to a 3 components vector.

+

From GLM_GTX_vector_access extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void glm::gtx::vector_access::set (detail::tvec2< valType > &  v,
valType const &  x,
valType const &  y 
)
+
+
+ +

Set values to a 2 components vector.

+

From GLM_GTX_vector_access extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00213.html b/doc/html/a00213.html new file mode 100644 index 00000000..f9f17c2b --- /dev/null +++ b/doc/html/a00213.html @@ -0,0 +1,148 @@ + + + + +GLM: glm::gtx::vector_angle Namespace Reference + + + + + + +
+

glm::gtx::vector_angle Namespace Reference

+

GLM_GTX_vector_angle extension: Compute angle between vectors. +More...

+ + + + + + + + + + + +

Functions

template<typename vecType >
vecType::value_type angle (vecType const &x, vecType const &y)
 Returns the absolute angle between x and y.
template<typename vecType >
vecType::value_type orientedAngle (vecType const &x, vecType const &y)
 Returns the oriented angle between x and y Parameters need to be normalized.
template<typename vecType >
vecType::value_type orientedAngleFromRef (vecType const &x, vecType const &y, detail::tvec3< typename vecType::value_type > const &ref)
 Returns the orientation of a two vector base from a normal.
+

Detailed Description

+

GLM_GTX_vector_angle extension: Compute angle between vectors.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
vecType::value_type glm::gtx::vector_angle::angle (vecType const &  x,
vecType const &  y 
)
+
+
+ +

Returns the absolute angle between x and y.

+

Parameters need to be normalized. From GLM_GTX_vector_angle extension

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
vecType::value_type glm::gtx::vector_angle::orientedAngle (vecType const &  x,
vecType const &  y 
)
+
+
+ +

Returns the oriented angle between x and y Parameters need to be normalized.

+

From GLM_GTX_vector_angle extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
vecType::value_type glm::gtx::vector_angle::orientedAngleFromRef (vecType const &  x,
vecType const &  y,
detail::tvec3< typename vecType::value_type > const &  ref 
)
+
+
+ +

Returns the orientation of a two vector base from a normal.

+

Parameters need to be normalized. From GLM_GTX_vector_angle extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00214.html b/doc/html/a00214.html new file mode 100644 index 00000000..3043c5eb --- /dev/null +++ b/doc/html/a00214.html @@ -0,0 +1,304 @@ + + + + +GLM: glm::gtx::vector_query Namespace Reference + + + + + + +
+

glm::gtx::vector_query Namespace Reference

+

GLM_GTX_vector_query extension: Query informations of vector types. +More...

+ + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename genType >
bool areCollinear (const genType &v0, const genType &v1, const GLMvalType epsilon=std::numeric_limits< GLMvalType >::epsilon())
 Check if two vectors are collinears.
template<typename genType >
bool areOpposite (const genType &v0, const genType &v1, const GLMvalType epsilon=std::numeric_limits< GLMvalType >::epsilon())
 Check if two vectors are opposites.
template<typename genType >
bool areOrthogonal (const genType &v0, const genType &v1, const GLMvalType epsilon=std::numeric_limits< GLMvalType >::epsilon())
 Check if two vectors are orthogonals.
template<typename genType >
bool areOrthonormal (const genType &v0, const genType &v1, const GLMvalType epsilon=std::numeric_limits< GLMvalType >::epsilon())
 Check if two vectors are orthonormal.
template<typename genType >
bool areSimilar (const genType &v0, const genType &v1, const GLMvalType epsilon=std::numeric_limits< GLMvalType >::epsilon())
 Check if two vectors are similar.
template<typename genType >
bool isNormalized (const genType &v, const GLMvalType epsilon=std::numeric_limits< GLMvalType >::epsilon())
 Check if a vector is normalized.
template<typename genType >
bool isNull (const genType &v, const GLMvalType epsilon=std::numeric_limits< GLMvalType >::epsilon())
 Check if a vector is null.
+

Detailed Description

+

GLM_GTX_vector_query extension: Query informations of vector types.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::vector_query::areCollinear (const genType &  v0,
const genType &  v1,
const GLMvalType  epsilon = std::numeric_limits< GLMvalType >::epsilon() 
)
+
+
+ +

Check if two vectors are collinears.

+

From GLM_GTX_vector_query extensions.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::vector_query::areOpposite (const genType &  v0,
const genType &  v1,
const GLMvalType  epsilon = std::numeric_limits< GLMvalType >::epsilon() 
)
+
+
+ +

Check if two vectors are opposites.

+

From GLM_GTX_vector_query extensions.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::vector_query::areOrthogonal (const genType &  v0,
const genType &  v1,
const GLMvalType  epsilon = std::numeric_limits< GLMvalType >::epsilon() 
)
+
+
+ +

Check if two vectors are orthogonals.

+

From GLM_GTX_vector_query extensions.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::vector_query::areOrthonormal (const genType &  v0,
const genType &  v1,
const GLMvalType  epsilon = std::numeric_limits< GLMvalType >::epsilon() 
)
+
+
+ +

Check if two vectors are orthonormal.

+

From GLM_GTX_vector_query extensions.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool glm::gtx::vector_query::areSimilar (const genType &  v0,
const genType &  v1,
const GLMvalType  epsilon = std::numeric_limits< GLMvalType >::epsilon() 
)
+
+
+ +

Check if two vectors are similar.

+

From GLM_GTX_vector_query extensions.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::vector_query::isNormalized (const genType &  v,
const GLMvalType  epsilon = std::numeric_limits< GLMvalType >::epsilon() 
)
+
+
+ +

Check if a vector is normalized.

+

From GLM_GTX_vector_query extensions.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
bool glm::gtx::vector_query::isNull (const genType &  v,
const GLMvalType  epsilon = std::numeric_limits< GLMvalType >::epsilon() 
)
+
+
+ +

Check if a vector is null.

+

From GLM_GTX_vector_query extensions.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00215.html b/doc/html/a00215.html new file mode 100644 index 00000000..2f29484c --- /dev/null +++ b/doc/html/a00215.html @@ -0,0 +1,41 @@ + + + + +GLM: glm::gtx::vecx Namespace Reference + + + + + + +
+

glm::gtx::vecx Namespace Reference

+

GLM_GTX_vecx extension: - Work in progress - Add custom size vectors. +More...

+ +
+

Detailed Description

+

GLM_GTX_vecx extension: - Work in progress - Add custom size vectors.

+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00216.html b/doc/html/a00216.html new file mode 100644 index 00000000..09240f97 --- /dev/null +++ b/doc/html/a00216.html @@ -0,0 +1,209 @@ + + + + +GLM: glm::gtx::verbose_operator Namespace Reference + + + + + + +
+

glm::gtx::verbose_operator Namespace Reference

+

GLM_GTX_verbose_operator extension: Use words to replace operators. +More...

+ + + + + + + + + + + + + + + + + +

Functions

template<typename genTypeT , typename genTypeU >
genTypeT add (genTypeT const &a, genTypeU const &b)
 Addition of two values From GLM_GTX_verbose_operator extension.
template<typename genTypeT , typename genTypeU >
genTypeT div (genTypeT const &a, genTypeU const &b)
 Division of two values From GLM_GTX_verbose_operator extension.
template<typename genTypeT , typename genTypeU , typename genTypeV >
genTypeT mad (genTypeT const &a, genTypeU const &b, genTypeV const &c)
 Multiplication and addition of three values From GLM_GTX_verbose_operator extension.
template<typename genTypeT , typename genTypeU >
genTypeT mul (genTypeT const &a, genTypeU const &b)
 Multiplication of two values From GLM_GTX_verbose_operator extension.
template<typename genTypeT , typename genTypeU >
genTypeT sub (genTypeT const &a, genTypeU const &b)
 Substration of two values From GLM_GTX_verbose_operator extension.
+

Detailed Description

+

GLM_GTX_verbose_operator extension: Use words to replace operators.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
genTypeT glm::gtx::verbose_operator::add (genTypeT const &  a,
genTypeU const &  b 
)
+
+
+ +

Addition of two values From GLM_GTX_verbose_operator extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genTypeT glm::gtx::verbose_operator::div (genTypeT const &  a,
genTypeU const &  b 
)
+
+
+ +

Division of two values From GLM_GTX_verbose_operator extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
genTypeT glm::gtx::verbose_operator::mad (genTypeT const &  a,
genTypeU const &  b,
genTypeV const &  c 
)
+
+
+ +

Multiplication and addition of three values From GLM_GTX_verbose_operator extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genTypeT glm::gtx::verbose_operator::mul (genTypeT const &  a,
genTypeU const &  b 
)
+
+
+ +

Multiplication of two values From GLM_GTX_verbose_operator extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genTypeT glm::gtx::verbose_operator::sub (genTypeT const &  a,
genTypeU const &  b 
)
+
+
+ +

Substration of two values From GLM_GTX_verbose_operator extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00217.html b/doc/html/a00217.html new file mode 100644 index 00000000..157660af --- /dev/null +++ b/doc/html/a00217.html @@ -0,0 +1,48 @@ + + + + +GLM: glm::img Namespace Reference + + + + + + +
+

glm::img Namespace Reference

+

IMG extensions. +More...

+ + + + +

+

+

Namespaces

namespace  multiple
 

GLM_IMG_multiple: Find the closest number of a number multiple of other number.

+
+

Detailed Description

+

IMG extensions.

+

VIRTREV extensions.

+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00218.html b/doc/html/a00218.html new file mode 100644 index 00000000..a6b17d1c --- /dev/null +++ b/doc/html/a00218.html @@ -0,0 +1,109 @@ + + + + +GLM: glm::img::multiple Namespace Reference + + + + + + +
+

glm::img::multiple Namespace Reference

+

GLM_IMG_multiple: Find the closest number of a number multiple of other number. +More...

+ + + + + + + + +

Functions

template<typename genType >
genType higherMultiple (genType const &Source, genType const &Multiple)
 Higher Multiple number of Source.
template<typename genType >
genType lowerMultiple (genType const &Source, genType const &Multiple)
 Lower Multiple number of Source.
+

Detailed Description

+

GLM_IMG_multiple: Find the closest number of a number multiple of other number.

+

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
genType glm::img::multiple::higherMultiple (genType const &  Source,
genType const &  Multiple 
)
+
+
+ +

Higher Multiple number of Source.

+

From GLM_IMG_multiple extension.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
genType glm::img::multiple::lowerMultiple (genType const &  Source,
genType const &  Multiple 
)
+
+
+ +

Lower Multiple number of Source.

+

From GLM_IMG_multiple extension.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00221.html b/doc/html/a00221.html new file mode 100644 index 00000000..57ce70a3 --- /dev/null +++ b/doc/html/a00221.html @@ -0,0 +1,643 @@ + + + + +GLM: glm::virtrev_glmext::address Namespace Reference + + + + + + +
+

glm::virtrev_glmext::address Namespace Reference

+

GLM_VIRTREV_address extension: Vector & matrix content address (T const * type pointer). +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Functions

template<typename T >
T * address (detail::tmat4x3< T > &mat)
 Get the address of the matrix content.
template<typename T >
T const * address (detail::tmat4x3< T > const &mat)
 Get the const address of the matrix content.
template<typename T >
T * address (detail::tmat3x4< T > &mat)
 Get the address of the matrix content.
template<typename T >
T const * address (detail::tmat3x4< T > const &mat)
 Get the const address of the matrix content.
template<typename T >
T * address (detail::tmat4x2< T > &mat)
 Get the address of the matrix content.
template<typename T >
T const * address (detail::tmat4x2< T > const &mat)
 Get the const address of the matrix content.
template<typename T >
T * address (detail::tmat2x4< T > &mat)
 Get the address of the matrix content.
template<typename T >
T const * address (detail::tmat2x4< T > const &mat)
 Get the const address of the matrix content.
template<typename T >
T * address (detail::tmat3x2< T > &mat)
 Get the address of the matrix content.
template<typename T >
T const * address (detail::tmat3x2< T > const &mat)
 Get the const address of the matrix content.
template<typename T >
T * address (detail::tmat2x3< T > &mat)
 Get the address of the matrix content.
template<typename T >
T const * address (detail::tmat2x3< T > const &mat)
 Get the const address of the matrix content.
template<typename T >
T * address (detail::tmat4x4< T > &mat)
 Get the address of the matrix content.
template<typename T >
T const * address (detail::tmat4x4< T > const &mat)
 Get the const address of the matrix content.
template<typename T >
T * address (detail::tmat3x3< T > &mat)
 Get the address of the matrix content.
template<typename T >
T const * address (detail::tmat3x3< T > const &mat)
 Get the const address of the matrix content.
template<typename T >
T * address (detail::tmat2x2< T > &mat)
 Get the address of the matrix content.
template<typename T >
T const * address (detail::tmat2x2< T > const &mat)
 Get the const address of the matrix content.
template<typename T >
T * address (detail::tvec4< T > &vec)
 Get the address of the vector content.
template<typename T >
T const * address (detail::tvec4< T > const &vec)
 Get the const address of the vector content.
template<typename T >
T * address (detail::tvec3< T > &vec)
 Get the address of the vector content.
template<typename T >
T const * address (detail::tvec3< T > const &vec)
 Get the const address of the vector content.
template<typename T >
T * address (detail::tvec2< T > &vec)
 Get the address of the vector content.
template<typename T >
T const * address (detail::tvec2< T > const &vec)
 Get the const address of the vector content.
+

Detailed Description

+

GLM_VIRTREV_address extension: Vector & matrix content address (T const * type pointer).

+

Function Documentation

+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tmat4x3< T > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+ +

Definition at line 178 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tmat4x3< T > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+ +

Definition at line 172 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tmat3x4< T > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+ +

Definition at line 165 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tmat3x4< T > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+ +

Definition at line 159 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tmat4x2< T > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+ +

Definition at line 152 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tmat4x2< T > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+ +

Definition at line 146 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tmat2x4< T > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+ +

Definition at line 139 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tmat2x4< T > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+ +

Definition at line 133 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tmat3x2< T > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+ +

Definition at line 126 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tmat3x2< T > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+ +

Definition at line 120 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tmat2x3< T > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+ +

Definition at line 113 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tmat2x3< T > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+ +

Definition at line 107 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tmat4x4< T > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+ +

Definition at line 100 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tmat4x4< T > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+ +

Definition at line 94 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tmat3x3< T > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+ +

Definition at line 87 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tmat3x3< T > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+ +

Definition at line 81 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tmat2x2< T > &  mat ) 
+
+
+ +

Get the address of the matrix content.

+ +

Definition at line 74 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tmat2x2< T > const &  mat ) 
+
+
+ +

Get the const address of the matrix content.

+ +

Definition at line 68 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tvec4< T > &  vec ) 
+
+
+ +

Get the address of the vector content.

+ +

Definition at line 61 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tvec4< T > const &  vec ) 
+
+
+ +

Get the const address of the vector content.

+ +

Definition at line 55 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tvec3< T > &  vec ) 
+
+
+ +

Get the address of the vector content.

+ +

Definition at line 48 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tvec3< T > const &  vec ) 
+
+
+ +

Get the const address of the vector content.

+ +

Definition at line 42 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T* glm::virtrev_glmext::address::address (detail::tvec2< T > &  vec ) 
+
+
+ +

Get the address of the vector content.

+ +

Definition at line 35 of file address.hpp.

+ +
+
+ +
+
+ + + + + + + + + +
T const* glm::virtrev_glmext::address::address (detail::tvec2< T > const &  vec ) 
+
+
+ +

Get the const address of the vector content.

+ +

Definition at line 29 of file address.hpp.

+ +
+
+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00222.html b/doc/html/a00222.html new file mode 100644 index 00000000..60850418 --- /dev/null +++ b/doc/html/a00222.html @@ -0,0 +1,41 @@ + + + + +GLM: glm::virtrev_glmext::equal_operator Namespace Reference + + + + + + +
+

glm::virtrev_glmext::equal_operator Namespace Reference

+

GLM_VIRTREV_gl extension: Vector & matrix integration with OpenGL. +More...

+ +
+

Detailed Description

+

GLM_VIRTREV_gl extension: Vector & matrix integration with OpenGL.

+
+
Generated on Mon Nov 16 11:23:25 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00223.html b/doc/html/a00223.html new file mode 100644 index 00000000..6b1bad85 --- /dev/null +++ b/doc/html/a00223.html @@ -0,0 +1,96 @@ + + + + +GLM: glm::virtrev_glmext::gl Namespace Reference + + + + + + +
+

glm::virtrev_glmext::gl Namespace Reference

+

GLM_VIRTREV_gl extension: Vector & matrix integration with OpenGL. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Typedefs

+typedef detail::tvec2< GLint > gl_ivec2
 vec2 for GLint OpenGL type
+typedef detail::tvec3< GLint > gl_ivec3
 vec3 for GLint OpenGL type
+typedef detail::tvec4< GLint > gl_ivec4
 vec4 for GLint OpenGL type
+typedef detail::tmat2x2< GLfloat > gl_mat2
 mat2x2 for GLfloat OpenGL type
+typedef detail::tmat2x3< GLfloat > gl_mat2x3
 mat2x3 for GLfloat OpenGL type
+typedef detail::tmat2x4< GLfloat > gl_mat2x4
 mat2x4 for GLfloat OpenGL type
+typedef detail::tmat3x3< GLfloat > gl_mat3
 mat3x3 for GLfloat OpenGL type
+typedef detail::tmat3x2< GLfloat > gl_mat3x2
 mat3x2 for GLfloat OpenGL type
+typedef detail::tmat3x4< GLfloat > gl_mat3x4
 mat3x4 for GLfloat OpenGL type
+typedef detail::tmat4x4< GLfloat > gl_mat4
 mat4x4 for GLfloat OpenGL type
+typedef detail::tmat4x2< GLfloat > gl_mat4x2
 mat4x2 for GLfloat OpenGL type
+typedef detail::tmat4x3< GLfloat > gl_mat4x3
 mat4x3 for GLfloat OpenGL type
+typedef detail::tvec2< GLshort > gl_svec2
 vec2 for GLshort OpenGL type
+typedef detail::tvec3< GLshort > gl_svec3
 vec3 for GLshort OpenGL type
+typedef detail::tvec4< GLshort > gl_svec4
 vec4 for GLshort OpenGL type
+typedef detail::tvec2< GLfloat > gl_vec2
 vec2 for GLfloat OpenGL type
+typedef detail::tvec3< GLfloat > gl_vec3
 vec3 for GLfloat OpenGL type
+typedef detail::tvec4< GLfloat > gl_vec4
 vec4 for GLfloat OpenGL type
+

Detailed Description

+

GLM_VIRTREV_gl extension: Vector & matrix integration with OpenGL.

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/a00224.html b/doc/html/a00224.html new file mode 100644 index 00000000..bd265fa1 --- /dev/null +++ b/doc/html/a00224.html @@ -0,0 +1,41 @@ + + + + +GLM: glm::virtrev_glmext::xstream Namespace Reference + + + + + + +
+

glm::virtrev_glmext::xstream Namespace Reference

+

GLM_VIRTREV_xstream extension: Streaming vector and matrix in a xml way. +More...

+ +
+

Detailed Description

+

GLM_VIRTREV_xstream extension: Streaming vector and matrix in a xml way.

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css new file mode 100644 index 00000000..9ca3cafb --- /dev/null +++ b/doc/html/doxygen.css @@ -0,0 +1,498 @@ +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 12px; +} + +/* @group Heading Levels */ + +h1 { + text-align: center; + font-size: 150%; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #153788; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #1b77c5; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { +} + +a.codeRef { +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + padding: 4px 6px; + margin: 4px 8px 4px 2px; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} + +td.indexkey { + background-color: #e8eef2; + font-weight: bold; + border: 1px solid #CCCCCC; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #e8eef2; + border: 1px solid #CCCCCC; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #f0f0f0; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} + +th.dirtab { + background: #e8eef2; + font-weight: bold; +} + +hr { + height: 0; + border: none; + border-top: 1px solid #666; +} + +/* @group Member Descriptions */ + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #FAFAFA; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #ccc; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memTemplParams { + color: #606060; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; + margin-left: 3px; +} + +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.memitem { + padding: 0; + margin-bottom: 10px; +} + +.memname { + white-space: nowrap; + font-weight: bold; +} + +.memproto, .memdoc { + border: 1px solid #84b0c7; +} + +.memproto { + padding: 0; + background-color: #d5e1e8; + font-weight: bold; + -webkit-border-top-left-radius: 8px; + -webkit-border-top-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -moz-border-radius-topleft: 8px; + -moz-border-radius-topright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + +} + +.memdoc { + padding: 2px 5px; + background-color: #eef3f5; + border-top-width: 0; + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0.5em; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +address { + font-style: normal; + color: #333; +} diff --git a/doc/html/doxygen.png b/doc/html/doxygen.png new file mode 100644 index 00000000..f0a274bb Binary files /dev/null and b/doc/html/doxygen.png differ diff --git a/doc/html/files.html b/doc/html/files.html new file mode 100644 index 00000000..e0cda383 --- /dev/null +++ b/doc/html/files.html @@ -0,0 +1,156 @@ + + + + +GLM: File Index + + + + + + +
+

File List

Here is a list of all documented files with brief descriptions: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
_detail.hpp [code]
_swizzle.hpp [code]
address.hpp [code]
associated_min_max.hpp [code]
bit.hpp [code]
closest_point.hpp [code]
color_cast.hpp [code]
color_space.hpp [code]
color_space_YCoCg.hpp [code]
comparison.hpp [code]
compatibility.hpp [code]
component_wise.hpp [code]
determinant.hpp [code]
gtc/double_float.hpp [code]
gtx/double_float.hpp [code]
epsilon.hpp [code]
equal_operator.hpp [code]
euler_angles.hpp [code]
ext.hpp [code]
extend.hpp [code]
extented_min_max.hpp [code]
fast_exponential.hpp [code]
fast_square_root.hpp [code]
fast_trigonometry.hpp [code]
func_common.hpp [code]
func_exponential.hpp [code]
func_geometric.hpp [code]
func_matrix.hpp [code]
func_noise.hpp [code]
func_trigonometric.hpp [code]
func_vector_relational.hpp [code]
gl.hpp [code]
glm.hpp [code]
gradient_paint.hpp [code]
gtc.hpp [code]
gtx.hpp [code]
gtc/half_float.hpp [code]
gtx/half_float.hpp [code]
handed_coordinate_space.hpp [code]
hint.hpp [code]
img.hpp [code]
inertia.hpp [code]
integer.hpp [code]
intersect.hpp [code]
intrinsic_common.hpp [code]
intrinsic_exponential.hpp [code]
intrinsic_geometric.hpp [code]
intrinsic_matrix.hpp [code]
intrinsic_trigonometric.hpp [code]
intrinsic_vector_relational.hpp [code]
inverse.hpp [code]
inverse_transpose.hpp [code]
log_base.hpp [code]
gtc/matrix_access.hpp [code]
gtx/matrix_access.hpp [code]
matrix_cross_product.hpp [code]
matrix_major_storage.hpp [code]
gtc/matrix_operation.hpp [code]
gtx/matrix_operation.hpp [code]
gtc/matrix_projection.hpp [code]
gtx/matrix_projection.hpp [code]
matrix_query.hpp [code]
matrix_selection.hpp [code]
matrix_transform.hpp [code]
matx.hpp [code]
mixed_product.hpp [code]
multiple.hpp [code]
norm.hpp [code]
normal.hpp [code]
normalize_dot.hpp [code]
number_precision.hpp [code]
ocl_type.hpp [code]
optimum_pow.hpp [code]
orthonormalize.hpp [code]
perpendicular.hpp [code]
polar_coordinates.hpp [code]
projection.hpp [code]
gtc/quaternion.hpp [code]
gtx/quaternion.hpp [code]
random.hpp [code]
raw_data.hpp [code]
reciprocal.hpp [code]
rotate_vector.hpp [code]
setup.hpp [code]
simd_common.hpp [code]
simd_geometric.hpp [code]
simd_mat4.hpp [code]
simd_vec4.hpp [code]
spline.hpp [code]
statistics_operation.hpp [code]
std_based_type.hpp [code]
string_cast.hpp [code]
transform.hpp [code]
transform2.hpp [code]
type.hpp [code]
type_float.hpp [code]
type_gentype.hpp [code]
type_half.hpp [code]
type_int.hpp [code]
type_mat2x2.hpp [code]
type_mat2x3.hpp [code]
type_mat2x4.hpp [code]
type_mat3x2.hpp [code]
type_mat3x3.hpp [code]
type_mat3x4.hpp [code]
type_mat4x2.hpp [code]
type_mat4x3.hpp [code]
type_mat4x4.hpp [code]
type_precision.hpp [code]
type_ptr.hpp [code]
type_size.hpp [code]
type_vec1.hpp [code]
type_vec2.hpp [code]
type_vec3.hpp [code]
type_vec4.hpp [code]
unsigned_int.hpp [code]
vector_access.hpp [code]
vector_angle.hpp [code]
vector_query.hpp [code]
vecx.hpp [code]
verbose_operator.hpp [code]
virtrev.hpp [code]
xstream.hpp [code]
+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/index.hhc b/doc/html/index.hhc new file mode 100644 index 00000000..32b8c905 --- /dev/null +++ b/doc/html/index.hhc @@ -0,0 +1,237 @@ + + + + + +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
+ + diff --git a/doc/html/index.hhk b/doc/html/index.hhk new file mode 100644 index 00000000..5a830dff --- /dev/null +++ b/doc/html/index.hhk @@ -0,0 +1,1689 @@ + + + + + +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
      +
    • +
    • +
    +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
      +
    • +
    • +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
+ + diff --git a/doc/html/index.hhp b/doc/html/index.hhp new file mode 100644 index 00000000..ed5e920e --- /dev/null +++ b/doc/html/index.hhp @@ -0,0 +1,298 @@ +[OPTIONS] +Compatibility=1.1 +Full-text search=Yes +Contents file=index.hhc +Default Window=main +Default topic=index.html +Index file=index.hhk +Language=0x409 English (United States) +Title=GLM + +[WINDOWS] +main="GLM","index.hhc","index.hhk","index.html","index.html",,,,,0x23520,,0x10387e,,,,,,,,0 + +[FILES] +index.html +a00001_source.html +a00002_source.html +a00003_source.html +a00004_source.html +a00005_source.html +a00006_source.html +a00007_source.html +a00008_source.html +a00009_source.html +a00010_source.html +a00011_source.html +a00012_source.html +a00013_source.html +a00014_source.html +a00015_source.html +a00016_source.html +a00017_source.html +a00018_source.html +a00019_source.html +a00020_source.html +a00021_source.html +a00022_source.html +a00023_source.html +a00024_source.html +a00025_source.html +a00026_source.html +a00027_source.html +a00028_source.html +a00029_source.html +a00030_source.html +a00031_source.html +a00032_source.html +a00033_source.html +a00034_source.html +a00035_source.html +a00036_source.html +a00037_source.html +a00038_source.html +a00039_source.html +a00040_source.html +a00041_source.html +a00042_source.html +a00043_source.html +a00044_source.html +a00045_source.html +a00046_source.html +a00047_source.html +a00048_source.html +a00049_source.html +a00050_source.html +a00051_source.html +a00052_source.html +a00053_source.html +a00054_source.html +a00055_source.html +a00056_source.html +a00057_source.html +a00058_source.html +a00059_source.html +a00060_source.html +a00061_source.html +a00062_source.html +a00063_source.html +a00064_source.html +a00065_source.html +a00066_source.html +a00067_source.html +a00068_source.html +a00069_source.html +a00070_source.html +a00071_source.html +a00072_source.html +a00073_source.html +a00074_source.html +a00075_source.html +a00076_source.html +a00077_source.html +a00078_source.html +a00079_source.html +a00080_source.html +a00081_source.html +a00082_source.html +a00083_source.html +a00084_source.html +a00085_source.html +a00086_source.html +a00087_source.html +a00088_source.html +a00089_source.html +a00090_source.html +a00091_source.html +a00092_source.html +a00093_source.html +a00094_source.html +a00095_source.html +a00096_source.html +a00097_source.html +a00098_source.html +a00099_source.html +a00100_source.html +a00101_source.html +a00102_source.html +a00103_source.html +a00104_source.html +a00105_source.html +a00106_source.html +a00107_source.html +a00108_source.html +a00109_source.html +a00110_source.html +a00111_source.html +a00112_source.html +a00113_source.html +a00114_source.html +a00115_source.html +a00116_source.html +a00117_source.html +a00118_source.html +a00119_source.html +a00120_source.html +a00121_source.html +a00122_source.html +a00123_source.html +namespaces.html +a00124.html +a00125.html +a00126.html +a00127.html +a00128.html +a00129.html +a00130.html +a00132.html +a00133.html +a00134.html +a00135.html +a00136.html +a00137.html +a00138.html +a00139.html +a00140.html +a00142.html +a00143.html +a00144.html +a00145.html +a00146.html +a00147.html +a00148.html +a00149.html +a00150.html +a00151.html +a00152.html +a00153.html +a00154.html +a00155.html +a00156.html +a00157.html +a00158.html +a00159.html +a00160.html +a00161.html +a00162.html +a00163.html +a00164.html +a00165.html +a00166.html +a00167.html +a00168.html +a00169.html +a00170.html +a00171.html +a00172.html +a00173.html +a00174.html +a00175.html +a00176.html +a00177.html +a00178.html +a00179.html +a00180.html +a00181.html +a00182.html +a00183.html +a00184.html +a00185.html +a00186.html +a00187.html +a00188.html +a00189.html +a00190.html +a00191.html +a00192.html +a00193.html +a00194.html +a00195.html +a00196.html +a00197.html +a00198.html +a00199.html +a00200.html +a00201.html +a00202.html +a00203.html +a00204.html +a00205.html +a00206.html +a00207.html +a00208.html +a00209.html +a00210.html +a00211.html +a00212.html +a00213.html +a00214.html +a00215.html +a00216.html +a00217.html +a00218.html +a00221.html +a00222.html +a00223.html +a00224.html +namespacemembers.html +namespacemembers_0x62.html +namespacemembers_0x63.html +namespacemembers_0x64.html +namespacemembers_0x65.html +namespacemembers_0x66.html +namespacemembers_0x67.html +namespacemembers_0x68.html +namespacemembers_0x69.html +namespacemembers_0x6c.html +namespacemembers_0x6d.html +namespacemembers_0x6e.html +namespacemembers_0x6f.html +namespacemembers_0x70.html +namespacemembers_0x71.html +namespacemembers_0x72.html +namespacemembers_0x73.html +namespacemembers_0x74.html +namespacemembers_0x75.html +namespacemembers_0x76.html +namespacemembers_0x77.html +namespacemembers_0x79.html +namespacemembers_func.html +namespacemembers_func_0x62.html +namespacemembers_func_0x63.html +namespacemembers_func_0x64.html +namespacemembers_func_0x65.html +namespacemembers_func_0x66.html +namespacemembers_func_0x67.html +namespacemembers_func_0x68.html +namespacemembers_func_0x69.html +namespacemembers_func_0x6c.html +namespacemembers_func_0x6d.html +namespacemembers_func_0x6e.html +namespacemembers_func_0x6f.html +namespacemembers_func_0x70.html +namespacemembers_func_0x71.html +namespacemembers_func_0x72.html +namespacemembers_func_0x73.html +namespacemembers_func_0x74.html +namespacemembers_func_0x75.html +namespacemembers_func_0x76.html +namespacemembers_func_0x79.html +namespacemembers_type.html +namespacemembers_type_0x63.html +namespacemembers_type_0x64.html +namespacemembers_type_0x66.html +namespacemembers_type_0x67.html +namespacemembers_type_0x68.html +namespacemembers_type_0x69.html +namespacemembers_type_0x6c.html +namespacemembers_type_0x6d.html +namespacemembers_type_0x71.html +namespacemembers_type_0x73.html +namespacemembers_type_0x75.html +namespacemembers_type_0x76.html +namespacemembers_type_0x77.html +files.html +tabs.css +tab_b.gif +tab_l.gif +tab_r.gif diff --git a/doc/html/index.html b/doc/html/index.html new file mode 100644 index 00000000..118d1706 --- /dev/null +++ b/doc/html/index.html @@ -0,0 +1,31 @@ + + + + +GLM: OpenGL Mathematics + + + + + + +
+

OpenGL Mathematics

Version 0.8.4

OpenGL Mathematics (GLM) is a C++ mathematics library for 3D applications based on the OpenGL Shading Language (GLSL) specification.

+

The goal of the project is to provide to 3D programmers math classes and functions that miss in C++ when we use to program with GLSL or any high level GPU language. With GLM, the idea is to have a library that works the same way that GLSL which imply a strict following of GLSL specification for the implementation.

+

However, this project isn't limited by GLSL features. An extension system based on GLSL extensions development conventions allows to extend GLSL capabilities.

+

GLM is release under MIT license and available for all version of GCC from version 3.4 and Visual Studio from version 8.0 as a platform independent library.

+

Any feedback is welcome, please send them to g.truc.creation[NO_SPAM_THANKS]gmail.com.

+
+
Generated on Mon Nov 16 11:23:22 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers.html b/doc/html/namespacemembers.html new file mode 100644 index 00000000..cb29d130 --- /dev/null +++ b/doc/html/namespacemembers.html @@ -0,0 +1,157 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- a -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x62.html b/doc/html/namespacemembers_0x62.html new file mode 100644 index 00000000..1cf90c5c --- /dev/null +++ b/doc/html/namespacemembers_0x62.html @@ -0,0 +1,144 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- b -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x63.html b/doc/html/namespacemembers_0x63.html new file mode 100644 index 00000000..d9c95c2c --- /dev/null +++ b/doc/html/namespacemembers_0x63.html @@ -0,0 +1,287 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- c -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x64.html b/doc/html/namespacemembers_0x64.html new file mode 100644 index 00000000..c26b6926 --- /dev/null +++ b/doc/html/namespacemembers_0x64.html @@ -0,0 +1,187 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- d -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x65.html b/doc/html/namespacemembers_0x65.html new file mode 100644 index 00000000..80b2c0e5 --- /dev/null +++ b/doc/html/namespacemembers_0x65.html @@ -0,0 +1,127 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- e -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x66.html b/doc/html/namespacemembers_0x66.html new file mode 100644 index 00000000..5a9a4670 --- /dev/null +++ b/doc/html/namespacemembers_0x66.html @@ -0,0 +1,471 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- f -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x67.html b/doc/html/namespacemembers_0x67.html new file mode 100644 index 00000000..c50d27f4 --- /dev/null +++ b/doc/html/namespacemembers_0x67.html @@ -0,0 +1,141 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- g -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x68.html b/doc/html/namespacemembers_0x68.html new file mode 100644 index 00000000..a2fb3311 --- /dev/null +++ b/doc/html/namespacemembers_0x68.html @@ -0,0 +1,213 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- h -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x69.html b/doc/html/namespacemembers_0x69.html new file mode 100644 index 00000000..8dc6bf97 --- /dev/null +++ b/doc/html/namespacemembers_0x69.html @@ -0,0 +1,239 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- i -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x6c.html b/doc/html/namespacemembers_0x6c.html new file mode 100644 index 00000000..695b6c37 --- /dev/null +++ b/doc/html/namespacemembers_0x6c.html @@ -0,0 +1,180 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- l -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x6d.html b/doc/html/namespacemembers_0x6d.html new file mode 100644 index 00000000..4ea58b69 --- /dev/null +++ b/doc/html/namespacemembers_0x6d.html @@ -0,0 +1,217 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- m -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x6e.html b/doc/html/namespacemembers_0x6e.html new file mode 100644 index 00000000..8032a401 --- /dev/null +++ b/doc/html/namespacemembers_0x6e.html @@ -0,0 +1,91 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- n -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x6f.html b/doc/html/namespacemembers_0x6f.html new file mode 100644 index 00000000..0612cb52 --- /dev/null +++ b/doc/html/namespacemembers_0x6f.html @@ -0,0 +1,102 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- o -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x70.html b/doc/html/namespacemembers_0x70.html new file mode 100644 index 00000000..3196a816 --- /dev/null +++ b/doc/html/namespacemembers_0x70.html @@ -0,0 +1,123 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- p -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x71.html b/doc/html/namespacemembers_0x71.html new file mode 100644 index 00000000..0b152a83 --- /dev/null +++ b/doc/html/namespacemembers_0x71.html @@ -0,0 +1,78 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- q -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x72.html b/doc/html/namespacemembers_0x72.html new file mode 100644 index 00000000..89aff7a8 --- /dev/null +++ b/doc/html/namespacemembers_0x72.html @@ -0,0 +1,130 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- r -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x73.html b/doc/html/namespacemembers_0x73.html new file mode 100644 index 00000000..dccf3fdf --- /dev/null +++ b/doc/html/namespacemembers_0x73.html @@ -0,0 +1,156 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- s -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x74.html b/doc/html/namespacemembers_0x74.html new file mode 100644 index 00000000..ccbb477f --- /dev/null +++ b/doc/html/namespacemembers_0x74.html @@ -0,0 +1,100 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- t -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x75.html b/doc/html/namespacemembers_0x75.html new file mode 100644 index 00000000..9314b238 --- /dev/null +++ b/doc/html/namespacemembers_0x75.html @@ -0,0 +1,210 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- u -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x76.html b/doc/html/namespacemembers_0x76.html new file mode 100644 index 00000000..81a40bb1 --- /dev/null +++ b/doc/html/namespacemembers_0x76.html @@ -0,0 +1,90 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- v -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x77.html b/doc/html/namespacemembers_0x77.html new file mode 100644 index 00000000..cbd9fc89 --- /dev/null +++ b/doc/html/namespacemembers_0x77.html @@ -0,0 +1,72 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- w -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_0x79.html b/doc/html/namespacemembers_0x79.html new file mode 100644 index 00000000..bad378a7 --- /dev/null +++ b/doc/html/namespacemembers_0x79.html @@ -0,0 +1,81 @@ + + + + +GLM: Class Members + + + + + + +
+Here is a list of all documented namespace members with links to the namespaces they belong to: + +

- y -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func.html b/doc/html/namespacemembers_func.html new file mode 100644 index 00000000..d50ad17c --- /dev/null +++ b/doc/html/namespacemembers_func.html @@ -0,0 +1,156 @@ + + + + +GLM: Class Members + + + + + + + +
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x62.html b/doc/html/namespacemembers_func_0x62.html new file mode 100644 index 00000000..a10a953a --- /dev/null +++ b/doc/html/namespacemembers_func_0x62.html @@ -0,0 +1,89 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- b -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x63.html b/doc/html/namespacemembers_func_0x63.html new file mode 100644 index 00000000..cbdb27f8 --- /dev/null +++ b/doc/html/namespacemembers_func_0x63.html @@ -0,0 +1,147 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- c -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x64.html b/doc/html/namespacemembers_func_0x64.html new file mode 100644 index 00000000..0e5d9bb6 --- /dev/null +++ b/doc/html/namespacemembers_func_0x64.html @@ -0,0 +1,120 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- d -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x65.html b/doc/html/namespacemembers_func_0x65.html new file mode 100644 index 00000000..35924c3f --- /dev/null +++ b/doc/html/namespacemembers_func_0x65.html @@ -0,0 +1,126 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- e -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x66.html b/doc/html/namespacemembers_func_0x66.html new file mode 100644 index 00000000..28307a49 --- /dev/null +++ b/doc/html/namespacemembers_func_0x66.html @@ -0,0 +1,218 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- f -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x67.html b/doc/html/namespacemembers_func_0x67.html new file mode 100644 index 00000000..2cc259aa --- /dev/null +++ b/doc/html/namespacemembers_func_0x67.html @@ -0,0 +1,86 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- g -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x68.html b/doc/html/namespacemembers_func_0x68.html new file mode 100644 index 00000000..73c01a7f --- /dev/null +++ b/doc/html/namespacemembers_func_0x68.html @@ -0,0 +1,83 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- h -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x69.html b/doc/html/namespacemembers_func_0x69.html new file mode 100644 index 00000000..234192d3 --- /dev/null +++ b/doc/html/namespacemembers_func_0x69.html @@ -0,0 +1,125 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- i -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x6c.html b/doc/html/namespacemembers_func_0x6c.html new file mode 100644 index 00000000..511d9124 --- /dev/null +++ b/doc/html/namespacemembers_func_0x6c.html @@ -0,0 +1,116 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- l -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x6d.html b/doc/html/namespacemembers_func_0x6d.html new file mode 100644 index 00000000..c63cd504 --- /dev/null +++ b/doc/html/namespacemembers_func_0x6d.html @@ -0,0 +1,116 @@ + + + + +GLM: Class Members + + + + + + + +
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x6e.html b/doc/html/namespacemembers_func_0x6e.html new file mode 100644 index 00000000..e46efbdc --- /dev/null +++ b/doc/html/namespacemembers_func_0x6e.html @@ -0,0 +1,90 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- n -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x6f.html b/doc/html/namespacemembers_func_0x6f.html new file mode 100644 index 00000000..4e741c14 --- /dev/null +++ b/doc/html/namespacemembers_func_0x6f.html @@ -0,0 +1,101 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- o -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x70.html b/doc/html/namespacemembers_func_0x70.html new file mode 100644 index 00000000..0f5e1ad7 --- /dev/null +++ b/doc/html/namespacemembers_func_0x70.html @@ -0,0 +1,122 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- p -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x71.html b/doc/html/namespacemembers_func_0x71.html new file mode 100644 index 00000000..39f58e25 --- /dev/null +++ b/doc/html/namespacemembers_func_0x71.html @@ -0,0 +1,71 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- q -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x72.html b/doc/html/namespacemembers_func_0x72.html new file mode 100644 index 00000000..a63df39e --- /dev/null +++ b/doc/html/namespacemembers_func_0x72.html @@ -0,0 +1,129 @@ + + + + +GLM: Class Members + + + + + + + +
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x73.html b/doc/html/namespacemembers_func_0x73.html new file mode 100644 index 00000000..0aff66d9 --- /dev/null +++ b/doc/html/namespacemembers_func_0x73.html @@ -0,0 +1,152 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- s -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x74.html b/doc/html/namespacemembers_func_0x74.html new file mode 100644 index 00000000..00d09ef5 --- /dev/null +++ b/doc/html/namespacemembers_func_0x74.html @@ -0,0 +1,99 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- t -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x75.html b/doc/html/namespacemembers_func_0x75.html new file mode 100644 index 00000000..935e8bdc --- /dev/null +++ b/doc/html/namespacemembers_func_0x75.html @@ -0,0 +1,125 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- u -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x76.html b/doc/html/namespacemembers_func_0x76.html new file mode 100644 index 00000000..e3b0cafc --- /dev/null +++ b/doc/html/namespacemembers_func_0x76.html @@ -0,0 +1,80 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- v -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_func_0x79.html b/doc/html/namespacemembers_func_0x79.html new file mode 100644 index 00000000..6ec28a30 --- /dev/null +++ b/doc/html/namespacemembers_func_0x79.html @@ -0,0 +1,80 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- y -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type.html b/doc/html/namespacemembers_type.html new file mode 100644 index 00000000..ce59c364 --- /dev/null +++ b/doc/html/namespacemembers_type.html @@ -0,0 +1,115 @@ + + + + +GLM: Class Members + + + + + + + +
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x63.html b/doc/html/namespacemembers_type_0x63.html new file mode 100644 index 00000000..c33fdfc3 --- /dev/null +++ b/doc/html/namespacemembers_type_0x63.html @@ -0,0 +1,199 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- c -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x64.html b/doc/html/namespacemembers_type_0x64.html new file mode 100644 index 00000000..fdada232 --- /dev/null +++ b/doc/html/namespacemembers_type_0x64.html @@ -0,0 +1,127 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- d -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x66.html b/doc/html/namespacemembers_type_0x66.html new file mode 100644 index 00000000..36910055 --- /dev/null +++ b/doc/html/namespacemembers_type_0x66.html @@ -0,0 +1,313 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- f -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x67.html b/doc/html/namespacemembers_type_0x67.html new file mode 100644 index 00000000..d2e9b3c8 --- /dev/null +++ b/doc/html/namespacemembers_type_0x67.html @@ -0,0 +1,115 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- g -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x68.html b/doc/html/namespacemembers_type_0x68.html new file mode 100644 index 00000000..49187319 --- /dev/null +++ b/doc/html/namespacemembers_type_0x68.html @@ -0,0 +1,190 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- h -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x69.html b/doc/html/namespacemembers_type_0x69.html new file mode 100644 index 00000000..9616e51b --- /dev/null +++ b/doc/html/namespacemembers_type_0x69.html @@ -0,0 +1,172 @@ + + + + +GLM: Class Members + + + + + + + +
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x6c.html b/doc/html/namespacemembers_type_0x6c.html new file mode 100644 index 00000000..6196380d --- /dev/null +++ b/doc/html/namespacemembers_type_0x6c.html @@ -0,0 +1,124 @@ + + + + +GLM: Class Members + + + + + + + +
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x6d.html b/doc/html/namespacemembers_type_0x6d.html new file mode 100644 index 00000000..fe4112c3 --- /dev/null +++ b/doc/html/namespacemembers_type_0x6d.html @@ -0,0 +1,160 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- m -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x71.html b/doc/html/namespacemembers_type_0x71.html new file mode 100644 index 00000000..e91dc929 --- /dev/null +++ b/doc/html/namespacemembers_type_0x71.html @@ -0,0 +1,67 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- q -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x73.html b/doc/html/namespacemembers_type_0x73.html new file mode 100644 index 00000000..7bf43c43 --- /dev/null +++ b/doc/html/namespacemembers_type_0x73.html @@ -0,0 +1,64 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- s -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x75.html b/doc/html/namespacemembers_type_0x75.html new file mode 100644 index 00000000..2a2e9a44 --- /dev/null +++ b/doc/html/namespacemembers_type_0x75.html @@ -0,0 +1,145 @@ + + + + +GLM: Class Members + + + + + + + +
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x76.html b/doc/html/namespacemembers_type_0x76.html new file mode 100644 index 00000000..456b93d7 --- /dev/null +++ b/doc/html/namespacemembers_type_0x76.html @@ -0,0 +1,70 @@ + + + + +GLM: Class Members + + + + + + + +
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespacemembers_type_0x77.html b/doc/html/namespacemembers_type_0x77.html new file mode 100644 index 00000000..a80abbf3 --- /dev/null +++ b/doc/html/namespacemembers_type_0x77.html @@ -0,0 +1,64 @@ + + + + +GLM: Class Members + + + + + + +
+  + +

- w -

+
+
Generated on Mon Nov 16 11:23:26 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/namespaces.html b/doc/html/namespaces.html new file mode 100644 index 00000000..6ddcc9d6 --- /dev/null +++ b/doc/html/namespaces.html @@ -0,0 +1,131 @@ + + + + +GLM: Namespace Index + + + + + + +
+

Namespace List

Here is a list of all documented namespaces with brief descriptions: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
glmGLM namespace, it contains all GLSL based features
glm::coreGLM core. Namespace that includes all the feature define by GLSL 1.30.8 specification. This namespace is included in glm namespace
glm::core::functionSome of the functions defined in section 8 Built-in Functions of GLSL 1.30.8 specification
glm::core::function::commonDefine common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace
glm::core::function::exponentialDefine all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace
glm::core::function::geometricDefine all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace
glm::core::function::matrixDefine all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace
glm::core::function::trigonometricDefine Angle and trigonometry functions from Section 8.1 of GLSL 1.30.8 specification
glm::core::function::vector_relationalDefine vector relational functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace
glm::core::typeScalar, vectors and matrices from section 4.1.2 Booleans, 4.1.3 Integers section, 4.1.4 Floats section, 4.1.5 Vectors and section 4.1.6 Matrices of GLSL 1.30.8 specification
glm::core::type::matrixMatrix types from section 4.1.6 of GLSL 1.30.8 specification
glm::core::type::matrix::precisionMatrix types with precision qualifier
glm::core::type::scalarScalar types from section 4.1.2 Booleans, 4.1.3 Integers and 4.1.4 Floats of GLSL 1.30.8 specification
glm::core::type::scalar::precisionScalar types with precision qualifier
glm::core::type::vectorVector types from section 4.1.5 of GLSL 1.30.8 specification
glm::core::type::vector::precisionVector types with precision qualifier
glm::gtcGLM stable extensions
glm::gtc::double_floatGLM_GTC_double_float extension: Add support for double precision floating-point types
glm::gtc::half_floatGLM_GTC_half_float extension: Add support for half precision floating-point types
glm::gtc::matrix_operationGLM_GTC_matrix_operation extension: Matrix operation functions
glm::gtc::matrix_projectionGLM_GTC_matrix_projection: Varius ways to build and operate on projection matrices
glm::gtc::matrix_transformGLM_GTC_matrix_transform extension: Add transformation matrices
glm::gtc::quaternionGLM_GTC_quaternion extension: Quaternion types and functions
glm::gtc::type_precisionGLM_GTC_type_precision extension: Defined types with specific size
glm::gtxGLM experimental extensions. The interface could change between releases
glm::gtx::associated_min_maxGLM_GTX_associated_min_max extension: Min and max functions that return associated values not the compared onces
glm::gtx::bitGLM_GTX_bit extension: Allow to perform bit operations on integer values
glm::gtx::closest_pointGLM_GTX_closest_point extension: Find the point on a straight line which is the closet of a point
glm::gtx::color_castGLM_GTX_color_cast extension: Conversion between two color types
glm::gtx::color_spaceGLM_GTX_color_space extension: Related to RGB to HSV conversions and operations
glm::gtx::color_space_YCoCgGLM_GTX_color_space_YCoCg extension: RGB to YCoCg conversions and operations
glm::gtx::comparisonGLM_GTX_comparison extension: Defined comparison operators for vectors
glm::gtx::compatibilityGLM_GTX_compatibility extension: Provide functions to increase the compatibility with Cg and HLSL languages
glm::gtx::component_wiseGLM_GTX_component_wise extension: Operations between components of a type
glm::gtx::determinantGLM_GTX_determinant extension: Compute the determinant of a matrix
glm::gtx::double_floatGLM_GTX_double_float extension: Add support for double precision flotting-point types
glm::gtx::epsilonGLM_GTX_epsilon extension: Comparaison functions for a user defined epsilon values
glm::gtx::euler_anglesGLM_GTX_euler_angles extension: Build matrices from euler angles
glm::gtx::extendGLM_GTX_extend extension: Extend a position from a source to a position at a defined length
glm::gtx::extented_min_maxGLM_GTX_extented_min_max extension: Min and max functions for 3 to 4 parameters
glm::gtx::fast_exponentialGLM_GTX_fast_exponential extension: Fast but less accurate implementations of exponential based functions
glm::gtx::fast_square_rootGLM_GTX_fast_square_root extension: Fast but less accurate implementations of square root based functions
glm::gtx::fast_trigonometryGLM_GTX_fast_trigonometry extension: Fast but less accurate implementations of trigonometric functions
glm::gtx::gradient_paintGLM_GTX_gradient_paint extension: Compute a radient gradient according section OpenVG 1.1 specifications, 9.3.2 Radial Gradients
glm::gtx::half_floatGLM_GTX_half_float extension: Add support for half precision flotting-point types
glm::gtx::handed_coordinate_spaceGLM_GTX_handed_coordinate_space extension: To know if a triedron is right or left handed
glm::gtx::inertiaGLM_GTX_inertia extension: Create inertia matrices
glm::gtx::integerGLM_GTX_integer extension: Add support for integer for core functions
glm::gtx::intersectGLM_GTX_intersect extension: Add intersection functions
glm::gtx::inverseGLM_GTX_inverse extension: Inverse matrix functions
glm::gtx::inverse_transposeGLM_GTX_inverse_transpose extension: Inverse transpose matrix functions
glm::gtx::log_baseGLM_GTX_log_base extension: Logarithm for any base. base can be a vector or a scalar
glm::gtx::matrix_accessGLM_GTX_matrix_access extension: Set a column or a row of a matrix
glm::gtx::matrix_cross_productGLM_GTX_matrix_cross_product: Build cross product matrices
glm::gtx::matrix_major_storageGLM_GTX_matrix_cross_product: Build matrices with specific matrix order, row or column
glm::gtx::matrix_operationGLM_GTX_matrix_operation: Build cross product matrices
glm::gtx::matrix_projectionGLM_GTX_matrix_projection: Varius ways to build and operate on projection matrices
glm::gtx::matrix_queryGLM_GTX_matrix_query: Query to evaluate matrices properties
glm::gtx::matrix_selectionGLM_GTX_matrix_selection extension: Access to matrix columns or rows
glm::gtx::matxGLM_GTX_matx extension: - Work in progress - NxN matrix types
glm::gtx::mixed_productGLM_GTX_mixed_product extension: Mixed product of 3 vectors
glm::gtx::normGLM_GTX_norm extension: Varius way to compute vector norms
glm::gtx::normalGLM_GTX_normal extension: Compute the normal of a triangle
glm::gtx::normalize_dotGLM_GTX_normalize_dot extension: Dot product of vectors that need to be normalize with a single square root
glm::gtx::number_precisionGLM_GTX_number_precision extension: Defined size types
glm::gtx::ocl_typeGLM_GTX_ocl_type extension: OpenCL types
glm::gtx::optimum_powGLM_GTX_optimum_pow extension: Integer exponenciation of power functions
glm::gtx::orthonormalizeGLM_GTX_orthonormalize extension: Orthonormalize matrices
glm::gtx::perpendicularGLM_GTX_perpendicular extension: Perpendicular of a vector from other one
glm::gtx::polar_coordinatesGLM_GTX_polar_coordinates extension: Conversion from Euclidean space to polar space and revert
glm::gtx::projectionGLM_GTX_projection extension: Projection of a vector to other one
glm::gtx::quaternionGLM_GTX_quaternion extension: Quaternion types and functions
glm::gtx::randomGLM_GTX_random extension: Generate random number from varius distribution methods
glm::gtx::raw_dataGLM_GTX_raw_data extension: Projection of a vector to other one
glm::gtx::reciprocalGLM_GTX_reciprocal extension: Define secant, cosecant and cotangent functions
glm::gtx::rotate_vectorGLM_GTX_rotate_vector extension: Function to directly rotate a vector
glm::gtx::simd_mat4GLM_GTX_simd_mat4 extension: SIMD implementation of vec4 type
glm::gtx::simd_vec4GLM_GTX_simd_vec4 extension: SIMD implementation of vec4 type
glm::gtx::splineGLM_GTX_spline extension: Spline functions
glm::gtx::statistics_operationGLM_GTX_statistics_operation extension: - Work in progress - Statistics functions
glm::gtx::std_based_typeGLM_GTX_std_based_type extension: Add support vector types based on C++ standard type
glm::gtx::string_castGLM_GTX_string_cast extension: Setup strings for GLM type values
glm::gtx::transformGLM_GTX_transform extension: Add transformation matrices
glm::gtx::transform2GLM_GTX_transform2 extension: Add extra transformation matrices
glm::gtx::type_ptrGLM_GTX_type_ptr extension: Get access to vectors & matrices value type address
glm::gtx::unsigned_intGLM_GTX_unsigned_int extension: Add support for unsigned integer for core functions
glm::gtx::vector_accessGLM_GTX_vector_access extension: Function to set values to vectors
glm::gtx::vector_angleGLM_GTX_vector_angle extension: Compute angle between vectors
glm::gtx::vector_queryGLM_GTX_vector_query extension: Query informations of vector types
glm::gtx::vecxGLM_GTX_vecx extension: - Work in progress - Add custom size vectors
glm::gtx::verbose_operatorGLM_GTX_verbose_operator extension: Use words to replace operators
glm::imgIMG extensions
glm::img::multipleGLM_IMG_multiple: Find the closest number of a number multiple of other number
glm::virtrev_glmext::addressGLM_VIRTREV_address extension: Vector & matrix content address (T const * type pointer)
glm::virtrev_glmext::equal_operatorGLM_VIRTREV_gl extension: Vector & matrix integration with OpenGL
glm::virtrev_glmext::glGLM_VIRTREV_gl extension: Vector & matrix integration with OpenGL
glm::virtrev_glmext::xstreamGLM_VIRTREV_xstream extension: Streaming vector and matrix in a xml way
+
+
Generated on Mon Nov 16 11:23:23 2009 for GLM by  + +doxygen 1.6.1
+ + diff --git a/doc/html/tab_b.gif b/doc/html/tab_b.gif new file mode 100644 index 00000000..0d623483 Binary files /dev/null and b/doc/html/tab_b.gif differ diff --git a/doc/html/tab_l.gif b/doc/html/tab_l.gif new file mode 100644 index 00000000..9b1e6337 Binary files /dev/null and b/doc/html/tab_l.gif differ diff --git a/doc/html/tab_r.gif b/doc/html/tab_r.gif new file mode 100644 index 00000000..ce9dd9f5 Binary files /dev/null and b/doc/html/tab_r.gif differ diff --git a/doc/html/tabs.css b/doc/html/tabs.css new file mode 100644 index 00000000..a4441634 --- /dev/null +++ b/doc/html/tabs.css @@ -0,0 +1,105 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs #MSearchBox +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.navpath +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; + text-align : center; + margin : 2px; + padding : 2px; +} diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 00000000..a3e2b885 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,166 @@ + + +OpenGL Mathematics: News
OpenGL Mathematics
GLSL + Optional features = OpenGL Mathematics (GLM).
A C++ mathematics library for 3D graphics.


16/11/2009
GLM 0.8.4.3 released
+ This version fixed half scalars and half vectors arithmetics. + This is a really slow practice that should be avoid. + Half floating point value should be use only to store GPU data. + GPUs have native support for half values, not x86 CPUs. +

Download: GLM 0.8.4.3 (zip, 1.1 MB)
Download: GLM 0.8.4.3 (7z, 463 KB)
Link: Full changelog
_________________

19/10/2009
GLM 0.8.4.2 released
+ This version is a really minor updates, fixing single issue with half float types. +

Download: GLM 0.8.4.2 (zip, 1.1 MB)
Download: GLM 0.8.4.2 (7z, 443 KB)
Link: Full changelog
_________________

05/10/2009
GLM 0.8.4.1 released
+ This version fixes few bugs and provides an major update of the manual thanks to Damian Trebilco. +

Download: GLM 0.8.4.1 (zip, 1.1 MB)
Download: GLM 0.8.4.1 (7z, 443 KB)
Link: Full changelog
_________________

16/09/2009
GLM 0.8.4.0 released
+ This new version mainly adds support for Visual Studio 2010 and GCC 4.4. It also provides various code optimization, bug fixes and an extension. +

Download: GLM 0.8.4.0 (zip, 1.1 MB)
Download: GLM 0.8.4.0 (7z, 439 KB)
Link: Full changelog
_________________

11/08/2009
GLM 0.8.3.5 released
+ Fixed extension bugs introduced by core update. +

Download: GLM 0.8.3.5 (zip, 971 KB)
Download: GLM 0.8.3.5 (7z, 405 KB)
Link: Full changelog
_________________

10/08/2009
GLM 0.8.3.4 released
+ Fixed varius bugs. Move determinant fonction to core following GLSL 1.5 specification. +

Download: GLM 0.8.3.4 (zip, 971 KB)
Download: GLM 0.8.3.4 (7z, 405 KB)
Link: Full changelog
_________________

25/06/2009
GLM 0.8.3.3 released
+ Fixed varius bugs. +

Download: GLM 0.8.3.3 (zip, 971 KB)
Download: GLM 0.8.3.3 (7z, 405 KB)
Link: Full changelog
_________________

04/06/2009
GLM 0.8.3.2 released
+ Add GLM_GTC_quaternion and GLM_GTC_type_precision extensions both subset of GLM_GTX_quaternion and GLM_GTX_number_precision +

Download: GLM 0.8.3.2 (zip, 971 KB)
Download: GLM 0.8.3.2 (7z, 405 KB)
Link: Full changelog
_________________

21/05/2009
GLM 0.8.3.1 released
+ The old way to use extensions have been fixed and GLM_GTX_bit extension gets updated with more functions to manipulate bit fields. +

Download: GLM 0.8.3.1 (zip, 954 KB)
Download: GLM 0.8.3.1 (7z, 402 KB)
Link: Full changelog
_________________

06/05/2009
GLM 0.8.3.0 released
+ This version brings to main changed: Stable extensions and a new extension system. +

+ The first stable GLM extensions are: GLM_GTC_double_float and GLM_GTC_half_float for higher and lower vectors and matrices floating point precision. GLM_GTC_matrix_operation provides determinant and inverse matrix calculation. GLM_GTC_matrix_transform allows to build scale, rotate and translate matrices and GLM_GTC_matrix_projection provides varius functions to build projection matrices. Few stable extensions yet but the number is going to grow with the next release! +

+ Both GLM 0.8.2.x extensions use method are deprecated (but still working) and replace by a new one. If you wnat to use GLM_GTC_half_float just include "glm/gtc/half_float.hpp" and it is going to be included in GLM namespace. +

+ Finally, quite some file have been renamed, using "hpp" instead of ".h". Old file have been deprecated but are still available so that GLM 0.8.3.0 is fully compatible with GLM 0.8.2.x. +

Download: GLM 0.8.3.0 (zip, 896 KB)
Download: GLM 0.8.3.0 (7z, 359 KB)
Link: Code samples page
Link: Manual
Link: Full changelog
_________________

01/04/2009
GLM 0.8.2.3 released
_________________

13/02/2009
GLM 0.8.2.1 released
+ A new release is available and inogurate a patch number. The goal of this patch number is to release faster fixes from bug reports. +

Download: GLM 0.8.2.1 (zip, 963 KB)
Download: GLM 0.8.2.1 (7z, 381 KB)
Link: Manual
Link: Full changelog
_________________

21/01/2009
GLM 0.8.2 released
+ This release only fixes bugs. Left sided swizzle operators, quaternion operators, vectors access operators for the main onces. +

Download: GLM 0.8.2 (zip, 963 KB)
Download: GLM 0.8.2 (7z, 381 KB)
Link: Manual
Link: Full changelog
_________________

19/11/2008
GLM current developments
+ Some artifacts have been added to the tracker to give a picture of what you could expect for the next releases. +

+ If you need something else you can add some artifacts to the tracker. Any comment on added entries is welcome. +

+ Furthermore, no more release of GLM 0.7.x will be done. Please upgrade to GLM 0.8.1. +

+ Finally, a pack of programmable oriented OpenGL samples using GLM is under development and planed to be release in December. +

Link: Tracker
_________________

30/10/2008
GLM 0.8.1 released
+ GLM 0.8.1 is released. This new version mainly fixes 64 bit integers with GCC and various bugs. +

Download: GLM 0.8.1 (zip, 938 KB)
Download: GLM 0.8.1 (7z, 372 KB)
Link: GLM 0.8.1 Manual
Link: Full changelog
_________________

23/10/2008
GLM 0.8.0 final released
+ GLM 0.8.0 is released. This new version is now based on GLSL 1.30 specification which provided new functions and precision qualifiers. +

+ Beyond this, lot of changes have been done to make GLM easier to use, easier to develop, more reliable, more conform to C++ ISO98 standard and GLSL specifications. +

+ It involves that GLM 0.8.x is not backward compatible with GLM 0.7.x... However, an application port from GLM 0.7.x to GLM 0.8.x isn't a huge work and actually for some, it won’t be work at all. +

+ On GLM core side, based on GLSL features, vector types can't be automatically cast to pointer anymore for code safety purposes. Vector constructors require a single scalar parameter of the exact number of components. +

+ On GLM extension side, the mechanism to use them has changed. The old [__]***GTX way doesn't exist anymore. Have a look on the manual for more information. +

+ Have a look on the manual and the changelog for more information. Don't forget to send your feedback and enjoy! +

Download: GLM 0.8.0 (zip, 936 KB)
Download: GLM 0.8.0 (7z, 370 KB)
Link: GLM 0.8.0 Manual
Link: Full changelog
Link: Post a comment
_________________

22/10/2008
A Humus demo to feature GLM 0.8.0
+ Ambient aperture lighting Humus demo have been updated to use GLM as math library. +

Download: Updated demo + all sources (zip, 2.38 MB)
Download: Original demo (zip, 1.40 MB)
Link: Post a comment
_________________

18/10/2008
Webside updated
+ As you can see the website get a little update to prepare GLM 0.8.0 final release. +

+ GLM 0.8.0 final should be release during the week. +

_________________

10/10/2008
GLM 0.8.0 beta 3 released
+ This release fixes some bugs and add few features though extensions. The development is now based on CMake to make easier cross platform tests and project management. +

Download: GLM 0.8.0 Beta 3 (zip, 819 KB)
Download: GLM 0.8.0 Beta 3 (7z, 345 KB)
Link: Full changelog
Link: Post a comment
_________________

04/10/2008
GLM 0.8.0 beta 2 released
+ This release mainly improves half float vectors support. By default the low precission vectors are based on float numbers not on half numbers +

+ It also provides new setup options. GLM_USE_ONLY_XYZW to disable multiple names to access to a single vector component. GLM_USE_ANONYMOUS_UNION to allow multiple component names on half vectors with Visual C++. +

+ Various bugs and updates of extensions have been done too. Final release is coming... +

Download: GLM 0.8.0 Beta 2 (zip, 798 KB)
Download: GLM 0.8.0 Beta 2 (7z, 327 KB)
Link: Full changelog
Link: Post a comment
_________________

26/09/2008
GLM 0.8.0 beta 1 released
+ GLM have been updated to support GLSL 1.30. API documentation had significant improvements to make easier finding of GLSL functions and types. +

+ GLM 0.8.x is NOT backward compatible with GLM 0.7.x. Upgrade to GLM 0.8.x could involve build errors for the following cases: A lot of improvements have been made to increase the conformance with GLSL specification. Lot of GLSL 1.30 features were already exposed in extensions that have been deleted. The extension syntaxe based on ARB convension is no long used. +

+ Due to the number of changes GLM 0.8.0 is release as beta first. The final release is schedule for october. +

Download: GLM 0.8.0 Beta 1 (zip, 786 KB)
Download: GLM 0.8.0 Beta 1 (7z, 321 KB)
Link: Full changelog
Link: Post a comment
_________________

08/08/2008
GLM 0.7.6 released
+ GLM 0.7.6 provides a better C++ conformance so that you can build GLM with –pedantic G++ parameter or without Visual Studio extensions. To make GLM more reliable, BOOST_STATIC_ASSERT are used according developer wishes. +

Download: GLM 0.7.6 (zip, 907 KB)
Download: GLM 0.7.6 (7z, 387 KB)
Link: Full changelog
Link: Manual
_________________

05/07/2008
GLM 0.7.5 released
+ GLM 0.7.5 is available and introduces a new build messsage system to get information of GLM build configuration with Visual Studio. This mechanism is documented in section 6 of GLM manual. Also, GLM can be built with GCC pedantic options. +

Download: GLM 0.7.5 (zip, 852 KB)
Download: GLM 0.7.5 (7z, 366 KB)
Link: Full changelog
Link: Manual
_________________

01/06/2008
GLM 0.7.4 released
+ GLM 0.7.4 introduces a new system to manage external dependencies. +

+ It allows developing extension using external dependencies like GLEW, Boost, etc. without making required those dependencies for GLM programmer that doesn't need those external dependent extensions. +

+ The mechanism is described into the updated manual. +

Download: GLM 0.7.4 (zip, 859 KB)
Download: GLM 0.7.4 (7z, 372 KB)
Link: Full changelog
Link: Manual
_________________

24/05/2008
GLM 0.7.3 released
+ GLM 0.7.3 is released. This version fixes few bugs and add few extensions +

Download: GLM 0.7.3 (zip, 1.8 MB)
Download: GLM 0.7.3 (7z, 635 KB)
Link: Full changelog
_________________

27/04/2008
GLM 0.7.2 released
+ GLM 0.7.2 is released. The documentation have been completed again and several issues handle with precompiler options. +

+ #define GLM_SWIZZLE GLM_SWIZZLE_FUNC allows to use swizzle operators with internal functions. For example, glm::vec3(1, 2, 3).zyx is replaced by glm::vec3(1, 2, 3)._zyx() with this option. +

+ #define GLM_FORCE_NO_HALF allows to include all extensions (#include "glm/glmext.h") without any support of half-precision floating-point numbers. +

+ #define GLM_AUTO_CAST GLM_DISABLE allows to disable automatic cast (eg: glLoadMatrixf(glm::mat4(1.0))) which could involve unfortunate issues in some cases. +

+ More information on these topic are available in GLM manual section 5 "Known issues". +

Download: GLM 0.7.2 (zip, 1.8 MB)
Download: GLM 0.7.2 (7z, 635 KB)
Download: Full changelog
_________________

24/03/2008
GLM 0.7.1 released
+ GLM 0.7.1 is available under MIT license. It fixes bugs with GCC. +

Download: GLM 0.7.1 (zip, 1.8 MB)
Download: GLM 0.7.1 (7z, 635 KB)
Download: Full changelog
_________________

22/03/2008
GLM 0.7.0 released
+ GLM 0.7.0 is available under MIT license. LGPL lisence have been discard due to an issue of use for console development. This release contains a lot better documentation based on Doxygen. Lot of bugs have been fixed and the documentation completed. Thanks to all people that has contributed thought bug reports and ideas to make this version a lot better! +

Download: GLM 0.7.0 (zip, 1.8 MB)
Download: GLM 0.7.0 (7z, 635 KB)
Download: Full changelog
_________________

10/12/2007
GLM 0.6.4 released
+ GLM 0.6.4 is available and fixes some swizzle operator issues. +

Download: GLM 0.6.4 (zip, 1.7 MB)
Download: GLM 0.6.4 (7z, 612 KB)
Download: Full changelog
_________________

05/11/2007
GLM 0.6.3 released
+ GLM 0.6.3 fixes accesses of matrices and a 3DSMax SDK conflict. +

Download: GLM 0.6.3 (zip, 1.8 MB)
Download: GLM 0.6.3 (7z, 633 KB)
Download: Full changelog
_________________

08/10/2007
GLM 0.6.2 released
+ GLM 0.6.2 fixes an error on an extension. +

Download: GLM 0.6.2 (zip, 1.8 MB)
Download: GLM 0.6.2 (7z, 632 KB)
Download: Full changelog
_________________

07/10/2007
GLM 0.6.1 released
+ GLM 0.6.1 is a minor update that fix an issue on extension namespace and add two more extensions. +

Download: GLM 0.6.1 (zip, 1.8 MB)
Download: GLM 0.6.1 (7z, 632 KB)
Download: Full changelog
_________________

16/09/2007
GLM 0.6.0 released
+ GLM 0.6.0 is available. For this release, work focus on extensions. A new mecanisum allows to integrate GLM extensions as it is actually done for GLSL extension by vendors. Lot of new extensions have been added. +

Download: GLM 0.6.0 (zip, 1.8 MB)
Download: GLM 0.6.0 (7z, 666 KB)
Download: Raytracer v1.0 (exe)
Download: Raytracer v1.0 (zip)
Download: Full changelog
_________________

19/02/2007
GLM 0.5.1 released
+ This release fixes some issues with swizzle operators. +

Download: GLM 0.5.1 (zip, 2.3 MB)
Download: GLM 0.5.1 (7z, 789 KB)
_________________

26/01/2007
Cattmull Clark subdivision sample
+ A new sample is available. It's an update of Philip Rideout's Catmull Clark subdivision program that uses GLM. Released with pleasant permission of Philip Rideout. +

Download: CatmullClark sample (zip, 605 KB)
_________________

06/01/2007
GLM 0.5.0 released
+ This release include GLSL 1.2 new feature in the core implementation. Also, it includes swizzle read and write operators and a custom options system to setup GLM. +

+ It includes some new extensions to extend GLSL features but they remain experimental. The next release should provide the first stable extensions. +

+ The GLM 0.5.0 packages contain some basic samples and some documentation. The ray tracer sample has been updated to GLM 0.5.0. Except for specific cases, especially with extensions, GLM 0.5 is backward compatible. +

+ Now, GLM development is taking advantages of SourceForge.net services: a bug tracker system and the development source code is publicly available on SF.net SVN server. +

Download: GLM 0.5.0 (zip, 2.4 MB)
Download: GLM 0.5.0 (7z, 843 KB)
Download: Raytracer b3.0 (exe, 751 KB)
Download: Raytracer b3.0 (zip, 1.1 MB)
_________________

22/05/2006
GLM 0.4.1 released
+ A GLM update is available. It simply includes some examples for a sweet start with GLM. +

+ The examples show how to use GLM with OpenGL intermediate mode and OpenGL vertex arrays. Also, they show how to use GLM extensions to replace GLU and OpenGL function witch could slightly increase performances by decreasing the number of OpenGL states changes. +

Download: GLM 0.4.1 (zip, 1.6 MB)
Download: GLM 0.4.1 (7z, 521 KB)
_________________

17/05/2006
GLM 0.4.0 released
+ This release introduces first GLSL 1.2 features as planed. Also, various new extensions have been added and updated. Finally, it's not anymore required to include windows.h before glm.h when windows.h is required. +

+ The number of features of GLM, including extensions, start to really increase the compilation time. That's why it's recommended to use precompiled headers. +

Download: GLM 0.4.0
_________________

23/04/2006
Roadmap for the years
+ Version 0.4 will complete matrices and vectors operators and will add GLSL 1.2 features. First, conversions simplifications will be integrated. Then, 4 per 3 matrices and outer product will be available from extensions. The transpose function is already available from extension. +

+ Version 0.5 will integrate GLSL 1.2 features to GLM core. +

+ Version 0.6 will add swizzle operators in reading and writing. (eg: vec3 v1(1.0, 2.0, 3.0); vec3 v2 = v1.xxx; v1.zyx = v;). +

_________________

22/04/2006
GLM 0.3.2 released
+ This release corrects two main bugs. First, a bug of the imat4 and mat4 division operators and other correct the vectors components access from texture coordinate way. +

Download: GLM 0.3.2
_________________

28/03/2006
GLM 0.3.1 released
+ This update adds GCC 4.0 support for MacOS X and Linux and GCC 4.1 under Linux. Also, its provides some optimisations. +

+ Further release will prodive GLSL 1.2 compliances. +

Download: GLM 0.3.1
_________________

19/02/2006
GLM 0.3 released
+ A new release of GLM is now available. It improves GLSL data type conversion and construction compliance. Also, It's adds extensions like some to manage double-precision and half-precision float numbers. Finally a Doxygen documentation has been added. +

+ This new release have been tested under Visual C++ 7.1, Visual C++ 8.0, GCC 3.2.3 et GCC 3.4.2. +

Download: GLM 0.3
Download: Raytrace
Documentation: Online documentation
_________________

06/05/2005
GLM 0.2 released
+ A new release of GLM is now available. A few bugs have been fixed, the portability of GLSL into C++ has been improved, and new experimental extensions have been implemented, enhancing GLSL features. +

+ Project now supports quaternions, adds new features to handle colors, vectors and matrices. For example, GLM allows base colors changing, vector projected operations, and 2D/3D transforms. +

+ To demo the features of this new version, a sample program is included. It is a simple Ray Tracer supporting reflected and refracted rays, three lights types (point, directionnal and spot), two objects types (sphere, plan), using all of the GLM possibilities. +

_________________

04/05/2005
English pages
+ The english section of this site is now available. +

_________________

21/02/2005
GLM 0.1 is available
+ This is the first public availability of GLM. This library supports part of GLSL specifications : All vectors and matrices types, and all the operators and associated functions. +

+ For now, there isn't detailed documentation, but you can freely have a look on GLSL specifications. Consider any incoherence with GLM as an error. Keep in mind the library is included in the namespace "glm". +

+ This project is multi platform and was successfully tested under Visual C++ 7.1, MinGW 3.4 and GCC 3.4. +

Download: GLM 0.1 User Release
Download: GLM 0.1 Contributor Release
Documentation: GLSL 1.10.59 specifications
_________________

+ Copyright © 2005-2009 G-Truc Creation
\ No newline at end of file diff --git a/doc/issue.html b/doc/issue.html new file mode 100644 index 00000000..c8917469 --- /dev/null +++ b/doc/issue.html @@ -0,0 +1,13 @@ + + +OpenGL Mathematics : Issues
OpenGL Mathematics
Problématiques

10) Several useful tools are missing in GLSL, is this possible to add them ?
DISCUTION: GLSL is not the ultimate mathematics library, i.e. for matrices operations, specs are very restricted. There aren't any functions to get the determinant, inverse, or a matrix transpose. Moreover, there are a few vector types and no quaternions.
PROPOSAL: What about completing the missing features using the extensions ? It will be developed from GLSL conventions and may add for exemple the extension GLM_GTX_quaternion, defining __quatGT type and conjugateGT function.
PROPOSAL: Extensions may be available through a separate file called glmext.h instead of being directly into the library core file.
PROPOSAL: It would be interesting to suggest GLM extensions implementations directly in GLSL to increase portability. It may hopefully end by submitting extensions to ARB.

+ STATUE : Partially resolved, 2005-03-21

9) Should GLM be included into a namespace ?
DISCUTION: The use of a namespace allows to prevenf from any name collision problem with other libraries like STL. GLSL uses a reserved 'namespace' keyword but does not define it. OpenGL uses a C technic for the namespaces management with the 'gl' prefix. What name should we give to this namespace ? 'gl', 'glsl', 'glm' or 'sl' ? What is the best solution ? C-like or C++-like namespaces ?
DISCUTION: Bug #3 says that 'not' is a C++ keyword. C-style namespaces use would resolves this bug but GLSL has been built from C upon a C++ logic.

+ STATUE : Unresolved, 2005-02-18

8) Could the OpenGL API be considered ?
DISCUTION: The interaction with OpenGL is not the purpose of GLM. However, GLM should be easily usable with OpenGL and some features could be welcome. i.e., using vec3 type with Vertex3fv function should simplify and optimize the program. Eventually, semantically speaking, vec3 is more accurate and stronger than addressing on a potential 3 floats table.
RESOLUTION: If it is possible to make easy the interoperability between GLM and OpenGL, then this work is recommended if semantic stays correct. GLM must also remain independent towards OpenGL.

+ STATUE : Resolved, 2005-03-04

7) How to consider reserved keywords ?
DISCUTION: GLSL specifications include unimplemented reserved keywords list. Their use must return an error. Some of them already exist in C++.
RESOLUTION: GLM can only allow C++ reserved keywords. The others must be undefined so the compiler returns an error.

+ STATUE : Partially resolved, 2005-01-26

6) How to manage GLSL qualifiers ?
DISCUTION: GLSL defines six variable qualifiers types : const, varying, uniform, attrib, in, out, inout.
RESOLUTION: 'const' variables are only usable in a local way into a shader. They are available for vertex and fragments shaders. GLSL's 'const' are similar to C++ 'static const', i.e. the variable only exists inside a compilation unit (.o files with GCC).
RESOLUTION: 'varying' variables offer a communication interface between vertex and fragment sahder. 'uniform' and 'attrib' variables are a way of communication between C/C++ program and shaders, so 'varying' are useless in the C++ program; so this qualifier is not allowed.
SUGGESTION: Some programmers are already using 'in', 'ou' and 'inout' qualifiers for semantic purpose. They define them as empty '#define'.
DISCUTION: It seems difficult to keep the same syntax than GLSL for 'uniform' and 'attrib' variables although this notion seems interesting. Why not keeping it only for their semantic properties ?

+ STATUE : Partially resolved, 2005-03-04

5) Should integrated variables be considered ?
SUGGESTION: All integrated variables matches with OpenGL state variables. So there are all accessible from the OpenGL API.

+ STATUE : Resolved, 2005-01-13

4) Should sampler* types be considered ?
DISCUTION: smapler* types come from GL_ARB_multitexure extension. Values matches with a texture unit.
SUGGESTION: A sampler type would offer an additionnal semantic value.
SUGGESTION: No, this is not the GLM objective.

+ STATUE : Resolved, 2005-03-05

3) How to manage specific access to *vec* types components ?
DISCUTION: GLSL allows several components to be accessed at the same time. Moreover, GLSL let the possibility to the user to order components as he wants. To implement such a possibility, 4² * 3 * 2 = 96 fuctions should be added for vec4 type, for example (components number : 4, access types : 3, readonly access and write access : 2).
RESOLUTION: A solution witch reach GLSL conformance have been found. However it need lot of functions. This feature is coming in a futur release.

+ STATUE : Unresolved, 2005-01-22

2) How to access to *vec* type components ?
DISCUTION: GLSL allows an access to a component with many different names, that explains the component notion. i.e. the first vec3 component is accessible with .x, .r, .s.
PROPOSAL: A possibility would be creating three functions for each component.
PROPOSAL: Another would be using the keyword 'union'.
RESOLUTION: The first solution allows to keep components values in a private classes table, but in this case, the overloaded operator [] must be used to access values and/or functions per component that is not conform to GLSL specifications. The second respect GLSL rules but components are public. In this case, this is not a real problem so this second solution is kept.

+ STATUE : Closed, 2005-01-15

1) How to consider dedicated functions to fragment shaders and ftransform function ?
RESOLUTION: GLSL specifications tell that 'fragment processing functions' are only available for fragment shaders and function ftransform is only available for vertex shaders. The C/C++ program must be considered as a third program type so this functions are not available.

+ STATUE : Closed, 2005-01-12

Copyright © 2005-2008 G-Truc Creation
\ No newline at end of file diff --git a/doc/link.html b/doc/link.html new file mode 100644 index 00000000..6bd52f52 --- /dev/null +++ b/doc/link.html @@ -0,0 +1,15 @@ + + +OpenGL Mathematics : Links
OpenGL Mathematics
Liens
+ This page lists all the documents that helped to develop OpenGL Mathematics. +

+ OpenGL's Official site. You would find OpenGL specifications, news and tons of related informations. +

+ This page contains all OpenGL extensions specifications. +

+ This page contains OpenGL 2.0 specifications. +

+ This page contains OpenGL Shading Language Specification. +

+ This document lists all the conventions for writing GLSL extensions. These rules are the basics of the GLM extensions system. +

Copyright © 2005-2008 G-Truc Creation
\ No newline at end of file diff --git a/glm/GLM_GTX_associated_min_max.h b/glm/GLM_GTX_associated_min_max.h new file mode 100644 index 00000000..c9882ffc --- /dev/null +++ b/glm/GLM_GTX_associated_min_max.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_associated_min_max_api +#define glm_gtx_associated_min_max_api + +#include "gtx/associated_min_max.hpp" + +namespace glm +{ + using GLM_GTX_associated_min_max; +} + +#endif//glm_gtx_associated_min_max_api diff --git a/glm/GLM_GTX_bit.h b/glm/GLM_GTX_bit.h new file mode 100644 index 00000000..3f4d6ad8 --- /dev/null +++ b/glm/GLM_GTX_bit.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_bit_api +#define glm_gtx_bit_api + +#include "gtx/bit.hpp" + +namespace glm +{ + using GLM_GTX_bit; +} + +#endif//glm_gtx_bit_api diff --git a/glm/GLM_GTX_closest_point.h b/glm/GLM_GTX_closest_point.h new file mode 100644 index 00000000..41dbb6c5 --- /dev/null +++ b/glm/GLM_GTX_closest_point.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_closest_point_api +#define glm_gtx_closest_point_api + +#include "gtx/closest_point.hpp" + +namespace glm +{ + using GLM_GTX_closest_point; +} + +#endif//glm_gtx_closest_point_api diff --git a/glm/GLM_GTX_color_cast.h b/glm/GLM_GTX_color_cast.h new file mode 100644 index 00000000..63e075cf --- /dev/null +++ b/glm/GLM_GTX_color_cast.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_color_cast_api +#define glm_gtx_color_cast_api + +#include "gtx/color_cast.hpp" + +namespace glm +{ + using GLM_GTX_color_cast; +} + +#endif//glm_gtx_color_cast_api diff --git a/glm/GLM_GTX_color_space.h b/glm/GLM_GTX_color_space.h new file mode 100644 index 00000000..06cde3da --- /dev/null +++ b/glm/GLM_GTX_color_space.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_color_space_api +#define glm_gtx_color_space_api + +#include "gtx/color_space.hpp" + +namespace glm +{ + using GLM_GTX_color_space; +} + +#endif//glm_gtx_color_space_api diff --git a/glm/GLM_GTX_color_space_YCoCg.h b/glm/GLM_GTX_color_space_YCoCg.h new file mode 100644 index 00000000..365b2db8 --- /dev/null +++ b/glm/GLM_GTX_color_space_YCoCg.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-11-28 +// Updated : 2008-11-28 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_color_space_YCoCg_api +#define glm_gtx_color_space_YCoCg_api + +#include "gtx/color_space_YCoCg.hpp" + +namespace glm +{ + using GLM_GTX_color_space_YCoCg; +} + +#endif//glm_gtx_color_space_YCoCg_api diff --git a/glm/GLM_GTX_comparison.h b/glm/GLM_GTX_comparison.h new file mode 100644 index 00000000..a17dcc73 --- /dev/null +++ b/glm/GLM_GTX_comparison.h @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_comparison_api +#define glm_gtx_comparison_api + +#include "gtx/comparison.hpp" + +using GLM_GTX_comparison; + +#endif//glm_gtx_comparison_api diff --git a/glm/GLM_GTX_compatibility.h b/glm/GLM_GTX_compatibility.h new file mode 100644 index 00000000..0b1093e0 --- /dev/null +++ b/glm/GLM_GTX_compatibility.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_compatibility_api +#define glm_gtx_compatibility_api + +#include "gtx/compatibility.hpp" + +namespace glm +{ + using GLM_GTX_compatibility; +} + +#endif//glm_gtx_compatibility_api diff --git a/glm/GLM_GTX_component_wise.h b/glm/GLM_GTX_component_wise.h new file mode 100644 index 00000000..64555f96 --- /dev/null +++ b/glm/GLM_GTX_component_wise.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_component_wise_api +#define glm_gtx_component_wise_api + +#include "gtx/component_wise.hpp" + +namespace glm +{ + using GLM_GTX_component_wise; +} + +#endif//glm_gtx_component_wise_api diff --git a/glm/GLM_GTX_determinant.h b/glm/GLM_GTX_determinant.h new file mode 100644 index 00000000..a3067895 --- /dev/null +++ b/glm/GLM_GTX_determinant.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_determinant_api +#define glm_gtx_determinant_api + +#include "gtx/determinant.hpp" + +namespace glm +{ + using GLM_GTX_determinant; +} + +#endif//glm_gtx_determinant_api diff --git a/glm/GLM_GTX_double_float.h b/glm/GLM_GTX_double_float.h new file mode 100644 index 00000000..b57cb050 --- /dev/null +++ b/glm/GLM_GTX_double_float.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_double_float_api +#define glm_gtx_double_float_api + +#include "gtx/double_float.hpp" + +namespace glm +{ + using GLM_GTX_double_float; +} + +#endif//glm_gtx_double_float_api diff --git a/glm/GLM_GTX_epsilon.h b/glm/GLM_GTX_epsilon.h new file mode 100644 index 00000000..df0eeef2 --- /dev/null +++ b/glm/GLM_GTX_epsilon.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_epsilon_api +#define glm_gtx_epsilon_api + +#include "gtx/epsilon.hpp" + +namespace glm +{ + using GLM_GTX_epsilon; +} + +#endif//glm_gtx_epsilon_api diff --git a/glm/GLM_GTX_euler_angles.h b/glm/GLM_GTX_euler_angles.h new file mode 100644 index 00000000..4a84fa34 --- /dev/null +++ b/glm/GLM_GTX_euler_angles.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_euler_angles_api +#define glm_gtx_euler_angles_api + +#include "gtx/euler_angles.hpp" + +namespace glm +{ + using GLM_GTX_euler_angles; +} + +#endif//glm_gtx_euler_angles_api diff --git a/glm/GLM_GTX_extend.h b/glm/GLM_GTX_extend.h new file mode 100644 index 00000000..39f62848 --- /dev/null +++ b/glm/GLM_GTX_extend.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_extend_api +#define glm_gtx_extend_api + +#include "gtx/extend.hpp" + +namespace glm +{ + using GLM_GTX_extend; +} + +#endif//glm_gtx_extend_api diff --git a/glm/GLM_GTX_extented_min_max.h b/glm/GLM_GTX_extented_min_max.h new file mode 100644 index 00000000..84fc11aa --- /dev/null +++ b/glm/GLM_GTX_extented_min_max.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_extented_min_max_api +#define glm_gtx_extented_min_max_api + +#include "gtx/extented_min_max.hpp" + +namespace glm +{ + using GLM_GTX_extented_min_max; +} + +#endif//glm_gtx_extented_min_max_api diff --git a/glm/GLM_GTX_fast_exponential.h b/glm/GLM_GTX_fast_exponential.h new file mode 100644 index 00000000..30e7b8e8 --- /dev/null +++ b/glm/GLM_GTX_fast_exponential.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_fast_exponential_api +#define glm_gtx_fast_exponential_api + +#include "gtx/fast_exponential.hpp" + +namespace glm +{ + using GLM_GTX_fast_exponential; +} + +#endif//glm_gtx_fast_exponential_api diff --git a/glm/GLM_GTX_fast_square_root.h b/glm/GLM_GTX_fast_square_root.h new file mode 100644 index 00000000..091d674f --- /dev/null +++ b/glm/GLM_GTX_fast_square_root.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_fast_square_root_api +#define glm_gtx_fast_square_root_api + +#include "gtx/fast_square_root.hpp" + +namespace glm +{ + using GLM_GTX_fast_square_root; +} + +#endif//glm_gtx_fast_square_root_api diff --git a/glm/GLM_GTX_fast_trigonometry.h b/glm/GLM_GTX_fast_trigonometry.h new file mode 100644 index 00000000..9b391478 --- /dev/null +++ b/glm/GLM_GTX_fast_trigonometry.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_fast_trigonometry_api +#define glm_gtx_fast_trigonometry_api + +#include "gtx/fast_trigonometry.hpp" + +namespace glm +{ + using GLM_GTX_fast_trigonometry; +} + +#endif//glm_gtx_fast_trigonometry_api diff --git a/glm/GLM_GTX_gradient_paint.h b/glm/GLM_GTX_gradient_paint.h new file mode 100644 index 00000000..e2e27a6a --- /dev/null +++ b/glm/GLM_GTX_gradient_paint.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-03-06 +// Updated : 2009-03-09 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_gradient_paint_api +#define glm_gtx_gradient_paint_api + +#include "gtx/gradient_paint.hpp" + +namespace glm +{ + using GLM_GTX_gradient_paint; +} + +#endif//glm_gtx_gradient_paint_api diff --git a/glm/GLM_GTX_half_float.h b/glm/GLM_GTX_half_float.h new file mode 100644 index 00000000..b7d48fe0 --- /dev/null +++ b/glm/GLM_GTX_half_float.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_half_float_api +#define glm_gtx_half_float_api + +#include "gtx/half_float.hpp" + +namespace glm +{ + using GLM_GTX_half_float; +} + +#endif//glm_gtx_half_float_api diff --git a/glm/GLM_GTX_handed_coordinate_space.h b/glm/GLM_GTX_handed_coordinate_space.h new file mode 100644 index 00000000..4696962e --- /dev/null +++ b/glm/GLM_GTX_handed_coordinate_space.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_handed_coordinate_space_api +#define glm_gtx_handed_coordinate_space_api + +#include "gtx/handed_coordinate_space.hpp" + +namespace glm +{ + using GLM_GTX_handed_coordinate_space; +} + +#endif//glm_gtx_handed_coordinate_space_api diff --git a/glm/GLM_GTX_inertia.h b/glm/GLM_GTX_inertia.h new file mode 100644 index 00000000..7107f6db --- /dev/null +++ b/glm/GLM_GTX_inertia.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_inertia_api +#define glm_gtx_inertia_api + +#include "gtx/inertia.hpp" + +namespace glm +{ + using GLM_GTX_inertia; +} + +#endif//glm_gtx_inertia_api diff --git a/glm/GLM_GTX_integer.h b/glm/GLM_GTX_integer.h new file mode 100644 index 00000000..7f6c4060 --- /dev/null +++ b/glm/GLM_GTX_integer.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_integer_api +#define glm_gtx_integer_api + +#include "gtx/integer.hpp" + +namespace glm +{ + using GLM_GTX_integer; +} + +#endif//glm_gtx_integer_api diff --git a/glm/GLM_GTX_intersect.h b/glm/GLM_GTX_intersect.h new file mode 100644 index 00000000..05bba624 --- /dev/null +++ b/glm/GLM_GTX_intersect.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_intersect_api +#define glm_gtx_intersect_api + +#include "gtx/intersect.hpp" + +namespace glm +{ + using GLM_GTX_intersect; +} + +#endif//glm_gtx_intersect_api diff --git a/glm/GLM_GTX_inverse.h b/glm/GLM_GTX_inverse.h new file mode 100644 index 00000000..1fa7c178 --- /dev/null +++ b/glm/GLM_GTX_inverse.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_inverse_api +#define glm_gtx_inverse_api + +#include "gtx/inverse.hpp" + +namespace glm +{ + using GLM_GTX_inverse; +} + +#endif//glm_gtx_inverse_api diff --git a/glm/GLM_GTX_inverse_transpose.h b/glm/GLM_GTX_inverse_transpose.h new file mode 100644 index 00000000..c6ee416d --- /dev/null +++ b/glm/GLM_GTX_inverse_transpose.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_inverse_transpose_api +#define glm_gtx_inverse_transpose_api + +#include "gtx/inverse_transpose.hpp" + +namespace glm +{ + using GLM_GTX_inverse_transpose; +} + +#endif//glm_gtx_inverse_transpose_api diff --git a/glm/GLM_GTX_log_base.h b/glm/GLM_GTX_log_base.h new file mode 100644 index 00000000..896812e6 --- /dev/null +++ b/glm/GLM_GTX_log_base.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-27 +// Updated : 2008-10-27 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_log_base_api +#define glm_gtx_log_base_api + +#include "gtx/log_base.hpp" + +namespace glm +{ + using GLM_GTX_log_base; +} + +#endif//glm_gtx_log_base_api diff --git a/glm/GLM_GTX_matrix_access.h b/glm/GLM_GTX_matrix_access.h new file mode 100644 index 00000000..178b6882 --- /dev/null +++ b/glm/GLM_GTX_matrix_access.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_access_api +#define glm_gtx_matrix_access_api + +#include "gtx/matrix_access.hpp" + +namespace glm +{ + using GLM_GTX_matrix_access; +} + +#endif//glm_gtx_matrix_access_api diff --git a/glm/GLM_GTX_matrix_cross_product.h b/glm/GLM_GTX_matrix_cross_product.h new file mode 100644 index 00000000..b0737c50 --- /dev/null +++ b/glm/GLM_GTX_matrix_cross_product.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_cross_product_api +#define glm_gtx_matrix_cross_product_api + +#include "gtx/matrix_cross_product.hpp" + +namespace glm +{ + using GLM_GTX_matrix_cross_product; +} + +#endif//glm_gtx_matrix_cross_product_api diff --git a/glm/GLM_GTX_matrix_major_storage.h b/glm/GLM_GTX_matrix_major_storage.h new file mode 100644 index 00000000..4b714810 --- /dev/null +++ b/glm/GLM_GTX_matrix_major_storage.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_major_storage_api +#define glm_gtx_matrix_major_storage_api + +#include "gtx/matrix_major_storage.hpp" + +namespace glm +{ + using GLM_GTX_matrix_major_storage; +} + +#endif//glm_gtx_matrix_major_storage_api diff --git a/glm/GLM_GTX_matrix_projection.h b/glm/GLM_GTX_matrix_projection.h new file mode 100644 index 00000000..ccf25648 --- /dev/null +++ b/glm/GLM_GTX_matrix_projection.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_projection_api +#define glm_gtx_matrix_projection_api + +#include "gtx/matrix_projection.hpp" + +namespace glm +{ + using GLM_GTX_matrix_projection; +} + +#endif//glm_gtx_matrix_projection_api diff --git a/glm/GLM_GTX_matrix_query.h b/glm/GLM_GTX_matrix_query.h new file mode 100644 index 00000000..4cce55de --- /dev/null +++ b/glm/GLM_GTX_matrix_query.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_query_api +#define glm_gtx_matrix_query_api + +#include "gtx/matrix_query.hpp" + +namespace glm +{ + using GLM_GTX_matrix_query; +} + +#endif//glm_gtx_matrix_query_api diff --git a/glm/GLM_GTX_matrix_selection.h b/glm/GLM_GTX_matrix_selection.h new file mode 100644 index 00000000..5cc7c0c7 --- /dev/null +++ b/glm/GLM_GTX_matrix_selection.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_selection_api +#define glm_gtx_matrix_selection_api + +#include "gtx/matrix_selection.hpp" + +namespace glm +{ + using GLM_GTX_matrix_selection; +} + +#endif//glm_gtx_matrix_selection_api diff --git a/glm/GLM_GTX_mixed_product.h b/glm/GLM_GTX_mixed_product.h new file mode 100644 index 00000000..168c2cd6 --- /dev/null +++ b/glm/GLM_GTX_mixed_product.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_mixed_product_api +#define glm_gtx_mixed_product_api + +#include "gtx/mixed_product.hpp" + +namespace glm +{ + using GLM_GTX_mixed_product; +} + +#endif//glm_gtx_mixed_product_api diff --git a/glm/GLM_GTX_norm.h b/glm/GLM_GTX_norm.h new file mode 100644 index 00000000..0974f848 --- /dev/null +++ b/glm/GLM_GTX_norm.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2009-01-16 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_norm_api +#define glm_gtx_norm_api + +#include "gtx/norm.hpp" + +namespace glm +{ + using GLM_GTX_norm; +} + +#endif//glm_gtx_norm_api diff --git a/glm/GLM_GTX_normal.h b/glm/GLM_GTX_normal.h new file mode 100644 index 00000000..ce08bf17 --- /dev/null +++ b/glm/GLM_GTX_normal.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_normal_api +#define glm_gtx_normal_api + +#include "gtx/normal.hpp" + +namespace glm +{ + using GLM_GTX_normal; +} + +#endif//glm_gtx_normal_api diff --git a/glm/GLM_GTX_normalize_dot.h b/glm/GLM_GTX_normalize_dot.h new file mode 100644 index 00000000..77c51f1f --- /dev/null +++ b/glm/GLM_GTX_normalize_dot.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_normalize_dot_api +#define glm_gtx_normalize_dot_api + +#include "gtx/normalize_dot.hpp" + +namespace glm +{ + using GLM_GTX_normalize_dot; +} + +#endif//glm_gtx_normalize_dot_api diff --git a/glm/GLM_GTX_number_precision.h b/glm/GLM_GTX_number_precision.h new file mode 100644 index 00000000..9406c948 --- /dev/null +++ b/glm/GLM_GTX_number_precision.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_number_precision_api +#define glm_gtx_number_precision_api + +#include "gtx/number_precision.hpp" + +namespace glm +{ + using GLM_GTX_number_precision; +} + +#endif//glm_gtx_number_precision_api diff --git a/glm/GLM_GTX_optimum_pow.h b/glm/GLM_GTX_optimum_pow.h new file mode 100644 index 00000000..14cef0bd --- /dev/null +++ b/glm/GLM_GTX_optimum_pow.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_optimum_pow_api +#define glm_gtx_optimum_pow_api + +#include "gtx/optimum_pow.hpp" + +namespace glm +{ + using GLM_GTX_optimum_pow; +} + +#endif//glm_gtx_optimum_pow_api diff --git a/glm/GLM_GTX_orthonormalize.h b/glm/GLM_GTX_orthonormalize.h new file mode 100644 index 00000000..9d71f214 --- /dev/null +++ b/glm/GLM_GTX_orthonormalize.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_orthonormalize_api +#define glm_gtx_orthonormalize_api + +#include "gtx/orthonormalize.hpp" + +namespace glm +{ + using GLM_GTX_orthonormalize; +} + +#endif//glm_gtx_orthonormalize_api diff --git a/glm/GLM_GTX_perpendicular.h b/glm/GLM_GTX_perpendicular.h new file mode 100644 index 00000000..ae78c77a --- /dev/null +++ b/glm/GLM_GTX_perpendicular.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_perpendicular_api +#define glm_gtx_perpendicular_api + +#include "gtx/perpendicular.hpp" + +namespace glm +{ + using GLM_GTX_perpendicular; +} + +#endif//glm_gtx_perpendicular_api diff --git a/glm/GLM_GTX_polar_coordinates.h b/glm/GLM_GTX_polar_coordinates.h new file mode 100644 index 00000000..13745ec2 --- /dev/null +++ b/glm/GLM_GTX_polar_coordinates.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_polar_coordinates_api +#define glm_gtx_polar_coordinates_api + +#include "gtx/polar_coordinates.hpp" + +namespace glm +{ + using GLM_GTX_polar_coordinates; +} + +#endif//glm_gtx_polar_coordinates_api diff --git a/glm/GLM_GTX_projection.h b/glm/GLM_GTX_projection.h new file mode 100644 index 00000000..f0a6c115 --- /dev/null +++ b/glm/GLM_GTX_projection.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_projection_api +#define glm_gtx_projection_api + +#include "gtx/projection.hpp" + +namespace glm +{ + using GLM_GTX_projection; +} + +#endif//glm_gtx_projection_api diff --git a/glm/GLM_GTX_quaternion.h b/glm/GLM_GTX_quaternion.h new file mode 100644 index 00000000..401fe388 --- /dev/null +++ b/glm/GLM_GTX_quaternion.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_quaternion_api +#define glm_gtx_quaternion_api + +#include "gtx/quaternion.hpp" + +namespace glm +{ + using GLM_GTX_quaternion; +} + +#endif//glm_gtx_quaternion_api diff --git a/glm/GLM_GTX_random.h b/glm/GLM_GTX_random.h new file mode 100644 index 00000000..dbd7bccb --- /dev/null +++ b/glm/GLM_GTX_random.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_random_api +#define glm_gtx_random_api + +#include "gtx/random.hpp" + +namespace glm +{ + using GLM_GTX_random; +} + +#endif//glm_gtx_random_api diff --git a/glm/GLM_GTX_raw_data.h b/glm/GLM_GTX_raw_data.h new file mode 100644 index 00000000..9fdee4a5 --- /dev/null +++ b/glm/GLM_GTX_raw_data.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-11-19 +// Updated : 2008-11-19 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_raw_data_api +#define glm_gtx_raw_data_api + +#include "gtx/raw_data.hpp" + +namespace glm +{ + using GLM_GTX_raw_data; +} + +#endif//glm_gtx_raw_data_api diff --git a/glm/GLM_GTX_reciprocal.h b/glm/GLM_GTX_reciprocal.h new file mode 100644 index 00000000..0ba6ae3a --- /dev/null +++ b/glm/GLM_GTX_reciprocal.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_reciprocal_api +#define glm_gtx_reciprocal_api + +#include "gtx/reciprocal.hpp" + +namespace glm +{ + using GLM_GTX_reciprocal; +} + +#endif//glm_gtx_reciprocal_api diff --git a/glm/GLM_GTX_rotate_vector.h b/glm/GLM_GTX_rotate_vector.h new file mode 100644 index 00000000..2db44392 --- /dev/null +++ b/glm/GLM_GTX_rotate_vector.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_rotate_vector_api +#define glm_gtx_rotate_vector_api + +#include "gtx/rotate_vector.hpp" + +namespace glm +{ + using GLM_GTX_rotate_vector; +} + +#endif//glm_gtx_rotate_vector_api diff --git a/glm/GLM_GTX_spline.h b/glm/GLM_GTX_spline.h new file mode 100644 index 00000000..43d383e4 --- /dev/null +++ b/glm/GLM_GTX_spline.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_spline_api +#define glm_gtx_spline_api + +#include "gtx/spline.hpp" + +namespace glm +{ + using GLM_GTX_spline; +} + +#endif//glm_gtx_spline_api diff --git a/glm/GLM_GTX_std_based_type.h b/glm/GLM_GTX_std_based_type.h new file mode 100644 index 00000000..9f167c71 --- /dev/null +++ b/glm/GLM_GTX_std_based_type.h @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_std_based_type_api +#define glm_gtx_std_based_type_api + +#include "gtx/std_based_type.hpp" + +namespace glm +{ + using GLM_GTX_std_based_type; +} + +#endif//glm_gtx_std_based_type_api diff --git a/glm/GLM_GTX_string_cast.h b/glm/GLM_GTX_string_cast.h new file mode 100644 index 00000000..c6e82efb --- /dev/null +++ b/glm/GLM_GTX_string_cast.h @@ -0,0 +1,25 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_double_float +// - GLM_GTX_half_float +// - GLM_GTX_quaternion +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_string_cast_api +#define glm_gtx_string_cast_api + +#include "gtx/string_cast.hpp" + +namespace glm +{ + using GLM_GTX_string_cast; +} + +#endif//glm_gtx_string_cast_api diff --git a/glm/GLM_GTX_transform.h b/glm/GLM_GTX_transform.h new file mode 100644 index 00000000..390b32bc --- /dev/null +++ b/glm/GLM_GTX_transform.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_transform_api +#define glm_gtx_transform_api + +#include "gtx/transform.hpp" + +namespace glm +{ + using GLM_GTX_transform; +} + +#endif//glm_gtx_transform_api diff --git a/glm/GLM_GTX_transform2.h b/glm/GLM_GTX_transform2.h new file mode 100644 index 00000000..78ac9315 --- /dev/null +++ b/glm/GLM_GTX_transform2.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_transform2_api +#define glm_gtx_transform2_api + +#include "gtx/transform2.hpp" + +namespace glm +{ + using GLM_GTX_transform2; +} + +#endif//glm_gtx_transform2_api diff --git a/glm/GLM_GTX_unsigned_int.h b/glm/GLM_GTX_unsigned_int.h new file mode 100644 index 00000000..12dcd721 --- /dev/null +++ b/glm/GLM_GTX_unsigned_int.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_unsigned_int_api +#define glm_gtx_unsigned_int_api + +#include "gtx/unsigned_int.hpp" + +namespace glm +{ + using GLM_GTX_unsigned_int; +} + +#endif//glm_gtx_unsigned_int_api diff --git a/glm/GLM_GTX_vector_access.h b/glm/GLM_GTX_vector_access.h new file mode 100644 index 00000000..32fc9513 --- /dev/null +++ b/glm/GLM_GTX_vector_access.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_vector_access_api +#define glm_gtx_vector_access_api + +#include "gtx/vector_access.hpp" + +namespace glm +{ + using GLM_GTX_vector_access; +} + +#endif//glm_gtx_vector_access_api diff --git a/glm/GLM_GTX_vector_angle.h b/glm/GLM_GTX_vector_angle.h new file mode 100644 index 00000000..1251f1b7 --- /dev/null +++ b/glm/GLM_GTX_vector_angle.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_vector_angle_api +#define glm_gtx_vector_angle_api + +#include "gtx/vector_angle.hpp" + +namespace glm +{ + using GLM_GTX_vector_angle; +} + +#endif//glm_gtx_vector_angle_api diff --git a/glm/GLM_GTX_vector_query.h b/glm/GLM_GTX_vector_query.h new file mode 100644 index 00000000..9a13a40a --- /dev/null +++ b/glm/GLM_GTX_vector_query.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_vector_query_api +#define glm_gtx_vector_query_api + +#include "gtx/vector_query.hpp" + +namespace glm +{ + using GLM_GTX_vector_query; +} + +#endif//glm_gtx_vector_query_api diff --git a/glm/GLM_GTX_verbose_operator.h b/glm/GLM_GTX_verbose_operator.h new file mode 100644 index 00000000..efbff0c0 --- /dev/null +++ b/glm/GLM_GTX_verbose_operator.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_verbose_operator_api +#define glm_gtx_verbose_operator_api + +#include "gtx/verbose_operator.hpp" + +namespace glm +{ + using GLM_GTX_verbose_operator; +} + +#endif//glm_gtx_verbose_operator_api diff --git a/glm/GLM_VIRTREV_address.h b/glm/GLM_VIRTREV_address.h new file mode 100644 index 00000000..19e1cbef --- /dev/null +++ b/glm/GLM_VIRTREV_address.h @@ -0,0 +1,20 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_virtrev_address_api +#define glm_virtrev_address_api + +#include "virtrev/address.hpp" + +namespace glm +{ + using GLM_VIRTREV_address; +} + +#endif//glm_virtrev_address_api + diff --git a/glm/GLM_VIRTREV_equal_operator.h b/glm/GLM_VIRTREV_equal_operator.h new file mode 100644 index 00000000..ea2d49f2 --- /dev/null +++ b/glm/GLM_VIRTREV_equal_operator.h @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_virtrev_equal_operator_api +#define glm_virtrev_equal_operator_api + +#include "virtrev/gl.hpp" + +using namespace glm::virtrev_glmext::equal_operator; + +#endif//glm_virtrev_equal_operator_api diff --git a/glm/GLM_VIRTREV_gl.h b/glm/GLM_VIRTREV_gl.h new file mode 100644 index 00000000..67984b27 --- /dev/null +++ b/glm/GLM_VIRTREV_gl.h @@ -0,0 +1,20 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_virtrev_gl_api +#define glm_virtrev_gl_api + +#include "virtrev/gl.hpp" + +namespace glm +{ + using namespace virtrev_glmext::gl; +} + +#endif//glm_virtrev_gl_api + diff --git a/glm/GLM_VIRTREV_xstream.h b/glm/GLM_VIRTREV_xstream.h new file mode 100644 index 00000000..bab3fc51 --- /dev/null +++ b/glm/GLM_VIRTREV_xstream.h @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-22 +// Updated : 2008-10-22 +// Licence : This source is under MIT License +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_virtrev_xstream_api +#define glm_virtrev_xstream_api + +#include "virtrev/xstream.hpp" + +namespace glm +{ + using GLM_VIRTREV_xstream; +} + +#endif//glm_virtrev_xstream_api diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp new file mode 100644 index 00000000..783114d3 --- /dev/null +++ b/glm/core/_detail.hpp @@ -0,0 +1,327 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-07-24 +// Updated : 2008-08-31 +// Licence : This source is under MIT License +// File : glm/core/_detail.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_detail +#define glm_core_detail + +#include "../setup.hpp" +#include + +//#define valType typename genType::value_type +//#define valType_cref typename genType::value_type const & +//#define genType_cref typename genType const & + +namespace glm{ +namespace detail{ + + class thalf; + +#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC)) + typedef signed __int64 sint64; + typedef unsigned __int64 uint64; +#elif(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_GCC)) + __extension__ typedef signed long long sint64; + __extension__ typedef unsigned long long uint64; +#else//unknown compiler + typedef signed long sint64; + typedef unsigned long uint64; +#endif//GLM_COMPILER + + template + struct If + { + template + static inline T apply(F functor, const T& val) + { + return functor(val); + } + }; + + template<> + struct If + { + template + static inline T apply(F, const T& val) + { + return val; + } + }; + + //template + //struct traits + //{ + // static const bool is_signed = false; + // static const bool is_float = false; + // static const bool is_vector = false; + // static const bool is_matrix = false; + // static const bool is_genType = false; + // static const bool is_genIType = false; + // static const bool is_genUType = false; + //}; + + //template <> + //struct traits + //{ + // static const bool is_float = true; + // static const bool is_genType = true; + //}; + + //template <> + //struct traits + //{ + // static const bool is_float = true; + // static const bool is_genType = true; + //}; + + //template <> + //struct traits + //{ + // static const bool is_float = true; + // static const bool is_genType = true; + //}; + + //template + //struct desc + //{ + // typedef genType type; + // typedef genType * pointer; + // typedef genType const* const_pointer; + // typedef genType const *const const_pointer_const; + // typedef genType *const pointer_const; + // typedef genType & reference; + // typedef genType const& const_reference; + // typedef genType const& param_type; + + // typedef typename genType::value_type value_type; + // typedef typename genType::size_type size_type; + // static const typename size_type value_size; + //}; + + //template + //const typename desc::size_type desc::value_size = genType::value_size(); + + union uif32 + { + uif32() : + i(0) + {} + + uif32(float f) : + f(f) + {} + + uif32(unsigned int i) : + i(i) + {} + + float f; + unsigned int i; + }; + + union uif64 + { + uif64() : + i(0) + {} + + uif64(double f) : + f(f) + {} + + uif64(uint64 i) : + i(i) + {} + + double f; + uint64 i; + }; + + typedef uif32 uif; + + ////////////////// + // int + + template + struct is_int + { + enum is_int_enum + { + YES = 0, + NO = 1 + }; + }; + +#define GLM_DETAIL_IS_INT(T) \ + template <> \ + struct is_int \ + { \ + enum is_int_enum \ + { \ + YES = 1, \ + NO = 0 \ + }; \ + } + + ////////////////// + // uint + + template + struct is_uint + { + enum is_uint_enum + { + YES = 0, + NO = 1 + }; + }; + +#define GLM_DETAIL_IS_UINT(T) \ + template <> \ + struct is_uint \ + { \ + enum is_uint_enum \ + { \ + YES = 1, \ + NO = 0 \ + }; \ + } + + //GLM_DETAIL_IS_UINT(unsigned long long) + + ////////////////// + // float + + template + struct is_float + { + enum is_float_enum + { + YES = 0, + NO = 1 + }; + }; + +#define GLM_DETAIL_IS_FLOAT(T) \ + template <> \ + struct is_float \ + { \ + enum is_float_enum \ + { \ + YES = 1, \ + NO = 0 \ + }; \ + } + + ////////////////// + // bool + + template + struct is_bool + { + enum is_bool_enum + { + YES = 0, + NO = 1 + }; + }; + + template <> + struct is_bool + { + enum is_bool_enum + { + YES = 1, + NO = 0 + }; + }; + + ////////////////// + // vector + + template + struct is_vector + { + enum is_vector_enum + { + YES = 0, + NO = 1 + }; + }; + +#define GLM_DETAIL_IS_VECTOR(T) \ + template <> \ + struct is_vector \ + { \ + enum is_vector_enum \ + { \ + YES = 1, \ + NO = 0 \ + }; \ + } + + ////////////////// + // matrix + + template + struct is_matrix + { + enum is_matrix_enum + { + YES = 0, + NO = 1 + }; + }; + +#define GLM_DETAIL_IS_MATRIX(T) \ + template <> \ + struct is_matrix \ + { \ + enum is_matrix_enum \ + { \ + YES = 1, \ + NO = 0 \ + }; \ + } + + ////////////////// + // type + + template + struct type + { + enum type_enum + { + is_float = is_float::YES, + is_int = is_int::YES, + is_uint = is_uint::YES, + is_bool = is_bool::YES + }; + }; + + ////////////////// + // type + + typedef signed char int8; + typedef signed short int16; + typedef signed int int32; + typedef detail::sint64 int64; + + typedef unsigned char uint8; + typedef unsigned short uint16; + typedef unsigned int uint32; + typedef detail::uint64 uint64; + + typedef detail::thalf float16; + typedef float float32; + typedef double float64; + +}//namespace detail +}//namespace glm + +#endif//glm_core_detail diff --git a/glm/core/_swizzle.hpp b/glm/core/_swizzle.hpp new file mode 100644 index 00000000..15caad17 --- /dev/null +++ b/glm/core/_swizzle.hpp @@ -0,0 +1,1085 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-04-20 +// Updated : 2008-08-22 +// Licence : This source is under MIT License +// File : glm/core/_swizzle.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_swizzle +#define glm_core_swizzle + +namespace glm +{ + enum comp + { + X = 0, + R = 0, + S = 0, + Y = 1, + G = 1, + T = 1, + Z = 2, + B = 2, + P = 2, + W = 3, + A = 3, + Q = 3 + }; +}//namespace glm + +#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW) + +#define xx swizzle(glm::X, glm::X) +#define yx swizzle(glm::Y, glm::X) +#define zx swizzle(glm::Z, glm::X) +#define wx swizzle(glm::W, glm::X) +#define xy swizzle(glm::X, glm::Y) +#define yy swizzle(glm::Y, glm::Y) +#define zy swizzle(glm::Z, glm::Y) +#define wy swizzle(glm::W, glm::Y) +#define xz swizzle(glm::X, glm::Z) +#define yz swizzle(glm::Y, glm::Z) +#define zz swizzle(glm::Z, glm::Z) +#define wz swizzle(glm::W, glm::Z) +#define xw swizzle(glm::X, glm::W) +#define yw swizzle(glm::Y, glm::W) +#define zw swizzle(glm::Z, glm::W) +#define ww swizzle(glm::W, glm::W) + +#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW) + +#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA) + +#define rr swizzle(glm::X, glm::X) +#define gr swizzle(glm::Y, glm::X) +#define br swizzle(glm::Z, glm::X) +#define ar swizzle(glm::W, glm::X) +#define rg swizzle(glm::X, glm::Y) +#define gg swizzle(glm::Y, glm::Y) +#define bg swizzle(glm::Z, glm::Y) +#define ag swizzle(glm::W, glm::Y) +#define rb swizzle(glm::X, glm::Z) +#define gb swizzle(glm::Y, glm::Z) +#define bb swizzle(glm::Z, glm::Z) +#define ab swizzle(glm::W, glm::Z) +#define ra swizzle(glm::X, glm::W) +#define ga swizzle(glm::Y, glm::W) +#define ba swizzle(glm::Z, glm::W) +#define aa swizzle(glm::W, glm::W) + +#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA) + +#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ) + +#define ss swizzle(glm::X, glm::X) +#define ts swizzle(glm::Y, glm::X) +#define ps swizzle(glm::Z, glm::X) +#define qs swizzle(glm::W, glm::X) +#define st swizzle(glm::X, glm::Y) +#define tt swizzle(glm::Y, glm::Y) +#define pt swizzle(glm::Z, glm::Y) +#define qt swizzle(glm::W, glm::Y) +#define sp swizzle(glm::X, glm::Z) +#define tp swizzle(glm::Y, glm::Z) +#define pp swizzle(glm::Z, glm::Z) +#define qp swizzle(glm::W, glm::Z) +#define sq swizzle(glm::X, glm::W) +#define tq swizzle(glm::Y, glm::W) +#define pq swizzle(glm::Z, glm::W) +#define qq swizzle(glm::W, glm::W) + +#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ) + +#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW) + +#define xxx swizzle(glm::X, glm::X, glm::X) +#define yxx swizzle(glm::Y, glm::X, glm::X) +#define zxx swizzle(glm::Z, glm::X, glm::X) +#define wxx swizzle(glm::W, glm::X, glm::X) +#define xyx swizzle(glm::X, glm::Y, glm::X) +#define yyx swizzle(glm::Y, glm::Y, glm::X) +#define zyx swizzle(glm::Z, glm::Y, glm::X) +#define wyx swizzle(glm::W, glm::Y, glm::X) +#define xzx swizzle(glm::X, glm::Z, glm::X) +#define yzx swizzle(glm::Y, glm::Z, glm::X) +#define zzx swizzle(glm::Z, glm::Z, glm::X) +#define wzx swizzle(glm::W, glm::Z, glm::X) +#define xwx swizzle(glm::X, glm::W, glm::X) +#define ywx swizzle(glm::Y, glm::W, glm::X) +#define zwx swizzle(glm::Z, glm::W, glm::X) +#define wwx swizzle(glm::W, glm::W, glm::X) +#define xxy swizzle(glm::X, glm::X, glm::Y) +#define yxy swizzle(glm::Y, glm::X, glm::Y) +#define zxy swizzle(glm::Z, glm::X, glm::Y) +#define wxy swizzle(glm::W, glm::X, glm::Y) +#define xyy swizzle(glm::X, glm::Y, glm::Y) +#define yyy swizzle(glm::Y, glm::Y, glm::Y) +#define zyy swizzle(glm::Z, glm::Y, glm::Y) +#define wyy swizzle(glm::W, glm::Y, glm::Y) +#define xzy swizzle(glm::X, glm::Z, glm::Y) +#define yzy swizzle(glm::Y, glm::Z, glm::Y) +#define zzy swizzle(glm::Z, glm::Z, glm::Y) +#define wzy swizzle(glm::W, glm::Z, glm::Y) +#define xwy swizzle(glm::X, glm::W, glm::Y) +#define ywy swizzle(glm::Y, glm::W, glm::Y) +#define zwy swizzle(glm::Z, glm::W, glm::Y) +#define wwy swizzle(glm::W, glm::W, glm::Y) +#define xxz swizzle(glm::X, glm::X, glm::Z) +#define yxz swizzle(glm::Y, glm::X, glm::Z) +#define zxz swizzle(glm::Z, glm::X, glm::Z) +#define wxz swizzle(glm::W, glm::X, glm::Z) +#define xyz swizzle(glm::X, glm::Y, glm::Z) +#define yyz swizzle(glm::Y, glm::Y, glm::Z) +#define zyz swizzle(glm::Z, glm::Y, glm::Z) +#define wyz swizzle(glm::W, glm::Y, glm::Z) +#define xzz swizzle(glm::X, glm::Z, glm::Z) +#define yzz swizzle(glm::Y, glm::Z, glm::Z) +#define zzz swizzle(glm::Z, glm::Z, glm::Z) +#define wzz swizzle(glm::W, glm::Z, glm::Z) +#define xwz swizzle(glm::X, glm::W, glm::Z) +#define ywz swizzle(glm::Y, glm::W, glm::Z) +#define zwz swizzle(glm::Z, glm::W, glm::Z) +#define wwz swizzle(glm::W, glm::W, glm::Z) +#define xxw swizzle(glm::X, glm::X, glm::W) +#define yxw swizzle(glm::Y, glm::X, glm::W) +#define zxw swizzle(glm::Z, glm::X, glm::W) +#define wxw swizzle(glm::W, glm::X, glm::W) +#define xyw swizzle(glm::X, glm::Y, glm::W) +#define yyw swizzle(glm::Y, glm::Y, glm::W) +#define zyw swizzle(glm::Z, glm::Y, glm::W) +#define wyw swizzle(glm::W, glm::Y, glm::W) +#define xzw swizzle(glm::X, glm::Z, glm::W) +#define yzw swizzle(glm::Y, glm::Z, glm::W) +#define zzw swizzle(glm::Z, glm::Z, glm::W) +#define wzw swizzle(glm::W, glm::Z, glm::W) +#define xww swizzle(glm::X, glm::W, glm::W) +#define yww swizzle(glm::Y, glm::W, glm::W) +#define zww swizzle(glm::Z, glm::W, glm::W) +#define www swizzle(glm::W, glm::W, glm::W) + +#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW) + +#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA) + +#define rrr swizzle(glm::X, glm::X, glm::X) +#define grr swizzle(glm::Y, glm::X, glm::X) +#define brr swizzle(glm::Z, glm::X, glm::X) +#define arr swizzle(glm::W, glm::X, glm::X) +#define rgr swizzle(glm::X, glm::Y, glm::X) +#define ggr swizzle(glm::Y, glm::Y, glm::X) +#define bgr swizzle(glm::Z, glm::Y, glm::X) +#define agr swizzle(glm::W, glm::Y, glm::X) +#define rbr swizzle(glm::X, glm::Z, glm::X) +#define gbr swizzle(glm::Y, glm::Z, glm::X) +#define bbr swizzle(glm::Z, glm::Z, glm::X) +#define abr swizzle(glm::W, glm::Z, glm::X) +#define rar swizzle(glm::X, glm::W, glm::X) +#define gar swizzle(glm::Y, glm::W, glm::X) +#define bar swizzle(glm::Z, glm::W, glm::X) +#define aar swizzle(glm::W, glm::W, glm::X) +#define rrg swizzle(glm::X, glm::X, glm::Y) +#define grg swizzle(glm::Y, glm::X, glm::Y) +#define brg swizzle(glm::Z, glm::X, glm::Y) +#define arg swizzle(glm::W, glm::X, glm::Y) +#define rgg swizzle(glm::X, glm::Y, glm::Y) +#define ggg swizzle(glm::Y, glm::Y, glm::Y) +#define bgg swizzle(glm::Z, glm::Y, glm::Y) +#define agg swizzle(glm::W, glm::Y, glm::Y) +#define rbg swizzle(glm::X, glm::Z, glm::Y) +#define gbg swizzle(glm::Y, glm::Z, glm::Y) +#define bbg swizzle(glm::Z, glm::Z, glm::Y) +#define abg swizzle(glm::W, glm::Z, glm::Y) +#define rag swizzle(glm::X, glm::W, glm::Y) +#define gag swizzle(glm::Y, glm::W, glm::Y) +#define bag swizzle(glm::Z, glm::W, glm::Y) +#define aag swizzle(glm::W, glm::W, glm::Y) +#define rrb swizzle(glm::X, glm::X, glm::Z) +#define grb swizzle(glm::Y, glm::X, glm::Z) +#define brb swizzle(glm::Z, glm::X, glm::Z) +#define arb swizzle(glm::W, glm::X, glm::Z) +#define rgb swizzle(glm::X, glm::Y, glm::Z) +#define ggb swizzle(glm::Y, glm::Y, glm::Z) +#define bgb swizzle(glm::Z, glm::Y, glm::Z) +#define agb swizzle(glm::W, glm::Y, glm::Z) +#define rbb swizzle(glm::X, glm::Z, glm::Z) +#define gbb swizzle(glm::Y, glm::Z, glm::Z) +#define bbb swizzle(glm::Z, glm::Z, glm::Z) +#define abb swizzle(glm::W, glm::Z, glm::Z) +#define rab swizzle(glm::X, glm::W, glm::Z) +#define gab swizzle(glm::Y, glm::W, glm::Z) +#define bab swizzle(glm::Z, glm::W, glm::Z) +#define aab swizzle(glm::W, glm::W, glm::Z) +#define rra swizzle(glm::X, glm::X, glm::W) +#define gra swizzle(glm::Y, glm::X, glm::W) +#define bra swizzle(glm::Z, glm::X, glm::W) +#define ara swizzle(glm::W, glm::X, glm::W) +#define rga swizzle(glm::X, glm::Y, glm::W) +#define gga swizzle(glm::Y, glm::Y, glm::W) +#define bga swizzle(glm::Z, glm::Y, glm::W) +#define aga swizzle(glm::W, glm::Y, glm::W) +#define rba swizzle(glm::X, glm::Z, glm::W) +#define gba swizzle(glm::Y, glm::Z, glm::W) +#define bba swizzle(glm::Z, glm::Z, glm::W) +#define aba swizzle(glm::W, glm::Z, glm::W) +#define raa swizzle(glm::X, glm::W, glm::W) +#define gaa swizzle(glm::Y, glm::W, glm::W) +#define baa swizzle(glm::Z, glm::W, glm::W) +#define aaa swizzle(glm::W, glm::W, glm::W) + +#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA) + +#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ) + +#define sss swizzle(glm::X, glm::X, glm::X) +#define tss swizzle(glm::Y, glm::X, glm::X) +#define pss swizzle(glm::Z, glm::X, glm::X) +#define qss swizzle(glm::W, glm::X, glm::X) +#define sts swizzle(glm::X, glm::Y, glm::X) +#define tts swizzle(glm::Y, glm::Y, glm::X) +#define pts swizzle(glm::Z, glm::Y, glm::X) +#define qts swizzle(glm::W, glm::Y, glm::X) +#define sps swizzle(glm::X, glm::Z, glm::X) +#define tps swizzle(glm::Y, glm::Z, glm::X) +#define pps swizzle(glm::Z, glm::Z, glm::X) +#define qps swizzle(glm::W, glm::Z, glm::X) +#define sqs swizzle(glm::X, glm::W, glm::X) +#define tqs swizzle(glm::Y, glm::W, glm::X) +#define pqs swizzle(glm::Z, glm::W, glm::X) +#define qqs swizzle(glm::W, glm::W, glm::X) +#define sst swizzle(glm::X, glm::X, glm::Y) +#define tst swizzle(glm::Y, glm::X, glm::Y) +#define pst swizzle(glm::Z, glm::X, glm::Y) +#define qst swizzle(glm::W, glm::X, glm::Y) +#define stt swizzle(glm::X, glm::Y, glm::Y) +#define ttt swizzle(glm::Y, glm::Y, glm::Y) +#define ptt swizzle(glm::Z, glm::Y, glm::Y) +#define qtt swizzle(glm::W, glm::Y, glm::Y) +#define spt swizzle(glm::X, glm::Z, glm::Y) +#define tpt swizzle(glm::Y, glm::Z, glm::Y) +#define ppt swizzle(glm::Z, glm::Z, glm::Y) +#define qpt swizzle(glm::W, glm::Z, glm::Y) +#define sqt swizzle(glm::X, glm::W, glm::Y) +#define tqt swizzle(glm::Y, glm::W, glm::Y) +#define pqt swizzle(glm::Z, glm::W, glm::Y) +#define qqt swizzle(glm::W, glm::W, glm::Y) +#define ssp swizzle(glm::X, glm::X, glm::Z) +#define tsp swizzle(glm::Y, glm::X, glm::Z) +#define psp swizzle(glm::Z, glm::X, glm::Z) +#define qsp swizzle(glm::W, glm::X, glm::Z) +#define stp swizzle(glm::X, glm::Y, glm::Z) +#define ttp swizzle(glm::Y, glm::Y, glm::Z) +#define ptp swizzle(glm::Z, glm::Y, glm::Z) +#define qtp swizzle(glm::W, glm::Y, glm::Z) +#define spp swizzle(glm::X, glm::Z, glm::Z) +#define tpp swizzle(glm::Y, glm::Z, glm::Z) +#define ppp swizzle(glm::Z, glm::Z, glm::Z) +#define qpp swizzle(glm::W, glm::Z, glm::Z) +#define sqp swizzle(glm::X, glm::W, glm::Z) +#define tqp swizzle(glm::Y, glm::W, glm::Z) +#define pqp swizzle(glm::Z, glm::W, glm::Z) +#define qqp swizzle(glm::W, glm::W, glm::Z) +#define ssq swizzle(glm::X, glm::X, glm::W) +#define tsq swizzle(glm::Y, glm::X, glm::W) +#define psq swizzle(glm::Z, glm::X, glm::W) +#define qsq swizzle(glm::W, glm::X, glm::W) +#define stq swizzle(glm::X, glm::Y, glm::W) +#define ttq swizzle(glm::Y, glm::Y, glm::W) +#define ptq swizzle(glm::Z, glm::Y, glm::W) +#define qtq swizzle(glm::W, glm::Y, glm::W) +#define spq swizzle(glm::X, glm::Z, glm::W) +#define tpq swizzle(glm::Y, glm::Z, glm::W) +#define ppq swizzle(glm::Z, glm::Z, glm::W) +#define qpq swizzle(glm::W, glm::Z, glm::W) +#define sqq swizzle(glm::X, glm::W, glm::W) +#define tqq swizzle(glm::Y, glm::W, glm::W) +#define pqq swizzle(glm::Z, glm::W, glm::W) +#define qqq swizzle(glm::W, glm::W, glm::W) + +#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ) + +#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW) + +#define xxxx swizzle(glm::X, glm::X, glm::X, glm::X) +#define yxxx swizzle(glm::Y, glm::X, glm::X, glm::X) +#define zxxx swizzle(glm::Z, glm::X, glm::X, glm::X) +#define wxxx swizzle(glm::W, glm::X, glm::X, glm::X) +#define xyxx swizzle(glm::X, glm::Y, glm::X, glm::X) +#define yyxx swizzle(glm::Y, glm::Y, glm::X, glm::X) +#define zyxx swizzle(glm::Z, glm::Y, glm::X, glm::X) +#define wyxx swizzle(glm::W, glm::Y, glm::X, glm::X) +#define xzxx swizzle(glm::X, glm::Z, glm::X, glm::X) +#define yzxx swizzle(glm::Y, glm::Z, glm::X, glm::X) +#define zzxx swizzle(glm::Z, glm::Z, glm::X, glm::X) +#define wzxx swizzle(glm::W, glm::Z, glm::X, glm::X) +#define xwxx swizzle(glm::X, glm::W, glm::X, glm::X) +#define ywxx swizzle(glm::Y, glm::W, glm::X, glm::X) +#define zwxx swizzle(glm::Z, glm::W, glm::X, glm::X) +#define wwxx swizzle(glm::W, glm::W, glm::X, glm::X) +#define xxyx swizzle(glm::X, glm::X, glm::Y, glm::X) +#define yxyx swizzle(glm::Y, glm::X, glm::Y, glm::X) +#define zxyx swizzle(glm::Z, glm::X, glm::Y, glm::X) +#define wxyx swizzle(glm::W, glm::X, glm::Y, glm::X) +#define xyyx swizzle(glm::X, glm::Y, glm::Y, glm::X) +#define yyyx swizzle(glm::Y, glm::Y, glm::Y, glm::X) +#define zyyx swizzle(glm::Z, glm::Y, glm::Y, glm::X) +#define wyyx swizzle(glm::W, glm::Y, glm::Y, glm::X) +#define xzyx swizzle(glm::X, glm::Z, glm::Y, glm::X) +#define yzyx swizzle(glm::Y, glm::Z, glm::Y, glm::X) +#define zzyx swizzle(glm::Z, glm::Z, glm::Y, glm::X) +#define wzyx swizzle(glm::W, glm::Z, glm::Y, glm::X) +#define xwyx swizzle(glm::X, glm::W, glm::Y, glm::X) +#define ywyx swizzle(glm::Y, glm::W, glm::Y, glm::X) +#define zwyx swizzle(glm::Z, glm::W, glm::Y, glm::X) +#define wwyx swizzle(glm::W, glm::W, glm::Y, glm::X) +#define xxzx swizzle(glm::X, glm::X, glm::Z, glm::X) +#define yxzx swizzle(glm::Y, glm::X, glm::Z, glm::X) +#define zxzx swizzle(glm::Z, glm::X, glm::Z, glm::X) +#define wxzx swizzle(glm::W, glm::X, glm::Z, glm::X) +#define xyzx swizzle(glm::X, glm::Y, glm::Z, glm::X) +#define yyzx swizzle(glm::Y, glm::Y, glm::Z, glm::X) +#define zyzx swizzle(glm::Z, glm::Y, glm::Z, glm::X) +#define wyzx swizzle(glm::W, glm::Y, glm::Z, glm::X) +#define xzzx swizzle(glm::X, glm::Z, glm::Z, glm::X) +#define yzzx swizzle(glm::Y, glm::Z, glm::Z, glm::X) +#define zzzx swizzle(glm::Z, glm::Z, glm::Z, glm::X) +#define wzzx swizzle(glm::W, glm::Z, glm::Z, glm::X) +#define xwzx swizzle(glm::X, glm::W, glm::Z, glm::X) +#define ywzx swizzle(glm::Y, glm::W, glm::Z, glm::X) +#define zwzx swizzle(glm::Z, glm::W, glm::Z, glm::X) +#define wwzx swizzle(glm::W, glm::W, glm::Z, glm::X) +#define xxwx swizzle(glm::X, glm::X, glm::W, glm::X) +#define yxwx swizzle(glm::Y, glm::X, glm::W, glm::X) +#define zxwx swizzle(glm::Z, glm::X, glm::W, glm::X) +#define wxwx swizzle(glm::W, glm::X, glm::W, glm::X) +#define xywx swizzle(glm::X, glm::Y, glm::W, glm::X) +#define yywx swizzle(glm::Y, glm::Y, glm::W, glm::X) +#define zywx swizzle(glm::Z, glm::Y, glm::W, glm::X) +#define wywx swizzle(glm::W, glm::Y, glm::W, glm::X) +#define xzwx swizzle(glm::X, glm::Z, glm::W, glm::X) +#define yzwx swizzle(glm::Y, glm::Z, glm::W, glm::X) +#define zzwx swizzle(glm::Z, glm::Z, glm::W, glm::X) +#define wzwx swizzle(glm::W, glm::Z, glm::W, glm::X) +#define xwwx swizzle(glm::X, glm::W, glm::W, glm::X) +#define ywwx swizzle(glm::Y, glm::W, glm::W, glm::X) +#define zwwx swizzle(glm::Z, glm::W, glm::W, glm::X) +#define wwwx swizzle(glm::W, glm::W, glm::W, glm::X) +#define xxxy swizzle(glm::X, glm::X, glm::X, glm::Y) +#define yxxy swizzle(glm::Y, glm::X, glm::X, glm::Y) +#define zxxy swizzle(glm::Z, glm::X, glm::X, glm::Y) +#define wxxy swizzle(glm::W, glm::X, glm::X, glm::Y) +#define xyxy swizzle(glm::X, glm::Y, glm::X, glm::Y) +#define yyxy swizzle(glm::Y, glm::Y, glm::X, glm::Y) +#define zyxy swizzle(glm::Z, glm::Y, glm::X, glm::Y) +#define wyxy swizzle(glm::W, glm::Y, glm::X, glm::Y) +#define xzxy swizzle(glm::X, glm::Z, glm::X, glm::Y) +#define yzxy swizzle(glm::Y, glm::Z, glm::X, glm::Y) +#define zzxy swizzle(glm::Z, glm::Z, glm::X, glm::Y) +#define wzxy swizzle(glm::W, glm::Z, glm::X, glm::Y) +#define xwxy swizzle(glm::X, glm::W, glm::X, glm::Y) +#define ywxy swizzle(glm::Y, glm::W, glm::X, glm::Y) +#define zwxy swizzle(glm::Z, glm::W, glm::X, glm::Y) +#define wwxy swizzle(glm::W, glm::W, glm::X, glm::Y) +#define xxyy swizzle(glm::X, glm::X, glm::Y, glm::Y) +#define yxyy swizzle(glm::Y, glm::X, glm::Y, glm::Y) +#define zxyy swizzle(glm::Z, glm::X, glm::Y, glm::Y) +#define wxyy swizzle(glm::W, glm::X, glm::Y, glm::Y) +#define xyyy swizzle(glm::X, glm::Y, glm::Y, glm::Y) +#define yyyy swizzle(glm::Y, glm::Y, glm::Y, glm::Y) +#define zyyy swizzle(glm::Z, glm::Y, glm::Y, glm::Y) +#define wyyy swizzle(glm::W, glm::Y, glm::Y, glm::Y) +#define xzyy swizzle(glm::X, glm::Z, glm::Y, glm::Y) +#define yzyy swizzle(glm::Y, glm::Z, glm::Y, glm::Y) +#define zzyy swizzle(glm::Z, glm::Z, glm::Y, glm::Y) +#define wzyy swizzle(glm::W, glm::Z, glm::Y, glm::Y) +#define xwyy swizzle(glm::X, glm::W, glm::Y, glm::Y) +#define ywyy swizzle(glm::Y, glm::W, glm::Y, glm::Y) +#define zwyy swizzle(glm::Z, glm::W, glm::Y, glm::Y) +#define wwyy swizzle(glm::W, glm::W, glm::Y, glm::Y) +#define xxzy swizzle(glm::X, glm::X, glm::Z, glm::Y) +#define yxzy swizzle(glm::Y, glm::X, glm::Z, glm::Y) +#define zxzy swizzle(glm::Z, glm::X, glm::Z, glm::Y) +#define wxzy swizzle(glm::W, glm::X, glm::Z, glm::Y) +#define xyzy swizzle(glm::X, glm::Y, glm::Z, glm::Y) +#define yyzy swizzle(glm::Y, glm::Y, glm::Z, glm::Y) +#define zyzy swizzle(glm::Z, glm::Y, glm::Z, glm::Y) +#define wyzy swizzle(glm::W, glm::Y, glm::Z, glm::Y) +#define xzzy swizzle(glm::X, glm::Z, glm::Z, glm::Y) +#define yzzy swizzle(glm::Y, glm::Z, glm::Z, glm::Y) +#define zzzy swizzle(glm::Z, glm::Z, glm::Z, glm::Y) +#define wzzy swizzle(glm::W, glm::Z, glm::Z, glm::Y) +#define xwzy swizzle(glm::X, glm::W, glm::Z, glm::Y) +#define ywzy swizzle(glm::Y, glm::W, glm::Z, glm::Y) +#define zwzy swizzle(glm::Z, glm::W, glm::Z, glm::Y) +#define wwzy swizzle(glm::W, glm::W, glm::Z, glm::Y) +#define xxwy swizzle(glm::X, glm::X, glm::W, glm::Y) +#define yxwy swizzle(glm::Y, glm::X, glm::W, glm::Y) +#define zxwy swizzle(glm::Z, glm::X, glm::W, glm::Y) +#define wxwy swizzle(glm::W, glm::X, glm::W, glm::Y) +#define xywy swizzle(glm::X, glm::Y, glm::W, glm::Y) +#define yywy swizzle(glm::Y, glm::Y, glm::W, glm::Y) +#define zywy swizzle(glm::Z, glm::Y, glm::W, glm::Y) +#define wywy swizzle(glm::W, glm::Y, glm::W, glm::Y) +#define xzwy swizzle(glm::X, glm::Z, glm::W, glm::Y) +#define yzwy swizzle(glm::Y, glm::Z, glm::W, glm::Y) +#define zzwy swizzle(glm::Z, glm::Z, glm::W, glm::Y) +#define wzwy swizzle(glm::W, glm::Z, glm::W, glm::Y) +#define xwwy swizzle(glm::X, glm::W, glm::W, glm::Y) +#define ywwy swizzle(glm::Y, glm::W, glm::W, glm::Y) +#define zwwy swizzle(glm::Z, glm::W, glm::W, glm::Y) +#define wwwy swizzle(glm::W, glm::W, glm::W, glm::Y) +#define xxxz swizzle(glm::X, glm::X, glm::X, glm::Z) +#define yxxz swizzle(glm::Y, glm::X, glm::X, glm::Z) +#define zxxz swizzle(glm::Z, glm::X, glm::X, glm::Z) +#define wxxz swizzle(glm::W, glm::X, glm::X, glm::Z) +#define xyxz swizzle(glm::X, glm::Y, glm::X, glm::Z) +#define yyxz swizzle(glm::Y, glm::Y, glm::X, glm::Z) +#define zyxz swizzle(glm::Z, glm::Y, glm::X, glm::Z) +#define wyxz swizzle(glm::W, glm::Y, glm::X, glm::Z) +#define xzxz swizzle(glm::X, glm::Z, glm::X, glm::Z) +#define yzxz swizzle(glm::Y, glm::Z, glm::X, glm::Z) +#define zzxz swizzle(glm::Z, glm::Z, glm::X, glm::Z) +#define wzxz swizzle(glm::W, glm::Z, glm::X, glm::Z) +#define xwxz swizzle(glm::X, glm::W, glm::X, glm::Z) +#define ywxz swizzle(glm::Y, glm::W, glm::X, glm::Z) +#define zwxz swizzle(glm::Z, glm::W, glm::X, glm::Z) +#define wwxz swizzle(glm::W, glm::W, glm::X, glm::Z) +#define xxyz swizzle(glm::X, glm::X, glm::Y, glm::Z) +#define yxyz swizzle(glm::Y, glm::X, glm::Y, glm::Z) +#define zxyz swizzle(glm::Z, glm::X, glm::Y, glm::Z) +#define wxyz swizzle(glm::W, glm::X, glm::Y, glm::Z) +#define xyyz swizzle(glm::X, glm::Y, glm::Y, glm::Z) +#define yyyz swizzle(glm::Y, glm::Y, glm::Y, glm::Z) +#define zyyz swizzle(glm::Z, glm::Y, glm::Y, glm::Z) +#define wyyz swizzle(glm::W, glm::Y, glm::Y, glm::Z) +#define xzyz swizzle(glm::X, glm::Z, glm::Y, glm::Z) +#define yzyz swizzle(glm::Y, glm::Z, glm::Y, glm::Z) +#define zzyz swizzle(glm::Z, glm::Z, glm::Y, glm::Z) +#define wzyz swizzle(glm::W, glm::Z, glm::Y, glm::Z) +#define xwyz swizzle(glm::X, glm::W, glm::Y, glm::Z) +#define ywyz swizzle(glm::Y, glm::W, glm::Y, glm::Z) +#define zwyz swizzle(glm::Z, glm::W, glm::Y, glm::Z) +#define wwyz swizzle(glm::W, glm::W, glm::Y, glm::Z) +#define xxzz swizzle(glm::X, glm::X, glm::Z, glm::Z) +#define yxzz swizzle(glm::Y, glm::X, glm::Z, glm::Z) +#define zxzz swizzle(glm::Z, glm::X, glm::Z, glm::Z) +#define wxzz swizzle(glm::W, glm::X, glm::Z, glm::Z) +#define xyzz swizzle(glm::X, glm::Y, glm::Z, glm::Z) +#define yyzz swizzle(glm::Y, glm::Y, glm::Z, glm::Z) +#define zyzz swizzle(glm::Z, glm::Y, glm::Z, glm::Z) +#define wyzz swizzle(glm::W, glm::Y, glm::Z, glm::Z) +#define xzzz swizzle(glm::X, glm::Z, glm::Z, glm::Z) +#define yzzz swizzle(glm::Y, glm::Z, glm::Z, glm::Z) +#define zzzz swizzle(glm::Z, glm::Z, glm::Z, glm::Z) +#define wzzz swizzle(glm::W, glm::Z, glm::Z, glm::Z) +#define xwzz swizzle(glm::X, glm::W, glm::Z, glm::Z) +#define ywzz swizzle(glm::Y, glm::W, glm::Z, glm::Z) +#define zwzz swizzle(glm::Z, glm::W, glm::Z, glm::Z) +#define wwzz swizzle(glm::W, glm::W, glm::Z, glm::Z) +#define xxwz swizzle(glm::X, glm::X, glm::W, glm::Z) +#define yxwz swizzle(glm::Y, glm::X, glm::W, glm::Z) +#define zxwz swizzle(glm::Z, glm::X, glm::W, glm::Z) +#define wxwz swizzle(glm::W, glm::X, glm::W, glm::Z) +#define xywz swizzle(glm::X, glm::Y, glm::W, glm::Z) +#define yywz swizzle(glm::Y, glm::Y, glm::W, glm::Z) +#define zywz swizzle(glm::Z, glm::Y, glm::W, glm::Z) +#define wywz swizzle(glm::W, glm::Y, glm::W, glm::Z) +#define xzwz swizzle(glm::X, glm::Z, glm::W, glm::Z) +#define yzwz swizzle(glm::Y, glm::Z, glm::W, glm::Z) +#define zzwz swizzle(glm::Z, glm::Z, glm::W, glm::Z) +#define wzwz swizzle(glm::W, glm::Z, glm::W, glm::Z) +#define xwwz swizzle(glm::X, glm::W, glm::W, glm::Z) +#define ywwz swizzle(glm::Y, glm::W, glm::W, glm::Z) +#define zwwz swizzle(glm::Z, glm::W, glm::W, glm::Z) +#define wwwz swizzle(glm::W, glm::W, glm::W, glm::Z) +#define xxxw swizzle(glm::X, glm::X, glm::X, glm::W) +#define yxxw swizzle(glm::Y, glm::X, glm::X, glm::W) +#define zxxw swizzle(glm::Z, glm::X, glm::X, glm::W) +#define wxxw swizzle(glm::W, glm::X, glm::X, glm::W) +#define xyxw swizzle(glm::X, glm::Y, glm::X, glm::W) +#define yyxw swizzle(glm::Y, glm::Y, glm::X, glm::W) +#define zyxw swizzle(glm::Z, glm::Y, glm::X, glm::W) +#define wyxw swizzle(glm::W, glm::Y, glm::X, glm::W) +#define xzxw swizzle(glm::X, glm::Z, glm::X, glm::W) +#define yzxw swizzle(glm::Y, glm::Z, glm::X, glm::W) +#define zzxw swizzle(glm::Z, glm::Z, glm::X, glm::W) +#define wzxw swizzle(glm::W, glm::Z, glm::X, glm::W) +#define xwxw swizzle(glm::X, glm::W, glm::X, glm::W) +#define ywxw swizzle(glm::Y, glm::W, glm::X, glm::W) +#define zwxw swizzle(glm::Z, glm::W, glm::X, glm::W) +#define wwxw swizzle(glm::W, glm::W, glm::X, glm::W) +#define xxyw swizzle(glm::X, glm::X, glm::Y, glm::W) +#define yxyw swizzle(glm::Y, glm::X, glm::Y, glm::W) +#define zxyw swizzle(glm::Z, glm::X, glm::Y, glm::W) +#define wxyw swizzle(glm::W, glm::X, glm::Y, glm::W) +#define xyyw swizzle(glm::X, glm::Y, glm::Y, glm::W) +#define yyyw swizzle(glm::Y, glm::Y, glm::Y, glm::W) +#define zyyw swizzle(glm::Z, glm::Y, glm::Y, glm::W) +#define wyyw swizzle(glm::W, glm::Y, glm::Y, glm::W) +#define xzyw swizzle(glm::X, glm::Z, glm::Y, glm::W) +#define yzyw swizzle(glm::Y, glm::Z, glm::Y, glm::W) +#define zzyw swizzle(glm::Z, glm::Z, glm::Y, glm::W) +#define wzyw swizzle(glm::W, glm::Z, glm::Y, glm::W) +#define xwyw swizzle(glm::X, glm::W, glm::Y, glm::W) +#define ywyw swizzle(glm::Y, glm::W, glm::Y, glm::W) +#define zwyw swizzle(glm::Z, glm::W, glm::Y, glm::W) +#define wwyw swizzle(glm::W, glm::W, glm::Y, glm::W) +#define xxzw swizzle(glm::X, glm::X, glm::Z, glm::W) +#define yxzw swizzle(glm::Y, glm::X, glm::Z, glm::W) +#define zxzw swizzle(glm::Z, glm::X, glm::Z, glm::W) +#define wxzw swizzle(glm::W, glm::X, glm::Z, glm::W) +#define xyzw swizzle(glm::X, glm::Y, glm::Z, glm::W) +#define yyzw swizzle(glm::Y, glm::Y, glm::Z, glm::W) +#define zyzw swizzle(glm::Z, glm::Y, glm::Z, glm::W) +#define wyzw swizzle(glm::W, glm::Y, glm::Z, glm::W) +#define xzzw swizzle(glm::X, glm::Z, glm::Z, glm::W) +#define yzzw swizzle(glm::Y, glm::Z, glm::Z, glm::W) +#define zzzw swizzle(glm::Z, glm::Z, glm::Z, glm::W) +#define wzzw swizzle(glm::W, glm::Z, glm::Z, glm::W) +#define xwzw swizzle(glm::X, glm::W, glm::Z, glm::W) +#define ywzw swizzle(glm::Y, glm::W, glm::Z, glm::W) +#define zwzw swizzle(glm::Z, glm::W, glm::Z, glm::W) +#define wwzw swizzle(glm::W, glm::W, glm::Z, glm::W) +#define xxww swizzle(glm::X, glm::X, glm::W, glm::W) +#define yxww swizzle(glm::Y, glm::X, glm::W, glm::W) +#define zxww swizzle(glm::Z, glm::X, glm::W, glm::W) +#define wxww swizzle(glm::W, glm::X, glm::W, glm::W) +#define xyww swizzle(glm::X, glm::Y, glm::W, glm::W) +#define yyww swizzle(glm::Y, glm::Y, glm::W, glm::W) +#define zyww swizzle(glm::Z, glm::Y, glm::W, glm::W) +#define wyww swizzle(glm::W, glm::Y, glm::W, glm::W) +#define xzww swizzle(glm::X, glm::Z, glm::W, glm::W) +#define yzww swizzle(glm::Y, glm::Z, glm::W, glm::W) +#define zzww swizzle(glm::Z, glm::Z, glm::W, glm::W) +#define wzww swizzle(glm::W, glm::Z, glm::W, glm::W) +#define xwww swizzle(glm::X, glm::W, glm::W, glm::W) +#define ywww swizzle(glm::Y, glm::W, glm::W, glm::W) +#define zwww swizzle(glm::Z, glm::W, glm::W, glm::W) +#define wwww swizzle(glm::W, glm::W, glm::W, glm::W) + +#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW) + +#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA) + +#define rrrr swizzle(glm::X, glm::X, glm::X, glm::X) +#define grrr swizzle(glm::Y, glm::X, glm::X, glm::X) +#define brrr swizzle(glm::Z, glm::X, glm::X, glm::X) +#define arrr swizzle(glm::W, glm::X, glm::X, glm::X) +#define rgrr swizzle(glm::X, glm::Y, glm::X, glm::X) +#define ggrr swizzle(glm::Y, glm::Y, glm::X, glm::X) +#define bgrr swizzle(glm::Z, glm::Y, glm::X, glm::X) +#define agrr swizzle(glm::W, glm::Y, glm::X, glm::X) +#define rbrr swizzle(glm::X, glm::Z, glm::X, glm::X) +#define gbrr swizzle(glm::Y, glm::Z, glm::X, glm::X) +#define bbrr swizzle(glm::Z, glm::Z, glm::X, glm::X) +#define abrr swizzle(glm::W, glm::Z, glm::X, glm::X) +#define rarr swizzle(glm::X, glm::W, glm::X, glm::X) +#define garr swizzle(glm::Y, glm::W, glm::X, glm::X) +#define barr swizzle(glm::Z, glm::W, glm::X, glm::X) +#define aarr swizzle(glm::W, glm::W, glm::X, glm::X) +#define rrgr swizzle(glm::X, glm::X, glm::Y, glm::X) +#define grgr swizzle(glm::Y, glm::X, glm::Y, glm::X) +#define brgr swizzle(glm::Z, glm::X, glm::Y, glm::X) +#define argr swizzle(glm::W, glm::X, glm::Y, glm::X) +#define rggr swizzle(glm::X, glm::Y, glm::Y, glm::X) +#define gggr swizzle(glm::Y, glm::Y, glm::Y, glm::X) +#define bggr swizzle(glm::Z, glm::Y, glm::Y, glm::X) +#define aggr swizzle(glm::W, glm::Y, glm::Y, glm::X) +#define rbgr swizzle(glm::X, glm::Z, glm::Y, glm::X) +#define gbgr swizzle(glm::Y, glm::Z, glm::Y, glm::X) +#define bbgr swizzle(glm::Z, glm::Z, glm::Y, glm::X) +#define abgr swizzle(glm::W, glm::Z, glm::Y, glm::X) +#define ragr swizzle(glm::X, glm::W, glm::Y, glm::X) +#define gagr swizzle(glm::Y, glm::W, glm::Y, glm::X) +#define bagr swizzle(glm::Z, glm::W, glm::Y, glm::X) +#define aagr swizzle(glm::W, glm::W, glm::Y, glm::X) +#define rrbr swizzle(glm::X, glm::X, glm::Z, glm::X) +#define grbr swizzle(glm::Y, glm::X, glm::Z, glm::X) +#define brbr swizzle(glm::Z, glm::X, glm::Z, glm::X) +#define arbr swizzle(glm::W, glm::X, glm::Z, glm::X) +#define rgbr swizzle(glm::X, glm::Y, glm::Z, glm::X) +#define ggbr swizzle(glm::Y, glm::Y, glm::Z, glm::X) +#define bgbr swizzle(glm::Z, glm::Y, glm::Z, glm::X) +#define agbr swizzle(glm::W, glm::Y, glm::Z, glm::X) +#define rbbr swizzle(glm::X, glm::Z, glm::Z, glm::X) +#define gbbr swizzle(glm::Y, glm::Z, glm::Z, glm::X) +#define bbbr swizzle(glm::Z, glm::Z, glm::Z, glm::X) +#define abbr swizzle(glm::W, glm::Z, glm::Z, glm::X) +#define rabr swizzle(glm::X, glm::W, glm::Z, glm::X) +#define gabr swizzle(glm::Y, glm::W, glm::Z, glm::X) +#define babr swizzle(glm::Z, glm::W, glm::Z, glm::X) +#define aabr swizzle(glm::W, glm::W, glm::Z, glm::X) +#define rrar swizzle(glm::X, glm::X, glm::W, glm::X) +#define grar swizzle(glm::Y, glm::X, glm::W, glm::X) +#define brar swizzle(glm::Z, glm::X, glm::W, glm::X) +#define arar swizzle(glm::W, glm::X, glm::W, glm::X) +#define rgar swizzle(glm::X, glm::Y, glm::W, glm::X) +#define ggar swizzle(glm::Y, glm::Y, glm::W, glm::X) +#define bgar swizzle(glm::Z, glm::Y, glm::W, glm::X) +#define agar swizzle(glm::W, glm::Y, glm::W, glm::X) +#define rbar swizzle(glm::X, glm::Z, glm::W, glm::X) +#define gbar swizzle(glm::Y, glm::Z, glm::W, glm::X) +#define bbar swizzle(glm::Z, glm::Z, glm::W, glm::X) +#define abar swizzle(glm::W, glm::Z, glm::W, glm::X) +#define raar swizzle(glm::X, glm::W, glm::W, glm::X) +#define gaar swizzle(glm::Y, glm::W, glm::W, glm::X) +#define baar swizzle(glm::Z, glm::W, glm::W, glm::X) +#define aaar swizzle(glm::W, glm::W, glm::W, glm::X) +#define rrrg swizzle(glm::X, glm::X, glm::X, glm::Y) +#define grrg swizzle(glm::Y, glm::X, glm::X, glm::Y) +#define brrg swizzle(glm::Z, glm::X, glm::X, glm::Y) +#define arrg swizzle(glm::W, glm::X, glm::X, glm::Y) +#define rgrg swizzle(glm::X, glm::Y, glm::X, glm::Y) +#define ggrg swizzle(glm::Y, glm::Y, glm::X, glm::Y) +#define bgrg swizzle(glm::Z, glm::Y, glm::X, glm::Y) +#define agrg swizzle(glm::W, glm::Y, glm::X, glm::Y) +#define rbrg swizzle(glm::X, glm::Z, glm::X, glm::Y) +#define gbrg swizzle(glm::Y, glm::Z, glm::X, glm::Y) +#define bbrg swizzle(glm::Z, glm::Z, glm::X, glm::Y) +#define abrg swizzle(glm::W, glm::Z, glm::X, glm::Y) +#define rarg swizzle(glm::X, glm::W, glm::X, glm::Y) +#define garg swizzle(glm::Y, glm::W, glm::X, glm::Y) +#define barg swizzle(glm::Z, glm::W, glm::X, glm::Y) +#define aarg swizzle(glm::W, glm::W, glm::X, glm::Y) +#define rrgg swizzle(glm::X, glm::X, glm::Y, glm::Y) +#define grgg swizzle(glm::Y, glm::X, glm::Y, glm::Y) +#define brgg swizzle(glm::Z, glm::X, glm::Y, glm::Y) +#define argg swizzle(glm::W, glm::X, glm::Y, glm::Y) +#define rggg swizzle(glm::X, glm::Y, glm::Y, glm::Y) +#define gggg swizzle(glm::Y, glm::Y, glm::Y, glm::Y) +#define bggg swizzle(glm::Z, glm::Y, glm::Y, glm::Y) +#define aggg swizzle(glm::W, glm::Y, glm::Y, glm::Y) +#define rbgg swizzle(glm::X, glm::Z, glm::Y, glm::Y) +#define gbgg swizzle(glm::Y, glm::Z, glm::Y, glm::Y) +#define bbgg swizzle(glm::Z, glm::Z, glm::Y, glm::Y) +#define abgg swizzle(glm::W, glm::Z, glm::Y, glm::Y) +#define ragg swizzle(glm::X, glm::W, glm::Y, glm::Y) +#define gagg swizzle(glm::Y, glm::W, glm::Y, glm::Y) +#define bagg swizzle(glm::Z, glm::W, glm::Y, glm::Y) +#define aagg swizzle(glm::W, glm::W, glm::Y, glm::Y) +#define rrbg swizzle(glm::X, glm::X, glm::Z, glm::Y) +#define grbg swizzle(glm::Y, glm::X, glm::Z, glm::Y) +#define brbg swizzle(glm::Z, glm::X, glm::Z, glm::Y) +#define arbg swizzle(glm::W, glm::X, glm::Z, glm::Y) +#define rgbg swizzle(glm::X, glm::Y, glm::Z, glm::Y) +#define ggbg swizzle(glm::Y, glm::Y, glm::Z, glm::Y) +#define bgbg swizzle(glm::Z, glm::Y, glm::Z, glm::Y) +#define agbg swizzle(glm::W, glm::Y, glm::Z, glm::Y) +#define rbbg swizzle(glm::X, glm::Z, glm::Z, glm::Y) +#define gbbg swizzle(glm::Y, glm::Z, glm::Z, glm::Y) +#define bbbg swizzle(glm::Z, glm::Z, glm::Z, glm::Y) +#define abbg swizzle(glm::W, glm::Z, glm::Z, glm::Y) +#define rabg swizzle(glm::X, glm::W, glm::Z, glm::Y) +#define gabg swizzle(glm::Y, glm::W, glm::Z, glm::Y) +#define babg swizzle(glm::Z, glm::W, glm::Z, glm::Y) +#define aabg swizzle(glm::W, glm::W, glm::Z, glm::Y) +#define rrag swizzle(glm::X, glm::X, glm::W, glm::Y) +#define grag swizzle(glm::Y, glm::X, glm::W, glm::Y) +#define brag swizzle(glm::Z, glm::X, glm::W, glm::Y) +#define arag swizzle(glm::W, glm::X, glm::W, glm::Y) +#define rgag swizzle(glm::X, glm::Y, glm::W, glm::Y) +#define ggag swizzle(glm::Y, glm::Y, glm::W, glm::Y) +#define bgag swizzle(glm::Z, glm::Y, glm::W, glm::Y) +#define agag swizzle(glm::W, glm::Y, glm::W, glm::Y) +#define rbag swizzle(glm::X, glm::Z, glm::W, glm::Y) +#define gbag swizzle(glm::Y, glm::Z, glm::W, glm::Y) +#define bbag swizzle(glm::Z, glm::Z, glm::W, glm::Y) +#define abag swizzle(glm::W, glm::Z, glm::W, glm::Y) +#define raag swizzle(glm::X, glm::W, glm::W, glm::Y) +#define gaag swizzle(glm::Y, glm::W, glm::W, glm::Y) +#define baag swizzle(glm::Z, glm::W, glm::W, glm::Y) +#define aaag swizzle(glm::W, glm::W, glm::W, glm::Y) +#define rrrb swizzle(glm::X, glm::X, glm::X, glm::Z) +#define grrb swizzle(glm::Y, glm::X, glm::X, glm::Z) +#define brrb swizzle(glm::Z, glm::X, glm::X, glm::Z) +#define arrb swizzle(glm::W, glm::X, glm::X, glm::Z) +#define rgrb swizzle(glm::X, glm::Y, glm::X, glm::Z) +#define ggrb swizzle(glm::Y, glm::Y, glm::X, glm::Z) +#define bgrb swizzle(glm::Z, glm::Y, glm::X, glm::Z) +#define agrb swizzle(glm::W, glm::Y, glm::X, glm::Z) +#define rbrb swizzle(glm::X, glm::Z, glm::X, glm::Z) +#define gbrb swizzle(glm::Y, glm::Z, glm::X, glm::Z) +#define bbrb swizzle(glm::Z, glm::Z, glm::X, glm::Z) +#define abrb swizzle(glm::W, glm::Z, glm::X, glm::Z) +#define rarb swizzle(glm::X, glm::W, glm::X, glm::Z) +#define garb swizzle(glm::Y, glm::W, glm::X, glm::Z) +#define barb swizzle(glm::Z, glm::W, glm::X, glm::Z) +#define aarb swizzle(glm::W, glm::W, glm::X, glm::Z) +#define rrgb swizzle(glm::X, glm::X, glm::Y, glm::Z) +#define grgb swizzle(glm::Y, glm::X, glm::Y, glm::Z) +#define brgb swizzle(glm::Z, glm::X, glm::Y, glm::Z) +#define argb swizzle(glm::W, glm::X, glm::Y, glm::Z) +#define rggb swizzle(glm::X, glm::Y, glm::Y, glm::Z) +#define gggb swizzle(glm::Y, glm::Y, glm::Y, glm::Z) +#define bggb swizzle(glm::Z, glm::Y, glm::Y, glm::Z) +#define aggb swizzle(glm::W, glm::Y, glm::Y, glm::Z) +#define rbgb swizzle(glm::X, glm::Z, glm::Y, glm::Z) +#define gbgb swizzle(glm::Y, glm::Z, glm::Y, glm::Z) +#define bbgb swizzle(glm::Z, glm::Z, glm::Y, glm::Z) +#define abgb swizzle(glm::W, glm::Z, glm::Y, glm::Z) +#define ragb swizzle(glm::X, glm::W, glm::Y, glm::Z) +#define gagb swizzle(glm::Y, glm::W, glm::Y, glm::Z) +#define bagb swizzle(glm::Z, glm::W, glm::Y, glm::Z) +#define aagb swizzle(glm::W, glm::W, glm::Y, glm::Z) +#define rrbb swizzle(glm::X, glm::X, glm::Z, glm::Z) +#define grbb swizzle(glm::Y, glm::X, glm::Z, glm::Z) +#define brbb swizzle(glm::Z, glm::X, glm::Z, glm::Z) +#define arbb swizzle(glm::W, glm::X, glm::Z, glm::Z) +#define rgbb swizzle(glm::X, glm::Y, glm::Z, glm::Z) +#define ggbb swizzle(glm::Y, glm::Y, glm::Z, glm::Z) +#define bgbb swizzle(glm::Z, glm::Y, glm::Z, glm::Z) +#define agbb swizzle(glm::W, glm::Y, glm::Z, glm::Z) +#define rbbb swizzle(glm::X, glm::Z, glm::Z, glm::Z) +#define gbbb swizzle(glm::Y, glm::Z, glm::Z, glm::Z) +#define bbbb swizzle(glm::Z, glm::Z, glm::Z, glm::Z) +#define abbb swizzle(glm::W, glm::Z, glm::Z, glm::Z) +#define rabb swizzle(glm::X, glm::W, glm::Z, glm::Z) +#define gabb swizzle(glm::Y, glm::W, glm::Z, glm::Z) +#define babb swizzle(glm::Z, glm::W, glm::Z, glm::Z) +#define aabb swizzle(glm::W, glm::W, glm::Z, glm::Z) +#define rrab swizzle(glm::X, glm::X, glm::W, glm::Z) +#define grab swizzle(glm::Y, glm::X, glm::W, glm::Z) +#define brab swizzle(glm::Z, glm::X, glm::W, glm::Z) +#define arab swizzle(glm::W, glm::X, glm::W, glm::Z) +#define rgab swizzle(glm::X, glm::Y, glm::W, glm::Z) +#define ggab swizzle(glm::Y, glm::Y, glm::W, glm::Z) +#define bgab swizzle(glm::Z, glm::Y, glm::W, glm::Z) +#define agab swizzle(glm::W, glm::Y, glm::W, glm::Z) +#define rbab swizzle(glm::X, glm::Z, glm::W, glm::Z) +#define gbab swizzle(glm::Y, glm::Z, glm::W, glm::Z) +#define bbab swizzle(glm::Z, glm::Z, glm::W, glm::Z) +#define abab swizzle(glm::W, glm::Z, glm::W, glm::Z) +#define raab swizzle(glm::X, glm::W, glm::W, glm::Z) +#define gaab swizzle(glm::Y, glm::W, glm::W, glm::Z) +#define baab swizzle(glm::Z, glm::W, glm::W, glm::Z) +#define aaab swizzle(glm::W, glm::W, glm::W, glm::Z) +#define rrra swizzle(glm::X, glm::X, glm::X, glm::W) +#define grra swizzle(glm::Y, glm::X, glm::X, glm::W) +#define brra swizzle(glm::Z, glm::X, glm::X, glm::W) +#define arra swizzle(glm::W, glm::X, glm::X, glm::W) +#define rgra swizzle(glm::X, glm::Y, glm::X, glm::W) +#define ggra swizzle(glm::Y, glm::Y, glm::X, glm::W) +#define bgra swizzle(glm::Z, glm::Y, glm::X, glm::W) +#define agra swizzle(glm::W, glm::Y, glm::X, glm::W) +#define rbra swizzle(glm::X, glm::Z, glm::X, glm::W) +#define gbra swizzle(glm::Y, glm::Z, glm::X, glm::W) +#define bbra swizzle(glm::Z, glm::Z, glm::X, glm::W) +#define abra swizzle(glm::W, glm::Z, glm::X, glm::W) +#define rara swizzle(glm::X, glm::W, glm::X, glm::W) +#define gara swizzle(glm::Y, glm::W, glm::X, glm::W) +#define bara swizzle(glm::Z, glm::W, glm::X, glm::W) +#define aara swizzle(glm::W, glm::W, glm::X, glm::W) +#define rrga swizzle(glm::X, glm::X, glm::Y, glm::W) +#define grga swizzle(glm::Y, glm::X, glm::Y, glm::W) +#define brga swizzle(glm::Z, glm::X, glm::Y, glm::W) +#define arga swizzle(glm::W, glm::X, glm::Y, glm::W) +#define rgga swizzle(glm::X, glm::Y, glm::Y, glm::W) +#define ggga swizzle(glm::Y, glm::Y, glm::Y, glm::W) +#define bgga swizzle(glm::Z, glm::Y, glm::Y, glm::W) +#define agga swizzle(glm::W, glm::Y, glm::Y, glm::W) +#define rbga swizzle(glm::X, glm::Z, glm::Y, glm::W) +#define gbga swizzle(glm::Y, glm::Z, glm::Y, glm::W) +#define bbga swizzle(glm::Z, glm::Z, glm::Y, glm::W) +#define abga swizzle(glm::W, glm::Z, glm::Y, glm::W) +#define raga swizzle(glm::X, glm::W, glm::Y, glm::W) +#define gaga swizzle(glm::Y, glm::W, glm::Y, glm::W) +#define baga swizzle(glm::Z, glm::W, glm::Y, glm::W) +#define aaga swizzle(glm::W, glm::W, glm::Y, glm::W) +#define rrba swizzle(glm::X, glm::X, glm::Z, glm::W) +#define grba swizzle(glm::Y, glm::X, glm::Z, glm::W) +#define brba swizzle(glm::Z, glm::X, glm::Z, glm::W) +#define arba swizzle(glm::W, glm::X, glm::Z, glm::W) +#define rgba swizzle(glm::X, glm::Y, glm::Z, glm::W) +#define ggba swizzle(glm::Y, glm::Y, glm::Z, glm::W) +#define bgba swizzle(glm::Z, glm::Y, glm::Z, glm::W) +#define agba swizzle(glm::W, glm::Y, glm::Z, glm::W) +#define rbba swizzle(glm::X, glm::Z, glm::Z, glm::W) +#define gbba swizzle(glm::Y, glm::Z, glm::Z, glm::W) +#define bbba swizzle(glm::Z, glm::Z, glm::Z, glm::W) +#define abba swizzle(glm::W, glm::Z, glm::Z, glm::W) +#define raba swizzle(glm::X, glm::W, glm::Z, glm::W) +#define gaba swizzle(glm::Y, glm::W, glm::Z, glm::W) +#define baba swizzle(glm::Z, glm::W, glm::Z, glm::W) +#define aaba swizzle(glm::W, glm::W, glm::Z, glm::W) +#define rraa swizzle(glm::X, glm::X, glm::W, glm::W) +#define graa swizzle(glm::Y, glm::X, glm::W, glm::W) +#define braa swizzle(glm::Z, glm::X, glm::W, glm::W) +#define araa swizzle(glm::W, glm::X, glm::W, glm::W) +#define rgaa swizzle(glm::X, glm::Y, glm::W, glm::W) +#define ggaa swizzle(glm::Y, glm::Y, glm::W, glm::W) +#define bgaa swizzle(glm::Z, glm::Y, glm::W, glm::W) +#define agaa swizzle(glm::W, glm::Y, glm::W, glm::W) +#define rbaa swizzle(glm::X, glm::Z, glm::W, glm::W) +#define gbaa swizzle(glm::Y, glm::Z, glm::W, glm::W) +#define bbaa swizzle(glm::Z, glm::Z, glm::W, glm::W) +#define abaa swizzle(glm::W, glm::Z, glm::W, glm::W) +#define raaa swizzle(glm::X, glm::W, glm::W, glm::W) +#define gaaa swizzle(glm::Y, glm::W, glm::W, glm::W) +#define baaa swizzle(glm::Z, glm::W, glm::W, glm::W) +#define aaaa swizzle(glm::W, glm::W, glm::W, glm::W) + +#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA) + +#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ) + +#define ssss swizzle(glm::X, glm::X, glm::X, glm::X) +#define tsss swizzle(glm::Y, glm::X, glm::X, glm::X) +#define psss swizzle(glm::Z, glm::X, glm::X, glm::X) +#define qsss swizzle(glm::W, glm::X, glm::X, glm::X) +#define stss swizzle(glm::X, glm::Y, glm::X, glm::X) +#define ttss swizzle(glm::Y, glm::Y, glm::X, glm::X) +#define ptss swizzle(glm::Z, glm::Y, glm::X, glm::X) +#define qtss swizzle(glm::W, glm::Y, glm::X, glm::X) +#define spss swizzle(glm::X, glm::Z, glm::X, glm::X) +#define tpss swizzle(glm::Y, glm::Z, glm::X, glm::X) +#define ppss swizzle(glm::Z, glm::Z, glm::X, glm::X) +#define qpss swizzle(glm::W, glm::Z, glm::X, glm::X) +#define sqss swizzle(glm::X, glm::W, glm::X, glm::X) +#define tqss swizzle(glm::Y, glm::W, glm::X, glm::X) +#define pqss swizzle(glm::Z, glm::W, glm::X, glm::X) +#define qqss swizzle(glm::W, glm::W, glm::X, glm::X) +#define ssts swizzle(glm::X, glm::X, glm::Y, glm::X) +#define tsts swizzle(glm::Y, glm::X, glm::Y, glm::X) +#define psts swizzle(glm::Z, glm::X, glm::Y, glm::X) +#define qsts swizzle(glm::W, glm::X, glm::Y, glm::X) +#define stts swizzle(glm::X, glm::Y, glm::Y, glm::X) +#define ttts swizzle(glm::Y, glm::Y, glm::Y, glm::X) +#define ptts swizzle(glm::Z, glm::Y, glm::Y, glm::X) +#define qtts swizzle(glm::W, glm::Y, glm::Y, glm::X) +#define spts swizzle(glm::X, glm::Z, glm::Y, glm::X) +#define tpts swizzle(glm::Y, glm::Z, glm::Y, glm::X) +#define ppts swizzle(glm::Z, glm::Z, glm::Y, glm::X) +#define qpts swizzle(glm::W, glm::Z, glm::Y, glm::X) +#define sqts swizzle(glm::X, glm::W, glm::Y, glm::X) +#define tqts swizzle(glm::Y, glm::W, glm::Y, glm::X) +#define pqts swizzle(glm::Z, glm::W, glm::Y, glm::X) +#define qqts swizzle(glm::W, glm::W, glm::Y, glm::X) +#define ssps swizzle(glm::X, glm::X, glm::Z, glm::X) +#define tsps swizzle(glm::Y, glm::X, glm::Z, glm::X) +#define psps swizzle(glm::Z, glm::X, glm::Z, glm::X) +#define qsps swizzle(glm::W, glm::X, glm::Z, glm::X) +#define stps swizzle(glm::X, glm::Y, glm::Z, glm::X) +#define ttps swizzle(glm::Y, glm::Y, glm::Z, glm::X) +#define ptps swizzle(glm::Z, glm::Y, glm::Z, glm::X) +#define qtps swizzle(glm::W, glm::Y, glm::Z, glm::X) +#define spps swizzle(glm::X, glm::Z, glm::Z, glm::X) +#define tpps swizzle(glm::Y, glm::Z, glm::Z, glm::X) +#define ppps swizzle(glm::Z, glm::Z, glm::Z, glm::X) +#define qpps swizzle(glm::W, glm::Z, glm::Z, glm::X) +#define sqps swizzle(glm::X, glm::W, glm::Z, glm::X) +#define tqps swizzle(glm::Y, glm::W, glm::Z, glm::X) +#define pqps swizzle(glm::Z, glm::W, glm::Z, glm::X) +#define qqps swizzle(glm::W, glm::W, glm::Z, glm::X) +#define ssqs swizzle(glm::X, glm::X, glm::W, glm::X) +#define tsqs swizzle(glm::Y, glm::X, glm::W, glm::X) +#define psqs swizzle(glm::Z, glm::X, glm::W, glm::X) +#define qsqs swizzle(glm::W, glm::X, glm::W, glm::X) +#define stqs swizzle(glm::X, glm::Y, glm::W, glm::X) +#define ttqs swizzle(glm::Y, glm::Y, glm::W, glm::X) +#define ptqs swizzle(glm::Z, glm::Y, glm::W, glm::X) +#define qtqs swizzle(glm::W, glm::Y, glm::W, glm::X) +#define spqs swizzle(glm::X, glm::Z, glm::W, glm::X) +#define tpqs swizzle(glm::Y, glm::Z, glm::W, glm::X) +#define ppqs swizzle(glm::Z, glm::Z, glm::W, glm::X) +#define qpqs swizzle(glm::W, glm::Z, glm::W, glm::X) +#define sqqs swizzle(glm::X, glm::W, glm::W, glm::X) +#define tqqs swizzle(glm::Y, glm::W, glm::W, glm::X) +#define pqqs swizzle(glm::Z, glm::W, glm::W, glm::X) +#define qqqs swizzle(glm::W, glm::W, glm::W, glm::X) +#define ssst swizzle(glm::X, glm::X, glm::X, glm::Y) +#define tsst swizzle(glm::Y, glm::X, glm::X, glm::Y) +#define psst swizzle(glm::Z, glm::X, glm::X, glm::Y) +#define qsst swizzle(glm::W, glm::X, glm::X, glm::Y) +#define stst swizzle(glm::X, glm::Y, glm::X, glm::Y) +#define ttst swizzle(glm::Y, glm::Y, glm::X, glm::Y) +#define ptst swizzle(glm::Z, glm::Y, glm::X, glm::Y) +#define qtst swizzle(glm::W, glm::Y, glm::X, glm::Y) +#define spst swizzle(glm::X, glm::Z, glm::X, glm::Y) +#define tpst swizzle(glm::Y, glm::Z, glm::X, glm::Y) +#define ppst swizzle(glm::Z, glm::Z, glm::X, glm::Y) +#define qpst swizzle(glm::W, glm::Z, glm::X, glm::Y) +#define sqst swizzle(glm::X, glm::W, glm::X, glm::Y) +#define tqst swizzle(glm::Y, glm::W, glm::X, glm::Y) +#define pqst swizzle(glm::Z, glm::W, glm::X, glm::Y) +#define qqst swizzle(glm::W, glm::W, glm::X, glm::Y) +#define sstt swizzle(glm::X, glm::X, glm::Y, glm::Y) +#define tstt swizzle(glm::Y, glm::X, glm::Y, glm::Y) +#define pstt swizzle(glm::Z, glm::X, glm::Y, glm::Y) +#define qstt swizzle(glm::W, glm::X, glm::Y, glm::Y) +#define sttt swizzle(glm::X, glm::Y, glm::Y, glm::Y) +#define tttt swizzle(glm::Y, glm::Y, glm::Y, glm::Y) +#define pttt swizzle(glm::Z, glm::Y, glm::Y, glm::Y) +#define qttt swizzle(glm::W, glm::Y, glm::Y, glm::Y) +#define sptt swizzle(glm::X, glm::Z, glm::Y, glm::Y) +#define tptt swizzle(glm::Y, glm::Z, glm::Y, glm::Y) +#define pptt swizzle(glm::Z, glm::Z, glm::Y, glm::Y) +#define qptt swizzle(glm::W, glm::Z, glm::Y, glm::Y) +#define sqtt swizzle(glm::X, glm::W, glm::Y, glm::Y) +#define tqtt swizzle(glm::Y, glm::W, glm::Y, glm::Y) +#define pqtt swizzle(glm::Z, glm::W, glm::Y, glm::Y) +#define qqtt swizzle(glm::W, glm::W, glm::Y, glm::Y) +#define sspt swizzle(glm::X, glm::X, glm::Z, glm::Y) +#define tspt swizzle(glm::Y, glm::X, glm::Z, glm::Y) +#define pspt swizzle(glm::Z, glm::X, glm::Z, glm::Y) +#define qspt swizzle(glm::W, glm::X, glm::Z, glm::Y) +#define stpt swizzle(glm::X, glm::Y, glm::Z, glm::Y) +#define ttpt swizzle(glm::Y, glm::Y, glm::Z, glm::Y) +#define ptpt swizzle(glm::Z, glm::Y, glm::Z, glm::Y) +#define qtpt swizzle(glm::W, glm::Y, glm::Z, glm::Y) +#define sppt swizzle(glm::X, glm::Z, glm::Z, glm::Y) +#define tppt swizzle(glm::Y, glm::Z, glm::Z, glm::Y) +#define pppt swizzle(glm::Z, glm::Z, glm::Z, glm::Y) +#define qppt swizzle(glm::W, glm::Z, glm::Z, glm::Y) +#define sqpt swizzle(glm::X, glm::W, glm::Z, glm::Y) +#define tqpt swizzle(glm::Y, glm::W, glm::Z, glm::Y) +#define pqpt swizzle(glm::Z, glm::W, glm::Z, glm::Y) +#define qqpt swizzle(glm::W, glm::W, glm::Z, glm::Y) +#define ssqt swizzle(glm::X, glm::X, glm::W, glm::Y) +#define tsqt swizzle(glm::Y, glm::X, glm::W, glm::Y) +#define psqt swizzle(glm::Z, glm::X, glm::W, glm::Y) +#define qsqt swizzle(glm::W, glm::X, glm::W, glm::Y) +#define stqt swizzle(glm::X, glm::Y, glm::W, glm::Y) +#define ttqt swizzle(glm::Y, glm::Y, glm::W, glm::Y) +#define ptqt swizzle(glm::Z, glm::Y, glm::W, glm::Y) +#define qtqt swizzle(glm::W, glm::Y, glm::W, glm::Y) +#define spqt swizzle(glm::X, glm::Z, glm::W, glm::Y) +#define tpqt swizzle(glm::Y, glm::Z, glm::W, glm::Y) +#define ppqt swizzle(glm::Z, glm::Z, glm::W, glm::Y) +#define qpqt swizzle(glm::W, glm::Z, glm::W, glm::Y) +#define sqqt swizzle(glm::X, glm::W, glm::W, glm::Y) +#define tqqt swizzle(glm::Y, glm::W, glm::W, glm::Y) +#define pqqt swizzle(glm::Z, glm::W, glm::W, glm::Y) +#define qqqt swizzle(glm::W, glm::W, glm::W, glm::Y) +#define sssp swizzle(glm::X, glm::X, glm::X, glm::Z) +#define tssp swizzle(glm::Y, glm::X, glm::X, glm::Z) +#define pssp swizzle(glm::Z, glm::X, glm::X, glm::Z) +#define qssp swizzle(glm::W, glm::X, glm::X, glm::Z) +#define stsp swizzle(glm::X, glm::Y, glm::X, glm::Z) +#define ttsp swizzle(glm::Y, glm::Y, glm::X, glm::Z) +#define ptsp swizzle(glm::Z, glm::Y, glm::X, glm::Z) +#define qtsp swizzle(glm::W, glm::Y, glm::X, glm::Z) +#define spsp swizzle(glm::X, glm::Z, glm::X, glm::Z) +#define tpsp swizzle(glm::Y, glm::Z, glm::X, glm::Z) +#define ppsp swizzle(glm::Z, glm::Z, glm::X, glm::Z) +#define qpsp swizzle(glm::W, glm::Z, glm::X, glm::Z) +#define sqsp swizzle(glm::X, glm::W, glm::X, glm::Z) +#define tqsp swizzle(glm::Y, glm::W, glm::X, glm::Z) +#define pqsp swizzle(glm::Z, glm::W, glm::X, glm::Z) +#define qqsp swizzle(glm::W, glm::W, glm::X, glm::Z) +#define sstp swizzle(glm::X, glm::X, glm::Y, glm::Z) +#define tstp swizzle(glm::Y, glm::X, glm::Y, glm::Z) +#define pstp swizzle(glm::Z, glm::X, glm::Y, glm::Z) +#define qstp swizzle(glm::W, glm::X, glm::Y, glm::Z) +#define sttp swizzle(glm::X, glm::Y, glm::Y, glm::Z) +#define tttp swizzle(glm::Y, glm::Y, glm::Y, glm::Z) +#define pttp swizzle(glm::Z, glm::Y, glm::Y, glm::Z) +#define qttp swizzle(glm::W, glm::Y, glm::Y, glm::Z) +#define sptp swizzle(glm::X, glm::Z, glm::Y, glm::Z) +#define tptp swizzle(glm::Y, glm::Z, glm::Y, glm::Z) +#define pptp swizzle(glm::Z, glm::Z, glm::Y, glm::Z) +#define qptp swizzle(glm::W, glm::Z, glm::Y, glm::Z) +#define sqtp swizzle(glm::X, glm::W, glm::Y, glm::Z) +#define tqtp swizzle(glm::Y, glm::W, glm::Y, glm::Z) +#define pqtp swizzle(glm::Z, glm::W, glm::Y, glm::Z) +#define qqtp swizzle(glm::W, glm::W, glm::Y, glm::Z) +#define sspp swizzle(glm::X, glm::X, glm::Z, glm::Z) +#define tspp swizzle(glm::Y, glm::X, glm::Z, glm::Z) +#define pspp swizzle(glm::Z, glm::X, glm::Z, glm::Z) +#define qspp swizzle(glm::W, glm::X, glm::Z, glm::Z) +#define stpp swizzle(glm::X, glm::Y, glm::Z, glm::Z) +#define ttpp swizzle(glm::Y, glm::Y, glm::Z, glm::Z) +#define ptpp swizzle(glm::Z, glm::Y, glm::Z, glm::Z) +#define qtpp swizzle(glm::W, glm::Y, glm::Z, glm::Z) +#define sppp swizzle(glm::X, glm::Z, glm::Z, glm::Z) +#define tppp swizzle(glm::Y, glm::Z, glm::Z, glm::Z) +#define pppp swizzle(glm::Z, glm::Z, glm::Z, glm::Z) +#define qppp swizzle(glm::W, glm::Z, glm::Z, glm::Z) +#define sqpp swizzle(glm::X, glm::W, glm::Z, glm::Z) +#define tqpp swizzle(glm::Y, glm::W, glm::Z, glm::Z) +#define pqpp swizzle(glm::Z, glm::W, glm::Z, glm::Z) +#define qqpp swizzle(glm::W, glm::W, glm::Z, glm::Z) +#define ssqp swizzle(glm::X, glm::X, glm::W, glm::Z) +#define tsqp swizzle(glm::Y, glm::X, glm::W, glm::Z) +#define psqp swizzle(glm::Z, glm::X, glm::W, glm::Z) +#define qsqp swizzle(glm::W, glm::X, glm::W, glm::Z) +#define stqp swizzle(glm::X, glm::Y, glm::W, glm::Z) +#define ttqp swizzle(glm::Y, glm::Y, glm::W, glm::Z) +#define ptqp swizzle(glm::Z, glm::Y, glm::W, glm::Z) +#define qtqp swizzle(glm::W, glm::Y, glm::W, glm::Z) +#define spqp swizzle(glm::X, glm::Z, glm::W, glm::Z) +#define tpqp swizzle(glm::Y, glm::Z, glm::W, glm::Z) +#define ppqp swizzle(glm::Z, glm::Z, glm::W, glm::Z) +#define qpqp swizzle(glm::W, glm::Z, glm::W, glm::Z) +#define sqqp swizzle(glm::X, glm::W, glm::W, glm::Z) +#define tqqp swizzle(glm::Y, glm::W, glm::W, glm::Z) +#define pqqp swizzle(glm::Z, glm::W, glm::W, glm::Z) +#define qqqp swizzle(glm::W, glm::W, glm::W, glm::Z) +#define sssq swizzle(glm::X, glm::X, glm::X, glm::W) +#define tssq swizzle(glm::Y, glm::X, glm::X, glm::W) +#define pssq swizzle(glm::Z, glm::X, glm::X, glm::W) +#define qssq swizzle(glm::W, glm::X, glm::X, glm::W) +#define stsq swizzle(glm::X, glm::Y, glm::X, glm::W) +#define ttsq swizzle(glm::Y, glm::Y, glm::X, glm::W) +#define ptsq swizzle(glm::Z, glm::Y, glm::X, glm::W) +#define qtsq swizzle(glm::W, glm::Y, glm::X, glm::W) +#define spsq swizzle(glm::X, glm::Z, glm::X, glm::W) +#define tpsq swizzle(glm::Y, glm::Z, glm::X, glm::W) +#define ppsq swizzle(glm::Z, glm::Z, glm::X, glm::W) +#define qpsq swizzle(glm::W, glm::Z, glm::X, glm::W) +#define sqsq swizzle(glm::X, glm::W, glm::X, glm::W) +#define tqsq swizzle(glm::Y, glm::W, glm::X, glm::W) +#define pqsq swizzle(glm::Z, glm::W, glm::X, glm::W) +#define qqsq swizzle(glm::W, glm::W, glm::X, glm::W) +#define sstq swizzle(glm::X, glm::X, glm::Y, glm::W) +#define tstq swizzle(glm::Y, glm::X, glm::Y, glm::W) +#define pstq swizzle(glm::Z, glm::X, glm::Y, glm::W) +#define qstq swizzle(glm::W, glm::X, glm::Y, glm::W) +#define sttq swizzle(glm::X, glm::Y, glm::Y, glm::W) +#define tttq swizzle(glm::Y, glm::Y, glm::Y, glm::W) +#define pttq swizzle(glm::Z, glm::Y, glm::Y, glm::W) +#define qttq swizzle(glm::W, glm::Y, glm::Y, glm::W) +#define sptq swizzle(glm::X, glm::Z, glm::Y, glm::W) +#define tptq swizzle(glm::Y, glm::Z, glm::Y, glm::W) +#define pptq swizzle(glm::Z, glm::Z, glm::Y, glm::W) +#define qptq swizzle(glm::W, glm::Z, glm::Y, glm::W) +#define sqtq swizzle(glm::X, glm::W, glm::Y, glm::W) +#define tqtq swizzle(glm::Y, glm::W, glm::Y, glm::W) +#define pqtq swizzle(glm::Z, glm::W, glm::Y, glm::W) +#define qqtq swizzle(glm::W, glm::W, glm::Y, glm::W) +#define sspq swizzle(glm::X, glm::X, glm::Z, glm::W) +#define tspq swizzle(glm::Y, glm::X, glm::Z, glm::W) +#define pspq swizzle(glm::Z, glm::X, glm::Z, glm::W) +#define qspq swizzle(glm::W, glm::X, glm::Z, glm::W) +#define stpq swizzle(glm::X, glm::Y, glm::Z, glm::W) +#define ttpq swizzle(glm::Y, glm::Y, glm::Z, glm::W) +#define ptpq swizzle(glm::Z, glm::Y, glm::Z, glm::W) +#define qtpq swizzle(glm::W, glm::Y, glm::Z, glm::W) +#define sppq swizzle(glm::X, glm::Z, glm::Z, glm::W) +#define tppq swizzle(glm::Y, glm::Z, glm::Z, glm::W) +#define pppq swizzle(glm::Z, glm::Z, glm::Z, glm::W) +#define qppq swizzle(glm::W, glm::Z, glm::Z, glm::W) +#define sqpq swizzle(glm::X, glm::W, glm::Z, glm::W) +#define tqpq swizzle(glm::Y, glm::W, glm::Z, glm::W) +#define pqpq swizzle(glm::Z, glm::W, glm::Z, glm::W) +#define qqpq swizzle(glm::W, glm::W, glm::Z, glm::W) +#define ssqq swizzle(glm::X, glm::X, glm::W, glm::W) +#define tsqq swizzle(glm::Y, glm::X, glm::W, glm::W) +#define psqq swizzle(glm::Z, glm::X, glm::W, glm::W) +#define qsqq swizzle(glm::W, glm::X, glm::W, glm::W) +#define stqq swizzle(glm::X, glm::Y, glm::W, glm::W) +#define ttqq swizzle(glm::Y, glm::Y, glm::W, glm::W) +#define ptqq swizzle(glm::Z, glm::Y, glm::W, glm::W) +#define qtqq swizzle(glm::W, glm::Y, glm::W, glm::W) +#define spqq swizzle(glm::X, glm::Z, glm::W, glm::W) +#define tpqq swizzle(glm::Y, glm::Z, glm::W, glm::W) +#define ppqq swizzle(glm::Z, glm::Z, glm::W, glm::W) +#define qpqq swizzle(glm::W, glm::Z, glm::W, glm::W) +#define sqqq swizzle(glm::X, glm::W, glm::W, glm::W) +#define tqqq swizzle(glm::Y, glm::W, glm::W, glm::W) +#define pqqq swizzle(glm::Z, glm::W, glm::W, glm::W) +#define qqqq swizzle(glm::W, glm::W, glm::W, glm::W) + +#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ) + +#endif//glm_core_swizzle diff --git a/glm/core/_swizzle.inl b/glm/core/_swizzle.inl new file mode 100644 index 00000000..68ff88ab --- /dev/null +++ b/glm/core/_swizzle.inl @@ -0,0 +1,20 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-04-27 +// Updated : 2006-04-27 +// Licence : This source is under MIT License +// File : _swizzle.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef __swizzle_inl__ +#define __swizzle_inl__ + +#include "./_swizzle.h" + +namespace glm +{ + +} + +#endif//__swizzle_inl__ diff --git a/glm/core/dummy.cpp b/glm/core/dummy.cpp new file mode 100644 index 00000000..0395e23b --- /dev/null +++ b/glm/core/dummy.cpp @@ -0,0 +1,4 @@ +int main() +{ + +} diff --git a/glm/core/func_common.hpp b/glm/core/func_common.hpp new file mode 100644 index 00000000..acefe46c --- /dev/null +++ b/glm/core/func_common.hpp @@ -0,0 +1,185 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-03-08 +// Updated : 2008-03-08 +// Licence : This source is under MIT License +// File : glm/core/func_common.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_func_common +#define glm_core_func_common + +namespace glm +{ + namespace test{ + void main_core_func_common(); + }//namespace test + + namespace core{ + namespace function{ + //! Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace. + namespace common{ + + //! Returns x if x >= 0; otherwise, it returns -x. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genFIType abs(genFIType const & x); + + //! Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genFIType sign(genFIType const & x); + + //! Returns a value equal to the nearest integer that is less then or equal to x. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genType floor(genType const & x); + + //! Returns a value equal to the nearest integer to x + //! whose absolute value is not larger than the absolute value of x. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genType trunc(genType const & x); + + //! Returns a value equal to the nearest integer to x. + //! The fraction 0.5 will round in a direction chosen by the + //! implementation, presumably the direction that is fastest. + //! This includes the possibility that round(x) returns the + //! same value as roundEven(x) for all values of x. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genType round(genType const & x); + + //! Returns a value equal to the nearest integer to x. + //! A fractional part of 0.5 will round toward the nearest even + //! integer. (Both 3.5 and 4.5 for x will return 4.0.) + //! (From GLSL 1.30.08 specification, section 8.3) + template + genType roundEven(genType const & x); + + //! Returns a value equal to the nearest integer + //! that is greater than or equal to x. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genType ceil(genType const & x); + + //! Return x - floor(x). + //! (From GLSL 1.30.08 specification, section 8.3) + template + genType fract(genType const & x); + + //! Modulus. Returns x - y * floor(x / y) + //! for each component in x using the floating point value y. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genTypeT mod( + genTypeT const & x, + genTypeU const & y); + + //! Returns the fractional part of x and sets i to the integer + //! part (as a whole number floating point value). Both the + //! return value and the output parameter will have the same + //! sign as x. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genType modf( + genType const & x, + genType & i); + + //! Returns y if y < x; otherwise, it returns x. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genUIFTypeT min( + genUIFTypeT const & x, + genUIFTypeU const & y); + + //! Returns y if x < y; otherwise, it returns x. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genUIFTypeT max( + genUIFTypeT const & x, + genUIFTypeU const & y); + + //! Returns min(max(x, minVal), maxVal) for each component in x + //! using the floating-point values minVal and maxVal. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genUIFTypeT clamp( + genUIFTypeT const & x, + genUIFTypeU const & minVal, + genUIFTypeU const & maxVal); + + //! \return If genTypeU is a floating scalar or vector: + //! Returns x * (1.0 - a) + y * a, i.e., the linear blend of + //! x and y using the floating-point value a. + //! The value for a is not restricted to the range [0, 1]. + //! + //! \return If genTypeU is a boolean scalar or vector: + //! Selects which vector each returned component comes + //! from. For a component of a that is false, the + //! corresponding component of x is returned. For a + //! component of a that is true, the corresponding + //! component of y is returned. Components of x and y that + //! are not selected are allowed to be invalid floating point + //! values and will have no effect on the results. Thus, this + //! provides different functionality than + //! genType mix(genType x, genType y, genType(a)) + //! where a is a Boolean vector. + //! + //! From GLSL 1.30.08 specification, section 8.3 + //! + //! \param[in] x Floating point scalar or vector. + //! \param[in] y Floating point scalar or vector. + //! \param[in] a Floating point or boolean scalar or vector. + //! + // \todo Test when 'a' is a boolean. + template + genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a); + + //! Returns 0.0 if x < edge, otherwise it returns 1.0. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genTypeU step(genTypeT const & edge, genTypeU const & x); + + //! Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and + //! performs smooth Hermite interpolation between 0 and 1 + //! when edge0 < x < edge1. This is useful in cases where + //! you would want a threshold function with a smooth + //! transition. This is equivalent to: + //! genType t; + //! t = clamp ((x – edge0) / (edge1 – edge0), 0, 1); + //! return t * t * (3 – 2 * t); + //! Results are undefined if edge0 >= edge1. + //! (From GLSL 1.30.08 specification, section 8.3) + template + genTypeU smoothstep(genTypeT const & edge0, genTypeT const & edge1, genTypeU const & x); + + //! Returns true if x holds a NaN (not a number) + //! representation in the underlying implementation's set of + //! floating point representations. Returns false otherwise, + //! including for implementations with no NaN + //! representations. + //! (From GLSL 1.30.08 specification, section 8.3) + template + typename genType::bool_type isnan(genType const & x); + + //! Returns true if x holds a positive infinity or negative + //! infinity representation in the underlying implementation's + //! set of floating point representations. Returns false + //! otherwise, including for implementations with no infinity + //! representations. + //! (From GLSL 1.30.08 specification, section 8.3) + template + typename genType::bool_type isinf(genType const & x); + + }//namespace common + }//namespace function + }//namespace core + + using namespace core::function::common; +}//namespace glm + +#include "func_common.inl" + +#endif//glm_core_func_common diff --git a/glm/core/func_common.inl b/glm/core/func_common.inl new file mode 100644 index 00000000..8e28f0c7 --- /dev/null +++ b/glm/core/func_common.inl @@ -0,0 +1,1299 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-03 +// Updated : 2008-09-04 +// Licence : This source is under MIT License +// File : glm/core/func_common.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace detail + { + + template + struct Abs_ + { + }; + + template + struct Abs_ + { + static genFIType get(genFIType const & x) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int); + return x >= genFIType(0) ? x : -x; + } + }; + + template + struct Abs_ + { + static genFIType get(genFIType const & x) + { + GLM_STATIC_ASSERT( + detail::type::is_uint); + + return x; + } + }; + }//namespace detail + + namespace core{ + namespace function{ + namespace common{ + + // abs + template + inline genFIType abs( + genFIType const & x) + { + return detail::Abs_::is_signed>::get(x); + } + + //template + //inline detail::tvec1 abs( + // detail::tvec1 const & v) + //{ + // return detail::tvec1( + // abs(v.x)); + //} + + template + inline detail::tvec2 abs( + detail::tvec2 const & v) + { + return detail::tvec2( + abs(v.x), + abs(v.y)); + } + + template + inline detail::tvec3 abs( + detail::tvec3 const & v) + { + return detail::tvec3( + abs(v.x), + abs(v.y), + abs(v.z)); + } + + template + inline detail::tvec4 abs( + detail::tvec4 const & v) + { + return detail::tvec4( + abs(v.x), + abs(v.y), + abs(v.z), + abs(v.w)); + } + + // sign + + //Try something like based on x >> 31 to get the sign bit + template + inline genFIType sign( + genFIType const & x) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int); + + genFIType result; + if(x > genFIType(0)) + result = genFIType(1); + else if(x < genFIType(0)) + result = genFIType(-1); + else + result = genFIType(0); + return result; + } + + template + inline detail::tvec2 sign( + detail::tvec2 const & x) + { + return detail::tvec2( + sign(x.x), + sign(x.y)); + } + + template + inline detail::tvec3 sign( + detail::tvec3 const & x) + { + return detail::tvec3( + sign(x.x), + sign(x.y), + sign(x.z)); + } + + template + inline detail::tvec4 sign( + detail::tvec4 const & x) + { + return detail::tvec4( + sign(x.x), + sign(x.y), + sign(x.z), + sign(x.w)); + } + + // floor + template + inline genType floor(genType const& x) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::floor(x); + } + + template + inline detail::tvec2 floor(detail::tvec2 const& x) + { + return detail::tvec2( + floor(x.x), + floor(x.y)); + } + + template + inline detail::tvec3 floor(detail::tvec3 const& x) + { + return detail::tvec3( + floor(x.x), + floor(x.y), + floor(x.z)); + } + + template + inline detail::tvec4 floor(detail::tvec4 const& x) + { + return detail::tvec4( + floor(x.x), + floor(x.y), + floor(x.z), + floor(x.w)); + } + + // trunc + template + inline genType trunc(genType const & x) + { + GLM_STATIC_ASSERT(detail::type::is_float); + return floor(abs(x)); + } + + template + inline detail::tvec2 trunc(detail::tvec2 const & x) + { + return detail::tvec2( + trunc(x.x), + trunc(x.y)); + } + + template + inline detail::tvec3 trunc(detail::tvec3 const & x) + { + return detail::tvec3( + trunc(x.x), + trunc(x.y), + trunc(x.z)); + } + + template + inline detail::tvec4 trunc(detail::tvec4 const & x) + { + return detail::tvec4( + trunc(x.x), + trunc(x.y), + trunc(x.z), + trunc(x.w)); + } + + // round + template + inline genType round(genType const& x) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return genType(int(x + genType(0.5))); + } + + template + inline detail::tvec2 round(detail::tvec2 const& x) + { + return detail::tvec2( + round(x.x), + round(x.y)); + } + + template + inline detail::tvec3 round(detail::tvec3 const& x) + { + return detail::tvec3( + round(x.x), + round(x.y), + round(x.z)); + } + + template + inline detail::tvec4 round(detail::tvec4 const& x) + { + return detail::tvec4( + round(x.x), + round(x.y), + round(x.z), + round(x.w)); + } + + // roundEven + template + inline genType roundEven(genType const& x) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return genType(int(x + genType(int(x) % 2))); + } + + template + inline detail::tvec2 roundEven(detail::tvec2 const& x) + { + return detail::tvec2( + roundEven(x.x), + roundEven(x.y)); + } + + template + inline detail::tvec3 roundEven(detail::tvec3 const& x) + { + return detail::tvec3( + roundEven(x.x), + roundEven(x.y), + roundEven(x.z)); + } + + template + inline detail::tvec4 roundEven(detail::tvec4 const& x) + { + return detail::tvec4( + roundEven(x.x), + roundEven(x.y), + roundEven(x.z), + roundEven(x.w)); + } + + // ceil + template + inline genType ceil(genType const & x) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::ceil(x); + } + + template + inline detail::tvec2 ceil(detail::tvec2 const & x) + { + return detail::tvec2( + ceil(x.x), + ceil(x.y)); + } + + template + inline detail::tvec3 ceil(detail::tvec3 const & x) + { + return detail::tvec3( + ceil(x.x), + ceil(x.y), + ceil(x.z)); + } + + template + inline detail::tvec4 ceil(detail::tvec4 const & x) + { + return detail::tvec4( + ceil(x.x), + ceil(x.y), + ceil(x.z), + ceil(x.w)); + } + + // fract + template + inline genType fract + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return x - ::std::floor(x); + } + + template + inline detail::tvec2 fract + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + fract(x.x), + fract(x.y)); + } + + template + inline detail::tvec3 fract + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + fract(x.x), + fract(x.y), + fract(x.z)); + } + + template + inline detail::tvec4 fract + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + fract(x.x), + fract(x.y), + fract(x.z), + fract(x.w)); + } + + // mod + template + inline genType mod + ( + genType const & x, + genType const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return x - y * floor(x / y); + } + + template + inline detail::tvec2 mod + ( + detail::tvec2 const & x, + valType y + ) + { + return detail::tvec2( + mod(x.x, y), + mod(x.y, y)); + } + + template + inline detail::tvec3 mod + ( + detail::tvec3 const & x, + valType y + ) + { + return detail::tvec3( + mod(x.x, y), + mod(x.y, y), + mod(x.z, y)); + } + + template + inline detail::tvec4 mod + ( + detail::tvec4 const & x, + valType y + ) + { + return detail::tvec4( + mod(x.x, y), + mod(x.y, y), + mod(x.z, y), + mod(x.w, y)); + } + + template + inline detail::tvec2 mod + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + return detail::tvec2( + mod(x.x, y.x), + mod(x.y, y.y)); + } + + template + inline detail::tvec3 mod + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + return detail::tvec3( + mod(x.x, y.x), + mod(x.y, y.y), + mod(x.z, y.z)); + } + + template + inline detail::tvec4 mod + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + return detail::tvec4( + mod(x.x, y.x), + mod(x.y, y.y), + mod(x.z, y.z), + mod(x.w, y.w)); + } + + // modf + template + inline genType modf + ( + genType const & x, + genType & i + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + i = glm::floor(x); + + return x - i; + } + + template + inline detail::tvec2 modf + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + return detail::tvec2( + modf(x.x, y.x), + modf(x.y, y.y)); + } + + template + inline detail::tvec3 modf + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + return detail::tvec3( + modf(x.x, y.x), + modf(x.y, y.y), + modf(x.z, y.z)); + } + + template + inline detail::tvec4 modf + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + return detail::tvec4( + modf(x.x, y.x), + modf(x.y, y.y), + modf(x.z, y.z), + modf(x.w, y.w)); + } + + //// Only valid if (INT_MIN <= x-y <= INT_MAX) + //// min(x,y) + //r = y + ((x - y) & ((x - y) >> (sizeof(int) * + //CHAR_BIT – 1))); + //// max(x,y) + //r = x - ((x - y) & ((x - y) >> (sizeof(int) * + //CHAR_BIT - 1))); + + // min + template + inline genType min + ( + genType const & x, + genType const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return x < y ? x : y; + } + + template + inline detail::tvec2 min + ( + detail::tvec2 const & x, + valType y + ) + { + return detail::tvec2( + min(x.x, y), + min(x.y, y)); + } + + template + inline detail::tvec3 min + ( + detail::tvec3 const & x, + valType y + ) + { + return detail::tvec3( + min(x.x, y), + min(x.y, y), + min(x.z, y)); + } + + template + inline detail::tvec4 min + ( + detail::tvec4 const & x, + valType y + ) + { + return detail::tvec4( + min(x.x, y), + min(x.y, y), + min(x.z, y), + min(x.w, y)); + } + + template + inline detail::tvec2 min + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + return detail::tvec2( + min(x.x, y.x), + min(x.y, y.y)); + } + + template + inline detail::tvec3 min + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + return detail::tvec3( + min(x.x, y.x), + min(x.y, y.y), + min(x.z, y.z)); + } + + template + inline detail::tvec4 min + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + return detail::tvec4( + min(x.x, y.x), + min(x.y, y.y), + min(x.z, y.z), + min(x.w, y.w)); + } + + // max + template + inline genType max + ( + genType const & x, + genType const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return x > y ? x : y; + } + + template + inline detail::tvec2 max + ( + detail::tvec2 const & x, + valType y + ) + { + return detail::tvec2( + max(x.x, y), + max(x.y, y)); + } + + template + inline detail::tvec3 max + ( + detail::tvec3 const & x, + valType y + ) + { + return detail::tvec3( + max(x.x, y), + max(x.y, y), + max(x.z, y)); + } + + template + inline detail::tvec4 max + ( + detail::tvec4 const & x, + valType y + ) + { + return detail::tvec4( + max(x.x, y), + max(x.y, y), + max(x.z, y), + max(x.w, y)); + } + + template + inline detail::tvec2 max + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + return detail::tvec2( + max(x.x, y.x), + max(x.y, y.y)); + } + + template + inline detail::tvec3 max + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + return detail::tvec3( + max(x.x, y.x), + max(x.y, y.y), + max(x.z, y.z)); + } + + template + inline detail::tvec4 max + ( + detail::tvec4 const & x, + detail::tvec4 const & y) + { + return detail::tvec4( + max(x.x, y.x), + max(x.y, y.y), + max(x.z, y.z), + max(x.w, y.w)); + } + + // clamp + template + inline valType clamp + ( + valType const & x, + valType const & minVal, + valType const & maxVal + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + if(x >= maxVal) return maxVal; + if(x <= minVal) return minVal; + return x; + } + + template + inline detail::tvec2 clamp + ( + detail::tvec2 const & x, + valType minVal, + valType maxVal + ) + { + return detail::tvec2( + clamp(x.x, minVal, maxVal), + clamp(x.y, minVal, maxVal)); + } + + template + inline detail::tvec3 clamp + ( + detail::tvec3 const & x, + valType minVal, + valType maxVal + ) + { + return detail::tvec3( + clamp(x.x, minVal, maxVal), + clamp(x.y, minVal, maxVal), + clamp(x.z, minVal, maxVal)); + } + + template + inline detail::tvec4 clamp + ( + detail::tvec4 const & x, + valType minVal, + valType maxVal + ) + { + return detail::tvec4( + clamp(x.x, minVal, maxVal), + clamp(x.y, minVal, maxVal), + clamp(x.z, minVal, maxVal), + clamp(x.w, minVal, maxVal)); + } + + template + inline detail::tvec2 clamp + ( + detail::tvec2 const & x, + detail::tvec2 const & minVal, + detail::tvec2 const & maxVal + ) + { + return detail::tvec2( + clamp(x.x, minVal.x, maxVal.x), + clamp(x.y, minVal.y, maxVal.y)); + } + + template + inline detail::tvec3 clamp + ( + detail::tvec3 const & x, + detail::tvec3 const & minVal, + detail::tvec3 const & maxVal + ) + { + return detail::tvec3( + clamp(x.x, minVal.x, maxVal.x), + clamp(x.y, minVal.y, maxVal.y), + clamp(x.z, minVal.z, maxVal.z)); + } + + template + inline detail::tvec4 clamp + ( + detail::tvec4 const & x, + detail::tvec4 const & minVal, + detail::tvec4 const & maxVal + ) + { + return detail::tvec4( + clamp(x.x, minVal.x, maxVal.x), + clamp(x.y, minVal.y, maxVal.y), + clamp(x.z, minVal.z, maxVal.z), + clamp(x.w, minVal.w, maxVal.w)); + } + + // mix + template + inline genTypeT mix + ( + genTypeT const & x, + genTypeT const & y, + genTypeU const & a + ) + { + // It could be a vector too + //GLM_STATIC_ASSERT( + // detail::type::is_float && + // detail::type::is_float); + + //return x + a * (y - x); + return genTypeU(x) + a * genTypeU(y - x); + } + + template + inline detail::tvec2 mix + ( + detail::tvec2 const & x, + detail::tvec2 const & y, + valTypeB const & a + ) + { + return detail::tvec2( + detail::tvec2(x) + a * detail::tvec2(y - x)); + } + + template + inline detail::tvec3 mix + ( + detail::tvec3 const & x, + detail::tvec3 const & y, + valTypeB const & a + ) + { + return detail::tvec3( + detail::tvec3(x) + a * detail::tvec3(y - x)); + } + + template + inline detail::tvec4 mix + ( + detail::tvec4 const & x, + detail::tvec4 const & y, + valTypeB const & a + ) + { + return detail::tvec4( + detail::tvec4(x) + a * detail::tvec4(y - x)); + } + + template + inline detail::tvec2 mix + ( + detail::tvec2 const & x, + detail::tvec2 const & y, + detail::tvec2 const & a + ) + { + return detail::tvec2( + detail::tvec2(x) + a * detail::tvec2(y - x)); + } + + template + inline detail::tvec3 mix + ( + detail::tvec3 const & x, + detail::tvec3 const & y, + detail::tvec3 const & a + ) + { + return detail::tvec3( + detail::tvec3(x) + a * detail::tvec3(y - x)); + } + + template + inline detail::tvec4 mix + ( + detail::tvec4 const & x, + detail::tvec4 const & y, + detail::tvec4 const & a + ) + { + return detail::tvec4( + detail::tvec4(x) + a * detail::tvec4(y - x)); + } + + //template + //inline genTypeT mix + //( + // genTypeT const & x, + // genTypeT const & y, + // float const & a + //) + //{ + // // It could be a vector too + // //GLM_STATIC_ASSERT( + // // detail::type::is_float && + // // detail::type::is_float); + + // return x + a * (y - x); + //} + + template + inline genType mix + ( + genType const & x, + genType const & y, + bool a + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return a ? x : y; + } + + template + inline detail::tvec2 mix + ( + detail::tvec2 const & x, + detail::tvec2 const & y, + typename detail::tvec2::bool_type a + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tvec2 result; + for + ( + typename detail::tvec2::size_type i = 0; + i < detail::tvec2::value_size(); + ++i + ) + { + result[i] = a[i] ? x[i] : y[i]; + } + return result; + } + + template + inline detail::tvec3 mix + ( + detail::tvec3 const & x, + detail::tvec3 const & y, + typename detail::tvec3::bool_type a + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tvec3 result; + for + ( + typename detail::tvec3::size_type i = 0; + i < detail::tvec3::value_size(); + ++i + ) + { + result[i] = a[i] ? x[i] : y[i]; + } + return result; + } + + template + inline detail::tvec4 mix + ( + detail::tvec4 const & x, + detail::tvec4 const & y, + typename detail::tvec4::bool_type a + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tvec4 result; + for + ( + typename detail::tvec4::size_type i = 0; + i < detail::tvec4::value_size(); + ++i + ) + { + result[i] = a[i] ? x[i] : y[i]; + } + return result; + } + + // step + template + inline genType step + ( + genType const & edge, + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return x <= edge ? genType(0) : genType(1); + } + + template + inline detail::tvec2 step + ( + valType const & edge, + detail::tvec2 const & x + ) + { + return detail::tvec2( + x.x <= edge ? valType(0) : valType(1), + x.y <= edge ? valType(0) : valType(1)); + } + + template + inline detail::tvec3 step + ( + valType const & edge, + detail::tvec3 const & x + ) + { + return detail::tvec3( + x.x <= edge ? valType(0) : valType(1), + x.y <= edge ? valType(0) : valType(1), + x.z <= edge ? valType(0) : valType(1)); + } + + template + inline detail::tvec4 step + ( + valType edge, + detail::tvec4 const & x + ) + { + return detail::tvec4( + x.x <= edge ? valType(0) : valType(1), + x.y <= edge ? valType(0) : valType(1), + x.z <= edge ? valType(0) : valType(1), + x.w <= edge ? valType(0) : valType(1)); + } + + template + inline detail::tvec2 step + ( + detail::tvec2 const & edge, + detail::tvec2 const & x + ) + { + return detail::tvec2( + x.x <= edge.x ? valType(0) : valType(1), + x.y <= edge.y ? valType(0) : valType(1)); + } + + template + inline detail::tvec3 step + ( + detail::tvec3 const & edge, + detail::tvec3 const & x + ) + { + return detail::tvec3( + x.x <= edge.x ? valType(0) : valType(1), + x.y <= edge.y ? valType(0) : valType(1), + x.z <= edge.z ? valType(0) : valType(1)); + } + + template + inline detail::tvec4 step + ( + detail::tvec4 const & edge, + detail::tvec4 const & x + ) + { + return detail::tvec4( + x.x <= edge.x ? valType(0) : valType(1), + x.y <= edge.y ? valType(0) : valType(1), + x.z <= edge.z ? valType(0) : valType(1), + x.w <= edge.w ? valType(0) : valType(1)); + } + + // smoothstep + template + inline genType smoothstep + ( + genType const & edge0, + genType const & edge1, + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + genType tmp = clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1)); + return tmp * tmp * (genType(3) - genType(2) * tmp); + } + + template + inline detail::tvec2 smoothstep + ( + valType const & edge0, + valType const & edge1, + detail::tvec2 const & x + ) + { + return detail::tvec2( + smoothstep(edge0, edge1, x.x), + smoothstep(edge0, edge1, x.y)); + } + + template + inline detail::tvec3 smoothstep + ( + valType const & edge0, + valType const & edge1, + detail::tvec3 const & x + ) + { + return detail::tvec3( + smoothstep(edge0, edge1, x.x), + smoothstep(edge0, edge1, x.y), + smoothstep(edge0, edge1, x.z)); + } + + template + inline detail::tvec4 smoothstep + ( + valType const & edge0, + valType const & edge1, + detail::tvec4 const & x + ) + { + return detail::tvec4( + smoothstep(edge0, edge1, x.x), + smoothstep(edge0, edge1, x.y), + smoothstep(edge0, edge1, x.z), + smoothstep(edge0, edge1, x.w)); + } + + template + inline detail::tvec2 smoothstep + ( + detail::tvec2 const & edge0, + detail::tvec2 const & edge1, + detail::tvec2 const & x + ) + { + return detail::tvec2( + smoothstep(edge0.x, edge1.x, x.x), + smoothstep(edge0.y, edge1.y, x.y)); + } + + template + inline detail::tvec3 smoothstep + ( + detail::tvec3 const & edge0, + detail::tvec3 const & edge1, + detail::tvec3 const & x + ) + { + return detail::tvec3( + smoothstep(edge0.x, edge1.x, x.x), + smoothstep(edge0.y, edge1.y, x.y), + smoothstep(edge0.z, edge1.z, x.z)); + } + + template + inline detail::tvec4 smoothstep + ( + detail::tvec4 const & edge0, + detail::tvec4 const & edge1, + detail::tvec4 const & x + ) + { + return detail::tvec4( + smoothstep(edge0.x, edge1.x, x.x), + smoothstep(edge0.y, edge1.y, x.y), + smoothstep(edge0.z, edge1.z, x.z), + smoothstep(edge0.w, edge1.w, x.w)); + } + + template + inline typename genType::bool_type isnan + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + +#if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC) + return typename genType::bool_type(_isnan(x)); +#else + return typename genType::bool_type(std::isnan(x)); +#endif + } + + template + inline typename detail::tvec2::bool_type isnan + ( + detail::tvec2 const & x + ) + { + return typename detail::tvec2::bool_type( + isnan(x.x), + isnan(x.y)); + } + + template + inline typename detail::tvec3::bool_type isnan + ( + detail::tvec3 const & x + ) + { + return typename detail::tvec3::bool_type( + isnan(x.x), + isnan(x.y), + isnan(x.z)); + } + + template + inline typename detail::tvec4::bool_type isnan + ( + const detail::tvec4& x + ) + { + return typename detail::tvec4::bool_type( + isnan(x.x), + isnan(x.y), + isnan(x.z), + isnan(x.w)); + } + + template + inline typename genType::bool_type isinf + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + +#if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC) + return typename genType::bool_type(_fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF); +#else + return typename genType::bool_type(std::isinf(x)); +#endif + } + + template + inline typename detail::tvec2::bool_type isinf + ( + detail::tvec2 const & x + ) + { + return typename detail::tvec2::bool_type( + isnan(x.x), + isnan(x.y)); + } + + template + inline typename detail::tvec3::bool_type isinf + ( + detail::tvec3 const & x + ) + { + return typename detail::tvec3::bool_type( + isnan(x.x), + isnan(x.y), + isnan(x.z)); + } + + template + inline typename detail::tvec4::bool_type isinf + ( + const detail::tvec4& x + ) + { + return typename detail::tvec4::bool_type( + isnan(x.x), + isnan(x.y), + isnan(x.z), + isnan(x.w)); + } + + }//namespace common + }//namespace function + }//namespace core +}//namespace glm diff --git a/glm/core/func_exponential.hpp b/glm/core/func_exponential.hpp new file mode 100644 index 00000000..82e08822 --- /dev/null +++ b/glm/core/func_exponential.hpp @@ -0,0 +1,71 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-08 +// Updated : 2008-09-06 +// Licence : This source is under MIT License +// File : glm/core/func_exponential.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_func_exponential +#define glm_core_func_exponential + +namespace glm +{ + namespace test{ + void main_core_func_exponential(); + }//namespace test + + namespace core{ + namespace function{ + //! Define all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace. + namespace exponential{ + + //! Returns x raised to the y power. + //! (From GLSL 1.30.08 specification, section 8.2) + template + genType pow(genType const & x, genType const & y); + + //! Returns the natural exponentiation of x, i.e., e^x. + //! (From GLSL 1.30.08 specification, section 8.2) + template + genType exp(genType const & x); + + //! Returns the natural logarithm of x, i.e., + //! returns the value y which satisfies the equation x = e^y. + //! Results are undefined if x <= 0. + //! (From GLSL 1.30.08 specification, section 8.2) + template + genType log(genType const & x); + + //! Returns 2 raised to the x power. + //! (From GLSL 1.30.08 specification, section 8.2) + template + genType exp2(genType const & x); + + //! Returns the base 2 log of x, i.e., returns the value y, + //! which satisfies the equation x = 2 ^ y. + //! (From GLSL 1.30.08 specification, section 8.2) + template + genType log2(genType const & x); + + //! Returns the positive square root of x. + //! (From GLSL 1.30.08 specification, section 8.2) + template + genType sqrt(genType const & x); + + //! Returns the reciprocal of the positive square root of x. + //! (From GLSL 1.30.08 specification, section 8.2) + template + genType inversesqrt(genType const & x); + + }//namespace exponential + }//namespace function + }//namespace core + + using namespace core::function::exponential; +}//namespace glm + +#include "func_exponential.inl" + +#endif//glm_core_func_exponential diff --git a/glm/core/func_exponential.inl b/glm/core/func_exponential.inl new file mode 100644 index 00000000..07b341cc --- /dev/null +++ b/glm/core/func_exponential.inl @@ -0,0 +1,358 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-03 +// Updated : 2008-09-06 +// Licence : This source is under MIT License +// File : glm/core/func_exponential.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace core{ + namespace function{ + namespace exponential{ + + // pow + template + inline genType pow + ( + genType const & x, + genType const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::pow(x, y); + } + + template + inline detail::tvec2 pow + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + return detail::tvec2( + pow(x.x, y.x), + pow(x.y, y.y)); + } + + template + inline detail::tvec3 pow + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + return detail::tvec3( + pow(x.x, y.x), + pow(x.y, y.y), + pow(x.z, y.z)); + } + + template + inline detail::tvec4 pow + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + return detail::tvec4( + pow(x.x, y.x), + pow(x.y, y.y), + pow(x.z, y.z), + pow(x.w, y.w)); + } + + // exp + template + inline genType exp + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::exp(x); + } + + template + inline detail::tvec2 exp + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + exp(x.x), + exp(x.y)); + } + + template + inline detail::tvec3 exp + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + exp(x.x), + exp(x.y), + exp(x.z)); + } + + template + inline detail::tvec4 exp + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + exp(x.x), + exp(x.y), + exp(x.z), + exp(x.w)); + } + + // log + template + inline genType log + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::log(x); + } + + template + inline detail::tvec2 log + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + log(x.x), + log(x.y)); + } + + template + inline detail::tvec3 log + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + log(x.x), + log(x.y), + log(x.z)); + } + + template + inline detail::tvec4 log + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + log(x.x), + log(x.y), + log(x.z), + log(x.w)); + } + + //exp2, ln2 = 0.69314718055994530941723212145818f + template + inline genType exp2 + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::exp(genType(0.69314718055994530941723212145818) * x); + } + + template + inline detail::tvec2 exp2 + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + exp2(x.x), + exp2(x.y)); + } + + template + inline detail::tvec3 exp2 + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + exp2(x.x), + exp2(x.y), + exp2(x.z)); + } + + template + inline detail::tvec4 exp2 + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + exp2(x.x), + exp2(x.y), + exp2(x.z), + exp2(x.w)); + } + + // log2, ln2 = 0.69314718055994530941723212145818f + template + inline genType log2 + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::log(x) / genType(0.69314718055994530941723212145818); + } + + template + inline detail::tvec2 log2 + ( + const detail::tvec2& x + ) + { + return detail::tvec2( + log2(x.x), + log2(x.y)); + } + + template + inline detail::tvec3 log2 + ( + const detail::tvec3& x + ) + { + return detail::tvec3( + log2(x.x), + log2(x.y), + log2(x.z)); + } + + template + inline detail::tvec4 log2 + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + log2(x.x), + log2(x.y), + log2(x.z), + log2(x.w)); + } + + // sqrt + template + inline genType sqrt + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return genType(::std::sqrt(double(x))); + } + + template + inline detail::tvec2 sqrt + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + sqrt(x.x), + sqrt(x.y)); + } + + template + inline detail::tvec3 sqrt + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + sqrt(x.x), + sqrt(x.y), + sqrt(x.z)); + } + + template + inline detail::tvec4 sqrt + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + sqrt(x.x), + sqrt(x.y), + sqrt(x.z), + sqrt(x.w)); + } + + template + inline genType inversesqrt + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return genType(1) / ::std::sqrt(x); + } + + template + inline detail::tvec2 inversesqrt + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + inversesqrt(x.x), + inversesqrt(x.y)); + } + + template + inline detail::tvec3 inversesqrt + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + inversesqrt(x.x), + inversesqrt(x.y), + inversesqrt(x.z)); + } + + template + inline detail::tvec4 inversesqrt + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + inversesqrt(x.x), + inversesqrt(x.y), + inversesqrt(x.z), + inversesqrt(x.w)); + } + + }//namespace exponential + }//namespace function + }//namespace core +}//namespace glm diff --git a/glm/core/func_geometric.hpp b/glm/core/func_geometric.hpp new file mode 100644 index 00000000..8537976e --- /dev/null +++ b/glm/core/func_geometric.hpp @@ -0,0 +1,76 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-03 +// Updated : 2008-09-08 +// Licence : This source is under MIT License +// File : glm/core/func_geometric.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_func_geometric +#define glm_core_func_geometric + +namespace glm +{ + namespace test{ + void main_core_func_geometric(); + }//namespace test + + namespace core{ + namespace function{ + //! Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace. + namespace geometric{ + + //! Returns the length of x, i.e., sqrt(x * x). + //! (From GLSL 1.30.08 specification, section 8.4) + template + typename genType::value_type length(genType const & x); + + //! Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). + //! (From GLSL 1.30.08 specification, section 8.4) + template + typename genType::value_type distance(genType const & p0, genType const & p1); + + //! Returns the dot product of x and y, i.e., result = x * y. + //! (From GLSL 1.30.08 specification, section 8.4) + template + typename genType::value_type dot(genType const & x, genType const & y); + + //! Returns the cross product of x and y. + //! (From GLSL 1.30.08 specification, section 8.4) + template + detail::tvec3 cross(detail::tvec3 const & x, detail::tvec3 const & y); + + //! Returns a vector in the same direction as x but with length of 1. + //! (From GLSL 1.30.08 specification, section 8.4) + template + genType normalize(genType const & x); + + //! If dot(Nref, I) < 0.0, return N, otherwise, return -N. + //! (From GLSL 1.30.08 specification, section 8.4) + template + genType faceforward(genType const & N, genType const & I, genType const & Nref); + + //! For the incident vector I and surface orientation N, + //! returns the reflection direction : result = I - 2.0 * dot(N, I) * N. + //! (From GLSL 1.30.08 specification, section 8.4) + template + genType reflect(genType const & I, genType const & N); + + //! For the incident vector I and surface normal N, + //! and the ratio of indices of refraction eta, + //! return the refraction vector. + //! (From GLSL 1.30.08 specification, section 8.4) + template + genType refract(genType const & I, genType const & N, typename genType::value_type const & eta); + + }//namespace geometric + }//namespace function + }//namespace core + + using namespace core::function::geometric; +}//namespace glm + +#include "func_geometric.inl" + +#endif//glm_core_func_geometric diff --git a/glm/core/func_geometric.inl b/glm/core/func_geometric.inl new file mode 100644 index 00000000..f9f97efe --- /dev/null +++ b/glm/core/func_geometric.inl @@ -0,0 +1,290 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-03 +// Updated : 2008-09-08 +// Licence : This source is under MIT License +// File : glm/core/func_geometric.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace core{ + namespace function{ + namespace geometric{ + + // length + template + inline genType length + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + genType sqr = x * x; + return sqrt(sqr); + } + + template + inline typename detail::tvec2::value_type length + ( + detail::tvec2 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType sqr = x.x * x.x + x.y * x.y; + return sqrt(sqr); + } + + template + inline typename detail::tvec3::value_type length + ( + detail::tvec3 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType sqr = x.x * x.x + x.y * x.y + x.z * x.z; + return sqrt(sqr); + } + + template + inline typename detail::tvec4::value_type length + ( + detail::tvec4 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; + return sqrt(sqr); + } + + // distance + template + inline genType distance + ( + genType const & p0, + genType const & p1 + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return length(p1 - p0); + } + + template + inline typename detail::tvec2::value_type distance + ( + detail::tvec2 const & p0, + detail::tvec2 const & p1 + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return length(p1 - p0); + } + + template + inline typename detail::tvec3::value_type distance + ( + detail::tvec3 const & p0, + detail::tvec3 const & p1 + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return length(p1 - p0); + } + + template + inline typename detail::tvec4::value_type distance + ( + detail::tvec4 const & p0, + detail::tvec4 const & p1 + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return length(p1 - p0); + } + + // dot + template + inline genType dot + ( + genType const & x, + genType const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return x * y; + } + + template + inline typename detail::tvec2::value_type dot + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return x.x * y.x + x.y * y.y; + } + + template + inline valType dot + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return x.x * y.x + x.y * y.y + x.z * y.z; + } +/* // SSE3 + inline float dot(const tvec4& x, const tvec4& y) + { + float Result; + __asm + { + mov esi, x + mov edi, y + movaps xmm0, [esi] + mulps xmm0, [edi] + haddps( _xmm0, _xmm0 ) + haddps( _xmm0, _xmm0 ) + movss Result, xmm0 + } + return Result; + } +*/ + template + inline valType dot + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w; + } + + // cross + template + inline detail::tvec3 cross + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return detail::tvec3( + x.y * y.z - y.y * x.z, + x.z * y.x - y.z * x.x, + x.x * y.y - y.x * x.y); + } + + // normalize + template + inline genType normalize + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return x < genType(0) ? genType(-1) : genType(1); + } + + // According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefine and generate an error + template + inline detail::tvec2 normalize + ( + detail::tvec2 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType sqr = x.x * x.x + x.y * x.y; + return x * inversesqrt(sqr); + } + + template + inline detail::tvec3 normalize + ( + detail::tvec3 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType sqr = x.x * x.x + x.y * x.y + x.z * x.z; + return x * inversesqrt(sqr); + } + + template + inline detail::tvec4 normalize + ( + detail::tvec4 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; + return x * inversesqrt(sqr); + } + + // faceforward + template + inline genType faceforward + ( + genType const & N, + genType const & I, + genType const & Nref + ) + { + return dot(Nref, I) < 0 ? N : -N; + } + + // reflect + template + genType reflect + ( + genType const & I, + genType const & N + ) + { + return I - N * dot(N, I) * float(2); + } + + // refract + template + inline genType refract + ( + genType const & I, + genType const & N, + typename genType::value_type const & eta + ) + { + //It could be a vector + //GLM_STATIC_ASSERT(detail::type::is_float); + + typename genType::value_type dotValue = dot(N, I); + typename genType::value_type k = typename genType::value_type(1) - eta * eta * (typename genType::value_type(1) - dotValue * dotValue); + if(k < typename genType::value_type(0)) + return genType(0); + else + return eta * I - (eta * dotValue + sqrt(k)) * N; + } + + }//namespace geometric + }//namespace function + }//namespace core +}//namespace glm diff --git a/glm/core/func_matrix.hpp b/glm/core/func_matrix.hpp new file mode 100644 index 00000000..88a2a417 --- /dev/null +++ b/glm/core/func_matrix.hpp @@ -0,0 +1,63 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-03 +// Updated : 2008-08-03 +// Licence : This source is under MIT License +// File : glm/core/func_matrix.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_func_matrix +#define glm_core_func_matrix + +namespace glm +{ + namespace test{ + void main_core_func_matrix(); + }//namespace test + + namespace core{ + namespace function{ + //! Define all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace. + namespace matrix{ + + //! Multiply matrix x by matrix y component-wise, i.e., + //! result[i][j] is the scalar product of x[i][j] and y[i][j]. + //! (From GLSL 1.30.08 specification, section 8.5) + template + matType matrixCompMult(matType const & x, matType const & y); + + //! Treats the first parameter c as a column vector + //! and the second parameter r as a row vector + //! and does a linear algebraic matrix multiply c * r. + //! (From GLSL 1.30.08 specification, section 8.5) + template + matType outerProduct(vecType const & c, vecType const & r); + + //! Returns the transposed matrix of x + //! (From GLSL 1.30.08 specification, section 8.5) + template + typename matType::transpose_type transpose(matType const & x); + + //! Return the determinant of a matrix. + //! (From GLSL 1.50.09 specification, section 8.5). genType: mat2, mat3, mat4. + template + typename genType::value_type determinant( + genType const & m); + + //! Return the inverse of a matrix. + //! (From GLSL 1.40.07 specification, section 8.5). genType: mat2, mat3, mat4. + template + genType inverse( + genType const & m); + + }//namespace matrix + }//namespace function + }//namespace core + + using namespace core::function::matrix; +}//namespace glm + +#include "func_matrix.inl" + +#endif//glm_core_func_matrix diff --git a/glm/core/func_matrix.inl b/glm/core/func_matrix.inl new file mode 100644 index 00000000..42b45bc1 --- /dev/null +++ b/glm/core/func_matrix.inl @@ -0,0 +1,760 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-03-08 +// Updated : 2008-03-08 +// Licence : This source is under MIT License +// File : glm/core/func_matrix.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace core{ + namespace function{ + namespace matrix{ + + // matrixCompMult +/* + template + inline detail::tmat2x2 matrixCompMult + ( + detail::tmat2x2 const & x, + detail::tmat2x2 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat2x2 result; + for(std::size_t i = 0; i < detail::tmat2x2::col_size(); ++i) + result[i] = x[i] * y[i]; + return result; + } + + template + inline detail::tmat3x3 matrixCompMult + ( + detail::tmat3x3 const & x, + detail::tmat3x3 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat3x3 result; + for(std::size_t i = 0; i < detail::tmat3x3::col_size(); ++i) + result[i] = x[i] * y[i]; + return result; + } + + template + inline detail::tmat4x4 matrixCompMult + ( + detail::tmat4x4 const & x, + detail::tmat4x4 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat4x4 result; + for(std::size_t i = 0; i < detail::tmat4x4::col_size(); ++i) + result[i] = x[i] * y[i]; + return result; + } + + template + inline detail::tmat2x3 matrixCompMult + ( + detail::tmat2x3 const & x, + detail::tmat2x3 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat2x3 result; + for(std::size_t i = 0; i < detail::tmat2x3::col_size(); ++i) + result[i] = x[i] * y[i]; + return result; + } + + template + inline detail::tmat3x2 matrixCompMult + ( + detail::tmat3x2 const & x, + detail::tmat3x2 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat3x2 result; + for(std::size_t i = 0; i < detail::tmat3x2::col_size(); ++i) + result[i] = x[i] * y[i]; + return result; + } + + template + inline detail::tmat2x4 matrixCompMult + ( + detail::tmat2x4 const & x, + detail::tmat2x4 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat2x4 result; + for(std::size_t i = 0; i < detail::tmat2x4::col_size(); ++i) + result[i] = x[i] * y[i]; + return result; + } + + template + inline detail::tmat4x2 matrixCompMult + ( + detail::tmat4x2 const & x, + detail::tmat4x2 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat4x2 result; + for(std::size_t i = 0; i < detail::tmat4x2::col_size(); ++i) + result[i] = x[i] * y[i]; + return result; + } + + template + inline detail::tmat3x4 matrixCompMult + ( + detail::tmat3x4 const & x, + detail::tmat3x4 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat3x4 result; + for(std::size_t i = 0; i < detail::tmat3x4::col_size(); ++i) + result[i] = x[i] * y[i]; + return result; + } + + template + inline detail::tmat4x3 matrixCompMult + ( + detail::tmat4x3 const & x, + detail::tmat4x3 const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat4x3 result; + for(std::size_t i = 0; i < detail::tmat4x3::col_size(); ++i) + result[i] = x[i] * y[i]; + return result; + } +*/ + template + inline matType matrixCompMult + ( + matType const & x, + matType const & y + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + matType result; + for(typename matType::size_type i = 0; i < matType::col_size(); ++i) + result[i] = x[i] * y[i]; + return result; + } + + // outerProduct + template + inline detail::tmat2x2 outerProduct + ( + detail::tvec2 const & c, + detail::tvec2 const & r + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat2x2 m; + m[0][0] = c[0] * r[0]; + m[0][1] = c[1] * r[0]; + m[1][0] = c[0] * r[1]; + m[1][1] = c[1] * r[1]; + return m; + } + + template + inline detail::tmat3x3 outerProduct + ( + detail::tvec3 const & c, + detail::tvec3 const & r + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat3x3 m; + for(typename detail::tmat3x3::size_type i = 0; i < detail::tmat3x3::col_size(); ++i) + m[i] = c * r[i]; + return m; + } + + template + inline detail::tmat4x4 outerProduct + ( + detail::tvec4 const & c, + detail::tvec4 const & r + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat4x4 m; + for(typename detail::tmat4x4::size_type i = 0; i < detail::tmat4x4::col_size(); ++i) + m[i] = c * r[i]; + return m; + } + + template + inline detail::tmat2x3 outerProduct + ( + detail::tvec3 const & c, + detail::tvec2 const & r + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat2x3 m; + m[0][0] = c.x * r.x; + m[0][1] = c.y * r.x; + m[0][2] = c.z * r.x; + m[1][0] = c.x * r.y; + m[1][1] = c.y * r.y; + m[1][2] = c.z * r.y; + return m; + } + + template + inline detail::tmat3x2 outerProduct + ( + detail::tvec2 const & c, + detail::tvec3 const & r + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat3x2 m; + m[0][0] = c.x * r.x; + m[0][1] = c.y * r.x; + m[1][0] = c.x * r.y; + m[1][1] = c.y * r.y; + m[2][0] = c.x * r.z; + m[2][1] = c.y * r.z; + return m; + } + + template + inline detail::tmat2x4 outerProduct + ( + detail::tvec2 const & c, + detail::tvec4 const & r + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat2x4 m; + m[0][0] = c.x * r.x; + m[0][1] = c.y * r.x; + m[0][2] = c.z * r.x; + m[0][3] = c.w * r.x; + m[1][0] = c.x * r.y; + m[1][1] = c.y * r.y; + m[1][2] = c.z * r.y; + m[1][3] = c.w * r.y; + return m; + } + + template + inline detail::tmat4x2 outerProduct + ( + detail::tvec4 const & c, + detail::tvec2 const & r + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat4x2 m; + m[0][0] = c.x * r.x; + m[0][1] = c.y * r.x; + m[1][0] = c.x * r.y; + m[1][1] = c.y * r.y; + m[2][0] = c.x * r.z; + m[2][1] = c.y * r.z; + m[3][0] = c.x * r.w; + m[3][1] = c.y * r.w; + return m; + } + + template + inline detail::tmat3x4 outerProduct + ( + detail::tvec4 const & c, + detail::tvec3 const & r + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat3x4 m; + m[0][0] = c.x * r.x; + m[0][1] = c.y * r.x; + m[0][2] = c.z * r.x; + m[0][3] = c.w * r.x; + m[1][0] = c.x * r.y; + m[1][1] = c.y * r.y; + m[1][2] = c.z * r.y; + m[1][3] = c.w * r.y; + m[2][0] = c.x * r.z; + m[2][1] = c.y * r.z; + m[2][2] = c.z * r.z; + m[2][3] = c.w * r.z; + return m; + } + + template + inline detail::tmat4x3 outerProduct + ( + detail::tvec3 const & c, + detail::tvec4 const & r + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat4x3 m; + m[0][0] = c.x * r.x; + m[0][1] = c.y * r.x; + m[0][2] = c.z * r.x; + m[1][0] = c.x * r.y; + m[1][1] = c.y * r.y; + m[1][2] = c.z * r.y; + m[2][0] = c.x * r.z; + m[2][1] = c.y * r.z; + m[2][2] = c.z * r.z; + m[3][0] = c.x * r.w; + m[3][1] = c.y * r.w; + m[3][2] = c.z * r.w; + return m; + } + + template + inline detail::tmat2x2 transpose + ( + detail::tmat2x2 const & m + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat2x2 result; + result[0][0] = m[0][0]; + result[0][1] = m[1][0]; + result[1][0] = m[0][1]; + result[1][1] = m[1][1]; + return result; + } + + template + inline detail::tmat3x3 transpose + ( + detail::tmat3x3 const & m + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat3x3 result; + result[0][0] = m[0][0]; + result[0][1] = m[1][0]; + result[0][2] = m[2][0]; + + result[1][0] = m[0][1]; + result[1][1] = m[1][1]; + result[1][2] = m[2][1]; + + result[2][0] = m[0][2]; + result[2][1] = m[1][2]; + result[2][2] = m[2][2]; + return result; + } + + template + inline detail::tmat4x4 transpose + ( + detail::tmat4x4 const & m + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat4x4 result; + result[0][0] = m[0][0]; + result[0][1] = m[1][0]; + result[0][2] = m[2][0]; + result[0][3] = m[3][0]; + + result[1][0] = m[0][1]; + result[1][1] = m[1][1]; + result[1][2] = m[2][1]; + result[1][3] = m[3][1]; + + result[2][0] = m[0][2]; + result[2][1] = m[1][2]; + result[2][2] = m[2][2]; + result[2][3] = m[3][2]; + + result[3][0] = m[0][3]; + result[3][1] = m[1][3]; + result[3][2] = m[2][3]; + result[3][3] = m[3][3]; + return result; + } + + template + inline detail::tmat2x3 transpose + ( + detail::tmat3x2 const & m + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat2x3 result; + result[0][0] = m[0][0]; + result[0][1] = m[1][0]; + result[0][2] = m[2][0]; + result[1][0] = m[0][1]; + result[1][1] = m[1][1]; + result[1][2] = m[2][1]; + return result; + } + + template + inline detail::tmat3x2 transpose + ( + detail::tmat2x3 const & m + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat3x2 result; + result[0][0] = m[0][0]; + result[0][1] = m[1][0]; + result[1][0] = m[0][1]; + result[1][1] = m[1][1]; + result[2][0] = m[0][2]; + result[2][1] = m[1][2]; + return result; + } + + template + inline detail::tmat2x4 transpose + ( + detail::tmat4x2 const & m + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat2x4 result; + result[0][0] = m[0][0]; + result[0][1] = m[1][0]; + result[0][2] = m[2][0]; + result[0][3] = m[3][0]; + result[1][0] = m[0][1]; + result[1][1] = m[1][1]; + result[1][2] = m[2][1]; + result[1][3] = m[3][1]; + return result; + } + + template + inline detail::tmat4x2 transpose + ( + detail::tmat2x4 const & m + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat4x2 result; + result[0][0] = m[0][0]; + result[0][1] = m[1][0]; + result[1][0] = m[0][1]; + result[1][1] = m[1][1]; + result[2][0] = m[0][2]; + result[2][1] = m[1][2]; + result[3][0] = m[0][3]; + result[3][1] = m[1][3]; + return result; + } + + template + inline detail::tmat3x4 transpose + ( + detail::tmat4x3 const & m + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat3x4 result; + result[0][0] = m[0][0]; + result[0][1] = m[1][0]; + result[0][2] = m[2][0]; + result[0][3] = m[3][0]; + result[1][0] = m[0][1]; + result[1][1] = m[1][1]; + result[1][2] = m[2][1]; + result[1][3] = m[3][1]; + result[2][0] = m[0][2]; + result[2][1] = m[1][2]; + result[2][2] = m[2][2]; + result[2][3] = m[3][2]; + return result; + } + + template + inline detail::tmat4x3 transpose + ( + detail::tmat3x4 const & m + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + detail::tmat4x3 result; + result[0][0] = m[0][0]; + result[0][1] = m[1][0]; + result[0][2] = m[2][0]; + result[1][0] = m[0][1]; + result[1][1] = m[1][1]; + result[1][2] = m[2][1]; + result[2][0] = m[0][2]; + result[2][1] = m[1][2]; + result[2][2] = m[2][2]; + result[3][0] = m[0][3]; + result[3][1] = m[1][3]; + result[3][2] = m[2][3]; + return result; + } + + template + inline typename detail::tmat2x2::value_type determinant + ( + detail::tmat2x2 const & m + ) + { + return m[0][0] * m[1][1] - m[1][0] * m[0][1]; + } + + template + inline typename detail::tmat3x3::value_type determinant + ( + detail::tmat3x3 const & m + ) + { + return m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) + - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) + + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]); + } + + template + inline typename detail::tmat4x4::value_type determinant + ( + detail::tmat4x4 const & m + ) + { + valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + + detail::tvec4 DetCof( + + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), + - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), + + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), + - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); + + return m[0][0] * DetCof[0] + + m[0][1] * DetCof[1] + + m[0][2] * DetCof[2] + + m[0][3] * DetCof[3]; + } + + template + inline detail::tmat2x2 inverse + ( + detail::tmat2x2 const & m + ) + { + //valType Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; + valType Determinant = determinant(m); + + detail::tmat2x2 Inverse( + + m[1][1] / Determinant, + - m[1][0] / Determinant, + - m[0][1] / Determinant, + + m[0][0] / Determinant); + + return Inverse; + } + + template + inline detail::tmat3x3 inverse + ( + detail::tmat3x3 const & m + ) + { + //valType Determinant = m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) + // - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) + // + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]); + + valType Determinant = determinant(m); + + detail::tmat3x3 Inverse; + Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]); + Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]); + Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]); + Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]); + Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]); + Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]); + Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]); + Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]); + Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]); + Inverse /= Determinant; + + return Inverse; + } + + template + inline detail::tmat4x4 inverseOgre + ( + detail::tmat4x4 const & m + ) + { + valType m00 = m[0][0], m01 = m[0][1], m02 = m[0][2], m03 = m[0][3]; + valType m10 = m[1][0], m11 = m[1][1], m12 = m[1][2], m13 = m[1][3]; + valType m20 = m[2][0], m21 = m[2][1], m22 = m[2][2], m23 = m[2][3]; + valType m30 = m[3][0], m31 = m[3][1], m32 = m[3][2], m33 = m[3][3]; + + valType v0 = m20 * m31 - m21 * m30; + valType v1 = m20 * m32 - m22 * m30; + valType v2 = m20 * m33 - m23 * m30; + valType v3 = m21 * m32 - m22 * m31; + valType v4 = m21 * m33 - m23 * m31; + valType v5 = m22 * m33 - m23 * m32; + + valType t00 = + (v5 * m11 - v4 * m12 + v3 * m13); + valType t10 = - (v5 * m10 - v2 * m12 + v1 * m13); + valType t20 = + (v4 * m10 - v2 * m11 + v0 * m13); + valType t30 = - (v3 * m10 - v1 * m11 + v0 * m12); + + valType invDet = 1 / (t00 * m00 + t10 * m01 + t20 * m02 + t30 * m03); + + valType d00 = t00 * invDet; + valType d10 = t10 * invDet; + valType d20 = t20 * invDet; + valType d30 = t30 * invDet; + + valType d01 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet; + valType d11 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet; + valType d21 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet; + valType d31 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet; + + v0 = m10 * m31 - m11 * m30; + v1 = m10 * m32 - m12 * m30; + v2 = m10 * m33 - m13 * m30; + v3 = m11 * m32 - m12 * m31; + v4 = m11 * m33 - m13 * m31; + v5 = m12 * m33 - m13 * m32; + + valType d02 = + (v5 * m01 - v4 * m02 + v3 * m03) * invDet; + valType d12 = - (v5 * m00 - v2 * m02 + v1 * m03) * invDet; + valType d22 = + (v4 * m00 - v2 * m01 + v0 * m03) * invDet; + valType d32 = - (v3 * m00 - v1 * m01 + v0 * m02) * invDet; + + v0 = m21 * m10 - m20 * m11; + v1 = m22 * m10 - m20 * m12; + v2 = m23 * m10 - m20 * m13; + v3 = m22 * m11 - m21 * m12; + v4 = m23 * m11 - m21 * m13; + v5 = m23 * m12 - m22 * m13; + + valType d03 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet; + valType d13 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet; + valType d23 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet; + valType d33 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet; + + return detail::tmat4x4( + d00, d01, d02, d03, + d10, d11, d12, d13, + d20, d21, d22, d23, + d30, d31, d32, d33); + } + + template + inline detail::tmat4x4 inverse + ( + detail::tmat4x4 const & m + ) + { + valType Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + valType Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + valType Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + valType Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + valType Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + valType Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + valType Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + valType Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + valType Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + valType Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + valType Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + valType Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + valType Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + valType Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + valType Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + valType Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + valType Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + valType Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + detail::tvec4 const SignA(+1, -1, +1, -1); + detail::tvec4 const SignB(-1, +1, -1, +1); + + detail::tvec4 Fac0(Coef00, Coef00, Coef02, Coef03); + detail::tvec4 Fac1(Coef04, Coef04, Coef06, Coef07); + detail::tvec4 Fac2(Coef08, Coef08, Coef10, Coef11); + detail::tvec4 Fac3(Coef12, Coef12, Coef14, Coef15); + detail::tvec4 Fac4(Coef16, Coef16, Coef18, Coef19); + detail::tvec4 Fac5(Coef20, Coef20, Coef22, Coef23); + + detail::tvec4 Vec0(m[1][0], m[0][0], m[0][0], m[0][0]); + detail::tvec4 Vec1(m[1][1], m[0][1], m[0][1], m[0][1]); + detail::tvec4 Vec2(m[1][2], m[0][2], m[0][2], m[0][2]); + detail::tvec4 Vec3(m[1][3], m[0][3], m[0][3], m[0][3]); + + detail::tvec4 Inv0 = SignA * (Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2); + detail::tvec4 Inv1 = SignB * (Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4); + detail::tvec4 Inv2 = SignA * (Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5); + detail::tvec4 Inv3 = SignB * (Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5); + + detail::tmat4x4 Inverse(Inv0, Inv1, Inv2, Inv3); + + detail::tvec4 Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]); + + valType Determinant = glm::dot(m[0], Row0); + + Inverse /= Determinant; + + return Inverse; + } + + }//namespace matrix + }//namespace function + }//namespace core +}//namespace glm diff --git a/glm/core/func_noise.hpp b/glm/core/func_noise.hpp new file mode 100644 index 00000000..8537ff4b --- /dev/null +++ b/glm/core/func_noise.hpp @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-01 +// Updated : 2008-09-10 +// Licence : This source is under MIT License +// File : glm/core/func_noise.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_func_noise +#define glm_core_func_noise + +namespace glm +{ + namespace test{ + void main_core_func_noise(); + }//namespace test + + namespace core{ + namespace function{ + // Define all noise functions from Section 8.9 of GLSL 1.30.8 specification. Included in glm namespace. + namespace noise{ + + // Returns a 1D noise value based on the input value x. + // From GLSL 1.30.08 specification, section 8.9. + template + typename genType::value_type noise1(genType const & x); + + // Returns a 2D noise value based on the input value x. + // From GLSL 1.30.08 specification, section 8.9. + template + detail::tvec2 noise2(genType const & x); + + // Returns a 3D noise value based on the input value x. + // From GLSL 1.30.08 specification, section 8.9. + template + detail::tvec3 noise3(genType const & x); + + // Returns a 4D noise value based on the input value x. + // From GLSL 1.30.08 specification, section 8.9. + template + detail::tvec4 noise4(genType const & x); + + }//namespace noise + }//namespace function + }//namespace core + + using namespace core::function::noise; +}//namespace glm + +#include "func_noise.inl" + +#endif//glm_core_func_noise diff --git a/glm/core/func_noise.inl b/glm/core/func_noise.inl new file mode 100644 index 00000000..b6cd4f26 --- /dev/null +++ b/glm/core/func_noise.inl @@ -0,0 +1,305 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-01 +// Updated : 2008-09-23 +// Licence : This source is under MIT License +// File : glm/core/func_noise.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace core{ + namespace function{ + namespace noise{ + + // noise1 + template + inline genType noise1 + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + int iNbr = int(x + genType(3) / genType(2)) * 1103515245 + 12345; + return genType(int(iNbr / genType(65536)) % 32768) / genType(32767); + } + + template + inline typename detail::tvec2::value_type noise1 + ( + detail::tvec2 const & x + ) + { + valType tmp(0); + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + tmp += x[i]; + return noise1(tmp); + } + + template + inline typename detail::tvec3::value_type noise1 + ( + detail::tvec3 const & x + ) + { + valType tmp(0); + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + tmp += x[i]; + return noise1(tmp); + } + + template + inline typename detail::tvec4::value_type noise1 + ( + detail::tvec4 const & x + ) + { + valType tmp(0); + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + tmp += x[i]; + return noise1(tmp); + } + + // noise2 + template + inline detail::tvec2 noise2 + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + genType f1 = x * genType(1103515245) + genType(12345); + genType f2 = f1 * genType(1103515245) + genType(12345); + return detail::tvec2( + noise1(f1), + noise1(f2)); + } + + template + inline detail::tvec2 noise2 + ( + detail::tvec2 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType f0(0); + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + f0 += x[i]; + + valType f1 = f0 * valType(1103515245) + valType(12345); + valType f2 = f1 * valType(1103515245) + valType(12345); + return detail::tvec2( + noise1(f1), + noise1(f2)); + } + + template + inline detail::tvec2 noise2 + ( + detail::tvec3 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType f0(0); + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + f0 += x[i]; + + valType f1 = f0 * valType(1103515245) + valType(12345); + valType f2 = f1 * valType(1103515245) + valType(12345); + return detail::tvec2( + noise1(f1), + noise1(f2)); + } + + template + inline detail::tvec2 noise2 + ( + detail::tvec4 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType f0(0); + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + f0 += x[i]; + + valType f1 = f0 * valType(1103515245) + valType(12345); + valType f2 = f1 * valType(1103515245) + valType(12345); + return detail::tvec2( + noise1(f1), + noise1(f2)); + } + + // noise3 + template + inline detail::tvec3 noise3 + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + genType f1 = x * genType(1103515245) + genType(12345); + genType f2 = f1 * genType(1103515245) + genType(12345); + genType f3 = f2 * genType(1103515245) + genType(12345); + return detail::tvec3( + noise1(f1), + noise1(f2), + noise1(f3)); + } + + template + inline detail::tvec3 noise3 + ( + detail::tvec2 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType f0(0); + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + f0 += x[i]; + valType f1 = f0 * valType(1103515245) + valType(12345); + valType f2 = f1 * valType(1103515245) + valType(12345); + valType f3 = f2 * valType(1103515245) + valType(12345); + return detail::tvec3( + noise1(f1), + noise1(f2), + noise1(f3)); + } + + template + inline detail::tvec3 noise3 + ( + detail::tvec3 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType f0(0); + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + f0 += x[i]; + valType f1 = f0 * valType(1103515245) + valType(12345); + valType f2 = f1 * valType(1103515245) + valType(12345); + valType f3 = f2 * valType(1103515245) + valType(12345); + return detail::tvec3( + noise1(f1), + noise1(f2), + noise1(f3)); + } + + template + inline detail::tvec3 noise3 + ( + detail::tvec4 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType f0(0); + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + f0 += x[i]; + valType f1 = f0 * valType(1103515245) + valType(12345); + valType f2 = f1 * valType(1103515245) + valType(12345); + valType f3 = f2 * valType(1103515245) + valType(12345); + return detail::tvec3( + noise1(f1), + noise1(f2), + noise1(f3)); + } + + // noise4 + template + inline detail::tvec4 noise4 + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + genType f1 = x * genType(1103515245) + genType(12345); + genType f2 = f1 * genType(1103515245) + genType(12345); + genType f3 = f2 * genType(1103515245) + genType(12345); + genType f4 = f3 * genType(1103515245) + genType(12345); + return detail::tvec4( + noise1(f1), + noise1(f2), + noise1(f3), + noise1(f4)); + } + + template + inline detail::tvec4 noise4 + ( + detail::tvec2 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType f0(0); + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + f0 += x[i]; + valType f1 = f0 * valType(1103515245) + valType(12345); + valType f2 = f1 * valType(1103515245) + valType(12345); + valType f3 = f2 * valType(1103515245) + valType(12345); + valType f4 = f3 * valType(1103515245) + valType(12345); + return detail::tvec4( + noise1(f1), + noise1(f2), + noise1(f3), + noise1(f4)); + } + + template + inline detail::tvec4 noise4 + ( + detail::tvec3 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType f0(0); + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + f0 += x[i]; + valType f1 = f0 * valType(1103515245) + valType(12345); + valType f2 = f1 * valType(1103515245) + valType(12345); + valType f3 = f2 * valType(1103515245) + valType(12345); + valType f4 = f3 * valType(1103515245) + valType(12345); + return detail::tvec4( + noise1(f1), + noise1(f2), + noise1(f3), + noise1(f4)); + } + + template + inline detail::tvec4 noise4 + ( + detail::tvec4 const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + valType f0(0); + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + f0 += x[i]; + valType f1 = f0 * valType(1103515245) + valType(12345); + valType f2 = f1 * valType(1103515245) + valType(12345); + valType f3 = f2 * valType(1103515245) + valType(12345); + valType f4 = f3 * valType(1103515245) + valType(12345); + return detail::tvec4( + noise1(f1), + noise1(f2), + noise1(f3), + noise1(f4)); + } + + }//namespace noise + }//namespace function + }//namespace core +}//namespace glm diff --git a/glm/core/func_trigonometric.hpp b/glm/core/func_trigonometric.hpp new file mode 100644 index 00000000..55917b1a --- /dev/null +++ b/glm/core/func_trigonometric.hpp @@ -0,0 +1,125 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-01 +// Updated : 2008-09-10 +// Licence : This source is under MIT License +// File : glm/core/func_trigonometric.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_func_trigonometric +#define glm_core_func_trigonometric + +namespace glm +{ + namespace test{ + void main_core_func_trigonometric(); + }//namespace test + + namespace core{ + namespace function{ + //! Define Angle and trigonometry functions + //! from Section 8.1 of GLSL 1.30.8 specification. + //! Included in glm namespace. + namespace trigonometric{ + + //! Converts degrees to radians and returns the result. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType radians(genType const & degrees); + + //! Converts radians to degrees and returns the result. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType degrees(genType const & radians); + + //! The standard trigonometric sine function. + //! The values returned by this function will range from [-1, 1]. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType sin(genType const & angle); + + //! The standard trigonometric cosine function. + //! The values returned by this function will range from [-1, 1]. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType cos(genType const & angle); + + //! The standard trigonometric tangent function. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType tan(genType const & angle); + + //! Arc sine. Returns an angle whose sine is x. + //! The range of values returned by this function is [-PI/2, PI/2]. + //! Results are undefined if |x| > 1. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType asin(genType const & x); + + //! Arc cosine. Returns an angle whose sine is x. + //! The range of values returned by this function is [0, PI]. + //! Results are undefined if |x| > 1. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType acos(genType const & x); + + //! Arc tangent. Returns an angle whose tangent is y/x. + //! The signs of x and y are used to determine what + //! quadrant the angle is in. The range of values returned + //! by this function is [-PI, PI]. Results are undefined + //! if x and y are both 0. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType atan(genType const & y, genType const & x); + + //! Arc tangent. Returns an angle whose tangent is y_over_x. + //! The range of values returned by this function is [-PI/2, PI/2]. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType atan(genType const & y_over_x); + + //! Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType sinh(genType const & angle); + + //! Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType cosh(genType const & angle); + + //! Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType tanh(genType const & angle); + + //! Arc hyperbolic sine; returns the inverse of sinh. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType asinh(genType const & x); + + //! Arc hyperbolic cosine; returns the non-negative inverse + //! of cosh. Results are undefined if x < 1. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType acosh(genType const & x); + + //! Arc hyperbolic tangent; returns the inverse of tanh. + //! Results are undefined if abs(x) >= 1. + //! (From GLSL 1.30.08 specification, section 8.1) + template + genType atanh(genType const & x); + + }//namespace trigonometric + }//namespace function + }//namespace core + + using namespace core::function::trigonometric; +}//namespace glm + +#include "func_trigonometric.inl" + +#endif//glm_core_func_trigonometric + + diff --git a/glm/core/func_trigonometric.inl b/glm/core/func_trigonometric.inl new file mode 100644 index 00000000..93f97c45 --- /dev/null +++ b/glm/core/func_trigonometric.inl @@ -0,0 +1,745 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-03 +// Updated : 2008-09-14 +// Licence : This source is under MIT License +// File : glm/core/func_trigonometric.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace core{ + namespace function{ + namespace trigonometric{ + + // radians + template + inline genType radians + ( + genType const & degrees + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + const genType pi = genType(3.1415926535897932384626433832795); + return degrees * (pi / genType(180)); + } + + template + inline detail::tvec2 radians + ( + detail::tvec2 const & degrees + ) + { + return detail::tvec2( + radians(degrees.x), + radians(degrees.y)); + } + + template + inline detail::tvec3 radians + ( + detail::tvec3 const & degrees + ) + { + return detail::tvec3( + radians(degrees.x), + radians(degrees.y), + radians(degrees.z)); + } + + template + inline detail::tvec4 radians + ( + detail::tvec4 const & degrees + ) + { + return detail::tvec4( + radians(degrees.x), + radians(degrees.y), + radians(degrees.z), + radians(degrees.w)); + } + + // degrees + template + inline genType degrees + ( + genType const & radians + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + const genType pi = genType(3.1415926535897932384626433832795); + return radians * (genType(180) / pi); + } + + template + inline detail::tvec2 degrees + ( + detail::tvec2 const & radians + ) + { + return detail::tvec2( + degrees(radians.x), + degrees(radians.y)); + } + + template + inline detail::tvec3 degrees + ( + detail::tvec3 const & radians + ) + { + return detail::tvec3( + degrees(radians.x), + degrees(radians.y), + degrees(radians.z)); + } + + template + inline detail::tvec4 degrees + ( + detail::tvec4 const & radians + ) + { + return detail::tvec4( + degrees(radians.x), + degrees(radians.y), + degrees(radians.z), + degrees(radians.w)); + } + + // sin + template + inline genType sin + ( + genType const & angle + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::sin(angle); + } + + template + inline detail::tvec2 sin + ( + detail::tvec2 const & angle + ) + { + return detail::tvec2( + sin(angle.x), + sin(angle.y)); + } + + template + inline detail::tvec3 sin + ( + detail::tvec3 const & angle + ) + { + return detail::tvec3( + sin(angle.x), + sin(angle.y), + sin(angle.z)); + } + + template + inline detail::tvec4 sin + ( + detail::tvec4 const & angle + ) + { + return detail::tvec4( + sin(angle.x), + sin(angle.y), + sin(angle.z), + sin(angle.w)); + } + + // cos + template + inline genType cos(genType const & angle) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::cos(angle); + } + + template + inline detail::tvec2 cos + ( + detail::tvec2 const & angle + ) + { + return detail::tvec2( + cos(angle.x), + cos(angle.y)); + } + + template + inline detail::tvec3 cos + ( + detail::tvec3 const & angle + ) + { + return detail::tvec3( + cos(angle.x), + cos(angle.y), + cos(angle.z)); + } + + template + inline detail::tvec4 cos + ( + detail::tvec4 const & angle + ) + { + return detail::tvec4( + cos(angle.x), + cos(angle.y), + cos(angle.z), + cos(angle.w)); + } + + // tan + template + inline genType tan + ( + genType const & angle + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::tan(angle); + } + + template + inline detail::tvec2 tan + ( + detail::tvec2 const & angle + ) + { + return detail::tvec2( + tan(angle.x), + tan(angle.y)); + } + + template + inline detail::tvec3 tan + ( + detail::tvec3 const & angle + ) + { + return detail::tvec3( + tan(angle.x), + tan(angle.y), + tan(angle.z)); + } + + template + inline detail::tvec4 tan + ( + detail::tvec4 const & angle + ) + { + return detail::tvec4( + tan(angle.x), + tan(angle.y), + tan(angle.z), + tan(angle.w)); + } + + // asin + template + inline genType asin + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::asin(x); + } + + template + inline detail::tvec2 asin + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + asin(x.x), + asin(x.y)); + } + + template + inline detail::tvec3 asin + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + asin(x.x), + asin(x.y), + asin(x.z)); + } + + template + inline detail::tvec4 asin + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + asin(x.x), + asin(x.y), + asin(x.z), + asin(x.w)); + } + + // acos + template + inline genType acos + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::acos(x); + } + + template + inline detail::tvec2 acos + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + acos(x.x), + acos(x.y)); + } + + template + inline detail::tvec3 acos + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + acos(x.x), + acos(x.y), + acos(x.z)); + } + + template + inline detail::tvec4 acos + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + acos(x.x), + acos(x.y), + acos(x.z), + acos(x.w)); + } + + // atan + template + inline genType atan + ( + genType const & y, + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::atan2(y, x); + } + + template + inline detail::tvec2 atan + ( + detail::tvec2 const & y, + detail::tvec2 const & x + ) + { + return detail::tvec2( + atan(y.x, x.x), + atan(y.y, x.y)); + } + + template + inline detail::tvec3 atan + ( + detail::tvec3 const & y, + detail::tvec3 const & x + ) + { + return detail::tvec3( + atan(y.x, x.x), + atan(y.y, x.y), + atan(y.z, x.z)); + } + + template + inline detail::tvec4 atan + ( + detail::tvec4 const & y, + detail::tvec4 const & x + ) + { + return detail::tvec4( + atan(y.x, x.x), + atan(y.y, x.y), + atan(y.z, x.z), + atan(y.w, x.w)); + } + + template + inline genType atan + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return ::std::atan(x); + } + + template + inline detail::tvec2 atan + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + atan(x.x), + atan(x.y)); + } + + template + inline detail::tvec3 atan + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + atan(x.x), + atan(x.y), + atan(x.z)); + } + + template + inline detail::tvec4 atan + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + atan(x.x), + atan(x.y), + atan(x.z), + atan(x.w)); + } + + // sinh + template + inline genType sinh + ( + genType const & angle + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return std::sinh(angle); + } + + template + inline detail::tvec2 sinh + ( + detail::tvec2 const & angle + ) + { + return detail::tvec2( + sinh(angle.x), + sinh(angle.y)); + } + + template + inline detail::tvec3 sinh + ( + detail::tvec3 const & angle + ) + { + return detail::tvec3( + sinh(angle.x), + sinh(angle.y), + sinh(angle.z)); + } + + template + inline detail::tvec4 sinh + ( + detail::tvec4 const & angle + ) + { + return detail::tvec4( + sinh(angle.x), + sinh(angle.y), + sinh(angle.z), + sinh(angle.w)); + } + + // cosh + template + inline genType cosh + ( + genType const & angle + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return std::cosh(angle); + } + + template + inline detail::tvec2 cosh + ( + detail::tvec2 const & angle + ) + { + return detail::tvec2( + cosh(angle.x), + cosh(angle.y)); + } + + template + inline detail::tvec3 cosh + ( + detail::tvec3 const & angle + ) + { + return detail::tvec3( + cosh(angle.x), + cosh(angle.y), + cosh(angle.z)); + } + + template + inline detail::tvec4 cosh + ( + detail::tvec4 const & angle + ) + { + return detail::tvec4( + cosh(angle.x), + cosh(angle.y), + cosh(angle.z), + cosh(angle.w)); + } + + // tanh + template + inline genType tanh + ( + genType const & angle + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return std::tanh(angle); + } + + template + inline detail::tvec2 tanh + ( + detail::tvec2 const & angle + ) + { + return detail::tvec2( + tanh(angle.x), + tanh(angle.y)); + } + + template + inline detail::tvec3 tanh + ( + detail::tvec3 const & angle + ) + { + return detail::tvec3( + tanh(angle.x), + tanh(angle.y), + tanh(angle.z)); + } + + template + inline detail::tvec4 tanh + ( + detail::tvec4 const & angle + ) + { + return detail::tvec4( + tanh(angle.x), + tanh(angle.y), + tanh(angle.z), + tanh(angle.w)); + } + + // asinh + template + inline genType asinh + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + return (x < genType(0) ? genType(-1) : (x > genType(0) ? genType(1) : genType(0))) * log(abs(x) + sqrt(genType(1) + x * x)); + } + + template + inline detail::tvec2 asinh + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + asinh(x.x), + asinh(x.y)); + } + + template + inline detail::tvec3 asinh + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + asinh(x.x), + asinh(x.y), + asinh(x.z)); + } + + template + inline detail::tvec4 asinh + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + asinh(x.x), + asinh(x.y), + asinh(x.z), + asinh(x.w)); + } + + // acosh + template + inline genType acosh + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + if(x < genType(1)) + return genType(0); + return log(x + sqrt(x * x - genType(1))); + } + + template + inline detail::tvec2 acosh + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + acosh(x.x), + acosh(x.y)); + } + + template + inline detail::tvec3 acosh + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + acosh(x.x), + acosh(x.y), + acosh(x.z)); + } + + template + inline detail::tvec4 acosh + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + acosh(x.x), + acosh(x.y), + acosh(x.z), + acosh(x.w)); + } + + // atanh + template + inline genType atanh + ( + genType const & x + ) + { + GLM_STATIC_ASSERT(detail::type::is_float); + + if(abs(x) >= genType(1)) + return 0; + return genType(0.5) * log((genType(1) + x) / (genType(1) - x)); + } + + template + inline detail::tvec2 atanh + ( + detail::tvec2 const & x + ) + { + return detail::tvec2( + atanh(x.x), + atanh(x.y)); + } + + template + inline detail::tvec3 atanh + ( + detail::tvec3 const & x + ) + { + return detail::tvec3( + atanh(x.x), + atanh(x.y), + atanh(x.z)); + } + + template + inline detail::tvec4 atanh + ( + detail::tvec4 const & x + ) + { + return detail::tvec4( + atanh(x.x), + atanh(x.y), + atanh(x.z), + atanh(x.w)); + } + + }//namespace trigonometric + }//namespace function + }//namespace core +}//namespace glm diff --git a/glm/core/func_vector_relational.hpp b/glm/core/func_vector_relational.hpp new file mode 100644 index 00000000..2c7ed6bb --- /dev/null +++ b/glm/core/func_vector_relational.hpp @@ -0,0 +1,78 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-03 +// Updated : 2008-09-09 +// Licence : This source is under MIT License +// File : glm/core/func_vector_relational.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_func_vector_relational +#define glm_core_func_vector_relational + +namespace glm +{ + namespace test{ + void main_core_func_vector_relational(); + }//namespace test + + namespace core{ + namespace function{ + //! Define vector relational functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace. + namespace vector_relational{ + + //! Returns the component-wise compare of x < y. + //! (From GLSL 1.30.08 specification, section 8.6) + template + typename vecType::bool_type lessThan(vecType const & x, vecType const & y); + + //! Returns the component-wise compare of x <= y. + //! (From GLSL 1.30.08 specification, section 8.6) + template + typename vecType::bool_type lessThanEqual(vecType const & x, vecType const & y); + + //! Returns the component-wise compare of x > y. + //! (From GLSL 1.30.08 specification, section 8.6) + template + typename vecType::bool_type greaterThan(vecType const & x, vecType const & y); + + //! Returns the component-wise compare of x >= y. + //! (From GLSL 1.30.08 specification, section 8.6) + template + typename vecType::bool_type greaterThanEqual(vecType const & x, vecType const & y); + + //! Returns the component-wise compare of x == y. + //! (From GLSL 1.30.08 specification, section 8.6) + template + typename vecType::bool_type equal(vecType const & x, vecType const & y); + + //! Returns the component-wise compare of x != y. + //! (From GLSL 1.30.08 specification, section 8.6) + template + typename vecType::bool_type notEqual(vecType const & x, vecType const & y); + + //! Returns true if any component of x is true. + //! (From GLSL 1.30.08 specification, section 8.6) + template + bool any(vecType const & x); + + //! Returns true if all components of x are true. + //! (From GLSL 1.30.08 specification, section 8.6) + template + bool all(vecType const & x); + + //! Returns the component-wise logical complement of x. + //! (From GLSL 1.30.08 specification, section 8.6) + template + typename vecType::bool_type not_(vecType const & x); + + }//namespace vector_relational + }//namespace function + }//namespace core + + using namespace core::function::vector_relational; +}//namespace glm + +#include "func_vector_relational.inl" + +#endif//glm_core_func_vector_relational diff --git a/glm/core/func_vector_relational.inl b/glm/core/func_vector_relational.inl new file mode 100644 index 00000000..fb00eb71 --- /dev/null +++ b/glm/core/func_vector_relational.inl @@ -0,0 +1,359 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-03 +// Updated : 2008-09-14 +// Licence : This source is under MIT License +// File : glm/core/func_vector_relational.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace core{ + namespace function{ + namespace vector_relational{ + + // lessThan + template + inline typename detail::tvec2::bool_type lessThan + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec2::bool_type(x.x < y.x, x.y < y.y); + } + + template + inline typename detail::tvec3::bool_type lessThan + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec3::bool_type(x.x < y.x, x.y < y.y, x.z < y.z); + } + + template + inline typename detail::tvec4::bool_type lessThan + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec4::bool_type(x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w); + } + + // lessThanEqual + template + inline typename detail::tvec2::bool_type lessThanEqual + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec2::bool_type(x.x <= y.x, x.y <= y.y); + } + + template + inline typename detail::tvec3::bool_type lessThanEqual + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec3::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z); + } + + template + inline typename detail::tvec4::bool_type lessThanEqual + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec4::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w); + } + + // greaterThan + template + inline typename detail::tvec2::bool_type greaterThan + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec2::bool_type(x.x > y.x, x.y > y.y); + } + + template + inline typename detail::tvec3::bool_type greaterThan + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec3::bool_type(x.x > y.x, x.y > y.y, x.z > y.z); + } + + template + inline typename detail::tvec4::bool_type greaterThan + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec4::bool_type(x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w); + } + + // greaterThanEqual + template + inline typename detail::tvec2::bool_type greaterThanEqual + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec2::bool_type(x.x >= y.x, x.y >= y.y); + } + + template + inline typename detail::tvec3::bool_type greaterThanEqual + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec3::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z); + } + + template + inline typename detail::tvec4::bool_type greaterThanEqual + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint); + + return typename detail::tvec4::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w); + } + + // equal + template + inline typename detail::tvec2::bool_type equal + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint || + detail::type::is_bool); + + return typename detail::tvec2::bool_type(x.x == y.x, x.y == y.y); + } + + template + inline typename detail::tvec3::bool_type equal + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint || + detail::type::is_bool); + + return typename detail::tvec3::bool_type(x.x == y.x, x.y == y.y, x.z == y.z); + } + + template + inline typename detail::tvec4::bool_type equal + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint || + detail::type::is_bool); + + return typename detail::tvec4::bool_type(x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w); + } + + // notEqual + template + inline typename detail::tvec2::bool_type notEqual + ( + detail::tvec2 const & x, + detail::tvec2 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint || + detail::type::is_bool); + + return typename detail::tvec2::bool_type(x.x != y.x, x.y != y.y); + } + + template + inline typename detail::tvec3::bool_type notEqual + ( + detail::tvec3 const & x, + detail::tvec3 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint || + detail::type::is_bool); + + return typename detail::tvec3::bool_type(x.x != y.x, x.y != y.y, x.z != y.z); + } + + template + inline typename detail::tvec4::bool_type notEqual + ( + detail::tvec4 const & x, + detail::tvec4 const & y + ) + { + GLM_STATIC_ASSERT( + detail::type::is_float || + detail::type::is_int || + detail::type::is_uint || + detail::type::is_bool); + + return typename detail::tvec4::bool_type(x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w); + } + + // any + inline bool any(detail::tvec2 const & x) + { + return x.x || x.y; + } + + inline bool any(detail::tvec3 const & x) + { + return x.x || x.y || x.z; + } + + inline bool any(detail::tvec4 const & x) + { + return x.x || x.y || x.z || x.w; + } + + // all + inline bool all(const detail::tvec2& x) + { + return x.x && x.y; + } + + inline bool all(const detail::tvec3& x) + { + return x.x && x.y && x.z; + } + + inline bool all(const detail::tvec4& x) + { + return x.x && x.y && x.z && x.w; + } + + // not + inline detail::tvec2::bool_type not_ + ( + detail::tvec2 const & v + ) + { + return detail::tvec2::bool_type(!v.x, !v.y); + } + + inline detail::tvec3::bool_type not_ + ( + detail::tvec3 const & v + ) + { + return detail::tvec3::bool_type(!v.x, !v.y, !v.z); + } + + inline detail::tvec4::bool_type not_ + ( + detail::tvec4 const & v + ) + { + return detail::tvec4::bool_type(!v.x, !v.y, !v.z, !v.w); + } + + }//namespace vector_relational + }//namespace function + }//namespace core +}//namespace glm + diff --git a/glm/core/hint.hpp b/glm/core/hint.hpp new file mode 100644 index 00000000..57625d4d --- /dev/null +++ b/glm/core/hint.hpp @@ -0,0 +1,21 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-14 +// Updated : 2008-08-14 +// Licence : This source is under MIT License +// File : glm/core/hint.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type +#define glm_core_type + +namespace glm +{ + // Use dont_care, nicest and fastest to optimize implementations. + class dont_care {}; + class nicest {}; + class fastest {}; +}; + +#endif//glm_core_type diff --git a/glm/core/intrinsic_common.hpp b/glm/core/intrinsic_common.hpp new file mode 100644 index 00000000..731cba7b --- /dev/null +++ b/glm/core/intrinsic_common.hpp @@ -0,0 +1,60 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-11 +// Updated : 2009-05-11 +// Licence : This source is under MIT License +// File : glm/core/intrinsic_common.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef GLM_DETAIL_INTRINSIC_COMMON_INCLUDED +#define GLM_DETAIL_INTRINSIC_COMMON_INCLUDED + +//#include +//#include +#include +#include + +__m128 _mm_abs_ps(__m128 x); + +__m128 _mm_sgn_ps(__m128 x); + +//floor +__m128 _mm_flr_ps(__m128 v); + +//trunc +__m128 _mm_trc_ps(__m128 v); + +//round +__m128 _mm_rnd_ps(__m128 v); + +//roundEven +__m128 _mm_rde_ps(__m128 v); + +__m128 _mm_ceil_ps(__m128 v); + +__m128 _mm_frc_ps(__m128 x); + +__m128 _mm_mod_ps(__m128 x, __m128 y); + +__m128 _mm_modf_ps(__m128 x, __m128i & i); + +//inline __m128 _mm_min_ps(__m128 x, __m128 y) + +//inline __m128 _mm_max_ps(__m128 x, __m128 y) + +__m128 _mm_clp_ps(__m128 v, __m128 minVal, __m128 maxVal); + +__m128 _mm_mix_ps(__m128 v1, __m128 v2, __m128 a); + +__m128 _mm_stp_ps(__m128 edge, __m128 x); + +__m128 _mm_ssp_ps(__m128 edge0, __m128 edge1, __m128 x); + +__m128 _mm_nan_ps(__m128 x); + +__m128 _mm_inf_ps(__m128 x); + +#include "intrinsic_common.inl" + +#endif//GLM_DETAIL_INTRINSIC_COMMON_INCLUDED diff --git a/glm/core/intrinsic_common.inl b/glm/core/intrinsic_common.inl new file mode 100644 index 00000000..ea732286 --- /dev/null +++ b/glm/core/intrinsic_common.inl @@ -0,0 +1,280 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-08 +// Updated : 2009-05-08 +// Licence : This source is under MIT License +// File : glm/core/intrinsic_common.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + + union ieee754_QNAN + { + const float f; + struct + { + const unsigned int mantissa:23, exp:8, sign:1; + }; + + ieee754_QNAN() : f(0.0), mantissa(0x7FFFFF), exp(0xFF), sign(0x0) {} + }; + + static const __m128 zero = _mm_setzero_ps(); + static const __m128 one = _mm_set_ps1(1.0f); + static const __m128 minus_one = _mm_set_ps1(-1.0f); + static const __m128 two = _mm_set_ps1(2.0f); + static const __m128 three = _mm_set_ps1(3.0f); + static const __m128 pi = _mm_set_ps1(3.1415926535897932384626433832795f); + static const __m128 hundred_eighty = _mm_set_ps1(180.f); + static const __m128 pi_over_hundred_eighty = _mm_set_ps1(0.017453292519943295769236907684886f); + static const __m128 hundred_eighty_over_pi = _mm_set_ps1(57.295779513082320876798154814105f); + + static const ieee754_QNAN absMask; + static const __m128 abs4Mask = _mm_set_ps1(absMask.f); + + //static const __m128 _epi32_sign_mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000)); + //static const __m128 _epi32_inv_sign_mask = _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF)); + //static const __m128 _epi32_mant_mask = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000)); + //static const __m128 _epi32_inv_mant_mask = _mm_castsi128_ps(_mm_set1_epi32(0x807FFFFF)); + //static const __m128 _epi32_min_norm_pos = _mm_castsi128_ps(_mm_set1_epi32(0x00800000)); + static const __m128 _epi32_0 = _mm_set_ps1(0); + static const __m128 _epi32_1 = _mm_set_ps1(1); + static const __m128 _epi32_2 = _mm_set_ps1(2); + static const __m128 _epi32_3 = _mm_set_ps1(3); + static const __m128 _epi32_4 = _mm_set_ps1(4); + static const __m128 _epi32_5 = _mm_set_ps1(5); + static const __m128 _epi32_6 = _mm_set_ps1(6); + static const __m128 _epi32_7 = _mm_set_ps1(7); + static const __m128 _epi32_8 = _mm_set_ps1(8); + static const __m128 _epi32_9 = _mm_set_ps1(9); + static const __m128 _epi32_127 = _mm_set_ps1(127); + //static const __m128 _epi32_ninf = _mm_castsi128_ps(_mm_set1_epi32(0xFF800000)); + //static const __m128 _epi32_pinf = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000)); + + static const __m128 _ps_1_3 = _mm_set_ps1(0.33333333333333333333333333333333f); + static const __m128 _ps_0p5 = _mm_set_ps1(0.5f); + static const __m128 _ps_1 = _mm_set_ps1(1.0f); + static const __m128 _ps_m1 = _mm_set_ps1(-1.0f); + static const __m128 _ps_2 = _mm_set_ps1(2.0f); + static const __m128 _ps_3 = _mm_set_ps1(3.0f); + static const __m128 _ps_127 = _mm_set_ps1(127.0f); + static const __m128 _ps_255 = _mm_set_ps1(255.0f); + static const __m128 _ps_2pow23 = _mm_set_ps1(8388608.0f); + + static const __m128 _ps_1_0_0_0 = _mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f); + static const __m128 _ps_0_1_0_0 = _mm_set_ps(0.0f, 1.0f, 0.0f, 0.0f); + static const __m128 _ps_0_0_1_0 = _mm_set_ps(0.0f, 0.0f, 1.0f, 0.0f); + static const __m128 _ps_0_0_0_1 = _mm_set_ps(0.0f, 0.0f, 0.0f, 1.0f); + + static const __m128 _ps_pi = _mm_set_ps1(3.1415926535897932384626433832795f); + static const __m128 _ps_pi2 = _mm_set_ps1(6.283185307179586476925286766560f); + static const __m128 _ps_2_pi = _mm_set_ps1(0.63661977236758134307553505349006f); + static const __m128 _ps_pi_2 = _mm_set_ps1(1.5707963267948966192313216916398f); + static const __m128 _ps_4_pi = _mm_set_ps1(1.2732395447351626861510701069801f); + static const __m128 _ps_pi_4 = _mm_set_ps1(0.78539816339744830961566084581988f); + + static const __m128 _ps_sincos_p0 = _mm_set_ps1(0.15707963267948963959e1f); + static const __m128 _ps_sincos_p1 = _mm_set_ps1(-0.64596409750621907082e0f); + static const __m128 _ps_sincos_p2 = _mm_set_ps1(0.7969262624561800806e-1f); + static const __m128 _ps_sincos_p3 = _mm_set_ps1(-0.468175413106023168e-2f); + static const __m128 _ps_tan_p0 = _mm_set_ps1(-1.79565251976484877988e7f); + static const __m128 _ps_tan_p1 = _mm_set_ps1(1.15351664838587416140e6f); + static const __m128 _ps_tan_p2 = _mm_set_ps1(-1.30936939181383777646e4f); + static const __m128 _ps_tan_q0 = _mm_set_ps1(-5.38695755929454629881e7f); + static const __m128 _ps_tan_q1 = _mm_set_ps1(2.50083801823357915839e7f); + static const __m128 _ps_tan_q2 = _mm_set_ps1(-1.32089234440210967447e6f); + static const __m128 _ps_tan_q3 = _mm_set_ps1(1.36812963470692954678e4f); + static const __m128 _ps_tan_poleval = _mm_set_ps1(3.68935e19f); + static const __m128 _ps_atan_t0 = _mm_set_ps1(-0.91646118527267623468e-1f); + static const __m128 _ps_atan_t1 = _mm_set_ps1(-0.13956945682312098640e1f); + static const __m128 _ps_atan_t2 = _mm_set_ps1(-0.94393926122725531747e2f); + static const __m128 _ps_atan_t3 = _mm_set_ps1(0.12888383034157279340e2f); + static const __m128 _ps_atan_s0 = _mm_set_ps1(0.12797564625607904396e1f); + static const __m128 _ps_atan_s1 = _mm_set_ps1(0.21972168858277355914e1f); + static const __m128 _ps_atan_s2 = _mm_set_ps1(0.68193064729268275701e1f); + static const __m128 _ps_atan_s3 = _mm_set_ps1(0.28205206687035841409e2f); + + static const __m128 _ps_exp_hi = _mm_set_ps1(88.3762626647949f); + static const __m128 _ps_exp_lo = _mm_set_ps1(-88.3762626647949f); + static const __m128 _ps_exp_rln2 = _mm_set_ps1(1.4426950408889634073599f); + static const __m128 _ps_exp_p0 = _mm_set_ps1(1.26177193074810590878e-4f); + static const __m128 _ps_exp_p1 = _mm_set_ps1(3.02994407707441961300e-2f); + static const __m128 _ps_exp_q0 = _mm_set_ps1(3.00198505138664455042e-6f); + static const __m128 _ps_exp_q1 = _mm_set_ps1(2.52448340349684104192e-3f); + static const __m128 _ps_exp_q2 = _mm_set_ps1(2.27265548208155028766e-1f); + static const __m128 _ps_exp_q3 = _mm_set_ps1(2.00000000000000000009e0f); + static const __m128 _ps_exp_c1 = _mm_set_ps1(6.93145751953125e-1f); + static const __m128 _ps_exp_c2 = _mm_set_ps1(1.42860682030941723212e-6f); + static const __m128 _ps_exp2_hi = _mm_set_ps1(127.4999961853f); + static const __m128 _ps_exp2_lo = _mm_set_ps1(-127.4999961853f); + static const __m128 _ps_exp2_p0 = _mm_set_ps1(2.30933477057345225087e-2f); + static const __m128 _ps_exp2_p1 = _mm_set_ps1(2.02020656693165307700e1f); + static const __m128 _ps_exp2_p2 = _mm_set_ps1(1.51390680115615096133e3f); + static const __m128 _ps_exp2_q0 = _mm_set_ps1(2.33184211722314911771e2f); + static const __m128 _ps_exp2_q1 = _mm_set_ps1(4.36821166879210612817e3f); + static const __m128 _ps_log_p0 = _mm_set_ps1(-7.89580278884799154124e-1f); + static const __m128 _ps_log_p1 = _mm_set_ps1(1.63866645699558079767e1f); + static const __m128 _ps_log_p2 = _mm_set_ps1(-6.41409952958715622951e1f); + static const __m128 _ps_log_q0 = _mm_set_ps1(-3.56722798256324312549e1f); + static const __m128 _ps_log_q1 = _mm_set_ps1(3.12093766372244180303e2f); + static const __m128 _ps_log_q2 = _mm_set_ps1(-7.69691943550460008604e2f); + static const __m128 _ps_log_c0 = _mm_set_ps1(0.693147180559945f); + static const __m128 _ps_log2_c0 = _mm_set_ps1(1.44269504088896340735992f); + +}//namespace detail +}//namespace glm + +inline __m128 _mm_abs_ps(__m128 x) +{ + return _mm_and_ps(glm::detail::abs4Mask, x); +} + +inline __m128 _mm_sgn_ps(__m128 x) +{ + //__m128 cmp0 = _mm_cmpeq_ps(x, zero); + //__m128 cmp1 = _mm_cmple_ps(x, zero); + //__m128 cmp2 = _mm_cmpge_ps(x, zero); + + __m128 result; + __m128 cmp0 = _mm_cmpeq_ps(x, glm::detail::zero); + if(_mm_movemask_ps(cmp0) == 0) + result = glm::detail::zero; + else + { + __m128 cmp1 = _mm_cmpge_ps(x, glm::detail::zero); + //__m128 cmp2 = _mm_cmple_ps(x, glm::detail::zero); + if(_mm_movemask_ps(cmp1) > 0) + result = glm::detail::one; + else //if(_mm_movemask_ps(cmp2) > 0) + result = glm::detail::minus_one; + } + return result; +} + +//floor +inline __m128 _mm_flr_ps(__m128 x) +{ + __m128 rnd0 = _mm_rnd_ps(x); + __m128 cmp0 = _mm_cmplt_ps(x, rnd0); + __m128 and0 = _mm_and_ps(cmp0, glm::detail::_ps_1); + __m128 sub0 = _mm_sub_ps(rnd0, and0); + return sub0; +} + +//trunc +inline __m128 _mm_trc_ps(__m128 v) +{ + return __m128(); +} + +//round +inline __m128 _mm_rnd_ps(__m128 x) +{ + __m128 and0;// = _mm_and_ps(glm::detail::_epi32_sign_mask, x); + __m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23); + __m128 add0 = _mm_add_ps(x, or0); + __m128 sub0 = _mm_sub_ps(add0, or0); + return sub0; +} + +//roundEven +inline __m128 _mm_rde_ps(__m128 v) +{ + +} + +inline __m128 _mm_ceil_ps(__m128 x) +{ + __m128 rnd0 = _mm_rnd_ps(x); + __m128 cmp0 = _mm_cmpgt_ps(x, rnd0); + __m128 and0 = _mm_and_ps(cmp0, glm::detail::_ps_1); + __m128 add0 = _mm_add_ps(rnd0, and0); + return add0; +} + +inline __m128 _mm_frc_ps(__m128 x) +{ + __m128 flr0 = _mm_flr_ps(x); + __m128 sub0 = _mm_sub_ps(x, flr0); + return sub0; +} + +inline __m128 _mm_mod_ps(__m128 x, __m128 y) +{ + __m128 div0 = _mm_div_ps(x, y); + __m128 flr0 = _mm_flr_ps(div0); + __m128 mul0 = _mm_mul_ps(y, flr0); + __m128 sub0 = _mm_sub_ps(x, mul0); + return sub0; +} + +inline __m128 _mm_modf_ps(__m128 x, __m128i & i) +{ + +} + +//inline __m128 _mm_min_ps(__m128 x, __m128 y) + +//inline __m128 _mm_max_ps(__m128 x, __m128 y) + +inline __m128 _mm_clp_ps(__m128 v, __m128 minVal, __m128 maxVal) +{ + __m128 min0 = _mm_min_ps(v, maxVal); + __m128 max0 = _mm_max_ps(min0, minVal); + return max0; +} + +inline __m128 _mm_mix_ps(__m128 v1, __m128 v2, __m128 a) +{ + __m128 sub0 = _mm_sub_ps(glm::detail::one, a); + __m128 mul0 = _mm_mul_ps(v1, sub0); + __m128 mul1 = _mm_mul_ps(v2, a); + __m128 add0 = _mm_add_ps(mul0, mul1); + return add0; +} + +inline __m128 _mm_stp_ps(__m128 edge, __m128 x) +{ + __m128 cmp = _mm_cmple_ps(x, edge); + if(_mm_movemask_ps(cmp) == 0) + return glm::detail::one; + else + return glm::detail::zero; +} + +inline __m128 _mm_ssp_ps(__m128 edge0, __m128 edge1, __m128 x) +{ + __m128 sub0 = _mm_sub_ps(x, edge0); + __m128 sub1 = _mm_sub_ps(edge1, edge0); + __m128 div0 = _mm_sub_ps(sub0, sub1); + __m128 clp0 = _mm_clp_ps(div0, glm::detail::zero, glm::detail::one); + __m128 mul0 = _mm_mul_ps(glm::detail::two, clp0); + __m128 sub2 = _mm_sub_ps(glm::detail::three, mul0); + __m128 mul1 = _mm_mul_ps(clp0, clp0); + __m128 mul2 = _mm_mul_ps(mul1, sub2); + return mul2; +} + +inline __m128 _mm_nan_ps(__m128 x) +{ + +} + +inline __m128 _mm_inf_ps(__m128 x) +{ + +} + +// SSE scalar reciprocal sqrt using rsqrt op, plus one Newton-Rhaphson iteration +// By Elan Ruskin, +inline __m128 _mm_sqrt_wip_ss(__m128 const x) +{ + __m128 recip = _mm_rsqrt_ss( x ); // "estimate" opcode + const static __m128 three = { 3, 3, 3, 3 }; // aligned consts for fast load + const static __m128 half = { 0.5,0.5,0.5,0.5 }; + __m128 halfrecip = _mm_mul_ss( half, recip ); + __m128 threeminus_xrr = _mm_sub_ss( three, _mm_mul_ss( x, _mm_mul_ss ( recip, recip ) ) ); + return _mm_mul_ss( halfrecip, threeminus_xrr ); +} diff --git a/glm/core/intrinsic_exponential.hpp b/glm/core/intrinsic_exponential.hpp new file mode 100644 index 00000000..e69de29b diff --git a/glm/core/intrinsic_exponential.inl b/glm/core/intrinsic_exponential.inl new file mode 100644 index 00000000..e69de29b diff --git a/glm/core/intrinsic_geometric.hpp b/glm/core/intrinsic_geometric.hpp new file mode 100644 index 00000000..422f19f2 --- /dev/null +++ b/glm/core/intrinsic_geometric.hpp @@ -0,0 +1,45 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-08 +// Updated : 2009-05-08 +// Licence : This source is under MIT License +// File : glm/core/intrinsic_geometric.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_intrinsic_geometric +#define glm_core_intrinsic_geometric + +#include "intrinsic_common.hpp" + +//length +__m128 _mm_len_ps(__m128 x); + +//distance +__m128 _mm_dst_ps(__m128 p0, __m128 p1); + +//dot +__m128 _mm_dot_ps(__m128 v1, __m128 v2); + +// SSE1 +__m128 _mm_dot_ss(__m128 v1, __m128 v2); + +//cross +__m128 _mm_xpd_ps(__m128 v1, __m128 v2); + +//normalize +__m128 _mm_nrm_ps(__m128 v); + +//faceforward +__m128 _mm_ffd_ps(__m128 N, __m128 I, __m128 Nref); + +//reflect +__m128 _mm_rfe_ps(__m128 I, __m128 N); + +//refract +__m128 _mm_rfa_ps(__m128 I, __m128 N, __m128 eta); + + +#include "intrinsic_geometric.inl" + +#endif//glm_core_intrinsic_geometric diff --git a/glm/core/intrinsic_geometric.inl b/glm/core/intrinsic_geometric.inl new file mode 100644 index 00000000..a98ca46c --- /dev/null +++ b/glm/core/intrinsic_geometric.inl @@ -0,0 +1,117 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-08 +// Updated : 2009-05-08 +// Licence : This source is under MIT License +// File : glm/core/intrinsic_geometric.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +//length +inline __m128 _mm_len_ps(__m128 x) +{ + __m128 dot0 = _mm_dot_ps(x, x); + __m128 sqt0 = _mm_sqrt_ps(dot0); + return sqt0; +} + +//distance +inline __m128 _mm_dst_ps(__m128 p0, __m128 p1) +{ + __m128 sub0 = _mm_sub_ps(p0, p1); + __m128 len0 = _mm_len_ps(sub0); + return len0; +} + +//dot +inline __m128 _mm_dot_ps(__m128 v1, __m128 v2) +{ + __m128 mul0 = _mm_mul_ps(v1, v2); + __m128 swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); + __m128 add0 = _mm_add_ps(mul0, swp0); + __m128 swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); + __m128 add1 = _mm_add_ps(add0, swp1); + return add1; +} + +// SSE1 +inline __m128 _mm_dot_ss(__m128 v1, __m128 v2) +{ + __m128 mul0 = _mm_mul_ps(v1, v2); + __m128 mov0 = _mm_movehl_ps(mul0, mul0); + __m128 add0 = _mm_add_ps(mov0, mul0); + __m128 swp1 = _mm_shuffle_ps(add0, add0, 1); + __m128 add1 = _mm_add_ss(add0, swp1); + return add1; +} + +//cross +inline __m128 _mm_xpd_ps(__m128 v1, __m128 v2) +{ + __m128 swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2)); + __m128 swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2)); + __m128 mul0 = _mm_mul_ps(swp0, swp3); + __m128 mul1 = _mm_mul_ps(swp1, swp2); + __m128 sub0 = _mm_sub_ps(mul0, mul1); + return sub0; +} + +//normalize +inline __m128 _mm_nrm_ps(__m128 v) +{ + __m128 dot0 = _mm_dot_ps(v, v); + __m128 isr0 = _mm_rsqrt_ps(dot0); + __m128 mul0 = _mm_mul_ps(v, isr0); + return mul0; +} + +//faceforward +inline __m128 _mm_ffd_ps(__m128 N, __m128 I, __m128 Nref) +{ + //__m128 dot0 = _mm_dot_ps(v, v); + //__m128 neg0 = _mm_neg_ps(N); + //__m128 sgn0 = _mm_sgn_ps(dot0); + //__m128 mix0 = _mm_mix_ps(N, neg0, sgn0); + //return mix0; + + __m128 dot0 = _mm_dot_ps(Nref, I); + __m128 sgn0 = _mm_sgn_ps(dot0); + __m128 mul0 = _mm_mul_ps(sgn0, glm::detail::minus_one); + __m128 mul1 = _mm_mul_ps(N, mul0); + return mul1; +} + +//reflect +inline __m128 _mm_rfe_ps(__m128 I, __m128 N) +{ + __m128 dot0 = _mm_dot_ps(N, I); + __m128 mul0 = _mm_mul_ps(N, I); + __m128 mul1 = _mm_mul_ps(mul0, glm::detail::two); + __m128 sub0 = _mm_sub_ps(I, mul1); + return sub0; +} + +//refract +inline __m128 _mm_rfa_ps(__m128 I, __m128 N, __m128 eta) +{ + __m128 dot0 = _mm_dot_ps(N, I); + __m128 mul0 = _mm_mul_ps(eta, eta); + __m128 mul1 = _mm_mul_ps(dot0, dot0); + __m128 sub0 = _mm_sub_ps(glm::detail::one, mul0); + __m128 sub1 = _mm_sub_ps(glm::detail::one, mul1); + __m128 mul2 = _mm_mul_ps(sub0, sub1); + + if(_mm_movemask_ps(_mm_cmplt_ss(mul2, glm::detail::zero)) == 0) + return glm::detail::zero; + + __m128 sqt0 = _mm_sqrt_ps(mul2); + __m128 mul3 = _mm_mul_ps(eta, dot0); + __m128 add0 = _mm_add_ps(mul3, sqt0); + __m128 mul4 = _mm_mul_ps(add0, N); + __m128 mul5 = _mm_mul_ps(eta, I); + __m128 sub2 = _mm_sub_ps(mul5, mul4); + + return sub2; +} diff --git a/glm/core/intrinsic_matrix.hpp b/glm/core/intrinsic_matrix.hpp new file mode 100644 index 00000000..3a9543de --- /dev/null +++ b/glm/core/intrinsic_matrix.hpp @@ -0,0 +1,36 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-06-05 +// Updated : 2009-06-05 +// Licence : This source is under MIT License +// File : glm/core/intrinsic_common.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef GLM_DETAIL_INTRINSIC_MATRIX_INCLUDED +#define GLM_DETAIL_INTRINSIC_MATRIX_INCLUDED + +#include "../glm.hpp" + +#include +#include + +void _mm_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); + +void _mm_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); + +__m128 _mm_mul_ps(__m128 m[4], __m128 v); + +__m128 _mm_mul_ps(__m128 v, __m128 m[4]); + +void _mm_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]); + +void _mm_transpose_ps(__m128 const in[4], __m128 out[4]); + +void _mm_inverse_ps(__m128 const in[4], __m128 out[4]); + +void _mm_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]); + +#include "intrinsic_matrix.inl" + +#endif//GLM_DETAIL_INTRINSIC_MATRIX_INCLUDED diff --git a/glm/core/intrinsic_matrix.inl b/glm/core/intrinsic_matrix.inl new file mode 100644 index 00000000..e5fe43ee --- /dev/null +++ b/glm/core/intrinsic_matrix.inl @@ -0,0 +1,704 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-06-05 +// Updated : 2009-06-05 +// Licence : This source is under MIT License +// File : glm/core/intrinsic_common.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +static const __m128 one = _mm_set_ps1(1.0f); +static const __m128 pi = _mm_set_ps1(3.141592653589793238462643383279f); +static const __m128 _m128_rad_ps = _mm_set_ps1(3.141592653589793238462643383279f / 180.f); +static const __m128 _m128_deg_ps = _mm_set_ps1(180.f / 3.141592653589793238462643383279f); + +inline void _mm_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]) +{ + { + out[0] = _mm_add_ps(in1[0], in2[0]); + out[1] = _mm_add_ps(in1[1], in2[1]); + out[2] = _mm_add_ps(in1[2], in2[2]); + out[3] = _mm_add_ps(in1[3], in2[3]); + } +} + +inline void _mm_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]) +{ + { + out[0] = _mm_sub_ps(in1[0], in2[0]); + out[1] = _mm_sub_ps(in1[1], in2[1]); + out[2] = _mm_sub_ps(in1[2], in2[2]); + out[3] = _mm_sub_ps(in1[3], in2[3]); + } +} + +inline __m128 _mm_mul_ps(__m128 m[4], __m128 v) +{ + __m128 v0 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 v1 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 v2 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 v3 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(m[0], v0); + __m128 m1 = _mm_mul_ps(m[1], v1); + __m128 m2 = _mm_mul_ps(m[2], v2); + __m128 m3 = _mm_mul_ps(m[3], v3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + return a2; +} + +inline __m128 _mm_mul_ps(__m128 v, __m128 m[4]) +{ + __m128 i0 = m[0]; + __m128 i1 = m[1]; + __m128 i2 = m[2]; + __m128 i3 = m[3]; + + __m128 m0 = _mm_mul_ps(v, i0); + __m128 m1 = _mm_mul_ps(v, i1); + __m128 m2 = _mm_mul_ps(v, i2); + __m128 m3 = _mm_mul_ps(v, i3); + + __m128 u0 = _mm_unpacklo_ps(m0, m1); + __m128 u1 = _mm_unpackhi_ps(m0, m1); + __m128 a0 = _mm_add_ps(u0, u1); + + __m128 u2 = _mm_unpacklo_ps(m2, m3); + __m128 u3 = _mm_unpackhi_ps(m2, m3); + __m128 a1 = _mm_add_ps(u2, u3); + + __m128 f0 = _mm_movelh_ps(a0, a1); + __m128 f1 = _mm_movehl_ps(a1, a0); + __m128 f2 = _mm_add_ps(f0, f1); + + return f2; +} + +inline void _mm_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]) +{ + { + __m128 e0 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[0] = a2; + } + + { + __m128 e0 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[1] = a2; + } + + { + __m128 e0 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[2] = a2; + } + + { + //(__m128&)_mm_shuffle_epi32(__m128i&)in2[0], _MM_SHUFFLE(3, 3, 3, 3)) + __m128 e0 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[3] = a2; + } +} + +inline void _mm_transpose_ps(__m128 const in[4], __m128 out[4]) +{ + __m128 tmp0 = _mm_shuffle_ps(in[0], in[1], 0x44); + __m128 tmp2 = _mm_shuffle_ps(in[0], in[1], 0xEE); + __m128 tmp1 = _mm_shuffle_ps(in[2], in[3], 0x44); + __m128 tmp3 = _mm_shuffle_ps(in[2], in[3], 0xEE); + + out[0] = _mm_shuffle_ps(tmp0, tmp1, 0x88); + out[1] = _mm_shuffle_ps(tmp0, tmp1, 0xDD); + out[2] = _mm_shuffle_ps(tmp2, tmp3, 0x88); + out[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD); +} + +inline void _mm_inverse_ps(__m128 const in[4], __m128 out[4]) +{ + __m128 Fac0; + { + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac0 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + __m128 Fac1; + { + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac1 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + + __m128 Fac2; + { + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac2 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + __m128 Fac3; + { + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac3 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + __m128 Fac4; + { + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac4 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + __m128 Fac5; + { + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac5 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); + __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); + + // m[1][0] + // m[0][0] + // m[0][0] + // m[0][0] + __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][1] + // m[0][1] + // m[0][1] + // m[0][1] + __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][2] + // m[0][2] + // m[0][2] + // m[0][2] + __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][3] + // m[0][3] + // m[0][3] + // m[0][3] + __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); + + // col0 + // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), + // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), + // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), + // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), + __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); + __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); + __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); + __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); + __m128 Add00 = _mm_add_ps(Sub00, Mul02); + __m128 Inv0 = _mm_mul_ps(SignB, Add00); + + // col1 + // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), + // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), + // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), + // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), + __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); + __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); + __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); + __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); + __m128 Add01 = _mm_add_ps(Sub01, Mul05); + __m128 Inv1 = _mm_mul_ps(SignA, Add01); + + // col2 + // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), + // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), + // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), + // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), + __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); + __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); + __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); + __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); + __m128 Add02 = _mm_add_ps(Sub02, Mul08); + __m128 Inv2 = _mm_mul_ps(SignB, Add02); + + // col3 + // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), + // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), + // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), + // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); + __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); + __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); + __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); + __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); + __m128 Add03 = _mm_add_ps(Sub03, Mul11); + __m128 Inv3 = _mm_mul_ps(SignA, Add03); + + __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); + + // valType Determinant = m[0][0] * Inverse[0][0] + // + m[0][1] * Inverse[1][0] + // + m[0][2] * Inverse[2][0] + // + m[0][3] * Inverse[3][0]; + __m128 Det0 = _mm_dot_ps(in[0], Row2); + __m128 Rcp0 = _mm_div_ps(one, Det0); + //__m128 Rcp0 = _mm_rcp_ps(Det0); + + // Inverse /= Determinant; + out[0] = _mm_mul_ps(Inv0, Rcp0); + out[1] = _mm_mul_ps(Inv1, Rcp0); + out[2] = _mm_mul_ps(Inv2, Rcp0); + out[3] = _mm_mul_ps(Inv3, Rcp0); +} + +inline void _mm_inverse_fast_ps(__m128 const in[4], __m128 out[4]) +{ + __m128 Fac0; + { + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac0 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + __m128 Fac1; + { + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac1 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + + __m128 Fac2; + { + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac2 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + __m128 Fac3; + { + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac3 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + __m128 Fac4; + { + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac4 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + __m128 Fac5; + { + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac5 = _mm_sub_ps(Mul00, Mul01); + + bool stop = true; + } + + __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); + __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); + + // m[1][0] + // m[0][0] + // m[0][0] + // m[0][0] + __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][1] + // m[0][1] + // m[0][1] + // m[0][1] + __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][2] + // m[0][2] + // m[0][2] + // m[0][2] + __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][3] + // m[0][3] + // m[0][3] + // m[0][3] + __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); + + // col0 + // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), + // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), + // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), + // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), + __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); + __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); + __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); + __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); + __m128 Add00 = _mm_add_ps(Sub00, Mul02); + __m128 Inv0 = _mm_mul_ps(SignB, Add00); + + // col1 + // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), + // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), + // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), + // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), + __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); + __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); + __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); + __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); + __m128 Add01 = _mm_add_ps(Sub01, Mul05); + __m128 Inv1 = _mm_mul_ps(SignA, Add01); + + // col2 + // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), + // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), + // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), + // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), + __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); + __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); + __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); + __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); + __m128 Add02 = _mm_add_ps(Sub02, Mul08); + __m128 Inv2 = _mm_mul_ps(SignB, Add02); + + // col3 + // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), + // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), + // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), + // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); + __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); + __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); + __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); + __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); + __m128 Add03 = _mm_add_ps(Sub03, Mul11); + __m128 Inv3 = _mm_mul_ps(SignA, Add03); + + __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); + + // valType Determinant = m[0][0] * Inverse[0][0] + // + m[0][1] * Inverse[1][0] + // + m[0][2] * Inverse[2][0] + // + m[0][3] * Inverse[3][0]; + __m128 Det0 = _mm_dot_ps(in[0], Row2); + __m128 Rcp0 = _mm_rcp_ps(Det0); + //__m128 Rcp0 = _mm_div_ps(one, Det0); + // Inverse /= Determinant; + out[0] = _mm_mul_ps(Inv0, Rcp0); + out[1] = _mm_mul_ps(Inv1, Rcp0); + out[2] = _mm_mul_ps(Inv2, Rcp0); + out[3] = _mm_mul_ps(Inv3, Rcp0); +} + + +void _mm_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]) +{ + float a = glm::radians(Angle); + float c = cos(a); + float s = sin(a); + + glm::vec4 AxisA(v[0], v[1], v[2], float(0)); + __m128 AxisB = _mm_set_ps(AxisA.w, AxisA.z, AxisA.y, AxisA.x); + __m128 AxisC = _mm_nrm_ps(AxisB); + + __m128 Cos0 = _mm_set_ss(c); + __m128 CosA = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Sin0 = _mm_set_ss(s); + __m128 SinA = _mm_shuffle_ps(Sin0, Sin0, _MM_SHUFFLE(0, 0, 0, 0)); + + // detail::tvec3 temp = (valType(1) - c) * axis; + __m128 Temp0 = _mm_sub_ps(one, CosA); + __m128 Temp1 = _mm_mul_ps(Temp0, AxisC); + + //Rotate[0][0] = c + temp[0] * axis[0]; + //Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; + //Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; + __m128 Axis0 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 TmpA0 = _mm_mul_ps(Axis0, AxisC); + __m128 CosA0 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 1, 0)); + __m128 TmpA1 = _mm_add_ps(CosA0, TmpA0); + __m128 SinA0 = SinA;//_mm_set_ps(0.0f, s, -s, 0.0f); + __m128 TmpA2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 1, 2, 3)); + __m128 TmpA3 = _mm_mul_ps(SinA0, TmpA2); + __m128 TmpA4 = _mm_add_ps(TmpA1, TmpA3); + + //Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; + //Rotate[1][1] = c + temp[1] * axis[1]; + //Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; + __m128 Axis1 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 TmpB0 = _mm_mul_ps(Axis1, AxisC); + __m128 CosA1 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 0, 1)); + __m128 TmpB1 = _mm_add_ps(CosA1, TmpB0); + __m128 SinB0 = SinA;//_mm_set_ps(-s, 0.0f, s, 0.0f); + __m128 TmpB2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 0, 3, 2)); + __m128 TmpB3 = _mm_mul_ps(SinA0, TmpB2); + __m128 TmpB4 = _mm_add_ps(TmpB1, TmpB3); + + //Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; + //Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; + //Rotate[2][2] = c + temp[2] * axis[2]; + __m128 Axis2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 TmpC0 = _mm_mul_ps(Axis2, AxisC); + __m128 CosA2 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 0, 1, 1)); + __m128 TmpC1 = _mm_add_ps(CosA2, TmpC0); + __m128 SinC0 = SinA;//_mm_set_ps(s, -s, 0.0f, 0.0f); + __m128 TmpC2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 3, 0, 1)); + __m128 TmpC3 = _mm_mul_ps(SinA0, TmpC2); + __m128 TmpC4 = _mm_add_ps(TmpC1, TmpC3); + + __m128 Result[4]; + Result[0] = TmpA4; + Result[1] = TmpB4; + Result[2] = TmpC4; + Result[2] = _mm_set_ps(1, 0, 0, 0); + + //detail::tmat4x4 Result(detail::tmat4x4::null); + //Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; + //Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; + //Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; + //Result[3] = m[3]; + //return Result; + _mm_mul_ps(in, Result, out); +} diff --git a/glm/core/intrinsic_trigonometric.hpp b/glm/core/intrinsic_trigonometric.hpp new file mode 100644 index 00000000..e69de29b diff --git a/glm/core/intrinsic_trigonometric.inl b/glm/core/intrinsic_trigonometric.inl new file mode 100644 index 00000000..e69de29b diff --git a/glm/core/intrinsic_vector_relational.hpp b/glm/core/intrinsic_vector_relational.hpp new file mode 100644 index 00000000..acf337b4 --- /dev/null +++ b/glm/core/intrinsic_vector_relational.hpp @@ -0,0 +1,18 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-06-09 +// Updated : 2009-06-09 +// Licence : This source is under MIT License +// File : glm/core/intrinsic_vector_relational.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef GLM_DETAIL_INTRINSIC_VECTOR_RELATIONAL_INCLUDED +#define GLM_DETAIL_INTRINSIC_VECTOR_RELATIONAL_INCLUDED + +#include +#include + +#include "intrinsic_vector_relational.inl" + +#endif//GLM_DETAIL_INTRINSIC_VECTOR_RELATIONAL_INCLUDED diff --git a/glm/core/intrinsic_vector_relational.inl b/glm/core/intrinsic_vector_relational.inl new file mode 100644 index 00000000..e9f2742a --- /dev/null +++ b/glm/core/intrinsic_vector_relational.inl @@ -0,0 +1,347 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-06-09 +// Updated : 2009-06-09 +// Licence : This source is under MIT License +// File : glm/core/intrinsic_vector_relational.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// +// +//// lessThan +//template +//inline typename detail::tvec2::bool_type lessThan +//( +// detail::tvec2 const & x, +// detail::tvec2 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec2::bool_type(x.x < y.x, x.y < y.y); +//} +// +//template +//inline typename detail::tvec3::bool_type lessThan +//( +// detail::tvec3 const & x, +// detail::tvec3 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec3::bool_type(x.x < y.x, x.y < y.y, x.z < y.z); +//} +// +//template +//inline typename detail::tvec4::bool_type lessThan +//( +// detail::tvec4 const & x, +// detail::tvec4 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec4::bool_type(x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w); +//} +// +//// lessThanEqual +//template +//inline typename detail::tvec2::bool_type lessThanEqual +//( +// detail::tvec2 const & x, +// detail::tvec2 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec2::bool_type(x.x <= y.x, x.y <= y.y); +//} +// +//template +//inline typename detail::tvec3::bool_type lessThanEqual +//( +// detail::tvec3 const & x, +// detail::tvec3 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec3::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z); +//} +// +//template +//inline typename detail::tvec4::bool_type lessThanEqual +//( +// detail::tvec4 const & x, +// detail::tvec4 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec4::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w); +//} +// +//// greaterThan +//template +//inline typename detail::tvec2::bool_type greaterThan +//( +// detail::tvec2 const & x, +// detail::tvec2 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec2::bool_type(x.x > y.x, x.y > y.y); +//} +// +//template +//inline typename detail::tvec3::bool_type greaterThan +//( +// detail::tvec3 const & x, +// detail::tvec3 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec3::bool_type(x.x > y.x, x.y > y.y, x.z > y.z); +//} +// +//template +//inline typename detail::tvec4::bool_type greaterThan +//( +// detail::tvec4 const & x, +// detail::tvec4 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec4::bool_type(x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w); +//} +// +//// greaterThanEqual +//template +//inline typename detail::tvec2::bool_type greaterThanEqual +//( +// detail::tvec2 const & x, +// detail::tvec2 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec2::bool_type(x.x >= y.x, x.y >= y.y); +//} +// +//template +//inline typename detail::tvec3::bool_type greaterThanEqual +//( +// detail::tvec3 const & x, +// detail::tvec3 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec3::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z); +//} +// +//template +//inline typename detail::tvec4::bool_type greaterThanEqual +//( +// detail::tvec4 const & x, +// detail::tvec4 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint); +// +// return typename detail::tvec4::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w); +//} +// +//// equal +//template +//inline typename detail::tvec2::bool_type equal +//( +// detail::tvec2 const & x, +// detail::tvec2 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint || +// detail::type::is_bool); +// +// return typename detail::tvec2::bool_type(x.x == y.x, x.y == y.y); +//} +// +//template +//inline typename detail::tvec3::bool_type equal +//( +// detail::tvec3 const & x, +// detail::tvec3 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint || +// detail::type::is_bool); +// +// return typename detail::tvec3::bool_type(x.x == y.x, x.y == y.y, x.z == y.z); +//} +// +//template +//inline typename detail::tvec4::bool_type equal +//( +// detail::tvec4 const & x, +// detail::tvec4 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint || +// detail::type::is_bool); +// +// return typename detail::tvec4::bool_type(x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w); +//} +// +//// notEqual +//template +//inline typename detail::tvec2::bool_type notEqual +//( +// detail::tvec2 const & x, +// detail::tvec2 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint || +// detail::type::is_bool); +// +// return typename detail::tvec2::bool_type(x.x != y.x, x.y != y.y); +//} +// +//template +//inline typename detail::tvec3::bool_type notEqual +//( +// detail::tvec3 const & x, +// detail::tvec3 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint || +// detail::type::is_bool); +// +// return typename detail::tvec3::bool_type(x.x != y.x, x.y != y.y, x.z != y.z); +//} +// +//template +//inline typename detail::tvec4::bool_type notEqual +//( +// detail::tvec4 const & x, +// detail::tvec4 const & y +//) +//{ +// GLM_STATIC_ASSERT( +// detail::type::is_float || +// detail::type::is_int || +// detail::type::is_uint || +// detail::type::is_bool); +// +// return typename detail::tvec4::bool_type(x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w); +//} +// +//// any +//inline bool any(detail::tvec2 const & x) +//{ +// return x.x || x.y; +//} +// +//inline bool any(detail::tvec3 const & x) +//{ +// return x.x || x.y || x.z; +//} +// +//inline bool any(detail::tvec4 const & x) +//{ +// return x.x || x.y || x.z || x.w; +//} +// +//// all +//inline bool all(const detail::tvec2& x) +//{ +// return x.x && x.y; +//} +// +//inline bool all(const detail::tvec3& x) +//{ +// return x.x && x.y && x.z; +//} +// +//inline bool all(const detail::tvec4& x) +//{ +// return x.x && x.y && x.z && x.w; +//} +// +//// not +//inline detail::tvec2::bool_type not_ +//( +// detail::tvec2 const & v +//) +//{ +// return detail::tvec2::bool_type(!v.x, !v.y); +//} +// +//inline detail::tvec3::bool_type not_ +//( +// detail::tvec3 const & v +//) +//{ +// return detail::tvec3::bool_type(!v.x, !v.y, !v.z); +//} +// +//inline detail::tvec4::bool_type not_ +//( +// detail::tvec4 const & v +//) +//{ +// return detail::tvec4::bool_type(!v.x, !v.y, !v.z, !v.w); +//} \ No newline at end of file diff --git a/glm/core/type.hpp b/glm/core/type.hpp new file mode 100644 index 00000000..73e5549b --- /dev/null +++ b/glm/core/type.hpp @@ -0,0 +1,34 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-01-08 +// Updated : 2008-01-08 +// Licence : This source is under MIT License +// File : glm/core/type.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type +#define glm_core_type + +#include "type_half.hpp" +#include "type_float.hpp" +#include "type_int.hpp" + +#include "type_gentype.hpp" + +#include "type_vec1.hpp" +#include "type_vec2.hpp" +#include "type_vec3.hpp" +#include "type_vec4.hpp" + +#include "type_mat2x2.hpp" +#include "type_mat2x3.hpp" +#include "type_mat2x4.hpp" +#include "type_mat3x2.hpp" +#include "type_mat3x3.hpp" +#include "type_mat3x4.hpp" +#include "type_mat4x2.hpp" +#include "type_mat4x3.hpp" +#include "type_mat4x4.hpp" + +#endif//glm_core_type diff --git a/glm/core/type_float.hpp b/glm/core/type_float.hpp new file mode 100644 index 00000000..fb678f18 --- /dev/null +++ b/glm/core/type_float.hpp @@ -0,0 +1,74 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-22 +// Updated : 2008-09-17 +// Licence : This source is under MIT License +// File : glm/core/type_float.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_float +#define glm_core_type_float + +#include "type_half.hpp" +#include "../setup.hpp" + +namespace glm +{ + namespace detail + { + GLM_DETAIL_IS_FLOAT(detail::thalf); + GLM_DETAIL_IS_FLOAT(float); + GLM_DETAIL_IS_FLOAT(double); + GLM_DETAIL_IS_FLOAT(long double); + } + //namespace detail + + namespace core{ + namespace type{ + namespace scalar{ + + namespace precision + { +#ifdef GLM_USE_HALF_SCALAR + typedef detail::thalf lowp_float_t; +#else//GLM_USE_HALF_SCALAR + typedef float lowp_float_t; +#endif//GLM_USE_HALF_SCALAR + typedef float mediump_float_t; + typedef double highp_float_t; + + //! Low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification + typedef lowp_float_t lowp_float; + //! Medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification + typedef mediump_float_t mediump_float; + //! High precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification + typedef highp_float_t highp_float; + } + //namespace precision + +#ifndef GLM_PRECISION + typedef precision::mediump_float_t float_t; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT) + typedef precision::highp_float_t float_t; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT) + typedef precision::mediump_float_t float_t; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT) + typedef precision::lowp_float_t float_t; +#else + # pragma message("GLM message: Precisson undefined for float numbers."); + typedef precision::mediump_float_t float_t; +#endif//GLM_PRECISION + + }//namespace scalar + }//namespace type + }//namespace core +}//namespace glm + +#endif//glm_core_type_float diff --git a/glm/core/type_gentype.hpp b/glm/core/type_gentype.hpp new file mode 100644 index 00000000..d16520dc --- /dev/null +++ b/glm/core/type_gentype.hpp @@ -0,0 +1,94 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-05 +// Updated : 2008-10-05 +// Licence : This source is under MIT License +// File : glm/core/type_gentype.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_gentype +#define glm_core_type_gentype + +#include "type_size.hpp" + +namespace glm{ + +enum profile +{ + nice, + fast, + simd +}; + +namespace detail{ + +template +class genType +{ +public: + ////////////////////////////////////// + // Traits + + typedef sizeType size_type; + typedef valTypeT value_type; + + typedef genType class_type; + + typedef genType bool_type; + typedef genType col_type; + typedef genType row_type; + typedef genType transpose_type; + + static size_type col_size(); + static size_type row_size(); + static size_type value_size(); + static bool is_scalar(); + static bool is_vector(); + static bool is_matrix(); + +private: + // Data + col_type value[colT]; + +public: + ////////////////////////////////////// + // Constructors + genType(); + genType(class_type const & m); + + explicit genType(value_type const & x); + explicit genType(value_type const * const x); + explicit genType(col_type const * const x); + + ////////////////////////////////////// + // Conversions + template + explicit genType(genType const & m); + + ////////////////////////////////////// + // Accesses + col_type& operator[](size_type i); + col_type const & operator[](size_type i) const; + + ////////////////////////////////////// + // Unary updatable operators + class_type& operator= (class_type const & x); + class_type& operator+= (value_type const & x); + class_type& operator+= (class_type const & x); + class_type& operator-= (value_type const & x); + class_type& operator-= (class_type const & x); + class_type& operator*= (value_type const & x); + class_type& operator*= (class_type const & x); + class_type& operator/= (value_type const & x); + class_type& operator/= (class_type const & x); + class_type& operator++ (); + class_type& operator-- (); +}; + +}//namespace detail +}//namespace glm + +#include "type_gentype.inl" + +#endif//glm_core_type_gentype diff --git a/glm/core/type_gentype.inl b/glm/core/type_gentype.inl new file mode 100644 index 00000000..5e452125 --- /dev/null +++ b/glm/core/type_gentype.inl @@ -0,0 +1,347 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-05 +// Updated : 2008-10-05 +// Licence : This source is under MIT License +// File : glm/core/type_gentype.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + +///////////////////////////////// +// Static functions + +template +typename genType::size_type genType::col_size() +{ + return cT; +} + +template +typename genType::size_type genType::row_size() +{ + return rT; +} + +template +typename genType::size_type genType::value_size() +{ + return rT * cT; +} + +template +bool genType::is_scalar() +{ + return rT == 1 && cT == 1; +} + +template +bool genType::is_vector() +{ + return rT == 1; +} + +template +bool genType::is_matrix() +{ + return rT != 1; +} + +///////////////////////////////// +// Constructor + +template +genType::genType() +{ + memset(&this->value, 0, cT * rT * sizeof(vT)); +} + +template +genType::genType +( + typename genType::class_type const & m +) +{ + for + ( + typename genType::size_type i = typename genType::size_type(0); + i < genType::col_size(); + ++i + ) + { + this->value[i] = m[i]; + } +} + +template +genType::genType +( + typename genType::value_type const & x +) +{ + if(rT == 1) // vector + { + for + ( + typename genType::size_type i = typename genType::size_type(0); + i < genType::col_size(); + ++i + ) + { + this->value[i][rT] = x; + } + } + else // matrix + { + memset(&this->value, 0, cT * rT * sizeof(vT)); + + typename genType::size_type stop = cT < rT ? cT : rT; + + for + ( + typename genType::size_type i = typename genType::size_type(0); + i < stop; + ++i + ) + { + this->value[i][i] = x; + } + } +} + +template +genType::genType +( + typename genType::value_type const * const x +) +{ + memcpy(&this->value, &x.value, cT * rT * sizeof(vT)); +} + +template +genType::genType +( + typename genType::col_type const * const x +) +{ + for + ( + typename genType::size_type i = typename genType::size_type(0); + i < genType::col_size(); + ++i + ) + { + this->value[i] = x[i]; + } +} + +template +template +genType::genType +( + genType const & m +) +{ + for + ( + typename genType::size_type i = typename genType::size_type(0); + i < genType::col_size(); + ++i + ) + { + this->value[i] = genType(m[i]); + } +} + +////////////////////////////////////// +// Accesses + +template +typename genType::col_type& genType::operator[] +( + typename genType::size_type i +) +{ + return this->value[i]; +} + +template +typename genType::col_type const & genType::operator[] +( + typename genType::size_type i +) const +{ + return this->value[i]; +} + +////////////////////////////////////// +// Unary updatable operators + +template +typename genType::class_type& genType::operator= +( + typename genType::class_type const & x +) +{ + memcpy(&this->value, &x.value, cT * rT * sizeof(vT)); + return *this; +} + +template +typename genType::class_type& genType::operator+= +( + typename genType::value_type const & x +) +{ + typename genType::size_type stop_col = x.col_size(); + typename genType::size_type stop_row = x.row_size(); + + for(typename genType::size_type j = 0; j < stop_col; ++j) + for(typename genType::size_type i = 0; i < stop_row; ++i) + this->value[j][i] += x; + + return *this; +} + +template +typename genType::class_type& genType::operator+= +( + typename genType::class_type const & x +) +{ + typename genType::size_type stop_col = x.col_size(); + typename genType::size_type stop_row = x.row_size(); + + for(typename genType::size_type j = 0; j < stop_col; ++j) + for(typename genType::size_type i = 0; i < stop_row; ++i) + this->value[j][i] += x[j][i]; + + return *this; +} + +template +typename genType::class_type& genType::operator-= +( + typename genType::value_type const & x +) +{ + typename genType::size_type stop_col = x.col_size(); + typename genType::size_type stop_row = x.row_size(); + + for(typename genType::size_type j = 0; j < stop_col; ++j) + for(typename genType::size_type i = 0; i < stop_row; ++i) + this->value[j][i] -= x; + + return *this; +} + +template +typename genType::class_type& genType::operator-= +( + typename genType::class_type const & x +) +{ + typename genType::size_type stop_col = x.col_size(); + typename genType::size_type stop_row = x.row_size(); + + for(typename genType::size_type j = 0; j < stop_col; ++j) + for(typename genType::size_type i = 0; i < stop_row; ++i) + this->value[j][i] -= x[j][i]; + + return *this; +} + +template +typename genType::class_type& genType::operator*= +( + typename genType::value_type const & x +) +{ + typename genType::size_type stop_col = x.col_size(); + typename genType::size_type stop_row = x.row_size(); + + for(typename genType::size_type j = 0; j < stop_col; ++j) + for(typename genType::size_type i = 0; i < stop_row; ++i) + this->value[j][i] *= x; + + return *this; +} + +template +typename genType::class_type& genType::operator*= +( + typename genType::class_type const & x +) +{ + typename genType::size_type stop_col = x.col_size(); + typename genType::size_type stop_row = x.row_size(); + + for(typename genType::size_type j = 0; j < stop_col; ++j) + for(typename genType::size_type i = 0; i < stop_row; ++i) + this->value[j][i] *= x[j][i]; + + return *this; +} + +template +typename genType::class_type& genType::operator/= +( + typename genType::value_type const & x +) +{ + typename genType::size_type stop_col = x.col_size(); + typename genType::size_type stop_row = x.row_size(); + + for(typename genType::size_type j = 0; j < stop_col; ++j) + for(typename genType::size_type i = 0; i < stop_row; ++i) + this->value[j][i] /= x; + + return *this; +} + +template +typename genType::class_type& genType::operator/= +( + typename genType::class_type const & x +) +{ + typename genType::size_type stop_col = x.col_size(); + typename genType::size_type stop_row = x.row_size(); + + for(typename genType::size_type j = 0; j < stop_col; ++j) + for(typename genType::size_type i = 0; i < stop_row; ++i) + this->value[j][i] /= x[j][i]; + + return *this; +} + +template +typename genType::class_type& genType::operator++ () +{ + typename genType::size_type stop_col = col_size(); + typename genType::size_type stop_row = row_size(); + + for(typename genType::size_type j = 0; j < stop_col; ++j) + for(typename genType::size_type i = 0; i < stop_row; ++i) + ++this->value[j][i]; + + return *this; +} + +template +typename genType::class_type& genType::operator-- () +{ + typename genType::size_type stop_col = col_size(); + typename genType::size_type stop_row = row_size(); + + for(typename genType::size_type j = 0; j < stop_col; ++j) + for(typename genType::size_type i = 0; i < stop_row; ++i) + --this->value[j][i]; + + return *this; +} + +} //namespace detail +} //namespace glm diff --git a/glm/core/type_half.hpp b/glm/core/type_half.hpp new file mode 100644 index 00000000..d8f34904 --- /dev/null +++ b/glm/core/type_half.hpp @@ -0,0 +1,85 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-17 +// Updated : 2009-11-12 +// Licence : This source is under MIT License +// File : glm/core/type_half.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_half +#define glm_core_type_half + +#include + +namespace glm +{ + namespace test + { + bool main_type_half(); + + }//namespace test + + namespace detail + { + typedef short hdata; + + float toFloat32(hdata value); + hdata toFloat16(float const & value); + + class thalf + { + public: + // Constructors + thalf(); + thalf(thalf const & s); + + template + thalf(U const & s); + + // Cast + //operator float(); + operator float() const; + //operator double(); + //operator double() const; + + // Unary updatable operators + thalf& operator= (thalf const & s); + thalf& operator+=(thalf const & s); + thalf& operator-=(thalf const & s); + thalf& operator*=(thalf const & s); + thalf& operator/=(thalf const & s); + thalf& operator++(); + thalf& operator--(); + + float toFloat() const{return toFloat32(data);} + + hdata _data() const{return data;} + + private: + hdata data; + }; + + thalf operator+ (thalf const & s1, thalf const & s2); + + thalf operator- (thalf const & s1, thalf const & s2); + + thalf operator* (thalf const & s1, thalf const & s2); + + thalf operator/ (thalf const & s1, thalf const & s2); + + // Unary constant operators + thalf operator- (thalf const & s); + + thalf operator-- (thalf const & s, int); + + thalf operator++ (thalf const & s, int); + + }//namespace detail + + +}//namespace glm + +#include "type_half.inl" + +#endif//glm_core_type_half diff --git a/glm/core/type_half.inl b/glm/core/type_half.inl new file mode 100644 index 00000000..d7426c12 --- /dev/null +++ b/glm/core/type_half.inl @@ -0,0 +1,357 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-17 +// Updated : 2009-11-12 +// Licence : This source is under MIT License +// File : glm/core/type_half.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Copyright: +// This half implementation is based on OpenEXR which is Copyright (c) 2002, +// Industrial Light & Magic, a division of Lucas Digital Ltd. LLC +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "_detail.hpp" + +namespace glm{ +namespace detail +{ + inline float overflow() + { + volatile float f = 1e10; + + for(int i = 0; i < 10; ++i) + f *= f; // this will overflow before + // the for­loop terminates + return f; + } + + inline float toFloat32(hdata value) + { + int s = (value >> 15) & 0x00000001; + int e = (value >> 10) & 0x0000001f; + int m = value & 0x000003ff; + + if(e == 0) + { + if(m == 0) + { + // + // Plus or minus zero + // + + detail::uif result; + result.i = s << 31; + return result.f; + } + else + { + // + // Denormalized number -- renormalize it + // + + while(!(m & 0x00000400)) + { + m <<= 1; + e -= 1; + } + + e += 1; + m &= ~0x00000400; + } + } + else if(e == 31) + { + if(m == 0) + { + // + // Positive or negative infinity + // + + uif result; + result.i = (s << 31) | 0x7f800000; + return result.f; + } + else + { + // + // Nan -- preserve sign and significand bits + // + + uif result; + result.i = (s << 31) | 0x7f800000 | (m << 13); + return result.f; + } + } + + // + // Normalized number + // + + e = e + (127 - 15); + m = m << 13; + + // + // Assemble s, e and m. + // + + uif Result; + Result.i = (s << 31) | (e << 23) | m; + return Result.f; + } + + inline hdata toFloat16(float const & f) + { + uif Entry; + Entry.f = f; + int i = Entry.i; + + // + // Our floating point number, f, is represented by the bit + // pattern in integer i. Disassemble that bit pattern into + // the sign, s, the exponent, e, and the significand, m. + // Shift s into the position where it will go in in the + // resulting half number. + // Adjust e, accounting for the different exponent bias + // of float and half (127 versus 15). + // + + register int s = (i >> 16) & 0x00008000; + register int e = ((i >> 23) & 0x000000ff) - (127 - 15); + register int m = i & 0x007fffff; + + // + // Now reassemble s, e and m into a half: + // + + if(e <= 0) + { + if(e < -10) + { + // + // E is less than -10. The absolute value of f is + // less than half_MIN (f may be a small normalized + // float, a denormalized float or a zero). + // + // We convert f to a _halfGTX zero. + // + + return 0; + } + + // + // E is between -10 and 0. F is a normalized float, + // whose magnitude is less than __half_NRM_MIN. + // + // We convert f to a denormalized _halfGTX. + // + + m = (m | 0x00800000) >> (1 - e); + + // + // Round to nearest, round "0.5" up. + // + // Rounding may cause the significand to overflow and make + // our number normalized. Because of the way a half's bits + // are laid out, we don't have to treat this case separately; + // the code below will handle it correctly. + // + + if(m & 0x00001000) + m += 0x00002000; + + // + // Assemble the _halfGTX from s, e (zero) and m. + // + + return hdata(s | (m >> 13)); + } + else if(e == 0xff - (127 - 15)) + { + if(m == 0) + { + // + // F is an infinity; convert f to a half + // infinity with the same sign as f. + // + + return hdata(s | 0x7c00); + } + else + { + // + // F is a NAN; we produce a half NAN that preserves + // the sign bit and the 10 leftmost bits of the + // significand of f, with one exception: If the 10 + // leftmost bits are all zero, the NAN would turn + // into an infinity, so we have to set at least one + // bit in the significand. + // + + m >>= 13; + + return hdata(s | 0x7c00 | m | (m == 0)); + } + } + else + { + // + // E is greater than zero. F is a normalized float. + // We try to convert f to a normalized half. + // + + // + // Round to nearest, round "0.5" up + // + + if(m & 0x00001000) + { + m += 0x00002000; + + if(m & 0x00800000) + { + m = 0; // overflow in significand, + e += 1; // adjust exponent + } + } + + // + // Handle exponent overflow + // + + if (e > 30) + { + overflow(); // Cause a hardware floating point overflow; + + return hdata(s | 0x7c00); + // if this returns, the half becomes an + } // infinity with the same sign as f. + + // + // Assemble the half from s, e and m. + // + + return hdata(s | (e << 10) | (m >> 13)); + } + } + + inline thalf::thalf() : + data(0) + {} + + inline thalf::thalf(thalf const & s) : + data(s.data) + {} + + template + inline thalf::thalf(U const & s) : + data(toFloat16(float(s))) + {} + + // Cast + //inline half::operator float() + //{ + // return toFloat(); + //} + + inline thalf::operator float() const + { + return toFloat(); + } + + //inline half::operator double() + //{ + // return double(toFloat()); + //} + + //inline half::operator double() const + //{ + // return double(toFloat()); + //} + + // Unary updatable operators + inline thalf& thalf::operator= (thalf const & s) + { + data = s.data; + return *this; + } + + inline thalf& thalf::operator+=(thalf const & s) + { + data = toFloat16(toFloat32(data) + toFloat32(s.data)); + return *this; + } + + inline thalf& thalf::operator-=(thalf const & s) + { + data = toFloat16(toFloat32(data) - toFloat32(s.data)); + return *this; + } + + inline thalf& thalf::operator*=(thalf const & s) + { + data = toFloat16(toFloat32(data) * toFloat32(s.data)); + return *this; + } + + inline thalf& thalf::operator/=(thalf const & s) + { + data = toFloat16(toFloat32(data) / toFloat32(s.data)); + return *this; + } + + inline thalf& thalf::operator++() + { + float Casted = toFloat32(data); + data = toFloat16(++Casted); + return *this; + } + + inline thalf& thalf::operator--() + { + float Casted = toFloat32(data); + data = toFloat16(--Casted); + return *this; + } + + ////////////////////////////////////// + // Binary arithmetic operators + + inline detail::thalf operator+ (detail::thalf const & s1, detail::thalf const & s2) + { + return detail::thalf(float(s1) + float(s2)); + } + + inline detail::thalf operator- (detail::thalf const & s1, detail::thalf const & s2) + { + return detail::thalf(float(s1) - float(s2)); + } + + inline detail::thalf operator* (detail::thalf const & s1, detail::thalf const & s2) + { + return detail::thalf(float(s1) * float(s2)); + } + + inline detail::thalf operator/ (detail::thalf const & s1, detail::thalf const & s2) + { + return detail::thalf(float(s1) / float(s2)); + } + + // Unary constant operators + inline detail::thalf operator- (detail::thalf const & s) + { + return detail::thalf(-float(s)); + } + + inline detail::thalf operator-- (detail::thalf const & s, int) + { + return detail::thalf(float(s) - 1.0f); + } + + inline detail::thalf operator++ (detail::thalf const & s, int) + { + return detail::thalf(float(s) + 1.0f); + } + +}//namespace detail +}//namespace glm diff --git a/glm/core/type_int.hpp b/glm/core/type_int.hpp new file mode 100644 index 00000000..d1543fdd --- /dev/null +++ b/glm/core/type_int.hpp @@ -0,0 +1,129 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-22 +// Updated : 2008-09-17 +// Licence : This source is under MIT License +// File : glm/core/type_int.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_int +#define glm_core_type_int + +#include "../setup.hpp" +#include "_detail.hpp" + +namespace glm +{ + namespace detail + { +#if defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC) + typedef signed __int64 highp_int_t; + typedef unsigned __int64 highp_uint_t; +#elif(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_GCC)) + __extension__ typedef signed long long highp_int_t; + __extension__ typedef unsigned long long highp_uint_t; +//# if GLM_MODEL == GLM_MODEL_64 +// typedef signed long highp_int_t; +// typedef unsigned long highp_uint_t; +//# elif GLM_MODEL == GLM_MODEL_32 +// __extension__ typedef signed long long highp_int_t; +// __extension__ typedef unsigned long long highp_uint_t; +//# endif//GLM_MODEL +#else + typedef signed long highp_int_t; + typedef unsigned long highp_uint_t; +#endif//GLM_COMPILER + + GLM_DETAIL_IS_INT(signed char); + GLM_DETAIL_IS_INT(signed short); + GLM_DETAIL_IS_INT(signed int); + GLM_DETAIL_IS_INT(signed long); + GLM_DETAIL_IS_INT(highp_int_t); + + GLM_DETAIL_IS_UINT(unsigned char); + GLM_DETAIL_IS_UINT(unsigned short); + GLM_DETAIL_IS_UINT(unsigned int); + GLM_DETAIL_IS_UINT(unsigned long); + GLM_DETAIL_IS_UINT(highp_uint_t); + } + //namespace detail + + namespace core{ + namespace type{ + namespace scalar{ + + namespace precision + { + typedef signed short lowp_int_t; + typedef signed int mediump_int_t; + typedef detail::highp_int_t highp_int_t; + + typedef unsigned short lowp_uint_t; + typedef unsigned int mediump_uint_t; + typedef detail::highp_uint_t highp_uint_t; + + //! Low precision signed integer. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification. + typedef lowp_int_t lowp_int; + //! Medium precision signed integer. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification. + typedef mediump_int_t mediump_int; + //! High precision signed integer. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification. + typedef highp_int_t highp_int; + + //! Low precision unsigned integer. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification. + typedef lowp_uint_t lowp_uint; + //! Medium precision unsigned integer. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification. + typedef mediump_uint_t mediump_uint; + //! High precision unsigned integer. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification. + typedef highp_uint_t highp_uint; + } + //namespace precision + +#ifndef GLM_PRECISION + typedef precision::mediump_int_t int_t; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT) + typedef precision::highp_int_t int_t; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT) + typedef precision::mediump_int_t int_t; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT) + typedef precision::lowp_int_t int_t; +#else + typedef mediump_int_t int_t; +# pragma message("GLM message: Precisson undefined for signed integer number."); +#endif//GLM_PRECISION + +#ifndef GLM_PRECISION + typedef precision::mediump_uint_t uint_t; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT) + typedef precision::highp_uint_t uint_t; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT) + typedef precision::mediump_uint_t uint_t; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT) + typedef precision::lowp_uint_t uint_t; +#else + typedef precision::mediump_uint_t uint_t; +# pragma message("GLM message: Precisson undefined for unsigned integer number."); +#endif//GLM_PRECISION + + //! Unsigned integer. + //! From GLSL 1.30.8 specification section 4.1.3 Integers. + typedef uint_t uint; + + }//namespace scalar + }//namespace type + }//namespace core +} + +#endif//glm_core_type_int diff --git a/glm/core/type_mat2x2.hpp b/glm/core/type_mat2x2.hpp new file mode 100644 index 00000000..4bd4ec91 --- /dev/null +++ b/glm/core/type_mat2x2.hpp @@ -0,0 +1,221 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-01-27 +// Updated : 2008-08-30 +// Licence : This source is under MIT License +// File : glm/core/type_mat2x2.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_mat2x2 +#define glm_core_type_mat2x2 + +#include "type_size.hpp" + +namespace glm +{ + namespace test + { + void main_mat2x2(); + }//namespace test + + namespace detail + { + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //!< \brief Template for 2 * 2 matrix of floating-point numbers. + template + struct tmat2x2 + { + public: + typedef tmat2x2* pointer; + typedef const tmat2x2* const_pointer; + typedef const tmat2x2*const const_pointer_const; + typedef tmat2x2*const pointer_const; + typedef tmat2x2& reference; + typedef const tmat2x2& const_reference; + typedef const tmat2x2& param_type; + typedef tmat2x2 transpose_type; + + typedef T value_type; + typedef detail::tvec2 col_type; + typedef detail::tvec2 row_type; + typedef glm::sizeType size_type; + static size_type value_size(); + static size_type col_size(); + static size_type row_size(); + static bool is_matrix(); + + public: + tmat2x2 _inverse() const; + + private: + // Data + detail::tvec2 value[2]; + + public: + // Constructors + tmat2x2(); + tmat2x2(tmat2x2 const & m); + + explicit tmat2x2(const T x); + explicit tmat2x2( + const T x1, const T y1, + const T x2, const T y2); + explicit tmat2x2( + const detail::tvec2 & v1, + const detail::tvec2 & v2); + + // Conversions + template + explicit tmat2x2(const tmat2x2& m); + + explicit tmat2x2(const tmat3x3& x); + explicit tmat2x2(const tmat4x4& x); + explicit tmat2x2(const tmat2x3& x); + explicit tmat2x2(const tmat3x2& x); + explicit tmat2x2(const tmat2x4& x); + explicit tmat2x2(const tmat4x2& x); + explicit tmat2x2(const tmat3x4& x); + explicit tmat2x2(const tmat4x3& x); + + ////////////////////////////////////// + // Accesses + + detail::tvec2& operator[](size_type i); + detail::tvec2 const & operator[](size_type i) const; + + // Unary updatable operators + tmat2x2& operator=(tmat2x2 const & m); + tmat2x2& operator+=(const T & s); + tmat2x2& operator+=(tmat2x2 const & m); + tmat2x2& operator-=(const T & s); + tmat2x2& operator-=(tmat2x2 const & m); + tmat2x2& operator*=(const T & s); + tmat2x2& operator*= (tmat2x2 const & m); + tmat2x2& operator/= (const T & s); + tmat2x2& operator/= (tmat2x2 const & m); + tmat2x2& operator++ (); + tmat2x2& operator-- (); + }; + + // Binary operators + template + tmat2x2 operator+ (tmat2x2 const & m, const T & s); + + template + tmat2x2 operator+ (const T & s, tmat2x2 const & m); + + template + tmat2x2 operator+ (tmat2x2 const & m1, tmat2x2 const & m2); + + template + tmat2x2 operator- (tmat2x2 const & m, const T & s); + + template + tmat2x2 operator- (const T & s, tmat2x2 const & m); + + template + tmat2x2 operator- (tmat2x2 const & m1, tmat2x2 const & m2); + + template + tmat2x2 operator* (tmat2x2 const & m, const T & s); + + template + tmat2x2 operator* (const T & s, tmat2x2 const & m); + + template + tvec2 operator* (tmat2x2 const & m, const tvec2& v); + + template + tvec2 operator* (const tvec2& v, tmat2x2 const & m); + + template + tmat2x2 operator* (tmat2x2 const & m1, tmat2x2 const & m2); + + template + tmat2x2 operator/ (tmat2x2 const & m, const T & s); + + template + tmat2x2 operator/ (const T & s, tmat2x2 const & m); + + template + tvec2 operator/ (tmat2x2 const & m, const tvec2& v); + + template + tvec2 operator/ (const tvec2& v, tmat2x2 const & m); + + template + tmat2x2 operator/ (tmat2x2 const & m1, tmat2x2 const & m2); + + // Unary constant operators + template + tmat2x2 const operator- (tmat2x2 const & m); + + template + tmat2x2 const operator-- (tmat2x2 const & m, int); + + template + tmat2x2 const operator++ (tmat2x2 const & m, int); + + } //namespace detail + + namespace core{ + namespace type{ + namespace matrix{ + + namespace precision + { + //! 2 columns of 2 components matrix of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x2 lowp_mat2x2; + //! 2 columns of 2 components matrix of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x2 mediump_mat2x2; + //! 2 columns of 2 components matrix of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x2 highp_mat2x2; + } + //namespace precision + +#ifndef GLM_PRECISION + //! 2 columns of 2 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef detail::tmat2x2 mat2x2; +#elif(GLM_PRECISION & GLM_PRECISION_HIGH) + typedef detail::tmat2x2 mat2x2; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM) + typedef detail::tmat2x2 mat2x2; +#elif(GLM_PRECISION & GLM_PRECISION_LOW) + typedef detail::tmat2x2 mat2x2; +#else + typedef detail::tmat2x2 mat2x2; +#endif//GLM_PRECISION + + //! 2 columns of 2 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef mat2x2 mat2; + + }//namespace matrix + }//namespace type + }//namespace core +} //namespace glm + +#include "type_mat2x2.inl" + +#endif //glm_core_type_mat2x2 diff --git a/glm/core/type_mat2x2.inl b/glm/core/type_mat2x2.inl new file mode 100644 index 00000000..609ec22b --- /dev/null +++ b/glm/core/type_mat2x2.inl @@ -0,0 +1,463 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-01-16 +// Updated : 2007-03-01 +// Licence : This source is under MIT License +// File : glm/core/type_mat2x2.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + + template + typename tmat2x2::size_type tmat2x2::value_size() + { + return typename tmat2x2::size_type(2); + } + + template + typename tmat2x2::size_type tmat2x2::col_size() + { + return typename tmat2x2::size_type(2); + } + + template + typename tmat2x2::size_type tmat2x2::row_size() + { + return typename tmat2x2::size_type(2); + } + + template + bool tmat2x2::is_matrix() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + detail::tvec2& tmat2x2::operator[](typename tmat2x2::size_type i) + { + assert( + i >= typename tmat2x2::size_type(0) && + i < tmat2x2::col_size()); + + return value[i]; + } + + template + const detail::tvec2& tmat2x2::operator[](typename tmat2x2::size_type i) const + { + assert( + i >= typename tmat2x2::size_type(0) && + i < tmat2x2::col_size()); + + return value[i]; + } + + ////////////////////////////////////////////////////////////// + // mat2 constructors + + template + inline tmat2x2::tmat2x2() + { + this->value[0] = detail::tvec2(1, 0); + this->value[1] = detail::tvec2(0, 1); + } + + template + inline tmat2x2::tmat2x2(const tmat2x2 & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + } + + template + inline tmat2x2::tmat2x2(const T f) + { + this->value[0] = detail::tvec2(f, 0); + this->value[1] = detail::tvec2(0, f); + } + + template + inline tmat2x2::tmat2x2(const T x0, const T y0, const T x1, const T y1) + { + this->value[0] = detail::tvec2(x0, y0); + this->value[1] = detail::tvec2(x1, y1); + } + + template + inline tmat2x2::tmat2x2(const detail::tvec2& v0, const detail::tvec2& v1) + { + this->value[0] = v0; + this->value[1] = v1; + } + + ////////////////////////////////////////////////////////////// + // mat2 conversions + + template + template + inline tmat2x2::tmat2x2(const tmat2x2& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + } + + template + inline tmat2x2::tmat2x2(const tmat3x3& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + } + + template + inline tmat2x2::tmat2x2(const tmat4x4& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + } + + template + inline tmat2x2::tmat2x2(const tmat2x3& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + } + + template + inline tmat2x2::tmat2x2(const tmat3x2& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + } + + template + inline tmat2x2::tmat2x2(const tmat2x4& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + } + + template + inline tmat2x2::tmat2x2(const tmat4x2& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + } + + template + inline tmat2x2::tmat2x2(const tmat3x4& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + } + + template + inline tmat2x2::tmat2x2(const tmat4x3& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + } + +/* + template + inline tmat2x2::tmat2x2(const T* a) + { + this->value[0] = detail::tvec2(a[0], a[1]); + this->value[1] = detail::tvec2(a[2], a[3]); + } +*/ + + template + inline tmat2x2 tmat2x2::_inverse() const + { + T Determinant = value[0][0] * value[1][1] - value[1][0] * value[0][1]; + + tmat2x2 Inverse( + + value[1][1] / Determinant, + - value[1][0] / Determinant, + - value[0][1] / Determinant, + + value[0][0] / Determinant); + return Inverse; + } + + ////////////////////////////////////////////////////////////// + // mat3 operators + + // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared + template + inline tmat2x2& tmat2x2::operator=(tmat2x2 const & m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } + + template + inline tmat2x2& tmat2x2::operator+= (const T & s) + { + this->value[0] += s; + this->value[1] += s; + return *this; + } + + template + inline tmat2x2& tmat2x2::operator+= (tmat2x2 const & m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + return *this; + } + + template + inline tmat2x2& tmat2x2::operator-= (const T & s) + { + this->value[0] -= s; + this->value[1] -= s; + return *this; + } + + template + inline tmat2x2& tmat2x2::operator-= (tmat2x2 const & m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + return *this; + } + + template + inline tmat2x2& tmat2x2::operator*= (const T & s) + { + this->value[0] *= s; + this->value[1] *= s; + return *this; + } + + template + inline tmat2x2& tmat2x2::operator*= (tmat2x2 const & m) + { + return (*this = *this * m); + } + + template + inline tmat2x2& tmat2x2::operator/= (const T & s) + { + this->value[0] /= s; + this->value[1] /= s; + return *this; + } + + template + inline tmat2x2& tmat2x2::operator/= (tmat2x2 const & m) + { + return (*this = *this / m); + } + + template + inline tmat2x2& tmat2x2::operator++ () + { + ++this->value[0]; + ++this->value[1]; + return *this; + } + + template + inline tmat2x2& tmat2x2::operator-- () + { + --this->value[0]; + --this->value[1]; + return *this; + } + + ////////////////////////////////////////////////////////////// + // Binary operators + + template + inline tmat2x2 operator+ (tmat2x2 const & m, const T & s) + { + return tmat2x2( + m[0] + s, + m[1] + s); + } + + template + inline tmat2x2 operator+ (const T & s, tmat2x2 const & m) + { + return tmat2x2( + m[0] + s, + m[1] + s); + } + + //template + //inline detail::tvec2 operator+ (tmat2x2 const & m, const detail::tvec2& v) + //{ + + //} + + //template + //inline detail::tvec2 operator+ (const detail::tvec2& v, tmat2x2 const & m) + //{ + + //} + + template + inline tmat2x2 operator+ (tmat2x2 const & m1, tmat2x2 const & m2) + { + return tmat2x2( + m1[0] + m2[0], + m1[1] + m2[1]); + } + + template + inline tmat2x2 operator- (tmat2x2 const & m, const T & s) + { + return tmat2x2( + m[0] - s, + m[1] - s); + } + + template + inline tmat2x2 operator- (const T & s, tmat2x2 const & m) + { + return tmat2x2( + s - m[0], + s - m[1]); + } + + //template + //inline tmat2x2 operator- (tmat2x2 const & m, const detail::tvec2& v) + //{ + + //} + + //template + //inline tmat2x2 operator- (const detail::tvec2& v, tmat2x2 const & m) + //{ + + //} + + template + inline tmat2x2 operator- (tmat2x2 const & m1, tmat2x2 const & m2) + { + return tmat2x2( + m1[0] - m2[0], + m1[1] - m2[1]); + } + + template + inline tmat2x2 operator* (tmat2x2 const & m, const T & s) + { + return tmat2x2( + m[0] * s, + m[1] * s); + } + + template + inline tmat2x2 operator* (const T & s, tmat2x2 const & m) + { + return tmat2x2( + m[0] * s, + m[1] * s); + } + + template + inline detail::tvec2 operator* (tmat2x2 const & m, const detail::tvec2& v) + { + return detail::tvec2( + m[0][0] * v.x + m[1][0] * v.y, + m[0][1] * v.x + m[1][1] * v.y); + } + + template + inline detail::tvec2 operator* (const detail::tvec2& v, tmat2x2 const & m) + { + return detail::tvec2( + m[0][0] * v.x + m[0][1] * v.y, + m[1][0] * v.x + m[1][1] * v.y); + } + + template + inline tmat2x2 operator* (tmat2x2 const & m1, tmat2x2 const & m2) + { + return tmat2x2( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]); + } + + template + inline tmat2x2 operator/ (tmat2x2 const & m, const T & s) + { + return tmat2x2( + m[0] / s, + m[1] / s); + } + + template + inline tmat2x2 operator/ (const T & s, tmat2x2 const & m) + { + return tmat2x2( + s / m[0], + s / m[1]); + } + + template + inline detail::tvec2 operator/ (tmat2x2 const & m, const detail::tvec2& v) + { + return m._inverse() * v; + } + + template + inline detail::tvec2 operator/ (const detail::tvec2& v, tmat2x2 const & m) + { + return v * m._inverse(); + } + + template + inline tmat2x2 operator/ (tmat2x2 const & m1, tmat2x2 const & m2) + { + return m1 * m2._inverse(); + } + + // Unary constant operators + template + inline tmat2x2 const operator- + ( + tmat2x2 const & m + ) + { + return tmat2x2( + -m[0], + -m[1]); + } + + template + inline tmat2x2 const operator++ + ( + tmat2x2 const & m, + int + ) + { + return tmat2x2( + m[0] + valType(1), + m[1] + valType(1)); + } + + template + inline tmat2x2 const operator-- + ( + tmat2x2 const & m, + int + ) + { + return tmat2x2( + m[0] - valType(1), + m[1] - valType(1)); + } + +} //namespace detail +} //namespace glm diff --git a/glm/core/type_mat2x3.hpp b/glm/core/type_mat2x3.hpp new file mode 100644 index 00000000..9842f6f3 --- /dev/null +++ b/glm/core/type_mat2x3.hpp @@ -0,0 +1,212 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-10-01 +// Updated : 2008-08-30 +// Licence : This source is under MIT License +// File : glm/core/type_mat2x3.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_mat2x3 +#define glm_core_type_mat2x3 + +#include "type_size.hpp" + +namespace glm +{ + namespace test + { + void main_mat2x3(); + }//namespace test + + namespace detail + { + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //!< \brief Template for 2 * 3 matrix of floating-point numbers. + template + struct tmat2x3 + { + public: + typedef tmat2x3* pointer; + typedef const tmat2x3* const_pointer; + typedef const tmat2x3*const const_pointer_const; + typedef tmat2x3*const pointer_const; + typedef tmat2x3& reference; + typedef const tmat2x3& const_reference; + typedef const tmat2x3& param_type; + typedef tmat3x2 transpose_type; + + typedef T value_type; + typedef detail::tvec3 col_type; + typedef detail::tvec2 row_type; + typedef glm::sizeType size_type; + static size_type col_size(); + static size_type row_size(); + static bool is_matrix(); + + public: + tmat3x2 _inverse() const; + + private: + // Data + detail::tvec3 value[2]; + + public: + // Constructors + tmat2x3(); + explicit tmat2x3(const T x); + explicit tmat2x3( + const T x0, const T y0, const T z0, + const T x1, const T y1, const T z1); + explicit tmat2x3( + const detail::tvec3& v0, + const detail::tvec3& v1); + + // Conversion + template + explicit tmat2x3(const tmat2x3& m); + + explicit tmat2x3(const tmat2x2& x); + explicit tmat2x3(const tmat3x3& x); + explicit tmat2x3(const tmat4x4& x); + explicit tmat2x3(const tmat2x4& x); + explicit tmat2x3(const tmat3x2& x); + explicit tmat2x3(const tmat3x4& x); + explicit tmat2x3(const tmat4x2& x); + explicit tmat2x3(const tmat4x3& x); + + // Accesses + detail::tvec3& operator[](size_type i); + detail::tvec3 const & operator[](size_type i) const; + + // Unary updatable operators + tmat2x3& operator= (const tmat2x3& m); + tmat2x3& operator+= (const T & s); + tmat2x3& operator+= (const tmat2x3& m); + tmat2x3& operator-= (const T & s); + tmat2x3& operator-= (const tmat2x3& m); + tmat2x3& operator*= (const T & s); + tmat2x3& operator*= (const tmat3x2& m); + tmat2x3& operator/= (const T & s); + // tmat2x3& operator/= (const tmat3x2& m); + + tmat2x3& operator++ (); + tmat2x3& operator-- (); + + // Unary constant operators + const tmat2x3 operator- () const; + const tmat2x3 operator++ (int n) const; + const tmat2x3 operator-- (int n) const; + }; + + // Binary operators + template + tmat2x3 operator+ (const tmat2x3& m, const T & s); + + template + tmat2x3 operator+ (const tmat2x3& m1, const tmat2x3& m2); + + template + tmat2x3 operator- (const tmat2x3& m, const T & s); + + template + tmat2x3 operator- (const tmat2x3& m1, const tmat2x3& m2); + + template + tmat2x3 operator* (const tmat2x3& m, const T & s); + + template + tmat2x3 operator* (const T & s, const tmat2x3& m); + + template + detail::tvec3 operator* (const tmat2x3& m, const detail::tvec2& v); + + template + detail::tvec3 operator* (const detail::tvec3& v, const tmat2x3& m); + + template + tmat3x3 operator* (const tmat2x3& m1, const tmat3x2& m2); + + template + tmat3x2 operator/ (const tmat2x3& m, const T & s); + + template + tmat3x2 operator/ (const T & s, const tmat2x3& m); + + //template + //detail::tvec3 operator/ (const tmat2x3& m, const detail::tvec2& v); + + //template + //detail::tvec2 operator/ (const detail::tvec3& v, const tmat2x3& m); + + //template + //tmat3x3 operator/ (const tmat3x2& m1, const tmat2x3& m2); + + // Unary constant operators + template + tmat2x3 const operator- (tmat2x3 const & m); + + template + tmat2x3 const operator-- (tmat2x3 const & m, int); + + template + tmat2x3 const operator++ (tmat2x3 const & m, int); + + } //namespace detail + + namespace core{ + namespace type{ + namespace matrix{ + + namespace precision + { + //! 2 columns of 3 components matrix of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x3 lowp_mat2x3; + //! 2 columns of 3 components matrix of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x3 mediump_mat2x3; + //! 2 columns of 3 components matrix of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x3 highp_mat2x3; + } + //namespace precision + +#ifndef GLM_PRECISION + //! 2 columns of 3 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef detail::tmat2x3 mat2x3; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT) + typedef detail::tmat2x3 mat2x3; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT) + typedef detail::tmat2x3 mat2x3; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT) + typedef detail::tmat2x3 mat2x3; +#else + typedef detail::tmat2x3 mat2x3; +#endif//GLM_PRECISION + + }//namespace matrix + }//namespace type + }//namespace core +} //namespace glm + +#include "type_mat2x3.inl" + +#endif //glm_core_type_mat2x3 diff --git a/glm/core/type_mat2x3.inl b/glm/core/type_mat2x3.inl new file mode 100644 index 00000000..d4409e44 --- /dev/null +++ b/glm/core/type_mat2x3.inl @@ -0,0 +1,457 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-08-05 +// Updated : 2006-10-01 +// Licence : This source is under MIT License +// File : glm/core/type_mat2x3.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + + template + typename tmat2x3::size_type tmat2x3::col_size() + { + return typename tmat2x3::size_type(2); + } + + template + typename tmat2x3::size_type tmat2x3::row_size() + { + return typename tmat2x3::size_type(3); + } + + template + bool tmat2x3::is_matrix() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + detail::tvec3& tmat2x3::operator[](typename tmat2x3::size_type i) + { + assert( + i >= typename tmat2x3::size_type(0) && + i < tmat2x3::col_size()); + + return value[i]; + } + + template + const detail::tvec3& tmat2x3::operator[](typename tmat2x3::size_type i) const + { + assert( + i >= typename tmat2x3::size_type(0) && + i < tmat2x3::col_size()); + + return value[i]; + } + + ////////////////////////////////////////////////////////////// + // Constructors + + template + inline tmat2x3::tmat2x3() + { + this->value[0] = detail::tvec3(T(1), T(0), T(0)); + this->value[1] = detail::tvec3(T(0), T(1), T(0)); + } + + template + inline tmat2x3::tmat2x3(const T f) + { + this->value[0] = detail::tvec3(f, T(0), T(0)); + this->value[1] = detail::tvec3(T(0), f, T(0)); + } + + template + inline tmat2x3::tmat2x3 + ( + const T x0, const T y0, const T z0, + const T x1, const T y1, const T z1 + ) + { + this->value[0] = detail::tvec3(x0, y0, z0); + this->value[1] = detail::tvec3(x1, y1, z1); + } + + template + inline tmat2x3::tmat2x3 + ( + const detail::tvec3 & v0, + const detail::tvec3 & v1 + ) + { + this->value[0] = v0; + this->value[1] = v1; + } + + // Conversion + template + template + inline tmat2x3::tmat2x3(const tmat2x3& m) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + } + + template + inline tmat2x3::tmat2x3(tmat2x2 const & m) + { + this->value[0] = detail::tvec3(m[0], T(0)); + this->value[1] = detail::tvec3(m[1], T(0)); + } + + template + inline tmat2x3::tmat2x3(const tmat3x3& m) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + } + + template + inline tmat2x3::tmat2x3(const tmat4x4& m) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + } + + template + inline tmat2x3::tmat2x3(const tmat2x4& m) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + } + + template + inline tmat2x3::tmat2x3(const tmat3x2& m) + { + this->value[0] = detail::tvec3(m[0], T(0)); + this->value[1] = detail::tvec3(m[1], T(0)); + } + + template + inline tmat2x3::tmat2x3(const tmat3x4& m) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + } + + template + inline tmat2x3::tmat2x3(const tmat4x2& m) + { + this->value[0] = detail::tvec3(m[0], T(0)); + this->value[1] = detail::tvec3(m[1], T(0)); + } + + template + inline tmat2x3::tmat2x3(const tmat4x3& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + } + + ////////////////////////////////////////////////////////////// + // Unary updatable operators + + template + inline tmat2x3& tmat2x3::operator= (const tmat2x3& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } + + template + inline tmat2x3& tmat2x3::operator+= (const T & s) + { + this->value[0] += s; + this->value[1] += s; + return *this; + } + + template + inline tmat2x3& tmat2x3::operator+= (const tmat2x3& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + return *this; + } + + template + inline tmat2x3& tmat2x3::operator-= (const T & s) + { + this->value[0] -= s; + this->value[1] -= s; + return *this; + } + + template + inline tmat2x3& tmat2x3::operator-= (const tmat2x3& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + return *this; + } + + template + inline tmat2x3& tmat2x3::operator*= (const T & s) + { + this->value[0] *= s; + this->value[1] *= s; + return *this; + } + + template + inline tmat2x3& tmat2x3::operator*= (const tmat3x2& m) + { + return (*this = tmat2x3(*this * m)); + } + + template + inline tmat2x3 & tmat2x3::operator/= (const T & s) + { + this->value[0] /= s; + this->value[1] /= s; + return *this; + } +/* ToDo + template + inline tmat2x3& tmat2x3::operator/= (const tmat3x2& m) + { + return (*this = tmat2x3(*this / m)); + } +*/ + template + inline tmat2x3& tmat2x3::operator++ () + { + ++this->value[0]; + ++this->value[1]; + return *this; + } + + template + inline tmat2x3& tmat2x3::operator-- () + { + --this->value[0]; + --this->value[1]; + return *this; + } + + ////////////////////////////////////////////////////////////// + // Unary constant operators + template + inline const tmat2x3 tmat2x3::operator- () const + { + return tmat2x3( + -this->value[0], + -this->value[1]); + } + + template + inline const tmat2x3 tmat2x3::operator-- (int n) const + { + tmat2x3 m = *this; + --m[0]; + --m[1]; + return m; + } + + template + inline const tmat2x3 tmat2x3::operator++ (int n) const + { + tmat2x3 m = *this; + ++m[0]; + ++m[1]; + return m; + } + + ////////////////////////////////////////////////////////////// + // Binary operators + + template + inline tmat2x3 operator+ (const tmat2x3& m, const T & s) + { + return tmat2x3( + m[0] + s, + m[1] + s); + } + + template + inline tmat2x3 operator+ (const tmat2x3& m1, const tmat2x3& m2) + { + return tmat2x3( + m1[0] + m2[0], + m1[1] + m2[1]); + } + + template + inline tmat2x3 operator- (const tmat2x3& m, const T & s) + { + return tmat2x3( + m[0] - s, + m[1] - s); + } + + template + inline tmat2x3 operator- (const tmat2x3& m1, const tmat2x3& m2) + { + return tmat2x3( + m1[0] - m2[0], + m1[1] - m2[1]); + } + + template + inline tmat2x3 operator* (const tmat2x3& m, const T & s) + { + return tmat2x3( + m[0] * s, + m[1] * s); + } + + template + inline tmat2x3 operator* (const T & s, const tmat2x3 & m) + { + return tmat2x3( + m[0] * s, + m[1] * s); + } + + template + inline detail::tvec3 operator* (const tmat2x3& m, const detail::tvec2& v) + { + return detail::tvec3( + m[0][0] * v.x + m[1][0] * v.y, + m[0][1] * v.x + m[1][1] * v.y, + m[0][2] * v.x + m[1][2] * v.y, + m[0][3] * v.x + m[1][3] * v.y); + } + + template + inline detail::tvec2 operator* (const detail::tvec3& v, const tmat2x3& m) + { + return detail::tvec2( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); + } + + template + inline tmat3x3 operator* (const tmat2x3& m1, const tmat3x2& m2) + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA02 = m1[0][2]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA12 = m1[1][2]; + + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB20 = m2[2][0]; + const T SrcB21 = m2[2][1]; + + tmat3x3 Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; + return Result; + } + + template + inline tmat2x3 operator/ (const tmat2x3& m, const T & s) + { + return tmat2x3( + m[0] / s, + m[1] / s, + m[2] / s); + } + + template + inline tmat2x3 operator/ (const T & s, const tmat2x3& m) + { + return tmat2x3( + s / m[0], + s / m[1], + s / m[2]); + } + + //template + //tvec3 operator/ + //( + // tmat3x2 const & m, + // tvec2 const & v + //) + //{ + // return m._inverse() * v; + //} + + //template + //tvec3 operator/ + //( + // tvec2 const & v, + // tmat3x2 const & m + //) + //{ + // return v * m._inverse(); + //} + + //template + //inline tmat2x2 operator/ + //( + // tmat3x2 const & m1, + // tmat2x3 const & m2 + //) + //{ + // return m1 * m2._inverse(); + //} + + // Unary constant operators + template + inline tmat2x3 const operator- + ( + tmat2x3 const & m + ) + { + return tmat2x3( + -m[0], + -m[1]); + } + + template + inline tmat2x3 const operator++ + ( + tmat2x3 const & m, + int + ) + { + return tmat2x3( + m[0] + valType(1), + m[1] + valType(1)); + } + + template + inline tmat2x3 const operator-- + ( + tmat2x3 const & m, + int + ) + { + return tmat2x3( + m[0] - valType(1), + m[1] - valType(1)); + } + +} //namespace detail +} //namespace glm diff --git a/glm/core/type_mat2x4.hpp b/glm/core/type_mat2x4.hpp new file mode 100644 index 00000000..ce0c05cd --- /dev/null +++ b/glm/core/type_mat2x4.hpp @@ -0,0 +1,208 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-08-05 +// Updated : 2008-08-25 +// Licence : This source is under MIT License +// File : glm/core/type_mat2x4.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_mat2x4 +#define glm_core_type_mat2x4 + +#include "type_size.hpp" + +namespace glm +{ + namespace test + { + void main_mat2x4(); + }//namespace test + + namespace detail + { + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //!< \brief Template for 2 * 4 matrix of floating-point numbers. + template + struct tmat2x4 + { + public: + typedef tmat2x4* pointer; + typedef const tmat2x4* const_pointer; + typedef const tmat2x4*const const_pointer_const; + typedef tmat2x4*const pointer_const; + typedef tmat2x4& reference; + typedef const tmat2x4& const_reference; + typedef const tmat2x4& param_type; + typedef tmat4x2 transpose_type; + + typedef T value_type; + typedef detail::tvec2 col_type; + typedef detail::tvec4 row_type; + typedef glm::sizeType size_type; + static size_type col_size(); + static size_type row_size(); + static bool is_matrix(); + + public: + tmat4x2 _inverse() const; + + private: + // Data + detail::tvec4 value[2]; + + public: + // Constructors + tmat2x4(); + explicit tmat2x4(const T x); + explicit tmat2x4( + const T x0, const T y0, const T z0, const T w0, + const T x1, const T y1, const T z1, const T w1); + explicit tmat2x4( + const detail::tvec4& v0, + const detail::tvec4& v1); + + // Conversion + template + explicit tmat2x4(const tmat2x4& m); + + explicit tmat2x4(const tmat2x2& x); + explicit tmat2x4(const tmat3x3& x); + explicit tmat2x4(const tmat4x4& x); + explicit tmat2x4(const tmat2x3& x); + //explicit tmat2x4(const tmat2x4& x); + explicit tmat2x4(const tmat3x2& x); + explicit tmat2x4(const tmat3x4& x); + explicit tmat2x4(const tmat4x2& x); + explicit tmat2x4(const tmat4x3& x); + + // Accesses + detail::tvec4& operator[](size_type i); + detail::tvec4 const & operator[](size_type i) const; + + // Unary updatable operators + tmat2x4& operator= (const tmat2x4& m); + tmat2x4& operator+= (const T & s); + tmat2x4& operator+= (const tmat2x4& m); + tmat2x4& operator-= (const T & s); + tmat2x4& operator-= (const tmat2x4& m); + tmat2x4& operator*= (const T & s); + tmat2x4& operator*= (const tmat4x2& m); + tmat2x4& operator/= (const T & s); + //tmat2x4& operator/= (const tmat4x2& m); + + tmat2x4& operator++ (); + tmat2x4& operator-- (); + }; + + // Binary operators + template + tmat2x4 operator+ (const tmat2x4& m, const T & s); + + template + tmat2x4 operator+ (const tmat2x4& m1, const tmat2x4& m2); + + template + tmat2x4 operator- (const tmat2x4& m, const T & s); + + template + tmat2x4 operator- (const tmat2x4& m1, const tmat2x4& m2); + + template + tmat2x4 operator* (const tmat2x4& m, const T & s); + + template + tmat2x4 operator* (const T & s, const tmat2x4& m); + + template + detail::tvec4 operator* (const tmat2x4& m, const detail::tvec2& v); + + template + detail::tvec2 operator* (const detail::tvec4& v, const tmat2x4& m); + + template + tmat4x4 operator* (const tmat2x4& m1, const tmat4x2& m2); + + template + tmat4x2 operator/ (const tmat2x4& m, const T & s); + + template + tmat4x2 operator/ (const T & s, const tmat2x4& m); + + //template + //detail::tvec4 operator/ (const tmat2x4& m, const detail::tvec2& v); + + //template + //detail::tvec2 operator/ (const detail::tvec4& v, const tmat2x4& m); + + //template + //tmat4x4 operator/ (const tmat4x2& m1, const tmat2x4& m2); + + // Unary constant operators + template + tmat2x4 const operator- (tmat2x4 const & m); + + template + tmat2x4 const operator-- (tmat2x4 const & m, int); + + template + tmat2x4 const operator++ (tmat2x4 const & m, int); + + } //namespace detail + + namespace core{ + namespace type{ + namespace matrix{ + + namespace precision + { + //! 2 columns of 4 components matrix of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x4 lowp_mat2x4; + //! 2 columns of 4 components matrix of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x4 mediump_mat2x4; + //! 2 columns of 4 components matrix of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x4 highp_mat2x4; + } + //namespace precision + +#ifndef GLM_PRECISION + //! 2 columns of 4 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef detail::tmat2x4 mat2x4; +#elif(GLM_PRECISION & GLM_PRECISION_HIGH) + typedef detail::tmat2x4 mat2x4; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM) + typedef detail::tmat2x4 mat2x4; +#elif(GLM_PRECISION & GLM_PRECISION_LOW) + typedef detail::tmat2x4 mat2x4; +#else + typedef detail::tmat2x4 mat2x4; +#endif//GLM_PRECISION + + }//namespace matrix + }//namespace type + }//namespace core +} //namespace glm + +#include "type_mat2x4.inl" + +#endif //glm_core_type_mat2x4 diff --git a/glm/core/type_mat2x4.inl b/glm/core/type_mat2x4.inl new file mode 100644 index 00000000..9988051a --- /dev/null +++ b/glm/core/type_mat2x4.inl @@ -0,0 +1,450 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-08-05 +// Updated : 2006-10-01 +// Licence : This source is under MIT License +// File : glm/core/type_mat2x4.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + + template + typename tmat2x4::size_type tmat2x4::col_size() + { + return typename tmat2x4::size_type(2); + } + + template + typename tmat2x4::size_type tmat2x4::row_size() + { + return typename tmat2x4::size_type(4); + } + + template + bool tmat2x4::is_matrix() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + detail::tvec4& tmat2x4::operator[](typename tmat2x4::size_type i) + { + assert( + i >= typename tmat2x4::size_type(0) && + i < tmat2x4::col_size()); + + return value[i]; + } + + template + const detail::tvec4& tmat2x4::operator[](typename tmat2x4::size_type i) const + { + assert( + i >= typename tmat2x4::size_type(0) && + i < tmat2x4::col_size()); + + return value[i]; + } + + ////////////////////////////////////////////////////////////// + // Constructors + + template + inline tmat2x4::tmat2x4() + { + this->value[0] = detail::tvec4(1, 0, 0, 0); + this->value[1] = detail::tvec4(0, 1, 0, 0); + } + + template + inline tmat2x4::tmat2x4(const T f) + { + this->value[0] = detail::tvec4(f, 0, 0, 0); + this->value[1] = detail::tvec4(0, f, 0, 0); + } + + template + inline tmat2x4::tmat2x4 + ( + const T x0, const T y0, const T z0, const T w0, + const T x1, const T y1, const T z1, const T w1 + ) + { + this->value[0] = detail::tvec4(x0, y0, z0, w0); + this->value[1] = detail::tvec4(x1, y1, z1, w1); + } + + template + inline tmat2x4::tmat2x4 + ( + const detail::tvec4 & v0, + const detail::tvec4 & v1 + ) + { + this->value[0] = v0; + this->value[1] = v1; + } + + // Conversion + template + template + inline tmat2x4::tmat2x4(const tmat2x4& m) + { + this->value[0] = detail::tvec4(m[0]); + this->value[1] = detail::tvec4(m[1]); + } + + template + inline tmat2x4::tmat2x4(tmat2x2 const & m) + { + this->value[0] = detail::tvec4(m[0], detail::tvec2(0)); + this->value[1] = detail::tvec4(m[1], detail::tvec2(0)); + } + + template + inline tmat2x4::tmat2x4(const tmat3x3& m) + { + this->value[0] = detail::tvec4(m[0], T(0)); + this->value[1] = detail::tvec4(m[1], T(0)); + } + + template + inline tmat2x4::tmat2x4(const tmat4x4& m) + { + this->value[0] = detail::tvec4(m[0]); + this->value[1] = detail::tvec4(m[1]); + } + + template + inline tmat2x4::tmat2x4(const tmat2x3& m) + { + this->value[0] = detail::tvec4(m[0], T(0)); + this->value[1] = detail::tvec4(m[1], T(0)); + } + + template + inline tmat2x4::tmat2x4(const tmat3x2& m) + { + this->value[0] = detail::tvec4(m[0], detail::tvec2(0)); + this->value[1] = detail::tvec4(m[1], detail::tvec2(0)); + } + + template + inline tmat2x4::tmat2x4(const tmat3x4& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + } + + template + inline tmat2x4::tmat2x4(const tmat4x2& m) + { + this->value[0] = detail::tvec4(m[0], detail::tvec2(T(0))); + this->value[1] = detail::tvec4(m[1], detail::tvec2(T(0))); + } + + template + inline tmat2x4::tmat2x4(const tmat4x3& m) + { + this->value[0] = detail::tvec4(m[0], T(0)); + this->value[1] = detail::tvec4(m[1], T(0)); + } + + ////////////////////////////////////////////////////////////// + // Unary updatable operators + + template + inline tmat2x4& tmat2x4::operator= (const tmat2x4& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } + + template + inline tmat2x4& tmat2x4::operator+= (const T & s) + { + this->value[0] += s; + this->value[1] += s; + return *this; + } + + template + inline tmat2x4& tmat2x4::operator+= (const tmat2x4& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + return *this; + } + + template + inline tmat2x4& tmat2x4::operator-= (const T & s) + { + this->value[0] -= s; + this->value[1] -= s; + return *this; + } + + template + inline tmat2x4& tmat2x4::operator-= (const tmat2x4& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + return *this; + } + + template + inline tmat2x4& tmat2x4::operator*= (const T & s) + { + this->value[0] *= s; + this->value[1] *= s; + return *this; + } + + template + inline tmat2x4& tmat2x4::operator*= (const tmat4x2& m) + { + return (*this = tmat2x4(*this * m)); + } + + template + inline tmat2x4 & tmat2x4::operator/= (const T & s) + { + this->value[0] /= s; + this->value[1] /= s; + return *this; + } +/* ToDo + template + inline tmat2x4& tmat2x4::operator/= (const tmat4x2& m) + { + return (*this = tmat2x4(*this / m)); + } +*/ + template + inline tmat2x4& tmat2x4::operator++ () + { + ++this->value[0]; + ++this->value[1]; + return *this; + } + + template + inline tmat2x4& tmat2x4::operator-- () + { + --this->value[0]; + --this->value[1]; + return *this; + } + + ////////////////////////////////////////////////////////////// + // inverse + template + inline tmat4x2 tmat2x4::_inverse() const + { + assert(0); //g.truc.creation[at]gmail.com + } + + ////////////////////////////////////////////////////////////// + // Binary operators + + template + inline tmat2x4 operator+ (const tmat2x4& m, const T & s) + { + return tmat2x4( + m[0] + s, + m[1] + s); + } + + template + inline tmat2x4 operator+ (const tmat2x4& m1, const tmat2x4& m2) + { + return tmat2x4( + m1[0] + m2[0], + m1[1] + m2[1]); + } + + template + inline tmat2x4 operator- (const tmat2x4& m, const T & s) + { + return tmat2x4( + m[0] - s, + m[1] - s); + } + + template + inline tmat2x4 operator- (const tmat2x4& m1, const tmat2x4& m2) + { + return tmat2x4( + m1[0] - m2[0], + m1[1] - m2[1]); + } + + template + inline tmat2x4 operator* (const tmat2x4& m, const T & s) + { + return tmat2x4( + m[0] * s, + m[1] * s); + } + + template + inline tmat2x4 operator* (const T & s, const tmat2x4 & m) + { + return tmat2x4( + m[0] * s, + m[1] * s); + } + + template + inline detail::tvec4 operator* (const tmat2x4& m, const detail::tvec2& v) + { + return detail::tvec4( + m[0][0] * v.x + m[1][0] * v.y, + m[0][1] * v.x + m[1][1] * v.y, + m[0][2] * v.x + m[1][2] * v.y, + m[0][3] * v.x + m[1][3] * v.y); + } + + template + inline detail::tvec2 operator* (const detail::tvec4& v, const tmat2x4& m) + { + return detail::tvec4( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); + } + + template + inline tmat4x4 operator* (const tmat2x4& m1, const tmat4x2& m2) + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA02 = m1[0][2]; + const T SrcA03 = m1[0][3]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA12 = m1[1][2]; + const T SrcA13 = m1[1][3]; + + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB20 = m2[2][0]; + const T SrcB21 = m2[2][1]; + const T SrcB30 = m2[3][0]; + const T SrcB31 = m2[3][1]; + + tmat4x4 Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; + Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; + Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; + Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21; + Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31; + Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31; + Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31; + Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31; + return Result; + } + + template + inline tmat2x4 operator/ (const tmat2x4& m, const T & s) + { + return tmat2x4( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } + + template + inline tmat2x4 operator/ (const T & s, const tmat2x4& m) + { + return tmat2x4( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } + + //template + //tvec4 operator/ + //( + // tmat4x2 const & m, + // tvec2 const & v + //) + //{ + // return m._inverse() * v; + //} + + //template + //tvec4 operator/ + //( + // tvec2 const & v, + // tmat4x2 const & m + //) + //{ + // return v * m._inverse(); + //} + + //template + //inline tmat2x2 operator/ + //( + // tmat4x2 const & m1, + // tmat2x4 const & m2 + //) + //{ + // return m1 * m2._inverse(); + //} + + // Unary constant operators + template + inline tmat2x4 const operator- + ( + tmat2x4 const & m + ) + { + return tmat2x4( + -m[0], + -m[1]); + } + + template + inline tmat2x4 const operator++ + ( + tmat2x4 const & m, + int + ) + { + return tmat2x4( + m[0] + valType(1), + m[1] + valType(1)); + } + + template + inline tmat2x4 const operator-- + ( + tmat2x4 const & m, + int + ) + { + return tmat2x4( + m[0] - valType(1), + m[1] - valType(1)); + } + +} //namespace detail +} //namespace glm diff --git a/glm/core/type_mat3x2.hpp b/glm/core/type_mat3x2.hpp new file mode 100644 index 00000000..9d1e3358 --- /dev/null +++ b/glm/core/type_mat3x2.hpp @@ -0,0 +1,209 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-08-05 +// Updated : 2008-08-30 +// Licence : This source is under MIT License +// File : glm/core/type_mat3x2.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_mat3x2 +#define glm_core_type_mat3x2 + +#include "type_size.hpp" + +namespace glm +{ + namespace test + { + void main_mat3x2(); + }//namespace test + + namespace detail + { + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //!< \brief Template for 3 * 2 matrix of floating-point numbers. + template + struct tmat3x2 + { + public: + typedef tmat3x2* pointer; + typedef const tmat3x2* const_pointer; + typedef const tmat3x2*const const_pointer_const; + typedef tmat3x2*const pointer_const; + typedef tmat3x2& reference; + typedef const tmat3x2& const_reference; + typedef const tmat3x2& param_type; + typedef tmat2x3 transpose_type; + + typedef T value_type; + typedef detail::tvec3 col_type; + typedef detail::tvec2 row_type; + typedef glm::sizeType size_type; + static size_type col_size(); + static size_type row_size(); + static bool is_matrix(); + + public: + tmat2x3 _inverse() const; + + private: + // Data + detail::tvec2 value[3]; + + public: + // Constructors + tmat3x2(); + explicit tmat3x2(const T x); + explicit tmat3x2( + const T x0, const T y0, + const T x1, const T y1, + const T x2, const T y2); + explicit tmat3x2( + const detail::tvec2& v0, + const detail::tvec2& v1, + const detail::tvec2& v2); + + // Conversion + template + explicit tmat3x2(const tmat3x2& m); + + explicit tmat3x2(const tmat2x2& x); + explicit tmat3x2(const tmat3x3& x); + explicit tmat3x2(const tmat4x4& x); + explicit tmat3x2(const tmat2x3& x); + explicit tmat3x2(const tmat2x4& x); + explicit tmat3x2(const tmat3x4& x); + explicit tmat3x2(const tmat4x2& x); + explicit tmat3x2(const tmat4x3& x); + + // Accesses + detail::tvec2& operator[](size_type i); + const detail::tvec2& operator[](size_type i) const; + + // Unary updatable operators + tmat3x2& operator= (const tmat3x2& m); + tmat3x2& operator+= (const T & s); + tmat3x2& operator+= (const tmat3x2& m); + tmat3x2& operator-= (const T & s); + tmat3x2& operator-= (const tmat3x2& m); + tmat3x2& operator*= (const T & s); + tmat3x2& operator*= (const tmat2x3& m); + tmat3x2& operator/= (const T & s); + //tmat3x2& operator/= (const tmat2x3& m); + + tmat3x2& operator++ (); + tmat3x2& operator-- (); + }; + + // Binary operators + template + tmat3x2 operator+ (const tmat3x2& m, const T & s); + + template + tmat3x2 operator+ (const tmat3x2& m1, const tmat3x2& m2); + + template + tmat3x2 operator- (const tmat3x2& m, const T & s); + + template + tmat3x2 operator- (const tmat3x2& m1, const tmat3x2& m2); + + template + tmat3x2 operator* (const tmat3x2& m, const T & s); + + template + tmat3x2 operator* (const T & s, const tmat3x4& m); + + template + detail::tvec2 operator* (const tmat3x2& m, const detail::tvec3& v); + + template + detail::tvec3 operator* (const detail::tvec2& v, const tmat3x2& m); + + template + tmat2x2 operator* (const tmat3x2& m1, const tmat2x3& m2); + + template + tmat2x3 operator/ (const tmat2x3& m, const T & s); + + template + tmat2x3 operator/ (const T s, const tmat2x3& m); + + //template + //detail::tvec2 operator/ (const tmat3x2& m, const detail::tvec3& v); + + //template + //detail::tvec3 operator/ (const detail::tvec2& v, const tmat3x2& m); + + //template + //tmat2x2 operator/ (const tmat2x3& m1, const tmat3x2& m2); + + // Unary constant operators + template + tmat3x2 const operator- (tmat3x2 const & m); + + template + tmat3x2 const operator-- (tmat3x2 const & m, int); + + template + tmat3x2 const operator++ (tmat3x2 const & m, int); + + } //namespace detail + + namespace core{ + namespace type{ + namespace matrix{ + + namespace precision + { + //! 3 columns of 2 components matrix of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x2 lowp_mat3x2; + //! 3 columns of 2 components matrix of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x2 mediump_mat3x2; + //! 3 columns of 2 components matrix of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x2 highp_mat3x2; + } + //namespace precision + +#ifndef GLM_PRECISION + //! 3 columns of 2 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef detail::tmat3x2 mat3x2; +#elif(GLM_PRECISION & GLM_PRECISION_HIGH) + typedef detail::tmat3x2 mat3x2; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM) + typedef detail::tmat3x2 mat3x2; +#elif(GLM_PRECISION & GLM_PRECISION_LOW) + typedef detail::tmat3x2 mat3x2; +#else + typedef detail::tmat3x2 mat3x2; +#endif//GLM_PRECISION + + }//namespace matrix + }//namespace type + }//namespace core +} //namespace glm + +#include "type_mat3x2.inl" + +#endif //glm_core_type_mat3x2 diff --git a/glm/core/type_mat3x2.inl b/glm/core/type_mat3x2.inl new file mode 100644 index 00000000..c6dc7e98 --- /dev/null +++ b/glm/core/type_mat3x2.inl @@ -0,0 +1,465 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-08-05 +// Updated : 2006-10-01 +// Licence : This source is under MIT License +// File : glm/core/type_mat3x2.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + + template + typename tmat3x2::size_type tmat3x2::col_size() + { + return typename tmat3x2::size_type(3); + } + + template + typename tmat3x2::size_type tmat3x2::row_size() + { + return typename tmat3x2::size_type(2); + } + + template + bool tmat3x2::is_matrix() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + detail::tvec2& tmat3x2::operator[](typename tmat3x2::size_type i) + { + assert( + i >= typename tmat3x2::size_type(0) && + i < tmat3x2::col_size()); + + return value[i]; + } + + template + const detail::tvec2& tmat3x2::operator[](typename tmat3x2::size_type i) const + { + assert( + i >= typename tmat3x2::size_type(0) && + i < tmat3x2::col_size()); + + return value[i]; + } + + ////////////////////////////////////////////////////////////// + // Constructors + + template + inline tmat3x2::tmat3x2() + { + this->value[0] = detail::tvec2(1, 0); + this->value[1] = detail::tvec2(0, 1); + this->value[2] = detail::tvec2(0, 0); + } + + template + inline tmat3x2::tmat3x2(const T f) + { + this->value[0] = detail::tvec2(f, 0); + this->value[1] = detail::tvec2(0, f); + this->value[2] = detail::tvec2(0, 0); + } + + template + inline tmat3x2::tmat3x2 + ( + const T x0, const T y0, + const T x1, const T y1, + const T x2, const T y2 + ) + { + this->value[0] = detail::tvec2(x0, y0); + this->value[1] = detail::tvec2(x1, y1); + this->value[2] = detail::tvec2(x2, y2); + } + + template + inline tmat3x2::tmat3x2 + ( + const detail::tvec2 & v0, + const detail::tvec2 & v1, + const detail::tvec2 & v2 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + } + + // Conversion + template + template + inline tmat3x2::tmat3x2(const tmat3x2& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(m[2]); + } + + template + inline tmat3x2::tmat3x2(tmat2x2 const & m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = detail::tvec2(T(0)); + } + + template + inline tmat3x2::tmat3x2(const tmat3x3& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(m[2]); + } + + template + inline tmat3x2::tmat3x2(const tmat4x4& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(m[2]); + } + + template + inline tmat3x2::tmat3x2(const tmat2x3& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(T(0)); + } + + template + inline tmat3x2::tmat3x2(const tmat2x4& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(T(0)); + } + + template + inline tmat3x2::tmat3x2(const tmat3x4& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(m[2]); + } + + template + inline tmat3x2::tmat3x2(const tmat4x2& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + } + + template + inline tmat3x2::tmat3x2(const tmat4x3& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(m[2]); + } + + ////////////////////////////////////////////////////////////// + // Unary updatable operators + + template + inline tmat3x2& tmat3x2::operator= (const tmat3x2& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } + + template + inline tmat3x2& tmat3x2::operator+= (const T & s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + return *this; + } + + template + inline tmat3x2& tmat3x2::operator+= (const tmat3x2& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + return *this; + } + + template + inline tmat3x2& tmat3x2::operator-= (const T & s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + return *this; + } + + template + inline tmat3x2& tmat3x2::operator-= (const tmat3x2& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + return *this; + } + + template + inline tmat3x2& tmat3x2::operator*= (const T & s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + return *this; + } + + template + inline tmat3x2& tmat3x2::operator*= (const tmat2x3& m) + { + return (*this = tmat3x2(*this * m)); + } + + template + inline tmat3x2 & tmat3x2::operator/= (const T & s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + return *this; + } + + //template + //inline tmat3x2& tmat3x2::operator/= (const tmat3x2& m) + //{ + // return (*this = tmat3x2(*this / m)); + //} + + template + inline tmat3x2& tmat3x2::operator++ () + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + return *this; + } + + template + inline tmat3x2& tmat3x2::operator-- () + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + return *this; + } + + ////////////////////////////////////////////////////////////// + // inverse + template + inline tmat2x3 tmat3x2::_inverse() const + { + assert(0); //g.truc.creation[at]gmail.com + } + + ////////////////////////////////////////////////////////////// + // Binary operators + + template + inline tmat3x2 operator+ (const tmat3x2& m, const T & s) + { + return tmat3x2( + m[0] + s, + m[1] + s, + m[2] + s); + } + + template + inline tmat3x2 operator+ (const tmat3x2& m1, const tmat3x2& m2) + { + return tmat3x2( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2]); + } + + template + inline tmat3x2 operator- (const tmat3x2& m, const T & s) + { + return tmat3x4( + m[0] - s, + m[1] - s, + m[2] - s); + } + + template + inline tmat3x2 operator- (const tmat3x2& m1, const tmat3x2& m2) + { + return tmat3x2( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2]); + } + + template + inline tmat3x2 operator* (const tmat3x2& m, const T & s) + { + return tmat3x2( + m[0] * s, + m[1] * s, + m[2] * s); + } + + template + inline tmat3x2 operator* (const T & s, const tmat3x2 & m) + { + return tmat3x2( + m[0] * s, + m[1] * s, + m[2] * s); + } + + template + inline detail::tvec2 operator* (const tmat3x2& m, const detail::tvec3& v) + { + return detail::tvec2( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z); + } + + template + inline detail::tvec3 operator* (const detail::tvec2& v, const tmat3x2& m) + { + return detail::tvec3( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); + } + + template + inline tmat2x2 operator* (const tmat3x2& m1, const tmat2x3& m2) + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA20 = m1[2][0]; + const T SrcA21 = m1[2][1]; + + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB02 = m2[0][2]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB12 = m2[1][2]; + + tmat2x2 Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA01 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + return Result; + } + + template + inline tmat3x2 operator/ (const tmat3x2& m, const T & s) + { + return tmat3x2( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } + + template + inline tmat3x2 operator/ (const T & s, const tmat3x2& m) + { + return tmat3x2( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } + + //template + //inline tvec2 operator/ + //( + // tmat3x2 const & m, + // tvec2 const & v + //) + //{ + // return m._inverse() * v; + //} + + //template + //inline tvec3 operator/ + //( + // tvec2 const & v, + // tmat3x2 const & m + //) + //{ + // return v * m._inverse(); + //} + + //template + //inline tmat3x3 operator/ + //( + // tmat3x2 const & m1, + // tmat2x3 const & m2 + //) + //{ + // return m1 * m2._inverse(); + //} + + // Unary constant operators + template + inline tmat3x2 const operator- + ( + tmat3x2 const & m + ) + { + return tmat3x2( + -m[0], + -m[1], + -m[2]); + } + + template + inline tmat3x2 const operator++ + ( + tmat3x2 const & m, + int + ) + { + return tmat3x2( + m[0] + valType(1), + m[1] + valType(1), + m[2] + valType(1)); + } + + template + inline tmat3x2 const operator-- + ( + tmat3x2 const & m, + int + ) + { + return tmat3x2( + m[0] - valType(1), + m[1] - valType(1), + m[2] - valType(1)); + } + +} //namespace detail +} //namespace glm diff --git a/glm/core/type_mat3x3.hpp b/glm/core/type_mat3x3.hpp new file mode 100644 index 00000000..4722abed --- /dev/null +++ b/glm/core/type_mat3x3.hpp @@ -0,0 +1,219 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-01-27 +// Updated : 2008-08-30 +// Licence : This source is under MIT License +// File : glm/core/type_mat3x3.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_mat3x3 +#define glm_core_type_mat3x3 + +#include "type_size.hpp" + +namespace glm +{ + namespace test + { + void main_mat3x3(); + }//namespace test + + namespace detail + { + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //!< \brief Template for 3 * 3 matrix of floating-point numbers. + template + struct tmat3x3 + { + public: + typedef tmat3x3* pointer; + typedef const tmat3x3* const_pointer; + typedef const tmat3x3*const const_pointer_const; + typedef tmat3x3*const pointer_const; + typedef tmat3x3& reference; + typedef const tmat3x3& const_reference; + typedef const tmat3x3& param_type; + typedef tmat3x3 transpose_type; + + typedef T value_type; + typedef detail::tvec3 col_type; + typedef detail::tvec3 row_type; + typedef glm::sizeType size_type; + static size_type value_size(); + static size_type col_size(); + static size_type row_size(); + static bool is_matrix(); + + public: + tmat3x3 _inverse() const; + + private: + // Data + tvec3 value[3]; + + public: + // Constructors + tmat3x3(); + explicit tmat3x3(const T x); + explicit tmat3x3( + const T x0, const T y0, const T z0, + const T x1, const T y1, const T z1, + const T x2, const T y2, const T z2); + explicit tmat3x3( + const detail::tvec3 & v0, + const detail::tvec3 & v1, + const detail::tvec3 & v2); + + // Conversions + template + explicit tmat3x3(const tmat3x3& m); + + explicit tmat3x3(const tmat2x2& x); + explicit tmat3x3(const tmat4x4& x); + explicit tmat3x3(const tmat2x3& x); + explicit tmat3x3(const tmat3x2& x); + explicit tmat3x3(const tmat2x4& x); + explicit tmat3x3(const tmat4x2& x); + explicit tmat3x3(const tmat3x4& x); + explicit tmat3x3(const tmat4x3& x); + + // Accesses + detail::tvec3& operator[](size_type i); + detail::tvec3 const & operator[](size_type i) const; + + // Unary updatable operators + tmat3x3& operator=(const tmat3x3& m); + tmat3x3& operator+= (const T & s); + tmat3x3& operator+= (const tmat3x3& m); + tmat3x3& operator-= (const T & s); + tmat3x3& operator-= (const tmat3x3& m); + tmat3x3& operator*= (const T & s); + tmat3x3& operator*= (const tmat3x3& m); + tmat3x3& operator/= (const T & s); + tmat3x3& operator/= (const tmat3x3& m); + tmat3x3& operator++ (); + tmat3x3& operator-- (); + }; + + // Binary operators + template + tmat3x3 operator+ (const tmat3x3& m, const T & s); + + template + tmat3x3 operator+ (const T & s, const tmat3x3& m); + + template + tmat3x3 operator+ (const tmat3x3& m1, const tmat3x3& m2); + + template + tmat3x3 operator- (const tmat3x3& m, const T & s); + + template + tmat3x3 operator- (const T & s, const tmat3x3& m); + + template + tmat3x3 operator- (const tmat3x3& m1, const tmat3x3& m2); + + template + tmat3x3 operator* (const tmat3x3& m, const T & s); + + template + tmat3x3 operator* (const T & s, const tmat3x3& m); + + template + detail::tvec3 operator* (const tmat3x3& m, const detail::tvec3& v); + + template + detail::tvec3 operator* (const detail::tvec3& v, const tmat3x3& m); + + template + tmat3x3 operator* (const tmat3x3& m1, const tmat3x3& m2); + + template + tmat3x3 operator/ (const tmat3x3& m, const T & s); + + template + tmat3x3 operator/ (const T & s, const tmat3x3& m); + + template + detail::tvec3 operator/ (const tmat3x3& m, const detail::tvec3& v); + + template + detail::tvec3 operator/ (const detail::tvec3& v, const tmat3x3& m); + + template + tmat3x3 operator/ (const tmat3x3& m1, const tmat3x3& m2); + + // Unary constant operators + template + tmat3x3 const operator- (tmat3x3 const & m); + + template + tmat3x3 const operator-- (tmat3x3 const & m, int); + + template + tmat3x3 const operator++ (tmat3x3 const & m, int); + + } //namespace detail + + namespace core{ + namespace type{ + namespace matrix{ + + namespace precision + { + //! 3 columns of 3 components matrix of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x3 lowp_mat3x3; + //! 3 columns of 3 components matrix of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x3 mediump_mat3x3; + //! 3 columns of 3 components matrix of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x3 highp_mat3x3; + } + //namespace precision + +#ifndef GLM_PRECISION + //! 3 columns of 3 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef detail::tmat3x3 mat3x3; +#elif(GLM_PRECISION & GLM_PRECISION_HIGH) + typedef detail::tmat3x3 mat3x3; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM) + typedef detail::tmat3x3 mat3x3; +#elif(GLM_PRECISION & GLM_PRECISION_LOW) + typedef detail::tmat3x3 mat3x3; +#else + typedef detail::tmat3x3 mat3x3; +#endif//GLM_PRECISION + + //! 3 columns of 3 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef mat3x3 mat3; + + }//namespace matrix + }//namespace type + }//namespace core +} //namespace glm + +#include "type_mat3x3.inl" + +#endif //glm_core_type_mat3x3 diff --git a/glm/core/type_mat3x3.inl b/glm/core/type_mat3x3.inl new file mode 100644 index 00000000..ae92a9e3 --- /dev/null +++ b/glm/core/type_mat3x3.inl @@ -0,0 +1,604 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-01-27 +// Updated : 2008-08-25 +// Licence : This source is under MIT License +// File : glm/core/type_mat3x3.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + + template + typename tmat3x3::size_type tmat3x3::value_size() + { + return typename tmat3x3::size_type(3); + } + + template + typename tmat3x3::size_type tmat3x3::col_size() + { + return typename tmat3x3::size_type(3); + } + + template + typename tmat3x3::size_type tmat3x3::row_size() + { + return typename tmat3x3::size_type(3); + } + + template + bool tmat3x3::is_matrix() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + detail::tvec3& tmat3x3::operator[](typename tmat3x3::size_type i) + { + assert( + i >= typename tmat3x3::size_type(0) && + i < tmat3x3::col_size()); + + return value[i]; + } + + template + const detail::tvec3& tmat3x3::operator[](typename tmat3x3::size_type i) const + { + assert( + i >= typename tmat3x3::size_type(0) && + i < tmat3x3::col_size()); + + return value[i]; + } + + ////////////////////////////////////////////////////////////// + // mat3 constructors + + template + inline tmat3x3::tmat3x3() + { + this->value[0] = detail::tvec3(1, 0, 0); + this->value[1] = detail::tvec3(0, 1, 0); + this->value[2] = detail::tvec3(0, 0, 1); + } + + template + inline tmat3x3::tmat3x3(const T f) + { + this->value[0] = detail::tvec3(f, 0, 0); + this->value[1] = detail::tvec3(0, f, 0); + this->value[2] = detail::tvec3(0, 0, f); + } + + template + inline tmat3x3::tmat3x3 + ( + const T x0, const T y0, const T z0, + const T x1, const T y1, const T z1, + const T x2, const T y2, const T z2 + ) + { + this->value[0] = detail::tvec3(x0, y0, z0); + this->value[1] = detail::tvec3(x1, y1, z1); + this->value[2] = detail::tvec3(x2, y2, z2); + } + + template + inline tmat3x3::tmat3x3 + ( + const detail::tvec3& v0, + const detail::tvec3& v1, + const detail::tvec3& v2 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + } + + ////////////////////////////////////////////////////////////// + // mat3 conversions + + template + template + inline tmat3x3::tmat3x3(const tmat3x3& m) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + this->value[2] = detail::tvec3(m[2]); + } + + template + inline tmat3x3::tmat3x3(tmat2x2 const & m) + { + this->value[0] = detail::tvec3(m[0], T(0)); + this->value[1] = detail::tvec3(m[1], T(0)); + this->value[2] = detail::tvec3(detail::tvec2(0), T(1)); + } + + template + inline tmat3x3::tmat3x3(const tmat4x4& m) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + this->value[2] = detail::tvec3(m[2]); + } + + template + inline tmat3x3::tmat3x3(const tmat2x3& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = detail::tvec3(detail::tvec2(0), T(1)); + } + + template + inline tmat3x3::tmat3x3(const tmat3x2& m) + { + this->value[0] = detail::tvec3(m[0], T(0)); + this->value[1] = detail::tvec3(m[1], T(0)); + this->value[2] = detail::tvec3(m[2], T(1)); + } + + template + inline tmat3x3::tmat3x3(const tmat2x4& m) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + this->value[2] = detail::tvec3(detail::tvec2(0), T(1)); + } + + template + inline tmat3x3::tmat3x3(const tmat4x2& m) + { + this->value[0] = detail::tvec3(m[0], T(0)); + this->value[1] = detail::tvec3(m[1], T(0)); + this->value[2] = detail::tvec3(m[2], T(1)); + } + + template + inline tmat3x3::tmat3x3(const tmat3x4& m) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + this->value[2] = detail::tvec3(m[2]); + } + + template + inline tmat3x3::tmat3x3(const tmat4x3& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + } + +/* + template + inline tmat3x3::tmat3x3(const T* a) + { + this->value[0] = detail::tvec3(a[0], a[1], a[2]); + this->value[1] = detail::tvec3(a[3], a[4], a[5]); + this->value[2] = detail::tvec3(a[6], a[7], a[8]); + } +*/ + /* + // GL_GTX_euler_angles + template + inline tmat3x3::tmat3x3(const detail::tvec3 & angles) + { + T ch = cos(angles.x); + T sh = sin(angles.x); + T cp = cos(angles.y); + T sp = sin(angles.y); + T cb = cos(angles.z); + T sb = sin(angles.z); + + value[0][0] = ch * cb + sh * sp * sb; + value[0][1] = sb * cp; + value[0][2] = -sh * cb + ch * sp * sb; + value[1][0] = -ch * sb + sh * sp * cb; + value[1][1] = cb * cp; + value[1][2] = sb * sh + ch * sp * cb; + value[2][0] = sh * cp; + value[2][1] = -sp; + value[2][2] = ch * cp; + } + */ + ////////////////////////////////////////////////////////////// + // mat3 conversions + /* + template + inline tmat3x3::tmat3x3(const tquat & q) + { + this->value[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z; + this->value[0][1] = 2 * q.x * q.y + 2 * q.w * q.z; + this->value[0][2] = 2 * q.x * q.z - 2 * q.w * q.y; + + this->value[1][0] = 2 * q.x * q.y - 2 * q.w * q.z; + this->value[1][1] = 1 - 2 * q.x * q.x - 2 * q.z * q.z; + this->value[1][2] = 2 * q.y * q.z + 2 * q.w * q.x; + + this->value[2][0] = 2 * q.x * q.z + 2 * q.w * q.y; + this->value[2][1] = 2 * q.y * q.z - 2 * q.w * q.x; + this->value[2][2] = 1 - 2 * q.x * q.x - 2 * q.y * q.y; + } + */ + ////////////////////////////////////////////////////////////// + // mat3 operators + + template + inline tmat3x3& tmat3x3::operator=(const tmat3x3& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } + + template + inline tmat3x3& tmat3x3::operator+= (const T & s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + return *this; + } + + template + inline tmat3x3& tmat3x3::operator+= (const tmat3x3& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + return *this; + } + + template + inline tmat3x3& tmat3x3::operator-= (const T & s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + return *this; + } + + template + inline tmat3x3& tmat3x3::operator-= (const tmat3x3& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + return *this; + } + + template + inline tmat3x3& tmat3x3::operator*= (const T & s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + return *this; + } + + template + inline tmat3x3& tmat3x3::operator*= (const tmat3x3& m) + { + return (*this = *this * m); + } + + template + inline tmat3x3& tmat3x3::operator/= (const T & s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + return *this; + } + + template + inline tmat3x3& tmat3x3::operator/= (const tmat3x3& m) + { + return (*this = *this / m); + } + + template + inline tmat3x3& tmat3x3::operator++ () + { + this->value[0]++; + this->value[1]++; + this->value[2]++; + return *this; + } + + template + inline tmat3x3& tmat3x3::operator-- () + { + this->value[0]--; + this->value[1]--; + this->value[2]--; + return *this; + } + + template + inline tmat3x3 tmat3x3::_inverse() const + { + T S00 = value[0][0]; + T S01 = value[0][1]; + T S02 = value[0][2]; + + T S10 = value[1][0]; + T S11 = value[1][1]; + T S12 = value[1][2]; + + T S20 = value[2][0]; + T S21 = value[2][1]; + T S22 = value[2][2]; + + tmat3x3 Inverse( + + (S11 * S22 - S21 * S12), + - (S10 * S22 - S20 * S12), + + (S10 * S21 - S20 * S11), + - (S01 * S22 - S21 * S02), + + (S00 * S22 - S20 * S02), + - (S00 * S21 - S20 * S01), + + (S01 * S12 - S11 * S02), + - (S00 * S12 - S10 * S02), + + (S00 * S11 - S10 * S01)); + + T Determinant = S00 * (S11 * S22 - S21 * S12) + - S10 * (S01 * S22 - S21 * S02) + + S20 * (S01 * S12 - S11 * S02); + + Inverse /= Determinant; + return Inverse; + } + + ////////////////////////////////////////////////////////////// + // Binary operators + + template + inline tmat3x3 operator+ (const tmat3x3& m, const T & s) + { + return tmat3x3( + m[0] + s, + m[1] + s, + m[2] + s); + } + + template + inline tmat3x3 operator+ (const T & s, const tmat3x3& m) + { + return tmat3x3( + m[0] + s, + m[1] + s, + m[2] + s); + } + + //template + //inline tvec3 operator+ (const tmat3x3& m, const tvec3& v) + //{ + + //} + + //template + //inline tvec3 operator+ (const tvec3& v, const tmat3x3& m) + //{ + + //} + + template + inline tmat3x3 operator+ (const tmat3x3& m1, const tmat3x3& m2) + { + return tmat3x3( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2]); + } + + template + inline tmat3x3 operator- (const tmat3x3& m, const T & s) + { + return tmat3x3( + m[0] - s, + m[1] - s, + m[2] - s); + } + + template + inline tmat3x3 operator- (const T & s, const tmat3x3& m) + { + return tmat3x3( + s - m[0], + s - m[1], + s - m[2]); + } + + //template + //inline detail::tvec3 operator- (const tmat3x3& m, const detail::tvec3& v) + //{ + + //} + + //template + //inline detail::tvec3 operator- (const detail::tvec3& v, const tmat3x3& m) + //{ + + //} + + template + inline tmat3x3 operator- (const tmat3x3& m1, const tmat3x3& m2) + { + return tmat3x3( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2]); + } + + template + inline tmat3x3 operator* (const tmat3x3& m, const T & s) + { + return tmat3x3( + m[0] * s, + m[1] * s, + m[2] * s); + } + + template + inline tmat3x3 operator* (const T & s, const tmat3x3& m) + { + return tmat3x3( + m[0] * s, + m[1] * s, + m[2] * s); + } + + template + inline detail::tvec3 operator* (const tmat3x3& m, const detail::tvec3& v) + { + return detail::tvec3( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z); + } + + template + inline detail::tvec3 operator* (const detail::tvec3& v, const tmat3x3& m) + { + return detail::tvec3( + m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z, + m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z, + m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z); + } + + template + inline tmat3x3 operator* (const tmat3x3& m1, const tmat3x3& m2) + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA02 = m1[0][2]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA12 = m1[1][2]; + const T SrcA20 = m1[2][0]; + const T SrcA21 = m1[2][1]; + const T SrcA22 = m1[2][2]; + + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB02 = m2[0][2]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB12 = m2[1][2]; + const T SrcB20 = m2[2][0]; + const T SrcB21 = m2[2][1]; + const T SrcB22 = m2[2][2]; + + tmat3x3 Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; + return Result; + } + + + template + inline tmat3x3 operator/ (const tmat3x3& m, const T & s) + { + return tmat3x3( + m[0] / s, + m[1] / s, + m[2] / s); + } + + template + inline tmat3x3 operator/ (const T & s, const tmat3x3& m) + { + return tmat3x3( + s / m[0], + s / m[1], + s / m[2]); + } + + template + inline detail::tvec3 operator/ + ( + tmat3x3 const & m, + tvec3 const & v + ) + { + return m._inverse() * v; + } + + template + inline detail::tvec3 operator/ + ( + tvec3 const & v, + tmat3x3 const & m + ) + { + return v * m._inverse(); + } + + template + inline tmat3x3 operator/ + ( + tmat3x3 const & m1, + tmat3x3 const & m2 + ) + { + return m1 * m2._inverse(); + } + + // Unary constant operators + template + inline tmat3x3 const operator- + ( + tmat3x3 const & m + ) + { + return tmat3x3( + -m[0], + -m[1], + -m[2]); + } + + template + inline tmat3x3 const operator++ + ( + tmat3x3 const & m, + int + ) + { + return tmat3x3( + m[0] + valType(1), + m[1] + valType(1), + m[2] + valType(1)); + } + + template + inline tmat3x3 const operator-- + ( + tmat3x3 const & m, + int + ) + { + return tmat3x3( + m[0] - valType(1), + m[1] - valType(1), + m[2] - valType(1)); + } + +} //namespace detail +} //namespace glm diff --git a/glm/core/type_mat3x4.hpp b/glm/core/type_mat3x4.hpp new file mode 100644 index 00000000..ffad864c --- /dev/null +++ b/glm/core/type_mat3x4.hpp @@ -0,0 +1,209 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-08-05 +// Updated : 2008-08-30 +// Licence : This source is under MIT License +// File : glm/core/type_mat3x4.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_mat3x4 +#define glm_core_type_mat3x4 + +#include "type_size.hpp" + +namespace glm +{ + namespace test + { + void main_mat3x4(); + }//namespace test + + namespace detail + { + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //!< \brief Template for 3 * 4 matrix of floating-point numbers. + template + struct tmat3x4 + { + public: + typedef tmat3x4* pointer; + typedef const tmat3x4* const_pointer; + typedef const tmat3x4*const const_pointer_const; + typedef tmat3x4*const pointer_const; + typedef tmat3x4& reference; + typedef const tmat3x4& const_reference; + typedef const tmat3x4& param_type; + typedef tmat4x3 transpose_type; + + typedef T value_type; + typedef detail::tvec3 col_type; + typedef detail::tvec4 row_type; + typedef glm::sizeType size_type; + static size_type col_size(); + static size_type row_size(); + static bool is_matrix(); + + public: + tmat4x3 _inverse() const; + + private: + // Data + detail::tvec4 value[3]; + + public: + // Constructors + tmat3x4(); + explicit tmat3x4(const T x); + explicit tmat3x4( + const T x0, const T y0, const T z0, const T w0, + const T x1, const T y1, const T z1, const T w1, + const T x2, const T y2, const T z2, const T w2); + explicit tmat3x4( + const detail::tvec4& v0, + const detail::tvec4& v1, + const detail::tvec4& v2); + + // Conversion + template + explicit tmat3x4(const tmat3x4& m); + + explicit tmat3x4(const tmat2x2& x); + explicit tmat3x4(const tmat3x3& x); + explicit tmat3x4(const tmat4x4& x); + explicit tmat3x4(const tmat2x3& x); + explicit tmat3x4(const tmat3x2& x); + explicit tmat3x4(const tmat2x4& x); + explicit tmat3x4(const tmat4x2& x); + explicit tmat3x4(const tmat4x3& x); + + // Accesses + detail::tvec4& operator[](size_type i); + detail::tvec4 const & operator[](size_type i) const; + + // Unary updatable operators + tmat3x4& operator= (const tmat3x4& m); + tmat3x4& operator+= (const T & s); + tmat3x4& operator+= (const tmat3x4& m); + tmat3x4& operator-= (const T & s); + tmat3x4& operator-= (const tmat3x4& m); + tmat3x4& operator*= (const T & s); + tmat3x4& operator*= (const tmat4x3& m); + tmat3x4& operator/= (const T & s); + //tmat3x4& operator/= (const tmat4x3& m); + + tmat3x4& operator++ (); + tmat3x4& operator-- (); + }; + + // Binary operators + template + tmat3x4 operator+ (const tmat3x4& m, const T & s); + + template + tmat3x4 operator+ (const tmat3x4& m1, const tmat3x4& m2); + + template + tmat3x4 operator- (const tmat3x4& m, const T & s); + + template + tmat3x4 operator- (const tmat3x4& m1, const tmat3x4& m2); + + template + tmat3x4 operator* (const tmat3x4& m, const T & s); + + template + tmat3x4 operator* (const T & s, const tmat3x4& m); + + template + detail::tvec4 operator* (const tmat3x4& m, const detail::tvec3& v); + + template + detail::tvec3 operator* (const detail::tvec4& v, const tmat3x4& m); + + template + tmat4x4 operator* (const tmat3x4& m1, const tmat4x3& m2); + + template + tmat4x3 operator/ (const tmat4x3& m, const T & s); + + template + tmat4x3 operator/ (const T & s, const tmat4x3& m); + + //template + //detail::tvec4 operator/ (const tmat3x4& m, const detail::tvec3& v); + + //template + //detail::tvec3 operator/ (const detail::tvec4& v, const tmat3x4& m); + + //template + //tmat4x4 operator/ (const tmat4x3& m1, const tmat3x4& m2); + + // Unary constant operators + template + tmat3x4 const operator- (tmat3x4 const & m); + + template + tmat3x4 const operator-- (tmat3x4 const & m, int); + + template + tmat3x4 const operator++ (tmat3x4 const & m, int); + + } //namespace detail + + namespace core{ + namespace type{ + namespace matrix{ + + namespace precision + { + //! 3 columns of 4 components matrix of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x4 lowp_mat3x4; + //! 3 columns of 4 components matrix of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x4 mediump_mat3x4; + //! 3 columns of 4 components matrix of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x4 highp_mat3x4; + } + //namespace precision + +#ifndef GLM_PRECISION + //! 3 columns of 4 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef detail::tmat3x4 mat3x4; +#elif(GLM_PRECISION & GLM_PRECISION_HIGH) + typedef detail::tmat3x4 mat3x4; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM) + typedef detail::tmat3x4 mat3x4; +#elif(GLM_PRECISION & GLM_PRECISION_LOW) + typedef detail::tmat3x4 mat3x4; +#else + typedef detail::tmat3x4 mat3x4; +#endif//GLM_PRECISION + + }//namespace matrix + }//namespace type + }//namespace core +} //namespace glm + +#include "type_mat3x4.inl" + +#endif //glm_core_type_mat3x4 diff --git a/glm/core/type_mat3x4.inl b/glm/core/type_mat3x4.inl new file mode 100644 index 00000000..ce758700 --- /dev/null +++ b/glm/core/type_mat3x4.inl @@ -0,0 +1,484 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-08-05 +// Updated : 2006-10-01 +// Licence : This source is under MIT License +// File : glm/core/type_mat3x4.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + + template + typename tmat3x4::size_type tmat3x4::col_size() + { + return typename tmat3x4::size_type(3); + } + + template + typename tmat3x4::size_type tmat3x4::row_size() + { + return typename tmat3x4::size_type(4); + } + + template + bool tmat3x4::is_matrix() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + detail::tvec4& tmat3x4::operator[](typename tmat3x4::size_type i) + { + assert( + i >= typename tmat3x4::size_type(0) && + i < tmat3x4::col_size()); + + return value[i]; + } + + template + const detail::tvec4& tmat3x4::operator[](typename tmat3x4::size_type i) const + { + assert( + i >= typename tmat3x4::size_type(0) && + i < tmat3x4::col_size()); + + return value[i]; + } + + ////////////////////////////////////////////////////////////// + // Constructors + + template + inline tmat3x4::tmat3x4() + { + this->value[0] = detail::tvec4(1, 0, 0, 0); + this->value[1] = detail::tvec4(0, 1, 0, 0); + this->value[2] = detail::tvec4(0, 0, 1, 0); + } + + template + inline tmat3x4::tmat3x4(const T f) + { + this->value[0] = detail::tvec4(f, 0, 0, 0); + this->value[1] = detail::tvec4(0, f, 0, 0); + this->value[2] = detail::tvec4(0, 0, f, 0); + } + + template + inline tmat3x4::tmat3x4 + ( + const T x0, const T y0, const T z0, const T w0, + const T x1, const T y1, const T z1, const T w1, + const T x2, const T y2, const T z2, const T w2 + ) + { + this->value[0] = detail::tvec4(x0, y0, z0, w0); + this->value[1] = detail::tvec4(x1, y1, z1, w1); + this->value[2] = detail::tvec4(x2, y2, z2, w2); + } + + template + inline tmat3x4::tmat3x4 + ( + const detail::tvec4 & v0, + const detail::tvec4 & v1, + const detail::tvec4 & v2 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + } + + // Conversion + template + template + inline tmat3x4::tmat3x4(const tmat3x4& m) + { + this->value[0] = detail::tvec4(m[0]); + this->value[1] = detail::tvec4(m[1]); + this->value[2] = detail::tvec4(m[2]); + } + + template + inline tmat3x4::tmat3x4(tmat2x2 const & m) + { + this->value[0] = detail::tvec4(m[0], detail::tvec2(0)); + this->value[1] = detail::tvec4(m[1], detail::tvec2(0)); + this->value[2] = detail::tvec4(T(0), T(0), T(1), T(0)); + } + + template + inline tmat3x4::tmat3x4(const tmat3x3& m) + { + this->value[0] = detail::tvec4(m[0], T(0)); + this->value[1] = detail::tvec4(m[1], T(0)); + this->value[2] = detail::tvec4(m[2], T(0)); + } + + template + inline tmat3x4::tmat3x4(const tmat4x4& m) + { + this->value[0] = detail::tvec4(m[0]); + this->value[1] = detail::tvec4(m[1]); + this->value[2] = detail::tvec4(m[2]); + } + + template + inline tmat3x4::tmat3x4(const tmat2x3& m) + { + this->value[0] = detail::tvec4(m[0], T(0)); + this->value[1] = detail::tvec4(m[1], T(0)); + this->value[2] = detail::tvec4(T(0), T(0), T(1), T(0)); + } + + template + inline tmat3x4::tmat3x4(const tmat3x2& m) + { + this->value[0] = detail::tvec4(m[0], detail::tvec2(0)); + this->value[1] = detail::tvec4(m[1], detail::tvec2(0)); + this->value[2] = detail::tvec4(m[2], T(0), T(1)); + } + + template + inline tmat3x4::tmat3x4(const tmat2x4& m) + { + this->value[0] = detail::tvec4(m[0]); + this->value[1] = detail::tvec4(m[1]); + this->value[2] = detail::tvec4(T(0), T(0), T(1), T(0)); + } + + template + inline tmat3x4::tmat3x4(const tmat4x2& m) + { + this->value[0] = detail::tvec4(m[0], detail::tvec2(T(0))); + this->value[1] = detail::tvec4(m[1], detail::tvec2(T(0))); + this->value[2] = detail::tvec4(m[2], detail::tvec2(T(1), T(0))); + } + + template + inline tmat3x4::tmat3x4(const tmat4x3& m) + { + this->value[0] = detail::tvec4(m[0], T(0)); + this->value[1] = detail::tvec4(m[1], T(0)); + this->value[2] = detail::tvec4(m[2], T(0)); + } + + ////////////////////////////////////////////////////////////// + // Unary updatable operators + + template + inline tmat3x4& tmat3x4::operator= (const tmat3x4& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } + + template + inline tmat3x4& tmat3x4::operator+= (const T & s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + return *this; + } + + template + inline tmat3x4& tmat3x4::operator+= (const tmat3x4& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + return *this; + } + + template + inline tmat3x4& tmat3x4::operator-= (const T & s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + return *this; + } + + template + inline tmat3x4& tmat3x4::operator-= (const tmat3x4& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + return *this; + } + + template + inline tmat3x4& tmat3x4::operator*= (const T & s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + return *this; + } + + template + inline tmat3x4& tmat3x4::operator*= (const tmat4x3& m) + { + return (*this = tmat3x4(*this * m)); + } + + template + inline tmat3x4 & tmat3x4::operator/= (const T & s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + return *this; + } +/* ToDo + template + inline tmat3x4& tmat3x4::operator/= (const tmat4x3& m) + { + return (*this = tmat3x4(*this / m)); + } +*/ + template + inline tmat3x4& tmat3x4::operator++ () + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + return *this; + } + + template + inline tmat3x4& tmat3x4::operator-- () + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + return *this; + } + + ////////////////////////////////////////////////////////////// + // Binary operators + + template + inline tmat3x4 operator+ (const tmat3x4& m, const T & s) + { + return tmat3x4( + m[0] + s, + m[1] + s, + m[2] + s); + } + + template + inline tmat3x4 operator+ (const tmat3x4& m1, const tmat3x4& m2) + { + return tmat3x4( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2]); + } + + template + inline tmat3x4 operator- (const tmat3x4& m, const T & s) + { + return tmat3x4( + m[0] - s, + m[1] - s, + m[2] - s); + } + + template + inline tmat3x4 operator- (const tmat3x4& m1, const tmat3x4& m2) + { + return tmat3x4( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2]); + } + + template + inline tmat3x4 operator* (const tmat3x4& m, const T & s) + { + return tmat3x4( + m[0] * s, + m[1] * s, + m[2] * s); + } + + template + inline tmat3x4 operator* (const T & s, const tmat3x4 & m) + { + return tmat3x4( + m[0] * s, + m[1] * s, + m[2] * s); + } + + template + inline detail::tvec4 operator* (const tmat3x4& m, const detail::tvec3& v) + { + return detail::tvec4( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z, + m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z); + } + + template + inline detail::tvec3 operator* (const detail::tvec4& v, const tmat3x4& m) + { + return detail::tvec3( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); + } + + template + inline tmat4x4 operator* (const tmat3x4& m1, const tmat4x3& m2) + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA02 = m1[0][2]; + const T SrcA03 = m1[0][3]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA12 = m1[1][2]; + const T SrcA13 = m1[1][3]; + const T SrcA20 = m1[2][0]; + const T SrcA21 = m1[2][1]; + const T SrcA22 = m1[2][2]; + const T SrcA23 = m1[2][3]; + + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB02 = m2[0][2]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB12 = m2[1][2]; + const T SrcB20 = m2[2][0]; + const T SrcB21 = m2[2][1]; + const T SrcB22 = m2[2][2]; + const T SrcB30 = m2[3][0]; + const T SrcB31 = m2[3][1]; + const T SrcB32 = m2[3][2]; + + tmat4x4 Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; + Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; + Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; + Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22; + Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32; + Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32; + Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32; + Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32; + return Result; + } + + template + inline tmat3x4 operator/ (const tmat3x4& m, const T & s) + { + return tmat3x4( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } + + template + inline tmat3x4 operator/ (const T & s, const tmat3x4& m) + { + return tmat3x4( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } + + //template + //inline tvec4 operator/ + //( + // tmat3x4 const & m, + // tvec4 const & v + //) + //{ + // return m._inverse() * v; + //} + + //template + //inline tvec3 operator/ + //( + // tvec4 const & v, + // tmat3x4 const & m + //) + //{ + // return v * m._inverse(); + //} + + //template + //inline tmat4x4 operator/ + //( + // tmat3x4 const & m1, + // tmat4x3 const & m2 + //) + //{ + // return m1 * m2._inverse(); + //} + + // Unary constant operators + template + inline tmat3x4 const operator- + ( + tmat3x4 const & m + ) + { + return tmat3x4( + -m[0], + -m[1], + -m[2]); + } + + template + inline tmat3x4 const operator++ + ( + tmat3x4 const & m, + int + ) + { + return tmat3x4( + m[0] + valType(1), + m[1] + valType(1), + m[2] + valType(1)); + } + + template + inline tmat3x4 const operator-- + ( + tmat3x4 const & m, + int + ) + { + return tmat3x4( + m[0] - valType(1), + m[1] - valType(1), + m[2] - valType(1)); + } + +} //namespace detail +} //namespace glm diff --git a/glm/core/type_mat4x2.hpp b/glm/core/type_mat4x2.hpp new file mode 100644 index 00000000..ec5deee1 --- /dev/null +++ b/glm/core/type_mat4x2.hpp @@ -0,0 +1,211 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-10-01 +// Updated : 2008-08-30 +// Licence : This source is under MIT License +// File : glm/core/type_mat4x2.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_mat4x2 +#define glm_core_type_mat4x2 + +#include "type_size.hpp" + +namespace glm +{ + namespace test + { + void main_mat4x2(); + }//namespace test + + namespace detail + { + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //!< \brief Template for 4 * 2 matrix of floating-point numbers. + template + struct tmat4x2 + { + public: + typedef tmat4x2* pointer; + typedef const tmat4x2* const_pointer; + typedef const tmat4x2*const const_pointer_const; + typedef tmat4x2*const pointer_const; + typedef tmat4x2& reference; + typedef const tmat4x2& const_reference; + typedef const tmat4x2& param_type; + typedef tmat2x4 transpose_type; + + typedef T value_type; + typedef detail::tvec4 col_type; + typedef detail::tvec2 row_type; + typedef glm::sizeType size_type; + static size_type col_size(); + static size_type row_size(); + static bool is_matrix(); + + public: + tmat2x4 _inverse() const; + + private: + // Data + detail::tvec2 value[4]; + + public: + // Constructors + tmat4x2(); + explicit tmat4x2(T const & x); + explicit tmat4x2( + T const & x0, T const & y0, + T const & x1, T const & y1, + T const & x2, T const & y2, + T const & x3, T const & y3); + explicit tmat4x2( + detail::tvec2 const & v0, + detail::tvec2 const & v1, + detail::tvec2 const & v2, + detail::tvec2 const & v3); + + // Conversions + template + explicit tmat4x2(const tmat4x2& m); + + explicit tmat4x2(const tmat2x2& x); + explicit tmat4x2(const tmat3x3& x); + explicit tmat4x2(const tmat4x4& x); + explicit tmat4x2(const tmat2x3& x); + explicit tmat4x2(const tmat3x2& x); + explicit tmat4x2(const tmat2x4& x); + explicit tmat4x2(const tmat4x3& x); + explicit tmat4x2(const tmat3x4& x); + + // Accesses + detail::tvec2& operator[](size_type i); + detail::tvec2 const & operator[](size_type i) const; + + // Unary updatable operators + tmat4x2& operator= (const tmat4x2& m); + tmat4x2& operator+= (const T & s); + tmat4x2& operator+= (const tmat4x2& m); + tmat4x2& operator-= (const T & s); + tmat4x2& operator-= (const tmat4x2& m); + tmat4x2& operator*= (const T & s); + tmat4x2& operator*= (const tmat2x4& m); + tmat4x2& operator/= (const T & s); + tmat4x2& operator/= (const tmat2x4& m); + + tmat4x2& operator++ (); + tmat4x2& operator-- (); + }; + + // Binary operators + template + tmat4x2 operator+ (const tmat4x2& m, const T & s); + + template + tmat4x2 operator+ (const tmat4x2& m1, const tmat4x2& m2); + + template + tmat4x2 operator- (const tmat4x2& m, const T & s); + + template + tmat4x2 operator- (const tmat4x2& m1, const tmat4x2& m2); + + template + tmat4x2 operator* (const tmat4x2& m, const T & s); + + template + tmat4x2 operator* (const T & s, const tmat4x2& m); + + template + detail::tvec2 operator* (const tmat4x2& m, const detail::tvec4& v); + + template + detail::tvec4 operator* (const detail::tvec2& v, const tmat4x2& m); + + template + tmat2x2 operator* (const tmat4x2& m1, const tmat2x4& m2); + + template + tmat4x2 operator/ (const tmat4x2& m, const T & s); + + template + tmat4x2 operator/ (const T & s, const tmat4x2& m); + + //template + //detail::tvec2 operator/ (const tmat4x2& m, const detail::tvec4& v); + + //template + //detail::tvec4 operator/ (const detail::tvec2& v, const tmat4x2& m); + + //template + //tmat2x2 operator/ (const tmat4x2& m1, const tmat2x4& m2); + + // Unary constant operators + template + tmat4x2 const operator- (tmat4x2 const & m); + + template + tmat4x2 const operator-- (tmat4x2 const & m, int); + + template + tmat4x2 const operator++ (tmat4x2 const & m, int); + + } //namespace detail + + namespace core{ + namespace type{ + namespace matrix{ + + namespace precision + { + //! 4 columns of 2 components matrix of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat4x2 lowp_mat4x2; + //! 4 columns of 2 components matrix of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat4x2 mediump_mat4x2; + //! 4 columns of 2 components matrix of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat4x2 highp_mat4x2; + } + //namespace precision + +#ifndef GLM_PRECISION + //! 4 columns of 2 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef detail::tmat4x2 mat4x2; +#elif(GLM_PRECISION & GLM_PRECISION_HIGH) + typedef detail::tmat4x2 mat4x2; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM) + typedef detail::tmat4x2 mat4x2; +#elif(GLM_PRECISION & GLM_PRECISION_LOW) + typedef detail::tmat4x2 mat4x2; +#else + typedef detail::tmat4x2 mat4x2; +#endif//GLM_PRECISION + + }//namespace matrix + }//namespace type + }//namespace core +} //namespace glm + +#include "type_mat4x2.inl" + +#endif //glm_core_type_mat4x2 diff --git a/glm/core/type_mat4x2.inl b/glm/core/type_mat4x2.inl new file mode 100644 index 00000000..d4b8825c --- /dev/null +++ b/glm/core/type_mat4x2.inl @@ -0,0 +1,513 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-10-01 +// Updated : 2008-10-05 +// Licence : This source is under MIT License +// File : glm/core/type_mat4x2.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + + template + typename tmat4x2::size_type tmat4x2::col_size() + { + return typename tmat4x2::size_type(4); + } + + template + typename tmat4x2::size_type tmat4x2::row_size() + { + return typename tmat4x2::size_type(2); + } + + template + bool tmat4x2::is_matrix() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + detail::tvec2& tmat4x2::operator[] + ( + typename tmat4x2::size_type i + ) + { + assert( + i >= typename tmat4x2::size_type(0) && + i < tmat4x2::col_size()); + + return value[i]; + } + + template + const detail::tvec2& tmat4x2::operator[] + ( + typename tmat4x2::size_type i + ) const + { + assert( + i >= typename tmat4x2::size_type(0) && + i < tmat4x2::col_size()); + + return value[i]; + } + + ////////////////////////////////////////////////////////////// + // Constructors + + template + inline tmat4x2::tmat4x2() + { + this->value[0] = detail::tvec2(1, 0); + this->value[1] = detail::tvec2(0, 1); + this->value[2] = detail::tvec2(0, 0); + this->value[3] = detail::tvec2(0, 0); + } + + template + inline tmat4x2::tmat4x2 + ( + valType const & s + ) + { + this->value[0] = detail::tvec2(s, 0); + this->value[1] = detail::tvec2(0, s); + this->value[2] = detail::tvec2(0, 0); + this->value[3] = detail::tvec2(0, 0); + } + + template + inline tmat4x2::tmat4x2 + ( + valType const & x0, valType const & y0, + valType const & x1, valType const & y1, + valType const & x2, valType const & y2, + valType const & x3, valType const & y3 + ) + { + this->value[0] = detail::tvec2(x0, y0); + this->value[1] = detail::tvec2(x1, y1); + this->value[2] = detail::tvec2(x2, y2); + this->value[3] = detail::tvec2(x3, y3); + } + + template + inline tmat4x2::tmat4x2 + ( + const detail::tvec2 & v0, + const detail::tvec2 & v1, + const detail::tvec2 & v2, + const detail::tvec2 & v3 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; + } + + // Conversion + template + template + inline tmat4x2::tmat4x2(const tmat4x2& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(m[2]); + this->value[3] = detail::tvec2(m[3]); + } + + template + inline tmat4x2::tmat4x2(tmat2x2 const & m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(valType(0)); + this->value[3] = detail::tvec2(valType(0)); + } + + template + inline tmat4x2::tmat4x2(const tmat3x3& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(m[2]); + this->value[3] = detail::tvec2(valType(0)); + } + + template + inline tmat4x2::tmat4x2(const tmat4x4& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(m[2]); + this->value[3] = detail::tvec2(m[3]); + } + + template + inline tmat4x2::tmat4x2(const tmat2x3& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(valType(0)); + this->value[3] = detail::tvec2(valType(0)); + } + + template + inline tmat4x2::tmat4x2(const tmat3x2& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(m[2]); + this->value[3] = detail::tvec2(valType(0)); + } + + template + inline tmat4x2::tmat4x2(const tmat2x4& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(valType(0)); + this->value[3] = detail::tvec2(valType(0)); + } + + template + inline tmat4x2::tmat4x2(const tmat4x3& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(m[2]); + this->value[3] = detail::tvec2(m[3]); + } + + template + inline tmat4x2::tmat4x2(const tmat3x4& m) + { + this->value[0] = detail::tvec2(m[0]); + this->value[1] = detail::tvec2(m[1]); + this->value[2] = detail::tvec2(m[2]); + this->value[3] = detail::tvec2(valType(0)); + } + + ////////////////////////////////////////////////////////////// + // Unary updatable operators + + template + inline tmat4x2& tmat4x2::operator= (const tmat4x2& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } + + template + inline tmat4x2& tmat4x2::operator+= (const valType & s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } + + template + inline tmat4x2& tmat4x2::operator+= (const tmat4x2& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } + + template + inline tmat4x2& tmat4x2::operator-= (const valType & s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } + + template + inline tmat4x2& tmat4x2::operator-= (const tmat4x2& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } + + template + inline tmat4x2& tmat4x2::operator*= (const valType & s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } + + template + inline tmat4x2& tmat4x2::operator*= (const tmat2x4& m) + { + return (*this = tmat4x2(*this * m)); + } + + template + inline tmat4x2 & tmat4x2::operator/= (const valType & s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } + + //template + //inline tmat2x2& tmat4x2::operator/= (const tmat2x4& m) + //{ + // return (*this = *this / m); + //} + + template + inline tmat4x2& tmat4x2::operator++ () + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } + + template + inline tmat4x2& tmat4x2::operator-- () + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } + + ////////////////////////////////////////////////////////////// + // inverse + template + inline tmat2x4 tmat4x2::_inverse() const + { + assert(0); //g.truc.creation[at]gmail.com + } + + ////////////////////////////////////////////////////////////// + // Binary operators + + template + inline tmat4x2 operator+ (const tmat4x2& m, const valType & s) + { + return tmat4x2( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } + + template + inline tmat4x2 operator+ (const tmat4x2& m1, const tmat4x2& m2) + { + return tmat4x2( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } + + template + inline tmat4x2 operator- (const tmat4x2& m, const valType & s) + { + return tmat4x2( + m[0] - s, + m[1] - s, + m[2] - s, + m[3] - s); + } + + template + inline tmat4x2 operator- (const tmat4x2& m1, const tmat4x2& m2) + { + return tmat4x2( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } + + template + inline tmat4x2 operator* (const tmat4x2& m, const valType & s) + { + return tmat4x2( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + inline tmat4x2 operator* (const valType & s, const tmat4x2 & m) + { + return tmat4x2( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + inline detail::tvec2 operator* (const tmat4x2& m, const tvec4& v) + { + return detail::tvec2( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); + } + + template + inline tvec4 operator* (const detail::tvec2& v, const tmat4x2& m) + { + return tvec4( + v.x * m[0][0] + v.y * m[0][1], + v.x * m[1][0] + v.y * m[1][1], + v.x * m[2][0] + v.y * m[2][1], + v.x * m[3][0] + v.y * m[3][1]); + } + + template + inline tmat2x2 operator* (const tmat4x2& m1, const tmat2x4& m2) + { + const valType SrcA00 = m1[0][0]; + const valType SrcA01 = m1[0][1]; + const valType SrcA10 = m1[1][0]; + const valType SrcA11 = m1[1][1]; + const valType SrcA20 = m1[2][0]; + const valType SrcA21 = m1[2][1]; + const valType SrcA30 = m1[3][0]; + const valType SrcA31 = m1[3][1]; + + const valType SrcB00 = m2[0][0]; + const valType SrcB01 = m2[0][1]; + const valType SrcB02 = m2[0][2]; + const valType SrcB03 = m2[0][3]; + const valType SrcB10 = m2[1][0]; + const valType SrcB11 = m2[1][1]; + const valType SrcB12 = m2[1][2]; + const valType SrcB13 = m2[1][3]; + + tmat2x2 Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA01 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; + return Result; + } + + template + inline tmat4x2 operator/ (const tmat4x2& m, const valType & s) + { + return tmat4x2( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } + + template + inline tmat4x2 operator/ (const valType & s, const tmat4x2& m) + { + return tmat4x2( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } + + //template + //tvec2 operator/ + //( + // tmat4x2 const & m, + // tvec4 const & v + //) + //{ + // return m._inverse() * v; + //} + + //template + //tvec4 operator/ + //( + // tvec2 const & v, + // tmat4x2 const & m + //) + //{ + // return v * m._inverse(); + //} + + //template + //inline tmat2x2 operator/ + //( + // tmat4x2 const & m1, + // tmat2x4 const & m2 + //) + //{ + // return m1 * m2._inverse(); + //} + + // Unary constant operators + template + inline tmat4x2 const operator- + ( + tmat4x2 const & m + ) + { + return tmat4x2( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + template + inline tmat4x2 const operator++ + ( + tmat4x2 const & m, + int + ) + { + return tmat4x2( + m[0] + valType(1), + m[1] + valType(1), + m[2] + valType(1), + m[3] + valType(1)); + } + + template + inline tmat4x2 const operator-- + ( + tmat4x2 const & m, + int + ) + { + return tmat4x2( + m[0] - valType(1), + m[1] - valType(1), + m[2] - valType(1), + m[3] - valType(1)); + } + +} //namespace detail +} //namespace glm diff --git a/glm/core/type_mat4x3.hpp b/glm/core/type_mat4x3.hpp new file mode 100644 index 00000000..f9db9824 --- /dev/null +++ b/glm/core/type_mat4x3.hpp @@ -0,0 +1,216 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-08-04 +// Updated : 2006-08-30 +// Licence : This source is under MIT License +// File : glm/core/type_type_mat4x3.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_mat4x3 +#define glm_core_type_mat4x3 + +#include "type_size.hpp" + +namespace glm +{ + namespace test + { + void main_mat4x3(); + }//namespace test + + namespace detail + { + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //!< \brief Template for 4 * 3 matrix of floating-point numbers. + template + struct tmat4x3 + { + public: + typedef tmat4x3* pointer; + typedef const tmat4x3* const_pointer; + typedef const tmat4x3*const const_pointer_const; + typedef tmat4x3*const pointer_const; + typedef tmat4x3& reference; + typedef const tmat4x3& const_reference; + typedef const tmat4x3& param_type; + typedef tmat3x4 transpose_type; + + typedef T value_type; + typedef detail::tvec4 col_type; + typedef detail::tvec3 row_type; + typedef glm::sizeType size_type; + static size_type col_size(); + static size_type row_size(); + static bool is_matrix(); + + public: + tmat3x4 _inverse() const; + + private: + // Data + detail::tvec3 value[4]; + + public: + // Constructors + tmat4x3(); + explicit tmat4x3(T const & x); + explicit tmat4x3( + const T x0, const T y0, const T z0, + const T x1, const T y1, const T z1, + const T x2, const T y2, const T z2, + const T x3, const T y3, const T z3); + explicit tmat4x3( + const detail::tvec3& v0, + const detail::tvec3& v1, + const detail::tvec3& v2, + const detail::tvec3& v3); + + // Conversion + template + explicit tmat4x3(const tmat4x3& m); + + explicit tmat4x3(const tmat2x2& x); + explicit tmat4x3(const tmat3x3& x); + explicit tmat4x3(const tmat4x4& x); + explicit tmat4x3(const tmat2x3& x); + explicit tmat4x3(const tmat3x2& x); + explicit tmat4x3(const tmat2x4& x); + explicit tmat4x3(const tmat4x2& x); + explicit tmat4x3(const tmat3x4& x); + + // Accesses + detail::tvec3& operator[](size_type i); + detail::tvec3 const & operator[](size_type i) const; + + // Unary updatable operators + tmat4x3& operator= (tmat4x3 const & m); + tmat4x3& operator+= (T const & s); + tmat4x3& operator+= (tmat4x3 const & m); + tmat4x3& operator-= (T const & s); + tmat4x3& operator-= (tmat4x3 const & m); + tmat4x3& operator*= (T const & s); + tmat4x3& operator*= (tmat3x4 const & m); + tmat4x3& operator/= (T const & s); + //tmat4x3& operator/= (tmat3x4 const & m); + + tmat4x3& operator++ (); + tmat4x3& operator-- (); + + // Unary constant operators + const tmat4x3 operator- () const; + const tmat4x3 operator++ (int) const; + const tmat4x3 operator-- (int) const; + }; + + // Binary operators + template + tmat4x3 operator+ (const tmat4x3& m, const T & s); + + template + tmat4x3 operator+ (const tmat4x3& m1, const tmat4x3& m2); + + template + tmat4x3 operator- (const tmat4x3& m, const T & s); + + template + tmat4x3 operator- (const tmat4x3& m1, const tmat4x3& m2); + + template + tmat4x3 operator* (const tmat4x3& m, const T & s); + + template + tmat4x3 operator* (const T & s, const tmat4x3& m); + + template + detail::tvec3 operator* (const tmat4x3& m, const detail::tvec4& v); + + template + detail::tvec4 operator* (const detail::tvec3& v, const tmat4x3& m); + + template + tmat3x3 operator* (const tmat4x3& m1, const tmat3x4& m2); + + template + tmat4x3 operator/ (const tmat4x3& m, const T & s); + + template + tmat4x3 operator/ (const T & s, const tmat4x3 & m); + + //template + //detail::tvec3 operator/ (const tmat4x3& m, const detail::tvec4& v); + + //template + //detail::tvec4 operator/ (const detail::tvec3& v, const tmat4x3& m); + + //template + //tmat3x3 operator/ (const tmat4x3& m1, const tmat3x4& m2); + + // Unary constant operators + template + tmat4x3 const operator- (tmat4x3 const & m); + + template + tmat4x3 const operator-- (tmat4x3 const & m, int); + + template + tmat4x3 const operator++ (tmat4x3 const & m, int); + + } //namespace detail + + namespace core{ + namespace type{ + namespace matrix{ + + namespace precision + { + //! 4 columns of 3 components matrix of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat4x3 lowp_mat4x3; + //! 4 columns of 3 components matrix of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat4x3 mediump_mat4x3; + //! 4 columns of 3 components matrix of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat4x3 highp_mat4x3; + } + //namespace precision + +#ifndef GLM_PRECISION + //! 4 columns of 3 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef detail::tmat4x3 mat4x3; +#elif(GLM_PRECISION & GLM_PRECISION_HIGH) + typedef detail::tmat4x3 mat4x3; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM) + typedef detail::tmat4x3 mat4x3; +#elif(GLM_PRECISION & GLM_PRECISION_LOW) + typedef detail::tmat4x3 mat4x3; +#else + typedef detail::tmat4x3 mat4x3; +#endif//GLM_PRECISION + + }//namespace matrix + }//namespace type + }//namespace core +} //namespace glm + +#include "type_mat4x3.inl" + +#endif//glm_core_type_mat4x3 diff --git a/glm/core/type_mat4x3.inl b/glm/core/type_mat4x3.inl new file mode 100644 index 00000000..e548b860 --- /dev/null +++ b/glm/core/type_mat4x3.inl @@ -0,0 +1,613 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-04-17 +// Updated : 2006-04-17 +// Licence : This source is under MIT License +// File : glm/core/type_mat4x3.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + + template + typename tmat4x3::size_type tmat4x3::col_size() + { + return typename tmat4x3::size_type(4); + } + + template + typename tmat4x3::size_type tmat4x3::row_size() + { + return typename tmat4x3::size_type(3); + } + + template + bool tmat4x3::is_matrix() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + detail::tvec3& tmat4x3::operator[] + ( + typename tmat4x3::size_type i + ) + { + assert( + i >= typename tmat4x3::size_type(0) && + i < tmat4x3::col_size()); + + return value[i]; + } + + template + const detail::tvec3& tmat4x3::operator[] + ( + typename tmat4x3::size_type i + ) const + { + assert( + i >= typename tmat4x3::size_type(0) && + i < tmat4x3::col_size()); + + return value[i]; + } + + ////////////////////////////////////////////////////////////// + // Constructors + + template + inline tmat4x3::tmat4x3() + { + this->value[0] = detail::tvec3(1, 0, 0); + this->value[1] = detail::tvec3(0, 1, 0); + this->value[2] = detail::tvec3(0, 0, 1); + this->value[3] = detail::tvec3(0, 0, 0); + } + + template + inline tmat4x3::tmat4x3(valType const & s) + { + this->value[0] = detail::tvec3(s, 0, 0); + this->value[1] = detail::tvec3(0, s, 0); + this->value[2] = detail::tvec3(0, 0, s); + this->value[3] = detail::tvec3(0, 0, 0); + } + + template + inline tmat4x3::tmat4x3 + ( + const valType x0, const valType y0, const valType z0, + const valType x1, const valType y1, const valType z1, + const valType x2, const valType y2, const valType z2, + const valType x3, const valType y3, const valType z3 + ) + { + this->value[0] = detail::tvec3(x0, y0, z0); + this->value[1] = detail::tvec3(x1, y1, z1); + this->value[2] = detail::tvec3(x2, y2, z2); + this->value[3] = detail::tvec3(x3, y3, z3); + } + + template + inline tmat4x3::tmat4x3 + ( + const detail::tvec3 & v0, + const detail::tvec3 & v1, + const detail::tvec3 & v2, + const detail::tvec3 & v3 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; + } + + // Conversion + template + template + inline tmat4x3::tmat4x3 + ( + tmat4x3 const & m + ) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + this->value[2] = detail::tvec3(m[2]); + this->value[3] = detail::tvec3(m[3]); + } + + template + inline tmat4x3::tmat4x3 + ( + tmat2x2 const & m + ) + { + this->value[0] = detail::tvec3(m[0], valType(0)); + this->value[1] = detail::tvec3(m[1], valType(0)); + this->value[2] = detail::tvec3(m[2], valType(1)); + this->value[3] = detail::tvec3(valType(0)); + } + + template + inline tmat4x3::tmat4x3 + ( + tmat3x3 const & m + ) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + this->value[2] = detail::tvec3(m[2]); + this->value[3] = detail::tvec3(valType(0)); + } + + template + inline tmat4x3::tmat4x3 + ( + tmat4x4 const & m + ) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + this->value[2] = detail::tvec3(m[2]); + this->value[3] = detail::tvec3(m[3]); + } + + template + inline tmat4x3::tmat4x3 + ( + tmat2x3 const & m + ) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + this->value[2] = detail::tvec3(valType(0), valType(0), valType(1)); + this->value[3] = detail::tvec3(valType(0)); + } + + template + inline tmat4x3::tmat4x3 + ( + tmat3x2 const & m + ) + { + this->value[0] = detail::tvec3(m[0], valType(0)); + this->value[1] = detail::tvec3(m[1], valType(0)); + this->value[2] = detail::tvec3(m[2], valType(1)); + this->value[3] = detail::tvec3(valType(0)); + } + + template + inline tmat4x3::tmat4x3 + ( + tmat2x4 const & m + ) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + this->value[2] = detail::tvec3(valType(0), valType(0), valType(1)); + this->value[3] = detail::tvec3(valType(0)); + } + + template + inline tmat4x3::tmat4x3 + ( + tmat4x2 const & m + ) + { + this->value[0] = detail::tvec3(m[0], valType(0)); + this->value[1] = detail::tvec3(m[1], valType(0)); + this->value[2] = detail::tvec3(m[2], valType(1)); + this->value[3] = detail::tvec3(m[3], valType(0)); + } + + template + inline tmat4x3::tmat4x3 + ( + tmat3x4 const & m + ) + { + this->value[0] = detail::tvec3(m[0]); + this->value[1] = detail::tvec3(m[1]); + this->value[2] = detail::tvec3(m[2]); + this->value[3] = detail::tvec3(valType(0)); + } + + ////////////////////////////////////////////////////////////// + // Unary updatable operators + + template + inline tmat4x3& tmat4x3::operator= + ( + tmat4x3 const & m + ) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } + + template + inline tmat4x3& tmat4x3::operator+= + ( + valType const & s + ) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } + + template + inline tmat4x3& tmat4x3::operator+= + ( + tmat4x3 const & m + ) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } + + template + inline tmat4x3& tmat4x3::operator-= + ( + valType const & s + ) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } + + template + inline tmat4x3& tmat4x3::operator-= + ( + tmat4x3 const & m + ) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } + + template + inline tmat4x3& tmat4x3::operator*= + ( + valType const & s + ) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } + + template + inline tmat4x3& tmat4x3::operator*= + ( + tmat3x4 const & m + ) + { + return (*this = tmat4x3(*this * m)); + } + + template + inline tmat4x3 & tmat4x3::operator/= + ( + valType const & s + ) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } + + //template + //inline tmat4x3& tmat4x3::operator/= + //( + // tmat3x4 const & m + //) + //{ + // return (*this = *this / m); + //} + + template + inline tmat4x3& tmat4x3::operator++ () + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } + + template + inline tmat4x3& tmat4x3::operator-- () + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } + + ////////////////////////////////////////////////////////////// + // inverse + template + inline tmat3x4 tmat4x3::_inverse() const + { + assert(0); //g.truc.creation[at]gmail.com + } + + ////////////////////////////////////////////////////////////// + // Unary constant operators + template + inline const tmat4x3 tmat4x3::operator- () const + { + return tmat4x3( + -this->value[0], + -this->value[1], + -this->value[2], + -this->value[3]); + } + + template + inline const tmat4x3 tmat4x3::operator-- (int) const + { + tmat4x3 m = *this; + --m.value[0]; + --m.value[1]; + --m.value[2]; + --m.value[3]; + return m; + } + + template + inline const tmat4x3 tmat4x3::operator++ (int) const + { + tmat4x4 m = *this; + ++m.value[0]; + ++m.value[1]; + ++m.value[2]; + ++m.value[3]; + return m; + } + + ////////////////////////////////////////////////////////////// + // Binary operators + + template + inline tmat4x3 operator+ (const tmat4x3& m, valType const & s) + { + return tmat4x3( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } + + template + inline tmat4x3 operator+ (const tmat4x3& m1, const tmat4x3& m2) + { + return tmat4x3( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } + + template + inline tmat4x3 operator- (const tmat4x3& m, valType const & s) + { + return tmat4x3( + m[0] - s, + m[1] - s, + m[2] - s, + m[3] - s); + } + + template + inline tmat4x3 operator- (const tmat4x3& m1, const tmat4x3& m2) + { + return tmat4x3( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } + + template + inline tmat4x3 operator* (const tmat4x3& m, valType const & s) + { + return tmat4x3( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + inline tmat4x3 operator* (valType const & s, const tmat4x3 & m) + { + return tmat4x3( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + inline detail::tvec3 operator* (const tmat4x3& m, const detail::tvec4& v) + { + return detail::tvec3( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); + } + + template + inline detail::tvec4 operator* (const detail::tvec3& v, const tmat4x3& m) + { + return detail::tvec4( + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2], + v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2], + v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]); + } + + template + inline tmat3x3 operator* (const tmat4x3& m1, const tmat3x4& m2) + { + const valType SrcA00 = m1[0][0]; + const valType SrcA01 = m1[0][1]; + const valType SrcA02 = m1[0][2]; + const valType SrcA10 = m1[1][0]; + const valType SrcA11 = m1[1][1]; + const valType SrcA12 = m1[1][2]; + const valType SrcA20 = m1[2][0]; + const valType SrcA21 = m1[2][1]; + const valType SrcA22 = m1[2][2]; + const valType SrcA30 = m1[3][0]; + const valType SrcA31 = m1[3][1]; + const valType SrcA32 = m1[3][2]; + + const valType SrcB00 = m2[0][0]; + const valType SrcB01 = m2[0][1]; + const valType SrcB02 = m2[0][2]; + const valType SrcB03 = m2[0][3]; + const valType SrcB10 = m2[1][0]; + const valType SrcB11 = m2[1][1]; + const valType SrcB12 = m2[1][2]; + const valType SrcB13 = m2[1][3]; + const valType SrcB20 = m2[2][0]; + const valType SrcB21 = m2[2][1]; + const valType SrcB22 = m2[2][2]; + const valType SrcB23 = m2[2][3]; + + tmat3x3 Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23; + return Result; + } + + template + inline tmat4x3 operator/ (const tmat4x3& m, valType const & s) + { + return tmat4x3( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } + + template + inline tmat4x3 operator/ (valType const & s, const tmat4x3& m) + { + return tmat4x3( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } + + //template + //inline tvec3 operator/ + //( + // tmat4x3 const & m, + // tvec3 const & v + //) + //{ + // return m._inverse() * v; + //} + + //template + //inline tvec4 operator/ + //( + // tvec3 const & v, + // tmat4x3 const & m + //) + //{ + // return v * m._inverse(); + //} + + //template + //inline tmat3x3 operator/ + //( + // tmat4x3 const & m1, + // tmat3x4 const & m2 + //) + //{ + // return m1 * m2._inverse(); + //} + + // Unary constant operators + template + inline tmat4x3 const operator- + ( + tmat4x3 const & m + ) + { + return tmat4x3( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + template + inline tmat4x3 const operator++ + ( + tmat4x3 const & m, + int + ) + { + return tmat4x3( + m[0] + valType(1), + m[1] + valType(1), + m[2] + valType(1), + m[3] + valType(1)); + } + + template + inline tmat4x3 const operator-- + ( + tmat4x3 const & m, + int + ) + { + return tmat4x3( + m[0] - valType(1), + m[1] - valType(1), + m[2] - valType(1), + m[3] - valType(1)); + } + +} //namespace detail +} //namespace glm + diff --git a/glm/core/type_mat4x4.hpp b/glm/core/type_mat4x4.hpp new file mode 100644 index 00000000..4bfb2b21 --- /dev/null +++ b/glm/core/type_mat4x4.hpp @@ -0,0 +1,224 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-01-27 +// Updated : 2008-08-30 +// Licence : This source is under MIT License +// File : glm/core/type_mat4x4.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_mat4x4 +#define glm_core_type_mat4x4 + +#include "type_size.hpp" + +namespace glm +{ + namespace test + { + void main_mat4x4(); + }//namespace test + + namespace detail + { + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //!< \brief Template for 4 * 4 matrix of floating-point numbers. + template + struct tmat4x4 + { + public: + enum ctor{null}; + + typedef tmat4x4* pointer; + typedef const tmat4x4* const_pointer; + typedef const tmat4x4*const const_pointer_const; + typedef tmat4x4*const pointer_const; + typedef tmat4x4& reference; + typedef const tmat4x4& const_reference; + typedef const tmat4x4& param_type; + typedef tmat4x4 transpose_type; + + typedef T value_type; + typedef tvec4 col_type; + typedef tvec4 row_type; + typedef glm::sizeType size_type; + static size_type value_size(); + static size_type col_size(); + static size_type row_size(); + static bool is_matrix(); + + public: + tmat4x4 _inverse() const; + + private: + // Data + detail::tvec4 value[4]; + + public: + // Constructors + tmat4x4(); + explicit tmat4x4(ctor Null); + explicit tmat4x4(T const & x); + explicit tmat4x4( + const T x0, const T y0, const T z0, const T w0, + const T x1, const T y1, const T z1, const T w1, + const T x2, const T y2, const T z2, const T w2, + const T x3, const T y3, const T z3, const T w3); + explicit tmat4x4( + detail::tvec4 const & v0, + detail::tvec4 const & v1, + detail::tvec4 const & v2, + detail::tvec4 const & v3); + + // Conversions + template + explicit tmat4x4(tmat4x4 const & m); + + explicit tmat4x4(tmat2x2 const & x); + explicit tmat4x4(tmat3x3 const & x); + explicit tmat4x4(tmat2x3 const & x); + explicit tmat4x4(tmat3x2 const & x); + explicit tmat4x4(tmat2x4 const & x); + explicit tmat4x4(tmat4x2 const & x); + explicit tmat4x4(tmat3x4 const & x); + explicit tmat4x4(tmat4x3 const & x); + + // Accesses + detail::tvec4& operator[](size_type i); + detail::tvec4 const & operator[](size_type i) const; + + // Unary updatable operators + tmat4x4& operator= (tmat4x4 const & m); + tmat4x4& operator+= (T const & s); + tmat4x4& operator+= (tmat4x4 const & m); + tmat4x4& operator-= (T const & s); + tmat4x4& operator-= (tmat4x4 const & m); + tmat4x4& operator*= (T const & s); + tmat4x4& operator*= (tmat4x4 const & m); + tmat4x4& operator/= (T const & s); + tmat4x4& operator/= (tmat4x4 const & m); + tmat4x4& operator++ (); + tmat4x4& operator-- (); + }; + + // Binary operators + template + tmat4x4 operator+ (const tmat4x4& m, valType const & s); + + template + tmat4x4 operator+ (valType const & s, const tmat4x4& m); + + template + tmat4x4 operator+ (const tmat4x4& m1, const tmat4x4& m2); + + template + tmat4x4 operator- (const tmat4x4& m, const T & s); + + template + tmat4x4 operator- (const T & s, const tmat4x4& m); + + template + tmat4x4 operator- (const tmat4x4& m1, const tmat4x4& m2); + + template + tmat4x4 operator* (const tmat4x4& m, const T & s); + + template + tmat4x4 operator* (const T & s, const tmat4x4& m); + + template + detail::tvec4 operator* (const tmat4x4& m, const detail::tvec4& v); + + template + detail::tvec4 operator* (const detail::tvec4& v, const tmat4x4& m); + + template + tmat4x4 operator* (const tmat4x4& m1, const tmat4x4& m2); + + template + tmat4x4 operator/ (const tmat4x4& m, const T & s); + + template + tmat4x4 operator/ (const T & s, const tmat4x4& m); + + template + detail::tvec4 operator/ (const tmat4x4& m, const detail::tvec4& v); + + template + detail::tvec4 operator/ (const detail::tvec4& v, const tmat4x4& m); + + template + tmat4x4 operator/ (const tmat4x4& m1, const tmat4x4& m2); + + // Unary constant operators + template + tmat4x4 const operator- (tmat4x4 const & m); + + template + tmat4x4 const operator-- (tmat4x4 const & m, int); + + template + tmat4x4 const operator++ (tmat4x4 const & m, int); + + } //namespace detail + + namespace core{ + namespace type{ + namespace matrix{ + + namespace precision + { + //! 4 columns of 4 components matrix of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat4x4 lowp_mat4x4; + //! 4 columns of 4 components matrix of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat4x4 mediump_mat4x4; + //! 4 columns of 4 components matrix of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat4x4 highp_mat4x4; + } + //namespace precision + +#ifndef GLM_PRECISION + //! 4 columns of 4 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef detail::tmat4x4 mat4x4; +#elif(GLM_PRECISION & GLM_PRECISION_HIGH) + typedef detail::tmat4x4 mat4x4; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM) + typedef detail::tmat4x4 mat4x4; +#elif(GLM_PRECISION & GLM_PRECISION_LOW) + typedef detail::tmat4x4 mat4x4; +#else + typedef detail::tmat4x4 mat4x4; +#endif//GLM_PRECISION + + //! 4 columns of 4 components matrix of floating-point numbers. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices) + typedef mat4x4 mat4; + + }//namespace matrix + }//namespace type + }//namespace core +} //namespace glm + +#include "type_mat4x4.inl" + +#endif //glm_core_type_mat4x4 diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl new file mode 100644 index 00000000..248091d5 --- /dev/null +++ b/glm/core/type_mat4x4.inl @@ -0,0 +1,802 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-01-27 +// Updated : 2008-09-09 +// Licence : This source is under MIT License +// File : glm/core/type_mat4x4.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + + template + typename tmat4x4::size_type tmat4x4::value_size() + { + return typename tmat4x4::size_type(4); + } + + template + typename tmat4x4::size_type tmat4x4::col_size() + { + return typename tmat4x4::size_type(4); + } + + template + typename tmat4x4::size_type tmat4x4::row_size() + { + return typename tmat4x4::size_type(4); + } + + template + bool tmat4x4::is_matrix() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + detail::tvec4& tmat4x4::operator[] + ( + typename tmat4x4::size_type i + ) + { + assert( + i >= typename tmat4x4::size_type(0) && + i < tmat4x4::col_size()); + + return value[i]; + } + + template + const detail::tvec4& tmat4x4::operator[] + ( + typename tmat4x4::size_type i + ) const + { + assert( + i >= typename tmat4x4::size_type(0) && + i < tmat4x4::col_size()); + + return value[i]; + } + + ////////////////////////////////////////////////////////////// + // mat4 constructors + + template + inline tmat4x4::tmat4x4() + { + this->value[0] = detail::tvec4(1, 0, 0, 0); + this->value[1] = detail::tvec4(0, 1, 0, 0); + this->value[2] = detail::tvec4(0, 0, 1, 0); + this->value[3] = detail::tvec4(0, 0, 0, 1); + } + + template + inline tmat4x4::tmat4x4(typename tmat4x4::ctor) + {} + + template + inline tmat4x4::tmat4x4(valType const & f) + { + this->value[0] = detail::tvec4(f, 0, 0, 0); + this->value[1] = detail::tvec4(0, f, 0, 0); + this->value[2] = detail::tvec4(0, 0, f, 0); + this->value[3] = detail::tvec4(0, 0, 0, f); + } + + template + inline tmat4x4::tmat4x4 + ( + const valType x0, const valType y0, const valType z0, const valType w0, + const valType x1, const valType y1, const valType z1, const valType w1, + const valType x2, const valType y2, const valType z2, const valType w2, + const valType x3, const valType y3, const valType z3, const valType w3 + ) + { + this->value[0] = detail::tvec4(x0, y0, z0, w0); + this->value[1] = detail::tvec4(x1, y1, z1, w1); + this->value[2] = detail::tvec4(x2, y2, z2, w2); + this->value[3] = detail::tvec4(x3, y3, z3, w3); + } + + template + inline tmat4x4::tmat4x4 + ( + detail::tvec4 const & v0, + detail::tvec4 const & v1, + detail::tvec4 const & v2, + detail::tvec4 const & v3 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; + } + + template + template + inline tmat4x4::tmat4x4 + ( + tmat4x4 const & m + ) + { + this->value[0] = detail::tvec4(m[0]); + this->value[1] = detail::tvec4(m[1]); + this->value[2] = detail::tvec4(m[2]); + this->value[3] = detail::tvec4(m[3]); + } + + template + inline tmat4x4::tmat4x4 + ( + tmat2x2 const & m + ) + { + this->value[0] = detail::tvec4(m[0], detail::tvec2(0)); + this->value[1] = detail::tvec4(m[1], detail::tvec2(0)); + this->value[2] = detail::tvec4(valType(0)); + this->value[3] = detail::tvec4(valType(0), valType(0), valType(0), valType(1)); + } + + template + inline tmat4x4::tmat4x4 + ( + tmat3x3 const & m + ) + { + this->value[0] = detail::tvec4(m[0], valType(0)); + this->value[1] = detail::tvec4(m[1], valType(0)); + this->value[2] = detail::tvec4(m[2], valType(0)); + this->value[3] = detail::tvec4(valType(0), valType(0), valType(0), valType(1)); + } + + template + inline tmat4x4::tmat4x4 + ( + tmat2x3 const & m + ) + { + this->value[0] = detail::tvec4(m[0], valType(0)); + this->value[1] = detail::tvec4(m[1], valType(0)); + this->value[2] = detail::tvec4(valType(0)); + this->value[3] = detail::tvec4(valType(0), valType(0), valType(0), valType(1)); + } + + template + inline tmat4x4::tmat4x4 + ( + tmat3x2 const & m + ) + { + this->value[0] = detail::tvec4(m[0], detail::tvec2(0)); + this->value[1] = detail::tvec4(m[1], detail::tvec2(0)); + this->value[2] = detail::tvec4(m[2], detail::tvec2(0)); + this->value[3] = detail::tvec4(valType(0), valType(0), valType(0), valType(1)); + } + + template + inline tmat4x4::tmat4x4 + ( + tmat2x4 const & m + ) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = detail::tvec4(valType(0)); + this->value[3] = detail::tvec4(valType(0), valType(0), valType(0), valType(1)); + } + + template + inline tmat4x4::tmat4x4 + ( + tmat4x2 const & m + ) + { + this->value[0] = detail::tvec4(m[0], detail::tvec2(0)); + this->value[1] = detail::tvec4(m[1], detail::tvec2(0)); + this->value[2] = detail::tvec4(valType(0)); + this->value[3] = detail::tvec4(valType(0), valType(0), valType(0), valType(1)); + } + + template + inline tmat4x4::tmat4x4 + ( + tmat3x4 const & m + ) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = detail::tvec4(valType(0), valType(0), valType(0), valType(1)); + } + + template + inline tmat4x4::tmat4x4 + ( + tmat4x3 const & m + ) + { + this->value[0] = detail::tvec4(m[0], valType(0)); + this->value[1] = detail::tvec4(m[1], valType(0)); + this->value[2] = detail::tvec4(m[2], valType(0)); + this->value[3] = detail::tvec4(m[3], valType(1)); + } + +/* + template + inline tmat4x4::tmat4x4(const valType* a) + { + this->value[0] = detail::tvec4(a[0], a[1], a[2], a[3]); + this->value[1] = detail::tvec4(a[4], a[5], a[6], a[7]); + this->value[2] = detail::tvec4(a[8], a[9], a[10], a[11]); + this->value[4] = detail::tvec4(a[12], a[13], a[14], a[15]); + } +*/ + /* + // GL_GTX_euler_angles + template + inline tmat4x4::tmat4x4(const tvec3 & angles) + { + valType ch = cos(angles.x); + valType sh = sin(angles.x); + valType cp = cos(angles.y); + valType sp = sin(angles.y); + valType cb = cos(angles.z); + valType sb = sin(angles.z); + + value[0][0] = ch * cb + sh * sp * sb; + value[0][1] = sb * cp; + value[0][2] = -sh * cb + ch * sp * sb; + value[0][3] = 0.0f; + value[1][0] = -ch * sb + sh * sp * cb; + value[1][1] = cb * cp; + value[1][2] = sb * sh + ch * sp * cb; + value[1][3] = 0.0f; + value[2][0] = sh * cp; + value[2][1] = -sp; + value[2][2] = ch * cp; + value[2][3] = 0.0f; + value[3][0] = 0.0f; + value[3][1] = 0.0f; + value[3][2] = 0.0f; + value[3][3] = 1.0f; + } + */ + ////////////////////////////////////////////////////////////// + // mat4 conversion + /* + template + inline tmat4x4::tmat4x4(const tquat & q) + { + *this = tmat4x4(1); + this->value[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z; + this->value[0][1] = 2 * q.x * q.y + 2 * q.w * q.z; + this->value[0][2] = 2 * q.x * q.z - 2 * q.w * q.y; + + this->value[1][0] = 2 * q.x * q.y - 2 * q.w * q.z; + this->value[1][1] = 1 - 2 * q.x * q.x - 2 * q.z * q.z; + this->value[1][2] = 2 * q.y * q.z + 2 * q.w * q.x; + + this->value[2][0] = 2 * q.x * q.z + 2 * q.w * q.y; + this->value[2][1] = 2 * q.y * q.z - 2 * q.w * q.x; + this->value[2][2] = 1 - 2 * q.x * q.x - 2 * q.y * q.y; + } + */ + ////////////////////////////////////////////////////////////// + // mat4 operators + + template + inline tmat4x4& tmat4x4::operator= + ( + tmat4x4 const & m + ) + { + //memcpy could be faster + //memcpy(&this->value, &m.value, 16 * sizeof(valType)); + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } + + template + inline tmat4x4& tmat4x4::operator+= + ( + valType const & s + ) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } + + template + inline tmat4x4& tmat4x4::operator+= + ( + tmat4x4 const & m + ) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } + + template + inline tmat4x4& tmat4x4::operator-= + ( + valType const & s + ) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } + + template + inline tmat4x4& tmat4x4::operator-= + ( + tmat4x4 const & m + ) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } + + template + inline tmat4x4& tmat4x4::operator*= + ( + valType const & s + ) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } + + template + inline tmat4x4& tmat4x4::operator*= + ( + tmat4x4 const & m + ) + { + return (*this = *this * m); + } + + template + inline tmat4x4 & tmat4x4::operator/= + ( + valType const & s + ) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } + + template + inline tmat4x4& tmat4x4::operator/= + ( + tmat4x4 const & m + ) + { + return (*this = *this / m); + } + + template + inline tmat4x4& tmat4x4::operator++ () + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } + + template + inline tmat4x4& tmat4x4::operator-- () + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } + + template + inline tmat4x4 tmat4x4::_inverse() const + { + // Calculate all mat2 determinants + valType SubFactor00 = this->value[2][2] * this->value[3][3] - this->value[3][2] * this->value[2][3]; + valType SubFactor01 = this->value[2][1] * this->value[3][3] - this->value[3][1] * this->value[2][3]; + valType SubFactor02 = this->value[2][1] * this->value[3][2] - this->value[3][1] * this->value[2][2]; + valType SubFactor03 = this->value[2][0] * this->value[3][3] - this->value[3][0] * this->value[2][3]; + valType SubFactor04 = this->value[2][0] * this->value[3][2] - this->value[3][0] * this->value[2][2]; + valType SubFactor05 = this->value[2][0] * this->value[3][1] - this->value[3][0] * this->value[2][1]; + valType SubFactor06 = this->value[1][2] * this->value[3][3] - this->value[3][2] * this->value[1][3]; + valType SubFactor07 = this->value[1][1] * this->value[3][3] - this->value[3][1] * this->value[1][3]; + valType SubFactor08 = this->value[1][1] * this->value[3][2] - this->value[3][1] * this->value[1][2]; + valType SubFactor09 = this->value[1][0] * this->value[3][3] - this->value[3][0] * this->value[1][3]; + valType SubFactor10 = this->value[1][0] * this->value[3][2] - this->value[3][0] * this->value[1][2]; + valType SubFactor11 = this->value[1][1] * this->value[3][3] - this->value[3][1] * this->value[1][3]; + valType SubFactor12 = this->value[1][0] * this->value[3][1] - this->value[3][0] * this->value[1][1]; + valType SubFactor13 = this->value[1][2] * this->value[2][3] - this->value[2][2] * this->value[1][3]; + valType SubFactor14 = this->value[1][1] * this->value[2][3] - this->value[2][1] * this->value[1][3]; + valType SubFactor15 = this->value[1][1] * this->value[2][2] - this->value[2][1] * this->value[1][2]; + valType SubFactor16 = this->value[1][0] * this->value[2][3] - this->value[2][0] * this->value[1][3]; + valType SubFactor17 = this->value[1][0] * this->value[2][2] - this->value[2][0] * this->value[1][2]; + valType SubFactor18 = this->value[1][0] * this->value[2][1] - this->value[2][0] * this->value[1][1]; + + tmat4x4 Inverse( + + (this->value[1][1] * SubFactor00 - this->value[1][2] * SubFactor01 + this->value[1][3] * SubFactor02), + - (this->value[1][0] * SubFactor00 - this->value[1][2] * SubFactor03 + this->value[1][3] * SubFactor04), + + (this->value[1][0] * SubFactor01 - this->value[1][1] * SubFactor03 + this->value[1][3] * SubFactor05), + - (this->value[1][0] * SubFactor02 - this->value[1][1] * SubFactor04 + this->value[1][2] * SubFactor05), + + - (this->value[0][1] * SubFactor00 - this->value[0][2] * SubFactor01 + this->value[0][3] * SubFactor02), + + (this->value[0][0] * SubFactor00 - this->value[0][2] * SubFactor03 + this->value[0][3] * SubFactor04), + - (this->value[0][0] * SubFactor01 - this->value[0][1] * SubFactor03 + this->value[0][3] * SubFactor05), + + (this->value[0][0] * SubFactor02 - this->value[0][1] * SubFactor04 + this->value[0][2] * SubFactor05), + + + (this->value[0][1] * SubFactor06 - this->value[0][2] * SubFactor07 + this->value[0][3] * SubFactor08), + - (this->value[0][0] * SubFactor06 - this->value[0][2] * SubFactor09 + this->value[0][3] * SubFactor10), + + (this->value[0][0] * SubFactor11 - this->value[0][1] * SubFactor09 + this->value[0][3] * SubFactor12), + - (this->value[0][0] * SubFactor08 - this->value[0][1] * SubFactor10 + this->value[0][2] * SubFactor12), + + - (this->value[0][1] * SubFactor13 - this->value[0][2] * SubFactor14 + this->value[0][3] * SubFactor15), + + (this->value[0][0] * SubFactor13 - this->value[0][2] * SubFactor16 + this->value[0][3] * SubFactor17), + - (this->value[0][0] * SubFactor14 - this->value[0][1] * SubFactor16 + this->value[0][3] * SubFactor18), + + (this->value[0][0] * SubFactor15 - this->value[0][1] * SubFactor17 + this->value[0][2] * SubFactor18)); + + valType Determinant = this->value[0][0] * Inverse[0][0] + + this->value[0][1] * Inverse[1][0] + + this->value[0][2] * Inverse[2][0] + + this->value[0][3] * Inverse[3][0]; + + Inverse /= Determinant; + return Inverse; + } + + // Binary operators + template + inline tmat4x4 operator+ + ( + tmat4x4 const & m, + valType const & s + ) + { + return tmat4x4( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } + + template + inline tmat4x4 operator+ + ( + valType const & s, + tmat4x4 const & m + ) + { + return tmat4x4( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } + + template + inline tmat4x4 operator+ + ( + tmat4x4 const & m1, + tmat4x4 const & m2 + ) + { + return tmat4x4( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } + + template + inline tmat4x4 operator- + ( + tmat4x4 const & m, + valType const & s + ) + { + return tmat4x4( + m[0] - s, + m[1] - s, + m[2] - s, + m[3] - s); + } + + template + inline tmat4x4 operator- + ( + valType const & s, + tmat4x4 const & m + ) + { + return tmat4x4( + s - m[0], + s - m[1], + s - m[2], + s - m[3]); + } + + template + inline tmat4x4 operator- + ( + tmat4x4 const & m1, + tmat4x4 const & m2 + ) + { + return tmat4x4( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } + + template + inline tmat4x4 operator* + ( + tmat4x4 const & m, + valType const & s + ) + { + return tmat4x4( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + inline tmat4x4 operator* + ( + valType const & s, + tmat4x4 const & m + ) + { + return tmat4x4( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + inline detail::tvec4 operator* + ( + tmat4x4 const & m, + detail::tvec4 const & v + ) + { + return detail::tvec4( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w, + m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z + m[3][3] * v.w); + } + + template + inline detail::tvec4 operator* + ( + detail::tvec4 const & v, + tmat4x4 const & m + ) + { + return detail::tvec4( + m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w, + m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w, + m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w, + m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] * v.w); + } +/* + template + inline tmat4x4 operator* + ( + tmat4x4 const & m1, + tmat4x4 const & m2 + ) + { + const valType SrcA00 = m1[0][0]; + const valType SrcA01 = m1[0][1]; + const valType SrcA02 = m1[0][2]; + const valType SrcA03 = m1[0][3]; + const valType SrcA10 = m1[1][0]; + const valType SrcA11 = m1[1][1]; + const valType SrcA12 = m1[1][2]; + const valType SrcA13 = m1[1][3]; + const valType SrcA20 = m1[2][0]; + const valType SrcA21 = m1[2][1]; + const valType SrcA22 = m1[2][2]; + const valType SrcA23 = m1[2][3]; + const valType SrcA30 = m1[3][0]; + const valType SrcA31 = m1[3][1]; + const valType SrcA32 = m1[3][2]; + const valType SrcA33 = m1[3][3]; + + const valType SrcB00 = m2[0][0]; + const valType SrcB01 = m2[0][1]; + const valType SrcB02 = m2[0][2]; + const valType SrcB03 = m2[0][3]; + const valType SrcB10 = m2[1][0]; + const valType SrcB11 = m2[1][1]; + const valType SrcB12 = m2[1][2]; + const valType SrcB13 = m2[1][3]; + const valType SrcB20 = m2[2][0]; + const valType SrcB21 = m2[2][1]; + const valType SrcB22 = m2[2][2]; + const valType SrcB23 = m2[2][3]; + const valType SrcB30 = m2[3][0]; + const valType SrcB31 = m2[3][1]; + const valType SrcB32 = m2[3][2]; + const valType SrcB33 = m2[3][3]; + + tmat4x4 Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; + Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02 + SrcA33 * SrcB03; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13; + Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12 + SrcA33 * SrcB13; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23; + Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22 + SrcA33 * SrcB23; + Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32 + SrcA30 * SrcB33; + Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32 + SrcA31 * SrcB33; + Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32 + SrcA32 * SrcB33; + Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32 + SrcA33 * SrcB33; + return Result; + } +*/ + template + inline tmat4x4 operator* + ( + tmat4x4 const & m1, + tmat4x4 const & m2 + ) + { + detail::tvec4 const SrcA0 = m1[0]; + detail::tvec4 const SrcA1 = m1[1]; + detail::tvec4 const SrcA2 = m1[2]; + detail::tvec4 const SrcA3 = m1[3]; + + detail::tvec4 const SrcB0 = m2[0]; + detail::tvec4 const SrcB1 = m2[1]; + detail::tvec4 const SrcB2 = m2[2]; + detail::tvec4 const SrcB3 = m2[3]; + + tmat4x4 Result; + Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3]; + Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3]; + Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3]; + Result[3] = SrcA0 * SrcB3[0] + SrcA1 * SrcB3[1] + SrcA2 * SrcB3[2] + SrcA3 * SrcB3[3]; + return Result; + } + + template + inline tmat4x4 operator/ + ( + tmat4x4 const & m, + valType const & s + ) + { + return tmat4x4( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } + + template + inline tmat4x4 operator/ (const valType s, const tmat4x4& m) + { + return tmat4x4( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } + + template + inline tvec4 operator/ + ( + tmat4x4 const & m, + tvec4 const & v + ) + { + return m._inverse() * v; + } + + template + inline tvec4 operator/ + ( + tvec4 const & v, + tmat4x4 const & m + ) + { + return v * m._inverse(); + } + + template + inline tmat4x4 operator/ + ( + tmat4x4 const & m1, + tmat4x4 const & m2 + ) + { + return m1 * m2._inverse(); + } + + // Unary constant operators + template + inline tmat4x4 const operator- + ( + tmat4x4 const & m + ) + { + return tmat4x4( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + template + inline tmat4x4 const operator++ + ( + tmat4x4 const & m, + int + ) + { + return tmat4x4( + m[0] + valType(1), + m[1] + valType(1), + m[2] + valType(1), + m[3] + valType(1)); + } + + template + inline tmat4x4 const operator-- + ( + tmat4x4 const & m, + int + ) + { + return tmat4x4( + m[0] - valType(1), + m[1] - valType(1), + m[2] - valType(1), + m[3] - valType(1)); + } + +} //namespace detail +} //namespace glm diff --git a/glm/core/type_size.hpp b/glm/core/type_size.hpp new file mode 100644 index 00000000..16ffe05c --- /dev/null +++ b/glm/core/type_size.hpp @@ -0,0 +1,29 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-05 +// Updated : 2008-10-05 +// Licence : This source is under MIT License +// File : glm/core/type_size.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_size +#define glm_core_type_size + +#include + +namespace glm +{ + namespace core{ + namespace type{ + namespace scalar{ + + //typedef std::size_t size_t; + typedef int sizeType; + + }//namespace scalar + }//namespace type + }//namespace core +}//namespace glm + +#endif//glm_core_type_size diff --git a/glm/core/type_vec1.hpp b/glm/core/type_vec1.hpp new file mode 100644 index 00000000..7c0851a6 --- /dev/null +++ b/glm/core/type_vec1.hpp @@ -0,0 +1,254 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-25 +// Updated : 2008-08-31 +// Licence : This source is under MIT License +// File : glm/core/type_vec1.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_gentype1 +#define glm_core_type_gentype1 + +#include "type_float.hpp" +#include "type_int.hpp" +#include "type_size.hpp" +#include "_swizzle.hpp" + +namespace glm +{ + namespace test + { + void main_vec1(); + }//namespace test + + namespace detail + { + template struct tref1; + template struct tref2; + template struct tref3; + template struct tref4; + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + + template + struct tvec1 + { + ////////////////////////////////////// + // Typedef (Implementation details) + + typedef valType value_type; + typedef valType& value_reference; + typedef valType* value_pointer; + typedef tvec1 bool_type; + + typedef glm::sizeType size_type; + static size_type value_size(); + static bool is_vector(); + + typedef tvec1 type; + typedef tvec1* pointer; + typedef const tvec1* const_pointer; + typedef const tvec1*const const_pointer_const; + typedef tvec1*const pointer_const; + typedef tvec1& reference; + typedef const tvec1& const_reference; + typedef const tvec1& param_type; + + ////////////////////////////////////// + // Data + +# if defined(GLM_USE_ONLY_XYZW) + value_type x, y; +# else//GLM_USE_ONLY_XYZW + union {value_type x, r, s;}; +# endif//GLM_USE_ONLY_XYZW + + ////////////////////////////////////// + // Accesses + + valType& operator[](size_type i); + valType const & operator[](size_type i) const; + + ////////////////////////////////////// + // Address (Implementation details) + + value_type const * _address() const{return (value_type*)(this);} + value_type * _address(){return (value_type*)(this);} + + ////////////////////////////////////// + // Implicit basic constructors + + tvec1(); + tvec1(const tvec1& v); + + ////////////////////////////////////// + // Explicit basic constructors + + tvec1(valType s); + + ////////////////////////////////////// + // Swizzle constructors + + tvec1(const tref1& r); + + ////////////////////////////////////// + // Convertion scalar constructors + + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec1(U x); + + ////////////////////////////////////// + // Convertion vector constructors + + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec1(const tvec2& v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec1(const tvec3& v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec1(const tvec4& v); + + ////////////////////////////////////// + // Unary arithmetic operators + + tvec1& operator= (const tvec1& v); + + tvec1& operator+=(valType const & s); + tvec1& operator+=(const tvec1& v); + tvec1& operator-=(valType const & s); + tvec1& operator-=(const tvec1& v); + tvec1& operator*=(valType const & s); + tvec1& operator*=(const tvec1& v); + tvec1& operator/=(valType const & s); + tvec1& operator/=(const tvec1& v); + tvec1& operator++(); + tvec1& operator--(); + + ////////////////////////////////////// + // Unary bit operators + + tvec1& operator%=(valType const & s); + tvec1& operator%=(const tvec1& v); + tvec1& operator&=(valType const & s); + tvec1& operator&=(const tvec1& v); + tvec1& operator|=(valType const & s); + tvec1& operator|=(const tvec1& v); + tvec1& operator^=(valType const & s); + tvec1& operator^=(const tvec1& v); + tvec1& operator<<=(valType const & s); + tvec1& operator<<=(const tvec1& v); + tvec1& operator>>=(valType const & s); + tvec1& operator>>=(const tvec1& v); + + ////////////////////////////////////// + // Swizzle operators + + valType swizzle(comp X) const; + tvec2 swizzle(comp X, comp Y) const; + tvec3 swizzle(comp X, comp Y, comp Z) const; + tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + tref1 swizzle(comp X); + }; + + template + struct tref1 + { + tref1(T& x); + tref1(const tref1& r); + tref1(const tvec1& v); + + tref1& operator= (const tref1& r); + tref1& operator= (const tvec1& v); + + T& x; + }; + } //namespace detail + + namespace core{ + namespace type{ + namespace vector{ + + ////////////////////////// + // Boolean definition + + typedef detail::tvec1 bvec1; + + ////////////////////////// + // Float definition + +#ifndef GLM_PRECISION + typedef detail::tvec1 vec1; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT) + typedef detail::tvec1 vec1; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT) + typedef detail::tvec1 vec1; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT) + typedef detail::tvec1 vec1; +#else + typedef detail::tvec1 vec1; +#endif//GLM_PRECISION + + namespace precision + { + typedef detail::tvec1 highp_vec1; + typedef detail::tvec1 mediump_vec1; + typedef detail::tvec1 lowp_vec1; + } + //namespace precision + + ////////////////////////// + // Signed integer definition + +#ifndef GLM_PRECISION + typedef detail::tvec1 ivec1; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT) + typedef detail::tvec1 ivec1; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT) + typedef detail::tvec1 ivec1; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT) + typedef detail::tvec1 ivec1; +#endif//GLM_PRECISION + + namespace precision + { + typedef detail::tvec1 highp_ivec1; + typedef detail::tvec1 mediump_ivec1; + typedef detail::tvec1 lowp_ivec1; + } + //namespace precision + + ////////////////////////// + // Unsigned integer definition + +#ifndef GLM_PRECISION + typedef detail::tvec1 uvec1; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT) + typedef detail::tvec1 uvec1; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT) + typedef detail::tvec1 uvec1; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT) + typedef detail::tvec1 uvec1; +#endif//GLM_PRECISION + + namespace precision + { + typedef detail::tvec1 highp_uvec1; + typedef detail::tvec1 mediump_uvec1; + typedef detail::tvec1 lowp_uvec1; + } + //namespace precision + + }//namespace vector + }//namespace type + }//namespace core +}//namespace glm + +#include "type_vec1.inl" + +#endif//glm_core_type_gentype1 diff --git a/glm/core/type_vec1.inl b/glm/core/type_vec1.inl new file mode 100644 index 00000000..cd850652 --- /dev/null +++ b/glm/core/type_vec1.inl @@ -0,0 +1,595 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-25 +// Updated : 2008-09-09 +// Licence : This source is under MIT License +// File : glm/core/type_vec1.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace detail + { + template + typename tvec1::size_type tvec1::value_size() + { + return typename tvec1::size_type(1); + } + + template + bool tvec1::is_vector() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + valType& tvec1::operator[](typename tvec1::size_type i) + { + assert( i >= typename tvec1::size_type(0) && + i < tvec1::value_size()); + return (&x)[i]; + } + + template + valType const & tvec1::operator[](typename tvec1::size_type i) const + { + assert( i >= typename tvec1::size_type(0) && + i < tvec1::value_size()); + return (&x)[i]; + } + + ////////////////////////////////////// + // Implicit basic constructors + + template + tvec1::tvec1() : + x(valType(0)) + {} + + template + tvec1::tvec1(const tvec1& v) : + x(v.x) + {} + + ////////////////////////////////////// + // Explicit basic constructors + + template + tvec1::tvec1(valType s) : + x(s) + {} + + ////////////////////////////////////// + // Swizzle constructors + + template + tvec1::tvec1(const tref1& r) : + x(r.x) + {} + + ////////////////////////////////////// + // Convertion scalar constructors + + template + template + tvec1::tvec1(U x) : + x(valType(x)) + {} + + ////////////////////////////////////// + // Convertion vector constructors + + template + template + tvec1::tvec1(const tvec2& v) : + x(valType(v.x)) + {} + + template + template + tvec1::tvec1(const tvec3& v) : + x(valType(v.x)) + {} + + template + template + tvec1::tvec1(const tvec4& v) : + x(valType(v.x)) + {} + + ////////////////////////////////////// + // Unary arithmetic operators + + template + tvec1& tvec1::operator= (const tvec1& v) + { + this->x = v.x; + return *this; + } + + template + tvec1& tvec1::operator+=(valType const & s) + { + this->x += s; + return *this; + } + + template + tvec1& tvec1::operator+=(const tvec1& v) + { + this->x += v.x; + return *this; + } + + template + tvec1& tvec1::operator-=(valType const & s) + { + this->x -= s; + return *this; + } + + template + tvec1& tvec1::operator-=(const tvec1& v) + { + this->x -= v.x; + return *this; + } + + template + tvec1& tvec1::operator*=(valType const & s) + { + this->x *= s; + return *this; + } + + template + tvec1& tvec1::operator*=(const tvec1& v) + { + this->x *= v.x; + return *this; + } + + template + tvec1& tvec1::operator/=(valType const & s) + { + this->x /= s; + return *this; + } + + template + tvec1& tvec1::operator/=(const tvec1& v) + { + this->x /= v.x; + return *this; + } + + template + tvec1& tvec1::operator++() + { + ++this->x; + return *this; + } + + template + tvec1& tvec1::operator--() + { + --this->x; + return *this; + } + + ////////////////////////////////////// + // Unary bit operators + + template + tvec1& tvec1::operator%=(valType const & s) + { + this->x %= s; + return *this; + } + + template + tvec1& tvec1::operator%=(const tvec1& v) + { + this->x %= v.x; + return *this; + } + + template + tvec1& tvec1::operator&=(valType const & s) + { + this->x &= s; + return *this; + } + + template + tvec1& tvec1::operator&=(const tvec1& v) + { + this->x &= v.x; + return *this; + } + + template + tvec1& tvec1::operator|=(valType const & s) + { + this->x |= s; + return *this; + } + + template + tvec1& tvec1::operator|=(const tvec1& v) + { + this->x |= v.x; + return *this; + } + + template + tvec1& tvec1::operator^=(valType const & s) + { + this->x ^= s; + return *this; + } + + template + tvec1& tvec1::operator^=(const tvec1& v) + { + this->x ^= v.x; + return *this; + } + + template + tvec1& tvec1::operator<<=(valType const & s) + { + this->x <<= s; + return *this; + } + + template + tvec1& tvec1::operator<<=(const tvec1& v) + { + this->x <<= v.x; + return *this; + } + + template + tvec1& tvec1::operator>>=(valType const & s) + { + this->x >>= s; + return *this; + } + + template + tvec1& tvec1::operator>>=(const tvec1& v) + { + this->x >>= v.x; + return *this; + } + + ////////////////////////////////////// + // Swizzle operators + + template + valType tvec1::swizzle(comp x) const + { + return (*this)[x]; + } + + template + tvec2 tvec1::swizzle(comp x, comp y) const + { + return tvec2( + (*this)[x], + (*this)[y]); + } + + template + tvec3 tvec1::swizzle(comp x, comp y, comp z) const + { + return tvec3( + (*this)[x], + (*this)[y], + (*this)[z]); + } + + template + tvec4 tvec1::swizzle(comp x, comp y, comp z, comp w) const + { + return tvec4( + (*this)[x], + (*this)[y], + (*this)[z], + (*this)[w]); + } + + template + tref1 tvec1::swizzle(comp x) + { + return tref1( + (*this)[x]); + } + + ////////////////////////////////////// + // Binary arithmetic operators + + template + inline tvec1 operator+ (const tvec1& v, T const & s) + { + return tvec1( + v.x + s); + } + + template + inline tvec1 operator+ (T const & s, const tvec1& v) + { + return tvec1( + s + v.x); + } + + template + inline tvec1 operator+ (const tvec1& v1, const tvec1& v2) + { + return tvec1( + v1.x + v2.x); + } + + //operator- + template + inline tvec1 operator- (const tvec1& v, T const & s) + { + return tvec1( + v.x - s); + } + + template + inline tvec1 operator- (T const & s, const tvec1& v) + { + return tvec1( + s - v.x); + } + + template + inline tvec1 operator- (const tvec1& v1, const tvec1& v2) + { + return tvec1( + v1.x - v2.x); + } + + //operator* + template + inline tvec1 operator* (const tvec1& v, T const & s) + { + return tvec1( + v.x * s); + } + + template + inline tvec1 operator* (T const & s, const tvec1& v) + { + return tvec1( + s * v.x); + } + + template + inline tvec1 operator* (const tvec1& v1, const tvec1 & v2) + { + return tvec1( + v1.x * v2.x); + } + + //operator/ + template + inline tvec1 operator/ (const tvec1& v, T const & s) + { + return tvec1( + v.x / s); + } + + template + inline tvec1 operator/ (T const & s, const tvec1& v) + { + return tvec1( + s / v.x); + } + + template + inline tvec1 operator/ (const tvec1& v1, const tvec1& v2) + { + return tvec1( + v1.x / v2.x); + } + + // Unary constant operators + template + inline tvec1 operator- (const tvec1& v) + { + return tvec1( + -v.x); + } + + template + inline tvec1 operator++ (const tvec1& v, int) + { + return tvec1( + v.x + T(1)); + } + + template + inline tvec1 operator-- (const tvec1& v, int) + { + return tvec1( + v.x - T(1)); + } + + ////////////////////////////////////// + // Binary bit operators + + template + inline tvec1 operator% (const tvec1& v, T const & s) + { + return tvec1( + v.x % s); + } + + template + inline tvec1 operator% (T const & s, const tvec1& v) + { + return tvec1( + s % v.x); + } + + template + inline tvec1 operator% (const tvec1& v1, const tvec1& v2) + { + return tvec1( + v1.x % v2.x); + } + + template + inline tvec1 operator& (const tvec1& v, T const & s) + { + return tvec1( + v.x & s); + } + + template + inline tvec1 operator& (T const & s, const tvec1& v) + { + return tvec1( + s & v.x); + } + + template + inline tvec1 operator& (const tvec1& v1, const tvec1& v2) + { + return tvec1( + v1.x & v2.x); + } + + template + inline tvec1 operator| (const tvec1& v, T const & s) + { + return tvec1( + v.x | s); + } + + template + inline tvec1 operator| (T const & s, const tvec1& v) + { + return tvec1( + s | v.x); + } + + template + inline tvec1 operator| (const tvec1& v1, const tvec1& v2) + { + return tvec1( + v1.x | v2.x); + } + + template + inline tvec1 operator^ (const tvec1& v, T const & s) + { + return tvec1( + v.x ^ s); + } + + template + inline tvec1 operator^ (T const & s, const tvec1& v) + { + return tvec1( + s ^ v.x); + } + + template + inline tvec1 operator^ (const tvec1& v1, const tvec1& v2) + { + return tvec1( + v1.x ^ v2.x); + } + + template + inline tvec1 operator<< (const tvec1& v, T const & s) + { + return tvec1( + v.x << s); + } + + template + inline tvec1 operator<< (T const & s, const tvec1& v) + { + return tvec1( + s << v.x); + } + + template + inline tvec1 operator<< (const tvec1& v1, const tvec1& v2) + { + return tvec1( + v1.x << v2.x); + } + + template + inline tvec1 operator>> (const tvec1& v, T const & s) + { + return tvec1( + v.x >> s); + } + + template + inline tvec1 operator>> (T const & s, const tvec1& v) + { + return tvec1( + s >> v.x); + } + + template + inline tvec1 operator>> (const tvec1& v1, const tvec1& v2) + { + return tvec1( + v1.x >> v2.x); + } + + template + inline tvec1 operator~ (const tvec1& v) + { + return tvec1( + ~v.x); + } + + ////////////////////////////////////// + // tref definition + + template + tref1::tref1(T& x) : + x(x) + {} + + template + tref1::tref1(const tref1& r) : + x(r.x) + {} + + template + tref1::tref1(const tvec1& v) : + x(v.x) + {} + + template + tref1& tref1::operator= (const tref1& r) + { + x = r.x; + return *this; + } + + template + tref1& tref1::operator= (const tvec1& v) + { + x = v.x; + return *this; + } + + }//namespace detail +}//namespace glm diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp new file mode 100644 index 00000000..c243e4b3 --- /dev/null +++ b/glm/core/type_vec2.hpp @@ -0,0 +1,311 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-18 +// Updated : 2008-08-31 +// Licence : This source is under MIT License +// File : glm/core/type_tvec2.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_gentype2 +#define glm_core_type_gentype2 + +#include "type_float.hpp" +#include "type_int.hpp" +#include "type_size.hpp" +#include "_swizzle.hpp" + +namespace glm +{ + namespace test + { + void main_vec2(); + } + //namespace test + + namespace detail + { + template struct tref2; + template struct tref3; + template struct tref4; + template struct tvec3; + template struct tvec4; + + template + struct tvec2 + { + ////////////////////////////////////// + // Typedef (Implementation details) + + typedef valType value_type; + typedef valType& value_reference; + typedef valType* value_pointer; + typedef tvec2 bool_type; + + typedef glm::sizeType size_type; + static size_type value_size(); + static bool is_vector(); + + typedef tvec2 type; + typedef tvec2* pointer; + typedef const tvec2* const_pointer; + typedef const tvec2*const const_pointer_const; + typedef tvec2*const pointer_const; + typedef tvec2& reference; + typedef const tvec2& const_reference; + typedef const tvec2& param_type; + + ////////////////////////////////////// + // Data + +# if defined(GLM_USE_ONLY_XYZW) + value_type x, y; +# else//GLM_USE_ONLY_XYZW +# ifdef GLM_USE_ANONYMOUS_UNION + union + { + struct{value_type x, y;}; + struct{value_type r, g;}; + struct{value_type s, t;}; + }; +# else//GLM_USE_ANONYMOUS_UNION + union {value_type x, r, s;}; + union {value_type y, g, t;}; +# endif//GLM_USE_ANONYMOUS_UNION +# endif//GLM_USE_ONLY_XYZW + + ////////////////////////////////////// + // Accesses + + valType & operator[](size_type i); + valType const & operator[](size_type i) const; + + ////////////////////////////////////// + // Address (Implementation details) + + value_type const * _address() const{return (value_type*)(this);} + value_type * _address(){return (value_type*)(this);} + + ////////////////////////////////////// + // Implicit basic constructors + + tvec2(); + tvec2(tvec2 const & v); + + ////////////////////////////////////// + // Explicit basic constructors + + explicit tvec2(valType s); + explicit tvec2(valType s1, valType s2); + + ////////////////////////////////////// + // Swizzle constructors + + tvec2(tref2 const & r); + + ////////////////////////////////////// + // Convertion scalar constructors + + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec2(U x); + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec2(U x, V y); + + ////////////////////////////////////// + // Convertion vector constructors + + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec2(tvec2 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec2(tvec3 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec2(tvec4 const & v); + + ////////////////////////////////////// + // Unary arithmetic operators + + tvec2& operator= (tvec2 const & v); + + tvec2& operator+=(valType const & s); + tvec2& operator+=(tvec2 const & v); + tvec2& operator-=(valType const & s); + tvec2& operator-=(tvec2 const & v); + tvec2& operator*=(valType const & s); + tvec2& operator*=(tvec2 const & v); + tvec2& operator/=(valType const & s); + tvec2& operator/=(tvec2 const & v); + tvec2& operator++(); + tvec2& operator--(); + + ////////////////////////////////////// + // Unary bit operators + + tvec2& operator%=(valType const & s); + tvec2& operator%=(tvec2 const & v); + tvec2& operator&=(valType const & s); + tvec2& operator&=(tvec2 const & v); + tvec2& operator|=(valType const & s); + tvec2& operator|=(tvec2 const & v); + tvec2& operator^=(valType const & s); + tvec2& operator^=(tvec2 const & v); + tvec2& operator<<=(valType const & s); + tvec2& operator<<=(tvec2 const & v); + tvec2& operator>>=(valType const & s); + tvec2& operator>>=(tvec2 const & v); + + ////////////////////////////////////// + // Swizzle operators + + valType swizzle(comp X) const; + tvec2 swizzle(comp X, comp Y) const; + tvec3 swizzle(comp X, comp Y, comp Z) const; + tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + tref2 swizzle(comp X, comp Y); + }; + +// tvec2::tvec2(float x, float y) : +// x(detail::thalf(x)), +// y(detail::thalf(y)) +// {} + + template + struct tref2 + { + tref2(T& x, T& y); + tref2(tref2 const & r); + tref2(tvec2 const & v); + + tref2& operator= (tref2 const & r); + tref2& operator= (tvec2 const & v); + + T& x; + T& y; + }; + } //namespace detail + + namespace core{ + namespace type{ + namespace vector{ + + ////////////////////////// + // Boolean definition + + //! 2 components vector of boolean. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec2 bvec2; + + ////////////////////////// + // Float definition + +#ifndef GLM_PRECISION + //! 2 components vector of floating-point numbers. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec2 vec2; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT) + typedef detail::tvec2 vec2; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT) + typedef detail::tvec2 vec2; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT) + typedef detail::tvec2 vec2; +#else + typedef detail::tvec2 vec2; +#endif//GLM_PRECISION + + namespace precision + { + //! 2 components vector of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + typedef detail::tvec2 highp_vec2; + //! 2 components vector of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + typedef detail::tvec2 mediump_vec2; + //! 2 components vector of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + typedef detail::tvec2 lowp_vec2; + } + //namespace precision + + ////////////////////////// + // Signed integer definition + +#ifndef GLM_PRECISION + //! \brief 2 components vector of signed integer numbers. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec2 ivec2; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT) + typedef detail::tvec2 ivec2; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT) + typedef detail::tvec2 ivec2; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT) + typedef detail::tvec2 ivec2; +#else + typedef detail::tvec2 ivec2; +#endif//GLM_PRECISION + + namespace precision + { + //! 2 components vector of high precision signed integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec2 highp_ivec2; + //! 2 components vector of medium precision signed integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec2 mediump_ivec2; + //! 2 components vector of low precision signed integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec2 lowp_ivec2; + } + //namespace precision + + ////////////////////////// + // Unsigned integer definition + +#ifndef GLM_PRECISION + //! 2 components vector of unsigned integer numbers. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec2 uvec2; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT) + typedef detail::tvec2 uvec2; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT) + typedef detail::tvec2 uvec2; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT) + typedef detail::tvec2 uvec2; +#else + typedef detail::tvec2 uvec2; +#endif//GLM_PRECISION + + namespace precision + { + //! 2 components vector of high precision unsigned integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec2 highp_uvec2; + //! 2 components vector of medium precision unsigned integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec2 mediump_uvec2; + //! 2 components vector of low precision unsigned integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec2 lowp_uvec2; + } + //namespace precision + + }//namespace vector + }//namespace type + }//namespace core +}//namespace glm + +#include "type_vec2.inl" + +#endif//glm_core_type_gentype2 diff --git a/glm/core/type_vec2.inl b/glm/core/type_vec2.inl new file mode 100644 index 00000000..1c79cd40 --- /dev/null +++ b/glm/core/type_vec2.inl @@ -0,0 +1,679 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-18 +// Updated : 2008-09-09 +// Licence : This source is under MIT License +// File : glm/core/type_tvec2.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace detail + { + template + typename tvec2::size_type tvec2::value_size() + { + return typename tvec2::size_type(2); + } + + template + bool tvec2::is_vector() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + inline valType& tvec2::operator[](typename tvec2::size_type i) + { + assert( i >= typename tvec2::size_type(0) && + i < tvec2::value_size()); + return (&x)[i]; + } + + template + inline valType const & tvec2::operator[](typename tvec2::size_type i) const + { + assert( i >= typename tvec2::size_type(0) && + i < tvec2::value_size()); + return (&x)[i]; + } + + ////////////////////////////////////// + // Implicit basic constructors + + template + inline tvec2::tvec2() : + x(Type(0)), + y(Type(0)) + {} + + template + inline tvec2::tvec2(tvec2 const & v) : + x(v.x), + y(v.y) + {} + + ////////////////////////////////////// + // Explicit basic constructors + + template + inline tvec2::tvec2(valType s) : + x(s), + y(s) + {} + + template + inline tvec2::tvec2(valType s1, valType s2) : + x(s1), + y(s2) + {} + + ////////////////////////////////////// + // Swizzle constructors + + template + inline tvec2::tvec2(tref2 const & r) : + x(r.x), + y(r.y) + {} + + ////////////////////////////////////// + // Convertion scalar constructors + + template + template + inline tvec2::tvec2(U x) : + x(valType(x)), + y(valType(x)) + {} + + template + template + inline tvec2::tvec2(U x, V y) : + x(valType(x)), + y(valType(y)) + {} + + ////////////////////////////////////// + // Convertion vector constructors + + template + template + inline tvec2::tvec2(tvec2 const & v) : + x(valType(v.x)), + y(valType(v.y)) + {} + + template + template + inline tvec2::tvec2(tvec3 const & v) : + x(valType(v.x)), + y(valType(v.y)) + {} + + template + template + inline tvec2::tvec2(tvec4 const & v) : + x(valType(v.x)), + y(valType(v.y)) + {} + + ////////////////////////////////////// + // Unary arithmetic operators + + template + inline tvec2& tvec2::operator= (tvec2 const & v) + { + this->x = v.x; + this->y = v.y; + return *this; + } + + template + inline tvec2& tvec2::operator+=(valType const & s) + { + this->x += s; + this->y += s; + return *this; + } + + template + inline tvec2& tvec2::operator+=(tvec2 const & v) + { + this->x += v.x; + this->y += v.y; + return *this; + } + + template + inline tvec2& tvec2::operator-=(valType const & s) + { + this->x -= s; + this->y -= s; + return *this; + } + + template + inline tvec2& tvec2::operator-=(tvec2 const & v) + { + this->x -= v.x; + this->y -= v.y; + return *this; + } + + template + inline tvec2& tvec2::operator*=(valType const & s) + { + this->x *= s; + this->y *= s; + return *this; + } + + template + inline tvec2& tvec2::operator*=(tvec2 const & v) + { + this->x *= v.x; + this->y *= v.y; + return *this; + } + + template + inline tvec2& tvec2::operator/=(valType const & s) + { + this->x /= s; + this->y /= s; + return *this; + } + + template + inline tvec2& tvec2::operator/=(tvec2 const & v) + { + this->x /= v.x; + this->y /= v.y; + return *this; + } + + template + inline tvec2& tvec2::operator++() + { + ++this->x; + ++this->y; + return *this; + } + + template + inline tvec2& tvec2::operator--() + { + --this->x; + --this->y; + return *this; + } + + ////////////////////////////////////// + // Unary bit operators + + template + inline tvec2& tvec2::operator%=(valType const & s) + { + this->x %= s; + this->y %= s; + return *this; + } + + template + inline tvec2& tvec2::operator%=(tvec2 const & v) + { + this->x %= v.x; + this->y %= v.y; + return *this; + } + + template + inline tvec2& tvec2::operator&=(valType const & s) + { + this->x &= s; + this->y &= s; + return *this; + } + + template + inline tvec2& tvec2::operator&=(tvec2 const & v) + { + this->x &= v.x; + this->y &= v.y; + return *this; + } + + template + inline tvec2& tvec2::operator|=(valType const & s) + { + this->x |= s; + this->y |= s; + return *this; + } + + template + inline tvec2& tvec2::operator|=(tvec2 const & v) + { + this->x |= v.x; + this->y |= v.y; + return *this; + } + + template + inline tvec2& tvec2::operator^=(valType const & s) + { + this->x ^= s; + this->y ^= s; + return *this; + } + + template + inline tvec2& tvec2::operator^=(tvec2 const & v) + { + this->x ^= v.x; + this->y ^= v.y; + return *this; + } + + template + inline tvec2& tvec2::operator<<=(valType const & s) + { + this->x <<= s; + this->y <<= s; + return *this; + } + + template + inline tvec2& tvec2::operator<<=(tvec2 const & v) + { + this->x <<= v.x; + this->y <<= v.y; + return *this; + } + + template + inline tvec2& tvec2::operator>>=(valType const & s) + { + this->x >>= s; + this->y >>= s; + return *this; + } + + template + inline tvec2& tvec2::operator>>=(tvec2 const & v) + { + this->x >>= v.x; + this->y >>= v.y; + return *this; + } + + ////////////////////////////////////// + // Swizzle operators + + template + inline valType tvec2::swizzle(comp x) const + { + return (*this)[x]; + } + + template + inline tvec2 tvec2::swizzle(comp x, comp y) const + { + return tvec2( + (*this)[x], + (*this)[y]); + } + + template + inline tvec3 tvec2::swizzle(comp x, comp y, comp z) const + { + return tvec3( + (*this)[x], + (*this)[y], + (*this)[z]); + } + + template + inline tvec4 tvec2::swizzle(comp x, comp y, comp z, comp w) const + { + return tvec4( + (*this)[x], + (*this)[y], + (*this)[z], + (*this)[w]); + } + + template + inline tref2 tvec2::swizzle(comp x, comp y) + { + return tref2( + (*this)[x], + (*this)[y]); + } + + ////////////////////////////////////// + // Binary arithmetic operators + + template + inline tvec2 operator+ (tvec2 const & v, T const & s) + { + return tvec2( + v.x + s, + v.y + s); + } + + template + inline tvec2 operator+ (T const & s, tvec2 const & v) + { + return tvec2( + s + v.x, + s + v.y); + } + + template + inline tvec2 operator+ (tvec2 const & v1, tvec2 const & v2) + { + return tvec2( + v1.x + v2.x, + v1.y + v2.y); + } + + //operator- + template + inline tvec2 operator- (tvec2 const & v, T const & s) + { + return tvec2( + v.x - s, + v.y - s); + } + + template + inline tvec2 operator- (T const & s, tvec2 const & v) + { + return tvec2( + s - v.x, + s - v.y); + } + + template + inline tvec2 operator- (tvec2 const & v1, tvec2 const & v2) + { + return tvec2( + v1.x - v2.x, + v1.y - v2.y); + } + + //operator* + template + inline tvec2 operator* (tvec2 const & v, T const & s) + { + return tvec2( + v.x * s, + v.y * s); + } + + template + inline tvec2 operator* (T const & s, tvec2 const & v) + { + return tvec2( + s * v.x, + s * v.y); + } + + template + inline tvec2 operator* (tvec2 const & v1, tvec2 const & v2) + { + return tvec2( + v1.x * v2.x, + v1.y * v2.y); + } + + //operator/ + template + inline tvec2 operator/ (tvec2 const & v, T const & s) + { + return tvec2( + v.x / s, + v.y / s); + } + + template + inline tvec2 operator/ (T const & s, tvec2 const & v) + { + return tvec2( + s / v.x, + s / v.y); + } + + template + inline tvec2 operator/ (tvec2 const & v1, tvec2 const & v2) + { + return tvec2( + v1.x / v2.x, + v1.y / v2.y); + } + + // Unary constant operators + template + inline tvec2 operator- (tvec2 const & v) + { + return tvec2( + -v.x, + -v.y); + } + + template + inline tvec2 operator++ (tvec2 const & v, int) + { + return tvec2( + v.x + T(1), + v.y + T(1)); + } + + template + inline tvec2 operator-- (tvec2 const & v, int) + { + return tvec2( + v.x - T(1), + v.y - T(1)); + } + + ////////////////////////////////////// + // Binary bit operators + + template + inline tvec2 operator% (tvec2 const & v, T const & s) + { + return tvec2( + v.x % s, + v.y % s); + } + + template + inline tvec2 operator% (T const & s, tvec2 const & v) + { + return tvec2( + s % v.x, + s % v.y); + } + + template + inline tvec2 operator% (tvec2 const & v1, tvec2 const & v2) + { + return tvec2( + v1.x % v2.x, + v1.y % v2.y); + } + + template + inline tvec2 operator& (tvec2 const & v, T const & s) + { + return tvec2( + v.x & s, + v.y & s); + } + + template + inline tvec2 operator& (T const & s, tvec2 const & v) + { + return tvec2( + s & v.x, + s & v.y); + } + + template + inline tvec2 operator& (tvec2 const & v1, tvec2 const & v2) + { + return tvec2( + v1.x & v2.x, + v1.y & v2.y); + } + + template + inline tvec2 operator| (tvec2 const & v, T const & s) + { + return tvec2( + v.x | s, + v.y | s); + } + + template + inline tvec2 operator| (T const & s, tvec2 const & v) + { + return tvec2( + s | v.x, + s | v.y); + } + + template + inline tvec2 operator| (const tvec2& v1, const tvec2& v2) + { + return tvec2( + v1.x | v2.x, + v1.y | v2.y); + } + + template + inline tvec2 operator^ (const tvec2& v, T const & s) + { + return tvec2( + v.x ^ s, + v.y ^ s); + } + + template + inline tvec2 operator^ (T const & s, const tvec2& v) + { + return tvec2( + s ^ v.x, + s ^ v.y); + } + + template + inline tvec2 operator^ (const tvec2& v1, const tvec2& v2) + { + return tvec2( + v1.x ^ v2.x, + v1.y ^ v2.y); + } + + template + inline tvec2 operator<< (const tvec2& v, T const & s) + { + return tvec2( + v.x << s, + v.y << s); + } + + template + inline tvec2 operator<< (T const & s, const tvec2& v) + { + return tvec2( + s << v.x, + s << v.y); + } + + template + inline tvec2 operator<< (const tvec2& v1, const tvec2& v2) + { + return tvec2( + v1.x << v2.x, + v1.y << v2.y); + } + + template + inline tvec2 operator>> (const tvec2& v, T const & s) + { + return tvec2( + v.x >> s, + v.y >> s); + } + + template + inline tvec2 operator>> (T const & s, const tvec2& v) + { + return tvec2( + s >> v.x, + s >> v.y); + } + + template + inline tvec2 operator>> (const tvec2& v1, const tvec2& v2) + { + return tvec2( + v1.x >> v2.x, + v1.y >> v2.y); + } + + template + inline tvec2 operator~ (const tvec2& v) + { + return tvec2( + ~v.x, + ~v.y); + } + + ////////////////////////////////////// + // tref definition + + template + tref2::tref2(T& x, T& y) : + x(x), + y(y) + {} + + template + tref2::tref2(const tref2& r) : + x(r.x), + y(r.y) + {} + + template + tref2::tref2(const tvec2& v) : + x(v.x), + y(v.y) + {} + + template + tref2& tref2::operator= (const tref2& r) + { + x = r.x; + y = r.y; + return *this; + } + + template + tref2& tref2::operator= (const tvec2& v) + { + x = v.x; + y = v.y; + return *this; + } + + }//namespace detail +}//namespace glm diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp new file mode 100644 index 00000000..2db2a788 --- /dev/null +++ b/glm/core/type_vec3.hpp @@ -0,0 +1,310 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-22 +// Updated : 2008-08-31 +// Licence : This source is under MIT License +// File : glm/core/type_tvec3.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_gentype3 +#define glm_core_type_gentype3 + +#include "type_float.hpp" +#include "type_int.hpp" +#include "type_size.hpp" +#include "_swizzle.hpp" + +namespace glm +{ + namespace test + { + void main_vec3(); + }//namespace test + + namespace detail + { + template struct tref2; + template struct tref3; + template struct tref4; + template struct tvec2; + template struct tvec4; + + template + struct tvec3 + { + ////////////////////////////////////// + // Typedef (Implementation details) + + typedef valType value_type; + typedef valType& value_reference; + typedef valType* value_pointer; + typedef tvec3 bool_type; + + typedef glm::sizeType size_type; + static size_type value_size(); + static bool is_vector(); + + typedef tvec3 type; + typedef tvec3* pointer; + typedef tvec3 const * const_pointer; + typedef tvec3 const * const const_pointer_const; + typedef tvec3 * const pointer_const; + typedef tvec3& reference; + typedef tvec3 const & const_reference; + typedef tvec3 const & param_type; + + ////////////////////////////////////// + // Data + +# if defined(GLM_USE_ONLY_XYZW) + value_type x, y, z; +# else//GLM_USE_ONLY_XYZW +# ifdef GLM_USE_ANONYMOUS_UNION + union + { + struct{value_type x, y, z;}; + struct{value_type r, g, b;}; + struct{value_type s, t, p;}; + }; +# else//GLM_USE_ANONYMOUS_UNION + union {value_type x, r, s;}; + union {value_type y, g, t;}; + union {value_type z, b, p;}; +# endif//GLM_USE_ANONYMOUS_UNION +# endif//GLM_USE_ONLY_XYZW + + ////////////////////////////////////// + // Accesses + + valType & operator[](size_type i); + valType const & operator[](size_type i) const; + + ////////////////////////////////////// + // Address (Implementation details) + + value_type const * _address() const{return (value_type*)(this);} + value_type * _address(){return (value_type*)(this);} + + ////////////////////////////////////// + // Implicit basic constructors + + tvec3(); + tvec3(tvec3 const & v); + + ////////////////////////////////////// + // Explicit basic constructors + + explicit tvec3(valType s); + explicit tvec3(valType s1, valType s2, valType s3); + + ////////////////////////////////////// + // Swizzle constructors + + tvec3(tref3 const & r); + + ////////////////////////////////////// + // Convertion scalar constructors + + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(U x); + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(U x, V y, W z); + + ////////////////////////////////////// + // Convertion vector constructors + + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(tvec2 const & v, B s); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(A s, tvec2 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(tvec3 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(tvec4 const & v); + + ////////////////////////////////////// + // Unary arithmetic operators + + tvec3& operator= (tvec3 const & v); + + tvec3& operator+=(valType const & s); + tvec3& operator+=(tvec3 const & v); + tvec3& operator-=(valType const & s); + tvec3& operator-=(tvec3 const & v); + tvec3& operator*=(valType const & s); + tvec3& operator*=(tvec3 const & v); + tvec3& operator/=(valType const & s); + tvec3& operator/=(tvec3 const & v); + tvec3& operator++(); + tvec3& operator--(); + + ////////////////////////////////////// + // Unary bit operators + + tvec3& operator%=(valType const & s); + tvec3& operator%=(tvec3 const & v); + tvec3& operator&=(valType const & s); + tvec3& operator&=(tvec3 const & v); + tvec3& operator|=(valType const & s); + tvec3& operator|=(tvec3 const & v); + tvec3& operator^=(valType const & s); + tvec3& operator^=(tvec3 const & v); + tvec3& operator<<=(valType const & s); + tvec3& operator<<=(tvec3 const & v); + tvec3& operator>>=(valType const & s); + tvec3& operator>>=(tvec3 const & v); + + ////////////////////////////////////// + // Swizzle operators + + valType swizzle(comp X) const; + tvec2 swizzle(comp X, comp Y) const; + tvec3 swizzle(comp X, comp Y, comp Z) const; + tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + tref3 swizzle(comp X, comp Y, comp Z); + }; + + template + struct tref3 + { + tref3(T& x, T& y, T& z); + tref3(tref3 const & r); + tref3(tvec3 const & v); + + tref3& operator= (tref3 const & r); + tref3& operator= (tvec3 const & v); + + T& x; + T& y; + T& z; + }; + } //namespace detail + + namespace core{ + namespace type{ + namespace vector{ + + ////////////////////////// + // Boolean definition + + //! 3 components vector of boolean. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec3 bvec3; + + ////////////////////////// + // Float definition + +#ifndef GLM_PRECISION + //! 3 components vector of floating-point numbers. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec3 vec3; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT) + typedef detail::tvec3 vec3; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT) + typedef detail::tvec3 vec3; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT) + typedef detail::tvec3 vec3; +#else + typedef detail::tvec3 vec3; +#endif//GLM_PRECISION + + namespace precision + { + //! 3 components vector of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + typedef detail::tvec3 highp_vec3; + //! 3 components vector of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + typedef detail::tvec3 mediump_vec3; + //! 3 components vector of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + typedef detail::tvec3 lowp_vec3; + } + //namespace precision + + ////////////////////////// + // Signed integer definition + +#ifndef GLM_PRECISION + //! 3 components vector of signed integer numbers. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec3 ivec3; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT) + typedef detail::tvec3 ivec3; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT) + typedef detail::tvec3 ivec3; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT) + typedef detail::tvec3 ivec3; +#else + typedef detail::tvec3 ivec3; +#endif//GLM_PRECISION + + namespace precision + { + //! 3 components vector of high precision signed integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec3 highp_ivec3; + //! 3 components vector of medium precision signed integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec3 mediump_ivec3; + //! 3 components vector of low precision signed integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec3 lowp_ivec3; + } + //namespace precision + + ////////////////////////// + // Unsigned integer definition + +#ifndef GLM_PRECISION + //! 3 components vector of unsigned integer numbers. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec3 uvec3; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT) + typedef detail::tvec3 uvec3; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT) + typedef detail::tvec3 uvec3; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT) + typedef detail::tvec3 uvec3; +#else + typedef detail::tvec3 uvec3; +#endif//GLM_PRECISION + + namespace precision + { + //! 3 components vector of high precision unsigned integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec3 highp_uvec3; + //! 3 components vector of medium precision unsigned integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec3 mediump_uvec3; + //! 3 components vector of low precision unsigned integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec3 lowp_uvec3; + } + //namespace precision + + }//namespace vector + }//namespace type + }//namespace core +}//namespace glm + +#include "type_vec3.inl" + +#endif//glm_core_type_gentype3 diff --git a/glm/core/type_vec3.inl b/glm/core/type_vec3.inl new file mode 100644 index 00000000..938b3bb7 --- /dev/null +++ b/glm/core/type_vec3.inl @@ -0,0 +1,762 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-22 +// Updated : 2008-09-09 +// Licence : This source is under MIT License +// File : glm/core/type_tvec3.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace detail + { + template + typename tvec3::size_type tvec3::value_size() + { + return typename tvec3::size_type(3); + } + + template + bool tvec3::is_vector() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + inline valType& tvec3::operator[](typename tvec3::size_type i) + { + assert( i >= typename tvec3::size_type(0) && + i < tvec3::value_size()); + + return (&x)[i]; + } + + template + inline valType const & tvec3::operator[](typename tvec3::size_type i) const + { + assert( i >= typename tvec3::size_type(0) && + i < tvec3::value_size()); + + return (&x)[i]; + } + + ////////////////////////////////////// + // Implicit basic constructors + + template + inline tvec3::tvec3() : + x(valType(0)), + y(valType(0)), + z(valType(0)) + {} + + template + inline tvec3::tvec3(const tvec3& v) : + x(v.x), + y(v.y), + z(v.z) + {} + + ////////////////////////////////////// + // Explicit basic constructors + + template + inline tvec3::tvec3(valType s) : + x(s), + y(s), + z(s) + {} + + template + inline tvec3::tvec3(valType s0, valType s1, valType s2) : + x(s0), + y(s1), + z(s2) + {} + + ////////////////////////////////////// + // Swizzle constructors + + template + inline tvec3::tvec3(const tref3& r) : + x(r.x), + y(r.y), + z(r.z) + {} + + ////////////////////////////////////// + // Convertion scalar constructors + + template + template + inline tvec3::tvec3(U x) : + x(valType(x)), + y(valType(x)), + z(valType(x)) + {} + + template + template + inline tvec3::tvec3(A x, B y, C z) : + x(valType(x)), + y(valType(y)), + z(valType(z)) + {} + + ////////////////////////////////////// + // Convertion vector constructors + + template + template + inline tvec3::tvec3(const tvec2& v, B s) : + x(valType(v.x)), + y(valType(v.y)), + z(valType(s)) + {} + + template + template + inline tvec3::tvec3(A s, const tvec2& v) : + x(valType(s)), + y(valType(v.x)), + z(valType(v.y)) + {} + + template + template + inline tvec3::tvec3(const tvec3& v) : + x(valType(v.x)), + y(valType(v.y)), + z(valType(v.z)) + {} + + template + template + inline tvec3::tvec3(const tvec4& v) : + x(valType(v.x)), + y(valType(v.y)), + z(valType(v.z)) + {} + + ////////////////////////////////////// + // Unary arithmetic operators + + template + inline tvec3& tvec3::operator= (const tvec3& v) + { + this->x = v.x; + this->y = v.y; + this->z = v.z; + return *this; + } + + template + inline tvec3& tvec3::operator+=(valType const & s) + { + this->x += s; + this->y += s; + this->z += s; + return *this; + } + + template + inline tvec3& tvec3::operator+=(const tvec3& v) + { + this->x += v.x; + this->y += v.y; + this->z += v.z; + return *this; + } + + template + inline tvec3& tvec3::operator-=(valType const & s) + { + this->x -= s; + this->y -= s; + this->z -= s; + return *this; + } + + template + inline tvec3& tvec3::operator-=(const tvec3& v) + { + this->x -= v.x; + this->y -= v.y; + this->z -= v.z; + return *this; + } + + template + inline tvec3& tvec3::operator*=(valType const & s) + { + this->x *= s; + this->y *= s; + this->z *= s; + return *this; + } + + template + inline tvec3& tvec3::operator*=(const tvec3& v) + { + this->x *= v.x; + this->y *= v.y; + this->z *= v.z; + return *this; + } + + template + inline tvec3& tvec3::operator/=(valType const & s) + { + this->x /= s; + this->y /= s; + this->z /= s; + return *this; + } + + template + inline tvec3& tvec3::operator/=(const tvec3& v) + { + this->x /= v.x; + this->y /= v.y; + this->z /= v.z; + return *this; + } + + template + inline tvec3& tvec3::operator++() + { + ++this->x; + ++this->y; + ++this->z; + return *this; + } + + template + inline tvec3& tvec3::operator--() + { + --this->x; + --this->y; + --this->z; + return *this; + } + + ////////////////////////////////////// + // Unary bit operators + + template + inline tvec3& tvec3::operator%=(valType const & s) + { + this->x %= s; + this->y %= s; + this->z %= s; + return *this; + } + + template + inline tvec3& tvec3::operator%=(const tvec3& v) + { + this->x %= v.x; + this->y %= v.y; + this->z %= v.z; + return *this; + } + + template + inline tvec3& tvec3::operator&=(valType const & s) + { + this->x &= s; + this->y &= s; + this->z &= s; + return *this; + } + + template + inline tvec3& tvec3::operator&=(const tvec3& v) + { + this->x &= v.x; + this->y &= v.y; + this->z &= v.z; + return *this; + } + + template + inline tvec3& tvec3::operator|=(valType const & s) + { + this->x |= s; + this->y |= s; + this->z |= s; + return *this; + } + + template + inline tvec3& tvec3::operator|=(const tvec3& v) + { + this->x |= v.x; + this->y |= v.y; + this->z |= v.z; + return *this; + } + + template + inline tvec3& tvec3::operator^=(valType const & s) + { + this->x ^= s; + this->y ^= s; + this->z ^= s; + return *this; + } + + template + inline tvec3& tvec3::operator^=(const tvec3& v) + { + this->x ^= v.x; + this->y ^= v.y; + this->z ^= v.z; + return *this; + } + + template + inline tvec3& tvec3::operator<<=(valType const & s) + { + this->x <<= s; + this->y <<= s; + this->z <<= s; + return *this; + } + + template + inline tvec3& tvec3::operator<<=(const tvec3& v) + { + this->x <<= v.x; + this->y <<= v.y; + this->z <<= v.z; + return *this; + } + + template + inline tvec3& tvec3::operator>>=(valType const & s) + { + this->x >>= s; + this->y >>= s; + this->z >>= s; + return *this; + } + + template + inline tvec3& tvec3::operator>>=(const tvec3& v) + { + this->x >>= v.x; + this->y >>= v.y; + this->z >>= v.z; + return *this; + } + + ////////////////////////////////////// + // Swizzle operators + + template + inline valType tvec3::swizzle(comp x) const + { + return (*this)[x]; + } + + template + inline tvec2 tvec3::swizzle(comp x, comp y) const + { + return tvec2( + (*this)[x], + (*this)[y]); + } + + template + inline tvec3 tvec3::swizzle(comp x, comp y, comp z) const + { + return tvec3( + (*this)[x], + (*this)[y], + (*this)[z]); + } + + template + inline tvec4 tvec3::swizzle(comp x, comp y, comp z, comp w) const + { + return tvec4( + (*this)[x], + (*this)[y], + (*this)[z], + (*this)[w]); + } + + template + inline tref3 tvec3::swizzle(comp x, comp y, comp z) + { + return tref3( + (*this)[x], + (*this)[y], + (*this)[z]); + } + + ////////////////////////////////////// + // Binary arithmetic operators + + template + inline tvec3 operator+ (const tvec3& v, T const & s) + { + return tvec3( + v.x + s, + v.y + s, + v.z + s); + } + + template + inline tvec3 operator+ (T const & s, const tvec3& v) + { + return tvec3( + s + v.x, + s + v.y, + s + v.z); + } + + template + inline tvec3 operator+ (const tvec3& v1, const tvec3& v2) + { + return tvec3( + v1.x + v2.x, + v1.y + v2.y, + v1.z + v2.z); + } + + //operator- + template + inline tvec3 operator- (const tvec3& v, T const & s) + { + return tvec3( + v.x - s, + v.y - s, + v.z - s); + } + + template + inline tvec3 operator- (T const & s, const tvec3& v) + { + return tvec3( + s - v.x, + s - v.y, + s - v.z); + } + + template + inline tvec3 operator- (const tvec3& v1, const tvec3& v2) + { + return tvec3( + v1.x - v2.x, + v1.y - v2.y, + v1.z - v2.z); + } + + //operator* + template + inline tvec3 operator* (const tvec3& v, T const & s) + { + return tvec3( + v.x * s, + v.y * s, + v.z * s); + } + + template + inline tvec3 operator* (T const & s, const tvec3& v) + { + return tvec3( + s * v.x, + s * v.y, + s * v.z); + } + + template + inline tvec3 operator* (const tvec3& v1, const tvec3 & v2) + { + return tvec3( + v1.x * v2.x, + v1.y * v2.y, + v1.z * v2.z); + } + + //operator/ + template + inline tvec3 operator/ (const tvec3& v, T const & s) + { + return tvec3( + v.x / s, + v.y / s, + v.z / s); + } + + template + inline tvec3 operator/ (T const & s, const tvec3& v) + { + return tvec3( + s / v.x, + s / v.y, + s / v.z); + } + + template + inline tvec3 operator/ (const tvec3& v1, const tvec3& v2) + { + return tvec3( + v1.x / v2.x, + v1.y / v2.y, + v1.z / v2.z); + } + + // Unary constant operators + template + inline tvec3 operator- (const tvec3& v) + { + return tvec3( + -v.x, + -v.y, + -v.z); + } + + template + inline tvec3 operator++ (const tvec3& v, int) + { + return tvec3( + v.x + T(1), + v.y + T(1), + v.z + T(1)); + } + + template + inline tvec3 operator-- (const tvec3& v, int) + { + return tvec3( + v.x - T(1), + v.y - T(1), + v.z - T(1)); + } + + ////////////////////////////////////// + // Binary bit operators + + template + inline tvec3 operator% (const tvec3& v, T const & s) + { + return tvec3( + v.x % s, + v.y % s, + v.z % s); + } + + template + inline tvec3 operator% (T const & s, const tvec3& v) + { + return tvec3( + s % v.x, + s % v.y, + s % v.z); + } + + template + inline tvec3 operator% (const tvec3& v1, const tvec3& v2) + { + return tvec3( + v1.x % v2.x, + v1.y % v2.y, + v1.z % v2.z); + } + + template + inline tvec3 operator& (const tvec3& v, T const & s) + { + return tvec3( + v.x & s, + v.y & s, + v.z & s); + } + + template + inline tvec3 operator& (T const & s, const tvec3& v) + { + return tvec3( + s & v.x, + s & v.y, + s & v.z); + } + + template + inline tvec3 operator& (const tvec3& v1, const tvec3& v2) + { + return tvec3( + v1.x & v2.x, + v1.y & v2.y, + v1.z & v2.z); + } + + template + inline tvec3 operator| (const tvec3& v, T const & s) + { + return tvec3( + v.x | s, + v.y | s, + v.z | s); + } + + template + inline tvec3 operator| (T const & s, const tvec3& v) + { + return tvec3( + s | v.x, + s | v.y, + s | v.z); + } + + template + inline tvec3 operator| (const tvec3& v1, const tvec3& v2) + { + return tvec3( + v1.x | v2.x, + v1.y | v2.y, + v1.z | v2.z); + } + + template + inline tvec3 operator^ (const tvec3& v, T const & s) + { + return tvec3( + v.x ^ s, + v.y ^ s, + v.z ^ s); + } + + template + inline tvec3 operator^ (T const & s, const tvec3& v) + { + return tvec3( + s ^ v.x, + s ^ v.y, + s ^ v.z); + } + + template + inline tvec3 operator^ (const tvec3& v1, const tvec3& v2) + { + return tvec3( + v1.x ^ v2.x, + v1.y ^ v2.y, + v1.z ^ v2.z); + } + + template + inline tvec3 operator<< (const tvec3& v, T const & s) + { + return tvec3( + v.x << s, + v.y << s, + v.z << s); + } + + template + inline tvec3 operator<< (T const & s, const tvec3& v) + { + return tvec3( + s << v.x, + s << v.y, + s << v.z); + } + + template + inline tvec3 operator<< (const tvec3& v1, const tvec3& v2) + { + return tvec3( + v1.x << v2.x, + v1.y << v2.y, + v1.z << v2.z); + } + + template + inline tvec3 operator>> (const tvec3& v, T const & s) + { + return tvec3( + v.x >> s, + v.y >> s, + v.z >> s); + } + + template + inline tvec3 operator>> (T const & s, const tvec3& v) + { + return tvec3( + s >> v.x, + s >> v.y, + s >> v.z); + } + + template + inline tvec3 operator>> (const tvec3& v1, const tvec3& v2) + { + return tvec3( + v1.x >> v2.x, + v1.y >> v2.y, + v1.z >> v2.z); + } + + template + inline tvec3 operator~ (const tvec3& v) + { + return tvec3( + ~v.x, + ~v.y, + ~v.z); + } + + ////////////////////////////////////// + // tref definition + + template + tref3::tref3(T& x, T& y, T& z) : + x(x), + y(y), + z(z) + {} + + template + tref3::tref3(const tref3& r) : + x(r.x), + y(r.y), + z(r.z) + {} + + template + tref3::tref3(const tvec3& v) : + x(v.x), + y(v.y), + z(v.z) + {} + + template + tref3& tref3::operator= (const tref3& r) + { + x = r.x; + y = r.y; + z = r.z; + return *this; + } + + template + tref3& tref3::operator= (const tvec3& v) + { + x = v.x; + y = v.y; + z = v.z; + return *this; + } + + }//namespace detail +}//namespace glm diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp new file mode 100644 index 00000000..136ff11f --- /dev/null +++ b/glm/core/type_vec4.hpp @@ -0,0 +1,323 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-22 +// Updated : 2008-08-31 +// Licence : This source is under MIT License +// File : glm/core/type_tvec4.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_core_type_gentype4 +#define glm_core_type_gentype4 + +#include "type_float.hpp" +#include "type_int.hpp" +#include "type_size.hpp" +#include "_swizzle.hpp" +#include "_detail.hpp" + +namespace glm +{ + namespace test + { + void main_vec4(); + }//namespace test + + namespace detail + { + template struct tref2; + template struct tref3; + template struct tref4; + template struct tvec2; + template struct tvec3; + + template + struct tvec4 + { + enum ctor{null}; + + ////////////////////////////////////// + // Typedef (Implementation details) + + typedef valType value_type; + typedef valType & value_reference; + typedef valType * value_pointer; + typedef tvec4 bool_type; + + typedef glm::sizeType size_type; + static size_type value_size(); + static bool is_vector(); + + typedef tvec4 type; + typedef tvec4 * pointer; + typedef tvec4 const * const_pointer; + typedef tvec4 const * const const_pointer_const; + typedef tvec4 * const pointer_const; + typedef tvec4 & reference; + typedef tvec4 const & const_reference; + typedef tvec4 const & param_type; + + ////////////////////////////////////// + // Data + +# if defined(GLM_USE_ONLY_XYZW) + value_type x, y, z, w; +# else//GLM_USE_ONLY_XYZW +# ifdef GLM_USE_ANONYMOUS_UNION + union + { + struct{value_type x, y, z, w;}; + struct{value_type r, g, b, a;}; + struct{value_type s, t, p, q;}; + + }; +# else//GLM_USE_ANONYMOUS_UNION + union {value_type x, r, s;}; + union {value_type y, g, t;}; + union {value_type z, b, p;}; + union {value_type w, a, q;}; +# endif//GLM_USE_ANONYMOUS_UNION +# endif//GLM_USE_ONLY_XYZW + + ////////////////////////////////////// + // Accesses + + valType & operator[](size_type i); + valType const & operator[](size_type i) const; + + ////////////////////////////////////// + // Address (Implementation details) + + value_type * _address(){return (value_type*)(this);} + value_type const * _address() const{return (value_type*)(this);} + + ////////////////////////////////////// + // Implicit basic constructors + + tvec4(); + tvec4(typename tvec4::ctor); + tvec4(tvec4 const & v); + + ////////////////////////////////////// + // Explicit basic constructors + + explicit tvec4(valType const & s); + explicit tvec4(valType const & s0, valType const & s1, valType const & s2, valType const & s3); + + ////////////////////////////////////// + // Swizzle constructors + + tvec4(tref4 const & r); + + ////////////////////////////////////// + // Convertion scalar constructors + + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(valTypeU const & x); + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(A const & x, B const & y, C const & z, D const & w); + + ////////////////////////////////////// + // Convertion vector constructors + + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(tvec2 const & v, B const & s1, C const & s2); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(A const & s1, tvec2 const & v, C const & s2); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(A const & s1, B const & s2, tvec2 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(tvec3 const & v, B const & s); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(A const & s, tvec3 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(tvec2 const & v1, tvec2 const & v2); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(tvec4 const & v); + + ////////////////////////////////////// + // Unary arithmetic operators + + tvec4& operator= (tvec4 const & v); + + tvec4& operator+=(valType const & s); + tvec4& operator+=(tvec4 const & v); + tvec4& operator-=(valType const & s); + tvec4& operator-=(tvec4 const & v); + tvec4& operator*=(valType const & s); + tvec4& operator*=(tvec4 const & v); + tvec4& operator/=(valType const & s); + tvec4& operator/=(tvec4 const & v); + tvec4& operator++(); + tvec4& operator--(); + + ////////////////////////////////////// + // Unary bit operators + + tvec4& operator%= (valType const & s); + tvec4& operator%= (tvec4 const & v); + tvec4& operator&= (valType const & s); + tvec4& operator&= (tvec4 const & v); + tvec4& operator|= (valType const & s); + tvec4& operator|= (tvec4 const & v); + tvec4& operator^= (valType const & s); + tvec4& operator^= (tvec4 const & v); + tvec4& operator<<=(valType const & s); + tvec4& operator<<=(tvec4 const & v); + tvec4& operator>>=(valType const & s); + tvec4& operator>>=(tvec4 const & v); + + ////////////////////////////////////// + // Swizzle operators + + valType swizzle(comp X) const; + tvec2 swizzle(comp X, comp Y) const; + tvec3 swizzle(comp X, comp Y, comp Z) const; + tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + tref4 swizzle(comp X, comp Y, comp Z, comp W); + }; + + template + struct tref4 + { + tref4(valType & x, valType & y, valType & z, valType & w); + tref4(tref4 const & r); + tref4(tvec4 const & v); + + tref4& operator= (tref4 const & r); + tref4& operator= (tvec4 const & v); + + valType & x; + valType & y; + valType & z; + valType & w; + }; + } //namespace detail + + namespace core{ + namespace type{ + namespace vector{ + + ////////////////////////// + // Boolean definition + + //! 4 components vector of boolean. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec4 bvec4; + + ////////////////////////// + // Float definition + +#ifndef GLM_PRECISION + //! 4 components vector of floating-point numbers. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec4 vec4; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT) + typedef detail::tvec4 vec4; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT) + typedef detail::tvec4 vec4; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT) + typedef detail::tvec4 vec4; +#endif//GLM_PRECISION + + namespace precision + { + //! 4 components vector of high precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + typedef detail::tvec4 highp_vec4; + //! 4 components vector of medium precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + typedef detail::tvec4 mediump_vec4; + //! 4 components vector of low precision floating-point numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + typedef detail::tvec4 lowp_vec4; + } + //namespace precision + + ////////////////////////// + // Signed integer definition + +#ifndef GLM_PRECISION + //! 4 components vector of signed integer numbers. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec4 ivec4; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT) + typedef detail::tvec4 ivec4; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT) + typedef detail::tvec4 ivec4; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT) + typedef detail::tvec4 ivec4; +#endif//GLM_PRECISION + + namespace precision + { + //! 4 components vector of high precision signed integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec4 highp_ivec4; + //! 4 components vector of medium precision signed integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec4 mediump_ivec4; + //! 4 components vector of low precision signed integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec4 lowp_ivec4; + } + //namespace precision + + ////////////////////////// + // Unsigned integer definition + +#ifndef GLM_PRECISION + //! 4 components vector of unsigned integer numbers. + //! From GLSL 1.30.8 specification, section 4.1.5 Vectors. + typedef detail::tvec4 uvec4; +#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT) + typedef detail::tvec4 uvec4; +#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT) + typedef detail::tvec4 uvec4; +#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT) + typedef detail::tvec4 uvec4; +#endif//GLM_PRECISION + + namespace precision + { + //! 4 components vector of high precision unsigned integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec4 highp_uvec4; + //! 4 components vector of medium precision unsigned integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec4 mediump_uvec4; + //! 4 components vector of low precision unsigned integer numbers. + //! There is no garanty on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + typedef detail::tvec4 lowp_uvec4; + } + //namespace precision + + }//namespace vector + }//namespace type + }//namespace core + + using namespace core::type; + +}//namespace glm + +#include "type_vec4.inl" + +#endif//glm_core_type_gentype4 diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl new file mode 100644 index 00000000..10c03a6b --- /dev/null +++ b/glm/core/type_vec4.inl @@ -0,0 +1,1115 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-08-23 +// Updated : 2008-09-09 +// Licence : This source is under MIT License +// File : glm/core/type_tvec4.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace detail + { + template + typename tvec4::size_type tvec4::value_size() + { + return typename tvec4::size_type(4); + } + + template + bool tvec4::is_vector() + { + return true; + } + + ////////////////////////////////////// + // Accesses + + template + inline valType& tvec4::operator[](typename tvec4::size_type i) + { + assert( i >= typename tvec4::size_type(0) && + i < tvec4::value_size()); + + return (&x)[i]; + } + + template + inline valType const & tvec4::operator[](typename tvec4::size_type i) const + { + assert( i >= typename tvec4::size_type(0) && + i < tvec4::value_size()); + + return (&x)[i]; + } + + ////////////////////////////////////// + // Implicit basic constructors + + template + inline tvec4::tvec4() : + x(valType(0)), + y(valType(0)), + z(valType(0)), + w(valType(0)) + {} + + template + inline tvec4::tvec4(typename tvec4::ctor) + {} + + template + inline tvec4::tvec4(tvec4 const & v) : + x(v.x), + y(v.y), + z(v.z), + w(v.w) + {} + + ////////////////////////////////////// + // Explicit basic constructors + + template + inline tvec4::tvec4 + ( + valType const & s + ) : + x(s), + y(s), + z(s), + w(s) + {} + + template + inline tvec4::tvec4 + ( + valType const & s1, + valType const & s2, + valType const & s3, + valType const & s4 + ) : + x(s1), + y(s2), + z(s3), + w(s4) + {} + + ////////////////////////////////////// + // Swizzle constructors + + template + inline tvec4::tvec4 + ( + tref4 const & r + ) : + x(r.x), + y(r.y), + z(r.z), + w(r.w) + {} + + ////////////////////////////////////// + // Convertion scalar constructors + + template + template + inline tvec4::tvec4 + ( + valTypeU const & x + ) : + x(valType(x)), + y(valType(x)), + z(valType(x)), + w(valType(x)) + {} + + template + template + inline tvec4::tvec4 + ( + A const & x, + B const & y, + C const & z, + D const & w + ) : + x(valType(x)), + y(valType(y)), + z(valType(z)), + w(valType(w)) + {} + + ////////////////////////////////////// + // Convertion vector constructors + + template + template + inline tvec4::tvec4 + ( + tvec2 const & v, + B const & s1, + C const & s2 + ) : + x(valType(v.x)), + y(valType(v.y)), + z(valType(s1)), + w(valType(s2)) + {} + + template + template + inline tvec4::tvec4 + ( + A const & s1, + tvec2 const & v, + C const & s2 + ) : + x(valType(s1)), + y(valType(v.x)), + z(valType(v.y)), + w(valType(s2)) + {} + + template + template + inline tvec4::tvec4 + ( + A const & s1, + B const & s2, + tvec2 const & v + ) : + x(valType(s1)), + y(valType(s2)), + z(valType(v.x)), + w(valType(v.y)) + {} + + template + template + inline tvec4::tvec4 + ( + tvec3 const & v, + B const & s + ) : + x(valType(v.x)), + y(valType(v.y)), + z(valType(v.z)), + w(valType(s)) + {} + + template + template + inline tvec4::tvec4 + ( + A const & s, + tvec3 const & v + ) : + x(valType(s)), + y(valType(v.x)), + z(valType(v.y)), + w(valType(v.z)) + {} + + template + template + inline tvec4::tvec4 + ( + tvec2 const & v1, + tvec2 const & v2 + ) : + x(valType(v1.x)), + y(valType(v1.y)), + z(valType(v2.x)), + w(valType(v2.y)) + {} + + template + template + inline tvec4::tvec4 + ( + tvec4 const & v + ) : + x(valType(v.x)), + y(valType(v.y)), + z(valType(v.z)), + w(valType(v.w)) + {} + + ////////////////////////////////////// + // Unary arithmetic operators + + template + inline tvec4& tvec4::operator= + ( + tvec4 const & v + ) + { + this->x = v.x; + this->y = v.y; + this->z = v.z; + this->w = v.w; + return *this; + } + + template + inline tvec4& tvec4::operator+= + ( + valType const & s + ) + { + this->x += s; + this->y += s; + this->z += s; + this->w += s; + return *this; + } + + template + inline tvec4& tvec4::operator+= + ( + tvec4 const & v + ) + { + this->x += v.x; + this->y += v.y; + this->z += v.z; + this->w += v.w; + return *this; + } + + template + inline tvec4& tvec4::operator-= + ( + valType const & s + ) + { + this->x -= s; + this->y -= s; + this->z -= s; + this->w -= s; + return *this; + } + + template + inline tvec4& tvec4::operator-= + ( + tvec4 const & v + ) + { + this->x -= v.x; + this->y -= v.y; + this->z -= v.z; + this->w -= v.w; + return *this; + } + + template + inline tvec4& tvec4::operator*= + ( + valType const & s + ) + { + this->x *= s; + this->y *= s; + this->z *= s; + this->w *= s; + return *this; + } + + template + inline tvec4& tvec4::operator*= + ( + tvec4 const & v + ) + { + this->x *= v.x; + this->y *= v.y; + this->z *= v.z; + this->w *= v.w; + return *this; + } + + template + inline tvec4& tvec4::operator/= + ( + valType const & s + ) + { + this->x /= s; + this->y /= s; + this->z /= s; + this->w /= s; + return *this; + } + + template + inline tvec4& tvec4::operator/= + ( + tvec4 const & v + ) + { + this->x /= v.x; + this->y /= v.y; + this->z /= v.z; + this->w /= v.w; + return *this; + } + + template + inline tvec4& tvec4::operator++() + { + ++this->x; + ++this->y; + ++this->z; + ++this->w; + return *this; + } + + template + inline tvec4& tvec4::operator--() + { + --this->x; + --this->y; + --this->z; + --this->w; + return *this; + } + + ////////////////////////////////////// + // Unary bit operators + + template + inline tvec4& tvec4::operator%= + ( + valType const & s + ) + { + this->x %= s; + this->y %= s; + this->z %= s; + this->w %= s; + return *this; + } + + template + inline tvec4& tvec4::operator%= + ( + tvec4 const & v + ) + { + this->x %= v.x; + this->y %= v.y; + this->z %= v.z; + this->w %= v.w; + return *this; + } + + template + inline tvec4& tvec4::operator&= + ( + valType const & s + ) + { + this->x &= s; + this->y &= s; + this->z &= s; + this->w &= s; + return *this; + } + + template + inline tvec4& tvec4::operator&= + ( + tvec4 const & v + ) + { + this->x &= v.x; + this->y &= v.y; + this->z &= v.z; + this->w &= v.w; + return *this; + } + + template + inline tvec4& tvec4::operator|= + ( + valType const & s + ) + { + this->x |= s; + this->y |= s; + this->z |= s; + this->w |= s; + return *this; + } + + template + inline tvec4& tvec4::operator|= + ( + tvec4 const & v + ) + { + this->x |= v.x; + this->y |= v.y; + this->z |= v.z; + this->w |= v.w; + return *this; + } + + template + inline tvec4& tvec4::operator^= + ( + valType const & s + ) + { + this->x ^= s; + this->y ^= s; + this->z ^= s; + this->w ^= s; + return *this; + } + + template + inline tvec4& tvec4::operator^= + ( + tvec4 const & v + ) + { + this->x ^= v.x; + this->y ^= v.y; + this->z ^= v.z; + this->w ^= v.w; + return *this; + } + + template + inline tvec4& tvec4::operator<<= + ( + valType const & s + ) + { + this->x <<= s; + this->y <<= s; + this->z <<= s; + this->w <<= s; + return *this; + } + + template + inline tvec4& tvec4::operator<<= + ( + tvec4 const & v + ) + { + this->x <<= v.x; + this->y <<= v.y; + this->z <<= v.z; + this->w <<= v.w; + return *this; + } + + template + inline tvec4& tvec4::operator>>= + ( + valType const & s + ) + { + this->x >>= s; + this->y >>= s; + this->z >>= s; + this->w >>= s; + return *this; + } + + template + inline tvec4& tvec4::operator>>= + ( + tvec4 const & v + ) + { + this->x >>= v.x; + this->y >>= v.y; + this->z >>= v.z; + this->w >>= v.w; + return *this; + } + + ////////////////////////////////////// + // Swizzle operators + + template + inline valType tvec4::swizzle(comp x) const + { + return (*this)[x]; + } + + template + inline tvec2 tvec4::swizzle(comp x, comp y) const + { + return tvec2( + (*this)[x], + (*this)[y]); + } + + template + inline tvec3 tvec4::swizzle(comp x, comp y, comp z) const + { + return tvec3( + (*this)[x], + (*this)[y], + (*this)[z]); + } + + template + inline tvec4 tvec4::swizzle(comp x, comp y, comp z, comp w) const + { + return tvec4( + (*this)[x], + (*this)[y], + (*this)[z], + (*this)[w]); + } + + template + inline tref4 tvec4::swizzle(comp x, comp y, comp z, comp w) + { + return tref4( + (*this)[x], + (*this)[y], + (*this)[z], + (*this)[w]); + } + + ////////////////////////////////////// + // Binary arithmetic operators + + template + inline tvec4 operator+ + ( + tvec4 const & v, + valType const & s + ) + { + return tvec4( + v.x + s, + v.y + s, + v.z + s, + v.w + s); + } + + template + inline tvec4 operator+ + ( + valType const & s, + tvec4 const & v + ) + { + return tvec4( + s + v.x, + s + v.y, + s + v.z, + s + v.w); + } + + template + inline tvec4 operator+ + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return tvec4( + v1.x + v2.x, + v1.y + v2.y, + v1.z + v2.z, + v1.w + v2.w); + } + + //operator- + template + inline tvec4 operator- + ( + tvec4 const & v, + valType const & s + ) + { + return tvec4( + v.x - s, + v.y - s, + v.z - s, + v.w - s); + } + + template + inline tvec4 operator- + ( + valType const & s, + tvec4 const & v + ) + { + return tvec4( + s - v.x, + s - v.y, + s - v.z, + s - v.w); + } + + template + inline tvec4 operator- + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return tvec4( + v1.x - v2.x, + v1.y - v2.y, + v1.z - v2.z, + v1.w - v2.w); + } + + //operator* + template + inline tvec4 operator* + ( + tvec4 const & v, + valType const & s + ) + { + return tvec4( + v.x * s, + v.y * s, + v.z * s, + v.w * s); + } + + template + inline tvec4 operator* + ( + valType const & s, + tvec4 const & v + ) + { + return tvec4( + s * v.x, + s * v.y, + s * v.z, + s * v.w); + } + + template + inline tvec4 operator* + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return tvec4( + v1.x * v2.x, + v1.y * v2.y, + v1.z * v2.z, + v1.w * v2.w); + } + + //operator/ + template + inline tvec4 operator/ + ( + tvec4 const & v, + valType const & s + ) + { + return tvec4( + v.x / s, + v.y / s, + v.z / s, + v.w / s); + } + + template + inline tvec4 operator/ + ( + valType const & s, + tvec4 const & v + ) + { + return tvec4( + s / v.x, + s / v.y, + s / v.z, + s / v.w); + } + + template + inline tvec4 operator/ + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return tvec4( + v1.x / v2.x, + v1.y / v2.y, + v1.z / v2.z, + v1.w / v2.w); + } + + // Unary constant operators + template + inline tvec4 operator- + ( + tvec4 const & v + ) + { + return tvec4( + -v.x, + -v.y, + -v.z, + -v.w); + } + + template + inline tvec4 operator++ + ( + tvec4 const & v, + int + ) + { + return tvec4( + v.x + valType(1), + v.y + valType(1), + v.z + valType(1), + v.w + valType(1)); + } + + template + inline tvec4 operator-- + ( + tvec4 const & v, + int + ) + { + return tvec4( + v.x - valType(1), + v.y - valType(1), + v.z - valType(1), + v.w - valType(1)); + } + + ////////////////////////////////////// + // Binary bit operators + + template + inline tvec4 operator% + ( + tvec4 const & v, + T const & s + ) + { + return tvec4( + v.x % s, + v.y % s, + v.z % s, + v.w % s); + } + + template + inline tvec4 operator% + ( + T const & s, + tvec4 const & v + ) + { + return tvec4( + s % v.x, + s % v.y, + s % v.z, + s % v.w); + } + + template + inline tvec4 operator% + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return tvec4( + v1.x % v2.x, + v1.y % v2.y, + v1.z % v2.z, + v1.w % v2.w); + } + + template + inline tvec4 operator& + ( + tvec4 const & v, + T const & s + ) + { + return tvec4( + v.x & s, + v.y & s, + v.z & s, + v.w & s); + } + + template + inline tvec4 operator& + ( + T const & s, + tvec4 const & v + ) + { + return tvec4( + s & v.x, + s & v.y, + s & v.z, + s & v.w); + } + + template + inline tvec4 operator& + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return tvec4( + v1.x & v2.x, + v1.y & v2.y, + v1.z & v2.z, + v1.w & v2.w); + } + + template + inline tvec4 operator| + ( + tvec4 const & v, + T const & s + ) + { + return tvec4( + v.x | s, + v.y | s, + v.z | s, + v.w | s); + } + + template + inline tvec4 operator| + ( + T const & s, + tvec4 const & v + ) + { + return tvec4( + s | v.x, + s | v.y, + s | v.z, + s | v.w); + } + + template + inline tvec4 operator| + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return tvec4( + v1.x | v2.x, + v1.y | v2.y, + v1.z | v2.z, + v1.w | v2.w); + } + + template + inline tvec4 operator^ + ( + tvec4 const & v, + T const & s + ) + { + return tvec4( + v.x ^ s, + v.y ^ s, + v.z ^ s, + v.w ^ s); + } + + template + inline tvec4 operator^ + ( + T const & s, + tvec4 const & v + ) + { + return tvec4( + s ^ v.x, + s ^ v.y, + s ^ v.z, + s ^ v.w); + } + + template + inline tvec4 operator^ + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return tvec4( + v1.x ^ v2.x, + v1.y ^ v2.y, + v1.z ^ v2.z, + v1.w ^ v2.w); + } + + template + inline tvec4 operator<< + ( + tvec4 const & v, + T const & s + ) + { + return tvec4( + v.x << s, + v.y << s, + v.z << s, + v.w << s); + } + + template + inline tvec4 operator<< + ( + T const & s, + tvec4 const & v + ) + { + return tvec4( + s << v.x, + s << v.y, + s << v.z, + s << v.w); + } + + template + inline tvec4 operator<< + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return tvec4( + v1.x << v2.x, + v1.y << v2.y, + v1.z << v2.z, + v1.w << v2.w); + } + + template + inline tvec4 operator>> + ( + tvec4 const & v, + T const & s + ) + { + return tvec4( + v.x >> s, + v.y >> s, + v.z >> s, + v.w >> s); + } + + template + inline tvec4 operator>> + ( + T const & s, + tvec4 const & v + ) + { + return tvec4( + s >> v.x, + s >> v.y, + s >> v.z, + s >> v.w); + } + + template + inline tvec4 operator>> + ( + tvec4 const & v1, + tvec4 const & v2 + ) + { + return tvec4( + v1.x >> v2.x, + v1.y >> v2.y, + v1.z >> v2.z, + v1.w >> v2.w); + } + + template + inline tvec4 operator~ + ( + tvec4 const & v + ) + { + return tvec4( + ~v.x, + ~v.y, + ~v.z, + ~v.w); + } + + ////////////////////////////////////// + // tref definition + + template + tref4::tref4(T& x, T& y, T& z, T& w) : + x(x), + y(y), + z(z), + w(w) + {} + + template + tref4::tref4(tref4 const & r) : + x(r.x), + y(r.y), + z(r.z), + w(r.w) + {} + + template + tref4::tref4(tvec4 const & v) : + x(v.x), + y(v.y), + z(v.z), + w(v.w) + {} + + template + tref4& tref4::operator= (tref4 const & r) + { + x = r.x; + y = r.y; + z = r.z; + w = r.w; + return *this; + } + + template + tref4& tref4::operator= (tvec4 const & v) + { + x = v.x; + y = v.y; + z = v.z; + w = v.w; + return *this; + } + + }//namespace detail +}//namespace glm diff --git a/glm/ext.hpp b/glm/ext.hpp new file mode 100644 index 00000000..fd0df9f0 --- /dev/null +++ b/glm/ext.hpp @@ -0,0 +1,27 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-01 +// Updated : 2009-05-01 +// Licence : This source is under MIT License +// File : glm/ext.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_ext +#define glm_ext + +#include "glm.hpp" +#include "gtc.hpp" +#include "gtx.hpp" +#include "img.hpp" + +//const float goldenRatio = 1.618033988749894848f; +//const float pi = 3.141592653589793238f; + +#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_EXTS | GLM_MESSAGE_NOTIFICATION))) +# pragma message("GLM message: Extensions library included") +#endif//GLM_MESSAGE + +#define GLM_EXTENSION(extension) namespace glm{using extension;} + +#endif //glm_ext diff --git a/glm/glm.h b/glm/glm.h new file mode 100644 index 00000000..2bbe0f81 --- /dev/null +++ b/glm/glm.h @@ -0,0 +1,2 @@ +#pragma message(" is deprecated, please include instead") +#include "glm.hpp" diff --git a/glm/glm.hpp b/glm/glm.hpp new file mode 100644 index 00000000..0327221f --- /dev/null +++ b/glm/glm.hpp @@ -0,0 +1,174 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-01-14 +// Updated : 2009-05-01 +// Licence : This source is under MIT License +// File : glm/glm.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +/*! \mainpage OpenGL Mathematics + * + * OpenGL Mathematics (GLM) is a C++ mathematics library for 3D applications based on the OpenGL Shading Language (GLSL) specification. + * + * The goal of the project is to provide to 3D programmers math classes and functions that miss in C++ when we use to program with GLSL or any high level GPU language. With GLM, the idea is to have a library that works the same way that GLSL which imply a strict following of GLSL specification for the implementation. + * + * However, this project isn't limited by GLSL features. An extension system based on GLSL extensions development conventions allows to extend GLSL capabilities. + * + * GLM is release under MIT license and available for all version of GCC from version 3.4 and Visual Studio from version 8.0 as a platform independent library. + * + * Any feedback is welcome, please send them to g.truc.creation[NO_SPAM_THANKS]gmail.com. + * + */ + +#ifndef glm_glm +#define glm_glm + +#ifdef max +#undef max +#endif + +#ifdef min +#undef min +#endif + +#define GLMvalType typename genType::value_type +#define GLMcolType typename genType::col_type +#define GLMrowType typename genType::row_type + +#define GLMsizeType typename genType::size_type +#define GLMrowSize typename genType::row_size +#define GLMcolSize typename genType::col_size + +#include +#include +#include +#include "./setup.hpp" + +//! GLM namespace, it contains all GLSL based features. +namespace glm +{ + namespace test + { + bool main_bug(); + bool main_core(); + }//namespace test + + //! GLM core. Namespace that includes all the feature define by GLSL 1.30.8 specification. This namespace is included in glm namespace. + namespace core + { + //! Scalar, vectors and matrices + //! from section 4.1.2 Booleans, 4.1.3 Integers section, 4.1.4 Floats section, + //! 4.1.5 Vectors and section 4.1.6 Matrices of GLSL 1.30.8 specification. + //! This namespace resolves precision qualifier define in section 4.5 of GLSL 1.30.8 specification. + namespace type + { + //! Scalar types from section 4.1.2 Booleans, 4.1.3 Integers and 4.1.4 Floats of GLSL 1.30.8 specification. + //! This namespace is included in glm namespace. + namespace scalar + { + //! Scalar types with precision qualifier. + //! This namespace is included in glm namespace. + namespace precision{} + } + + //! Vector types from section 4.1.5 of GLSL 1.30.8 specification. + //! This namespace is included in glm namespace. + namespace vector + { + //! Vector types with precision qualifier. + //! This namespace is included in glm namespace. + namespace precision{} + } + + //! Matrix types from section 4.1.6 of GLSL 1.30.8 specification. + //! This namespace is included in glm namespace. + namespace matrix + { + //! Matrix types with precision qualifier. + //! This namespace is included in glm namespace. + namespace precision{} + } + } + //! Some of the functions defined in section 8 Built-in Functions of GLSL 1.30.8 specification. + //! Angle and trigonometry, exponential, common, geometric, matrix and vector relational functions. + namespace function{} + } + //namespace core + + using namespace core::type::scalar; + using namespace core::type::scalar::precision; + using namespace core::type::vector; + using namespace core::type::vector::precision; + using namespace core::type::matrix; + using namespace core::type::matrix::precision; + + //! GLM experimental extensions. The interface could change between releases. + namespace gtx{} + + //! GLM stable extensions. + namespace gtc{} + + //! IMG extensions. + namespace img{} + + //! VIRTREV extensions. + namespace img{} + +} //namespace glm + +#include "./core/_detail.hpp" +#include "./core/type.hpp" +#include "./core/type_half.hpp" + +#include "./core/func_common.hpp" +#include "./core/func_exponential.hpp" +#include "./core/func_geometric.hpp" +#include "./core/func_matrix.hpp" +#include "./core/func_trigonometric.hpp" +#include "./core/func_vector_relational.hpp" +#include "./core/func_noise.hpp" +#include "./core/_swizzle.hpp" +//#include "./core/_xref2.hpp" +//#include "./core/_xref3.hpp" +//#include "./core/_xref4.hpp" + +#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_CORE | GLM_MESSAGE_NOTIFICATION))) +# pragma message("GLM message: Core library included") +#endif//GLM_MESSAGE + +#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC)) + +#define GLM_DEPRECATED __declspec(deprecated) +#define GLM_RESTRICT __restrict +#define GLM_ALIGN(x) __declspec(align(x)) + +//#define aligned(x) __declspec(align(x)) struct + +#else + +#define GLM_DEPRECATED +#define GLM_RESTRICT +#define GLM_ALIGN(x) + +#endif//GLM_COMPILER + +//////////////////// +// check type sizes +#ifndef GLM_STATIC_ASSERT_NULL + GLM_STATIC_ASSERT(sizeof(glm::detail::int8)==1); + GLM_STATIC_ASSERT(sizeof(glm::detail::int16)==2); + GLM_STATIC_ASSERT(sizeof(glm::detail::int32)==4); + GLM_STATIC_ASSERT(sizeof(glm::detail::int64)==8); + + GLM_STATIC_ASSERT(sizeof(glm::detail::uint8)==1); + GLM_STATIC_ASSERT(sizeof(glm::detail::uint16)==2); + GLM_STATIC_ASSERT(sizeof(glm::detail::uint32)==4); + GLM_STATIC_ASSERT(sizeof(glm::detail::uint64)==8); + + GLM_STATIC_ASSERT(sizeof(glm::detail::float16)==2); + GLM_STATIC_ASSERT(sizeof(glm::detail::float32)==4); + GLM_STATIC_ASSERT(sizeof(glm::detail::float64)==8); +#endif//GLM_STATIC_ASSERT_NULL + +#endif //glm_glm diff --git a/glm/glmext.h b/glm/glmext.h new file mode 100644 index 00000000..df83c329 --- /dev/null +++ b/glm/glmext.h @@ -0,0 +1,2 @@ +#pragma message(" is deprecated, please include specific extensions instead") +#include "ext.hpp" diff --git a/glm/glmsetup.h b/glm/glmsetup.h new file mode 100644 index 00000000..b1aa6003 --- /dev/null +++ b/glm/glmsetup.h @@ -0,0 +1,2 @@ +#pragma message(" is deprecated, please include instead") +#include "setup.hpp" diff --git a/glm/gtc.hpp b/glm/gtc.hpp new file mode 100644 index 00000000..82352aa3 --- /dev/null +++ b/glm/gtc.hpp @@ -0,0 +1,26 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-01 +// Updated : 2009-05-01 +// Licence : This source is under MIT License +// File : glm/gtc.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Note: +// GTC extensions are stable extensions +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtc +#define glm_gtc + +#define GLM_GTC_GLOBAL 1 + +#include "gtc/double_float.hpp" +#include "gtc/half_float.hpp" +#include "gtc/matrix_access.hpp" +#include "gtc/matrix_operation.hpp" +#include "gtc/matrix_projection.hpp" +#include "gtc/matrix_transform.hpp" +#include "gtc/quaternion.hpp" + +#endif//glm_gtc diff --git a/glm/gtc/double_float.hpp b/glm/gtc/double_float.hpp new file mode 100644 index 00000000..f471edd2 --- /dev/null +++ b/glm/gtc/double_float.hpp @@ -0,0 +1,92 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-04-29 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtc/double_float.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Note: +// - This implementation doesn't need to redefine all build-in functions to +// support double based type. +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtc_double_float +#define glm_gtc_double_float + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + bool main_gtc_double_float(); + }//namespace test + + namespace gtc{ + //! GLM_GTC_double_float extension: Add support for double precision floating-point types + namespace double_float + { + //! Vector of 2 single-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tvec2 fvec2; + + //! Vector of 3 single-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tvec3 fvec3; + + //! Vector of 4 single-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tvec4 fvec4; + + //! 2 * 2 matrix of single-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tmat2x2 fmat2; + + //! 3 * 3 matrix of single-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tmat3x3 fmat3; + + //! 4 * 4 matrix of single-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tmat4x4 fmat4; + + //! Vector of 2 double-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tvec2 dvec2; + + //! Vector of 3 double-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tvec3 dvec3; + + //! Vector of 4 double-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tvec4 dvec4; + + //! 2 * 2 matrix of double-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tmat2x2 dmat2; + + //! 3 * 3 matrix of double-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tmat3x3 dmat3; + + //! 4 * 4 matrix of double-precision floating-point numbers. + //! From GLM_GTC_double_float extension. + typedef detail::tmat4x4 dmat4; + + }//namespace double_float + }//namespace gtc +}//namespace glm + +#define GLM_GTC_double_float namespace gtc::double_float +#ifndef GLM_GTC_GLOBAL +namespace glm {using GLM_GTC_double_float;} +#endif//GLM_GTC_GLOBAL + +#include "double_float.inl" + +#endif//glm_gtc_double_float diff --git a/glm/gtc/double_float.inl b/glm/gtc/double_float.inl new file mode 100644 index 00000000..7d7a01ef --- /dev/null +++ b/glm/gtc/double_float.inl @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-04-29 +// Updated : 2009-04-29 +// Licence : This source is under MIT licence +// File : glm/gtc/double_float.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail +{ + +}//namespace detail + +}//namespace glm diff --git a/glm/gtc/half_float.hpp b/glm/gtc/half_float.hpp new file mode 100644 index 00000000..552d4343 --- /dev/null +++ b/glm/gtc/half_float.hpp @@ -0,0 +1,407 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-04-29 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtc/half_float.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtc_half_float +#define glm_gtc_half_float + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + bool main_gtc_half_float(); + }//namespace test + + namespace detail + { +#ifndef GLM_USE_ANONYMOUS_UNION + template <> + struct tvec2 + { + ////////////////////////////////////// + // Typedef (Implementation details) + + typedef thalf value_type; + typedef thalf & value_reference; + typedef thalf * value_pointer; + typedef tvec2 bool_type; + + typedef sizeType size_type; + static size_type value_size(); + static bool is_vector(); + + typedef tvec2 type; + typedef tvec2* pointer; + typedef const tvec2* const_pointer; + typedef const tvec2*const const_pointer_const; + typedef tvec2*const pointer_const; + typedef tvec2& reference; + typedef const tvec2& const_reference; + typedef const tvec2& param_type; + + ////////////////////////////////////// + // Data + + thalf x, y; + + ////////////////////////////////////// + // Accesses + + thalf & operator[](size_type i); + thalf const & operator[](size_type i) const; + + ////////////////////////////////////// + // Address (Implementation details) + + thalf const * _address() const{return (value_type*)(this);} + thalf * _address(){return (value_type*)(this);} + + ////////////////////////////////////// + // Implicit basic constructors + + tvec2(); + tvec2(tvec2 const & v); + + ////////////////////////////////////// + // Explicit basic constructors + + explicit tvec2(thalf s); + explicit tvec2(thalf s1, thalf s2); + + ////////////////////////////////////// + // Swizzle constructors + + tvec2(tref2 const & r); + + ////////////////////////////////////// + // Convertion scalar constructors + + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec2(U x); + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec2(U x, V y); + + ////////////////////////////////////// + // Convertion vector constructors + + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec2(tvec2 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec2(tvec3 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec2(tvec4 const & v); + + ////////////////////////////////////// + // Unary arithmetic operators + + tvec2& operator= (tvec2 const & v); + + tvec2& operator+=(thalf s); + tvec2& operator+=(tvec2 const & v); + tvec2& operator-=(thalf s); + tvec2& operator-=(tvec2 const & v); + tvec2& operator*=(thalf s); + tvec2& operator*=(tvec2 const & v); + tvec2& operator/=(thalf s); + tvec2& operator/=(tvec2 const & v); + tvec2& operator++(); + tvec2& operator--(); + + ////////////////////////////////////// + // Swizzle operators + + thalf swizzle(comp X) const; + tvec2 swizzle(comp X, comp Y) const; + tvec3 swizzle(comp X, comp Y, comp Z) const; + tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + tref2 swizzle(comp X, comp Y); + }; + + template <> + struct tvec3 + { + ////////////////////////////////////// + // Typedef (Implementation details) + + typedef thalf value_type; + typedef thalf & value_reference; + typedef thalf * value_pointer; + typedef tvec3 bool_type; + + typedef glm::sizeType size_type; + static size_type value_size(); + static bool is_vector(); + + typedef tvec3 type; + typedef tvec3 * pointer; + typedef tvec3 const * const_pointer; + typedef tvec3 const * const const_pointer_const; + typedef tvec3 * const pointer_const; + typedef tvec3 & reference; + typedef tvec3 const & const_reference; + typedef tvec3 const & param_type; + + ////////////////////////////////////// + // Data + + thalf x, y, z; + + ////////////////////////////////////// + // Accesses + + thalf & operator[](size_type i); + thalf const & operator[](size_type i) const; + + ////////////////////////////////////// + // Address (Implementation details) + + value_type const * _address() const{return (value_type*)(this);} + value_type * _address(){return (value_type*)(this);} + + ////////////////////////////////////// + // Implicit basic constructors + + tvec3(); + tvec3(tvec3 const & v); + + ////////////////////////////////////// + // Explicit basic constructors + + explicit tvec3(thalf s); + explicit tvec3(thalf s1, thalf s2, thalf s3); + + ////////////////////////////////////// + // Swizzle constructors + + tvec3(tref3 const & r); + + ////////////////////////////////////// + // Convertion scalar constructors + + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(U x); + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(U x, V y, W z); + + ////////////////////////////////////// + // Convertion vector constructors + + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(const tvec2& v, B s); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(A s, const tvec2& v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(tvec3 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec3(tvec4 const & v); + + ////////////////////////////////////// + // Unary arithmetic operators + + tvec3& operator= (tvec3 const & v); + + tvec3& operator+=(thalf s); + tvec3& operator+=(tvec3 const & v); + tvec3& operator-=(thalf s); + tvec3& operator-=(tvec3 const & v); + tvec3& operator*=(thalf s); + tvec3& operator*=(tvec3 const & v); + tvec3& operator/=(thalf s); + tvec3& operator/=(tvec3 const & v); + tvec3& operator++(); + tvec3& operator--(); + + ////////////////////////////////////// + // Swizzle operators + + thalf swizzle(comp X) const; + tvec2 swizzle(comp X, comp Y) const; + tvec3 swizzle(comp X, comp Y, comp Z) const; + tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + tref3 swizzle(comp X, comp Y, comp Z); + }; + + template <> + struct tvec4 + { + ////////////////////////////////////// + // Typedef (Implementation details) + + typedef thalf value_type; + typedef thalf & value_reference; + typedef thalf * value_pointer; + typedef tvec4 bool_type; + + typedef glm::sizeType size_type; + static size_type value_size(); + static bool is_vector(); + + typedef tvec4 type; + typedef tvec4 * pointer; + typedef tvec4 const * const_pointer; + typedef tvec4 const * const const_pointer_const; + typedef tvec4 * const pointer_const; + typedef tvec4 & reference; + typedef tvec4 const & const_reference; + typedef tvec4 const & param_type; + + ////////////////////////////////////// + // Data + + thalf x, y, z, w; + + ////////////////////////////////////// + // Accesses + + thalf & operator[](size_type i); + thalf const & operator[](size_type i) const; + + ////////////////////////////////////// + // Address (Implementation details) + + value_type const * _address() const{return (value_type*)(this);} + value_type * _address(){return (value_type*)(this);} + + ////////////////////////////////////// + // Implicit basic constructors + + tvec4(); + tvec4(tvec4 const & v); + + ////////////////////////////////////// + // Explicit basic constructors + + explicit tvec4(thalf s); + explicit tvec4(thalf s0, thalf s1, thalf s2, thalf s3); + + ////////////////////////////////////// + // Swizzle constructors + + tvec4(tref4 const & r); + + ////////////////////////////////////// + // Convertion scalar constructors + + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(U x); + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(A x, B y, C z, D w); + + ////////////////////////////////////// + // Convertion vector constructors + + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(const tvec2& v, B s1, C s2); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(A s1, const tvec2& v, C s2); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(A s1, B s2, const tvec2& v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(const tvec3& v, B s); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(A s, const tvec3& v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(const tvec2& v1, const tvec2& v2); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + explicit tvec4(const tvec4& v); + + ////////////////////////////////////// + // Unary arithmetic operators + + tvec4& operator= (tvec4 const & v); + + tvec4& operator+=(thalf s); + tvec4& operator+=(tvec4 const & v); + tvec4& operator-=(thalf s); + tvec4& operator-=(tvec4 const & v); + tvec4& operator*=(thalf s); + tvec4& operator*=(tvec4 const & v); + tvec4& operator/=(thalf s); + tvec4& operator/=(tvec4 const & v); + tvec4& operator++(); + tvec4& operator--(); + + ////////////////////////////////////// + // Swizzle operators + + thalf swizzle(comp X) const; + tvec2 swizzle(comp X, comp Y) const; + tvec3 swizzle(comp X, comp Y, comp Z) const; + tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + tref4 swizzle(comp X, comp Y, comp Z, comp W); + }; +#endif//GLM_USE_ANONYMOUS_UNION + } + //namespace detail + + namespace gtc{ + //! GLM_GTC_half_float extension: Add support for half precision floating-point types + namespace half_float + { + //! Type for half-precision floating-point numbers. + //! From GLM_GTC_half_float extension. + typedef detail::thalf half; + + //! Vector of 2 half-precision floating-point numbers. + //! From GLM_GTC_half_float extension. + typedef detail::tvec2 hvec2; + + //! Vector of 3 half-precision floating-point numbers. + //! From GLM_GTC_half_float extension. + typedef detail::tvec3 hvec3; + + //! Vector of 4 half-precision floating-point numbers. + //! From GLM_GTC_half_float extension. + typedef detail::tvec4 hvec4; + + //! 2 * 2 matrix of half-precision floating-point numbers. + //! From GLM_GTC_half_float extension. + typedef detail::tmat2x2 hmat2; + + //! 3 * 3 matrix of half-precision floating-point numbers. + //! From GLM_GTC_half_float extension. + typedef detail::tmat3x3 hmat3; + + //! 4 * 4 matrix of half-precision floating-point numbers. + //! From GLM_GTC_half_float extension. + typedef detail::tmat4x4 hmat4; + + }//namespace half_float + }//namespace gtc +}//namespace glm + +#define GLM_GTC_half_float namespace gtc::half_float +#ifndef GLM_GTC_GLOBAL +namespace glm {using GLM_GTC_half_float;} +#endif//GLM_GTC_GLOBAL + +#include "half_float.inl" + +#endif//glm_gtc_half_float diff --git a/glm/gtc/half_float.inl b/glm/gtc/half_float.inl new file mode 100644 index 00000000..496fb6cd --- /dev/null +++ b/glm/gtc/half_float.inl @@ -0,0 +1,784 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-08-24 +// Licence : This source is under MIT licence +// File : glm/gtc/half_float.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + +#ifndef GLM_USE_ANONYMOUS_UNION + +////////////////////////////////////// +// hvec2 + +inline tvec2::size_type tvec2::value_size() +{ + return tvec2::size_type(2); +} + +inline bool tvec2::is_vector() +{ + return true; +} + +////////////////////////////////////// +// Accesses + +inline thalf & tvec2::operator[](tvec2::size_type i) +{ + assert( i >= tvec2::size_type(0) && + i < tvec2::value_size()); + return (&x)[i]; +} + +inline thalf const & tvec2::operator[](tvec2::size_type i) const +{ + assert( i >= tvec2::size_type(0) && + i < tvec2::value_size()); + return (&x)[i]; +} + +////////////////////////////////////// +// Implicit basic constructors + +inline tvec2::tvec2() : + x(thalf(0.f)), + y(thalf(0.f)) +{} + +inline tvec2::tvec2(tvec2 const & v) : + x(v.x), + y(v.y) +{} + +////////////////////////////////////// +// Explicit basic constructors + +inline tvec2::tvec2(thalf s) : + x(s), + y(s) +{} + +inline tvec2::tvec2(thalf s1, thalf s2) : + x(s1), + y(s2) +{} + +////////////////////////////////////// +// Swizzle constructors + +inline tvec2::tvec2(tref2 const & r) : + x(r.x), + y(r.y) +{} + +////////////////////////////////////// +// Convertion scalar constructors + +template +inline tvec2::tvec2(U x) : + x(thalf(x)), + y(thalf(x)) +{} + +template +inline tvec2::tvec2(U x, V y) : + x(thalf(x)), + y(thalf(y)) +{} + +////////////////////////////////////// +// Convertion vector constructors + +template +inline tvec2::tvec2(tvec2 const & v) : + x(thalf(v.x)), + y(thalf(v.y)) +{} + +template +inline tvec2::tvec2(tvec3 const & v) : + x(thalf(v.x)), + y(thalf(v.y)) +{} + +template +inline tvec2::tvec2(tvec4 const & v) : + x(thalf(v.x)), + y(thalf(v.y)) +{} + +////////////////////////////////////// +// Unary arithmetic operators + +inline tvec2& tvec2::operator= (tvec2 const & v) +{ + this->x = v.x; + this->y = v.y; + return *this; +} + +inline tvec2& tvec2::operator+=(thalf s) +{ + this->x += s; + this->y += s; + return *this; +} + +inline tvec2& tvec2::operator+=(tvec2 const & v) +{ + this->x += v.x; + this->y += v.y; + return *this; +} + +inline tvec2& tvec2::operator-=(thalf s) +{ + this->x -= s; + this->y -= s; + return *this; +} + +inline tvec2& tvec2::operator-=(tvec2 const & v) +{ + this->x -= v.x; + this->y -= v.y; + return *this; +} + +inline tvec2& tvec2::operator*=(thalf s) +{ + this->x *= s; + this->y *= s; + return *this; +} + +inline tvec2& tvec2::operator*=(tvec2 const & v) +{ + this->x *= v.x; + this->y *= v.y; + return *this; +} + +inline tvec2& tvec2::operator/=(thalf s) +{ + this->x /= s; + this->y /= s; + return *this; +} + +inline tvec2& tvec2::operator/=(tvec2 const & v) +{ + this->x /= v.x; + this->y /= v.y; + return *this; +} + +inline tvec2& tvec2::operator++() +{ + ++this->x; + ++this->y; + return *this; +} + +inline tvec2& tvec2::operator--() +{ + --this->x; + --this->y; + return *this; +} + +////////////////////////////////////// +// Swizzle operators + +inline thalf tvec2::swizzle(comp x) const +{ + return (*this)[x]; +} + +inline tvec2 tvec2::swizzle(comp x, comp y) const +{ + return tvec2( + (*this)[x], + (*this)[y]); +} + +inline tvec3 tvec2::swizzle(comp x, comp y, comp z) const +{ + return tvec3( + (*this)[x], + (*this)[y], + (*this)[z]); +} + +inline tvec4 tvec2::swizzle(comp x, comp y, comp z, comp w) const +{ + return tvec4( + (*this)[x], + (*this)[y], + (*this)[z], + (*this)[w]); +} + +inline tref2 tvec2::swizzle(comp x, comp y) +{ + return tref2( + (*this)[x], + (*this)[y]); +} + +////////////////////////////////////// +// hvec3 + +inline tvec3::size_type tvec3::value_size() +{ + return tvec3::size_type(3); +} + +inline bool tvec3::is_vector() +{ + return true; +} + +////////////////////////////////////// +// Accesses + +inline thalf & tvec3::operator[](tvec3::size_type i) +{ + assert( i >= tvec3::size_type(0) && + i < tvec3::value_size()); + + return (&x)[i]; +} + +inline thalf const & tvec3::operator[](tvec3::size_type i) const +{ + assert( i >= tvec3::size_type(0) && + i < tvec3::value_size()); + + return (&x)[i]; +} + +////////////////////////////////////// +// Implicit basic constructors + +inline tvec3::tvec3() : + x(thalf(0)), + y(thalf(0)), + z(thalf(0)) +{} + +inline tvec3::tvec3(tvec3 const & v) : + x(v.x), + y(v.y), + z(v.z) +{} + +////////////////////////////////////// +// Explicit basic constructors + +inline tvec3::tvec3(thalf s) : + x(s), + y(s), + z(s) +{} + +inline tvec3::tvec3(thalf s0, thalf s1, thalf s2) : + x(s0), + y(s1), + z(s2) +{} + +////////////////////////////////////// +// Swizzle constructors + +inline tvec3::tvec3(tref3 const & r) : + x(r.x), + y(r.y), + z(r.z) +{} + +////////////////////////////////////// +// Convertion scalar constructors + +template +inline tvec3::tvec3(U x) : + x(thalf(x)), + y(thalf(x)), + z(thalf(x)) +{} + +template +inline tvec3::tvec3(A x, B y, C z) : + x(thalf(x)), + y(thalf(y)), + z(thalf(z)) +{} + +////////////////////////////////////// +// Convertion vector constructors + +template +inline tvec3::tvec3(tvec2 const & v, B s) : + x(thalf(v.x)), + y(thalf(v.y)), + z(thalf(s)) +{} + +template +inline tvec3::tvec3(A s, tvec2 const & v) : + x(thalf(s)), + y(thalf(v.x)), + z(thalf(v.y)) +{} + +template +inline tvec3::tvec3(tvec3 const & v) : + x(thalf(v.x)), + y(thalf(v.y)), + z(thalf(v.z)) +{} + +template +inline tvec3::tvec3(tvec4 const & v) : + x(thalf(v.x)), + y(thalf(v.y)), + z(thalf(v.z)) +{} + +////////////////////////////////////// +// Unary arithmetic operators + +inline tvec3& tvec3::operator= (tvec3 const & v) +{ + this->x = v.x; + this->y = v.y; + this->z = v.z; + return *this; +} + +inline tvec3& tvec3::operator+=(thalf s) +{ + this->x += s; + this->y += s; + this->z += s; + return *this; +} + +inline tvec3& tvec3::operator+=(tvec3 const & v) +{ + this->x += v.x; + this->y += v.y; + this->z += v.z; + return *this; +} + +inline tvec3& tvec3::operator-=(thalf s) +{ + this->x -= s; + this->y -= s; + this->z -= s; + return *this; +} + +inline tvec3& tvec3::operator-=(tvec3 const & v) +{ + this->x -= v.x; + this->y -= v.y; + this->z -= v.z; + return *this; +} + +inline tvec3& tvec3::operator*=(thalf s) +{ + this->x *= s; + this->y *= s; + this->z *= s; + return *this; +} + +inline tvec3& tvec3::operator*=(tvec3 const & v) +{ + this->x *= v.x; + this->y *= v.y; + this->z *= v.z; + return *this; +} + +inline tvec3& tvec3::operator/=(thalf s) +{ + this->x /= s; + this->y /= s; + this->z /= s; + return *this; +} + +inline tvec3& tvec3::operator/=(tvec3 const & v) +{ + this->x /= v.x; + this->y /= v.y; + this->z /= v.z; + return *this; +} + +inline tvec3& tvec3::operator++() +{ + ++this->x; + ++this->y; + ++this->z; + return *this; +} + +inline tvec3& tvec3::operator--() +{ + --this->x; + --this->y; + --this->z; + return *this; +} + +////////////////////////////////////// +// Swizzle operators + +inline thalf tvec3::swizzle(comp x) const +{ + return (*this)[x]; +} + +inline tvec2 tvec3::swizzle(comp x, comp y) const +{ + return tvec2( + (*this)[x], + (*this)[y]); +} + +inline tvec3 tvec3::swizzle(comp x, comp y, comp z) const +{ + return tvec3( + (*this)[x], + (*this)[y], + (*this)[z]); +} + +inline tvec4 tvec3::swizzle(comp x, comp y, comp z, comp w) const +{ + return tvec4( + (*this)[x], + (*this)[y], + (*this)[z], + (*this)[w]); +} + +inline tref3 tvec3::swizzle(comp x, comp y, comp z) +{ + return tref3( + (*this)[x], + (*this)[y], + (*this)[z]); +} + +////////////////////////////////////// +// hvec4 + +inline tvec4::size_type tvec4::value_size() +{ + return tvec4::size_type(4); +} + +inline bool tvec4::is_vector() +{ + return true; +} + +////////////////////////////////////// +// Accesses + +inline thalf & tvec4::operator[](tvec4::size_type i) +{ + assert( i >= tvec4::size_type(0) && + i < tvec4::value_size()); + + return (&x)[i]; +} + +inline thalf const & tvec4::operator[](tvec4::size_type i) const +{ + assert( i >= tvec4::size_type(0) && + i < tvec4::value_size()); + + return (&x)[i]; +} + +////////////////////////////////////// +// Implicit basic constructors + +inline tvec4::tvec4() : + x(thalf(0)), + y(thalf(0)), + z(thalf(0)), + w(thalf(0)) +{} + +inline tvec4::tvec4(tvec4 const & v) : + x(v.x), + y(v.y), + z(v.z), + w(v.w) +{} + +////////////////////////////////////// +// Explicit basic constructors + +inline tvec4::tvec4(thalf s) : + x(s), + y(s), + z(s), + w(s) +{} + +inline tvec4::tvec4(thalf s1, thalf s2, thalf s3, thalf s4) : + x(s1), + y(s2), + z(s3), + w(s4) +{} + +////////////////////////////////////// +// Swizzle constructors + +inline tvec4::tvec4(tref4 const & r) : + x(r.x), + y(r.y), + z(r.z), + w(r.w) +{} + +////////////////////////////////////// +// Convertion scalar constructors + +template +inline tvec4::tvec4(U x) : + x(thalf(x)), + y(thalf(x)), + z(thalf(x)), + w(thalf(x)) +{} + +template +inline tvec4::tvec4(A x, B y, C z, D w) : + x(thalf(x)), + y(thalf(y)), + z(thalf(z)), + w(thalf(w)) +{} + +////////////////////////////////////// +// Convertion vector constructors + +template +inline tvec4::tvec4(const tvec2& v, B s1, C s2) : + x(thalf(v.x)), + y(thalf(v.y)), + z(thalf(s1)), + w(thalf(s2)) +{} + +template +inline tvec4::tvec4(A s1, const tvec2& v, C s2) : + x(thalf(s1)), + y(thalf(v.x)), + z(thalf(v.y)), + w(thalf(s2)) +{} + +template +inline tvec4::tvec4(A s1, B s2, const tvec2& v) : + x(thalf(s1)), + y(thalf(s2)), + z(thalf(v.x)), + w(thalf(v.y)) +{} + +template +inline tvec4::tvec4(const tvec3& v, B s) : + x(thalf(v.x)), + y(thalf(v.y)), + z(thalf(v.z)), + w(thalf(s)) +{} + +template +inline tvec4::tvec4(A s, const tvec3& v) : + x(thalf(s)), + y(thalf(v.x)), + z(thalf(v.y)), + w(thalf(v.z)) +{} + +template +inline tvec4::tvec4(const tvec2& v1, const tvec2& v2) : + x(thalf(v1.x)), + y(thalf(v1.y)), + z(thalf(v2.x)), + w(thalf(v2.y)) +{} + +template +inline tvec4::tvec4(const tvec4& v) : + x(thalf(v.x)), + y(thalf(v.y)), + z(thalf(v.z)), + w(thalf(v.w)) +{} + +////////////////////////////////////// +// Unary arithmetic operators + +inline tvec4& tvec4::operator= (tvec4 const & v) +{ + this->x = v.x; + this->y = v.y; + this->z = v.z; + this->w = v.w; + return *this; +} + +inline tvec4& tvec4::operator+=(thalf s) +{ + this->x += s; + this->y += s; + this->z += s; + this->w += s; + return *this; +} + +inline tvec4& tvec4::operator+=(tvec4 const & v) +{ + this->x += v.x; + this->y += v.y; + this->z += v.z; + this->w += v.w; + return *this; +} + +inline tvec4& tvec4::operator-=(thalf s) +{ + this->x -= s; + this->y -= s; + this->z -= s; + this->w -= s; + return *this; +} + +inline tvec4& tvec4::operator-=(tvec4 const & v) +{ + this->x -= v.x; + this->y -= v.y; + this->z -= v.z; + this->w -= v.w; + return *this; +} + +inline tvec4& tvec4::operator*=(thalf s) +{ + this->x *= s; + this->y *= s; + this->z *= s; + this->w *= s; + return *this; +} + +inline tvec4& tvec4::operator*=(tvec4 const & v) +{ + this->x *= v.x; + this->y *= v.y; + this->z *= v.z; + this->w *= v.w; + return *this; +} + +inline tvec4& tvec4::operator/=(thalf s) +{ + this->x /= s; + this->y /= s; + this->z /= s; + this->w /= s; + return *this; +} + +inline tvec4& tvec4::operator/=(tvec4 const & v) +{ + this->x /= v.x; + this->y /= v.y; + this->z /= v.z; + this->w /= v.w; + return *this; +} + +inline tvec4& tvec4::operator++() +{ + ++this->x; + ++this->y; + ++this->z; + ++this->w; + return *this; +} + +inline tvec4& tvec4::operator--() +{ + --this->x; + --this->y; + --this->z; + --this->w; + return *this; +} + +////////////////////////////////////// +// Swizzle operators + +inline thalf tvec4::swizzle(comp x) const +{ + return (*this)[x]; +} + +inline tvec2 tvec4::swizzle(comp x, comp y) const +{ + return tvec2( + (*this)[x], + (*this)[y]); +} + +inline tvec3 tvec4::swizzle(comp x, comp y, comp z) const +{ + return tvec3( + (*this)[x], + (*this)[y], + (*this)[z]); +} + +inline tvec4 tvec4::swizzle(comp x, comp y, comp z, comp w) const +{ + return tvec4( + (*this)[x], + (*this)[y], + (*this)[z], + (*this)[w]); +} + +inline tref4 tvec4::swizzle(comp x, comp y, comp z, comp w) +{ + return tref4( + (*this)[x], + (*this)[y], + (*this)[z], + (*this)[w]); +} + +#endif//GLM_USE_ANONYMOUS_UNION + +}//namespace detail +}//namespace glm diff --git a/glm/gtc/matrix_access.hpp b/glm/gtc/matrix_access.hpp new file mode 100644 index 00000000..e69de29b diff --git a/glm/gtc/matrix_access.inl b/glm/gtc/matrix_access.inl new file mode 100644 index 00000000..e69de29b diff --git a/glm/gtc/matrix_operation.hpp b/glm/gtc/matrix_operation.hpp new file mode 100644 index 00000000..a7a0dbf1 --- /dev/null +++ b/glm/gtc/matrix_operation.hpp @@ -0,0 +1,36 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-04-29 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtc/matrix_operation.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtc_matrix_operation +#define glm_gtc_matrix_operation + +// Dependency: +#include "../glm.hpp" + +namespace glm{ +namespace gtc{ +//! GLM_GTC_matrix_operation extension: Matrix operation functions +namespace matrix_operation +{ + +}//namespace matrix_operation +}//namespace gtc +}//namespace glm + +#define GLM_GTC_matrix_operation namespace gtc::matrix_operation +#ifndef GLM_GTC_GLOBAL +namespace glm {using GLM_GTC_matrix_operation;} +#endif//GLM_GTC_GLOBAL + +#include "matrix_operation.inl" + +#endif//glm_gtc_matrix_operation diff --git a/glm/gtc/matrix_operation.inl b/glm/gtc/matrix_operation.inl new file mode 100644 index 00000000..f8dfb1c5 --- /dev/null +++ b/glm/gtc/matrix_operation.inl @@ -0,0 +1,17 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-04-29 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtc/matrix_operation.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtc{ +namespace matrix_operation +{ + +}//namespace matrix_operation +}//namespace gtc +}//namespace glm diff --git a/glm/gtc/matrix_projection.hpp b/glm/gtc/matrix_projection.hpp new file mode 100644 index 00000000..569a2057 --- /dev/null +++ b/glm/gtc/matrix_projection.hpp @@ -0,0 +1,102 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-04-29 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtc/matrix_projection.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTC_matrix_operation +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtc_matrix_projection +#define glm_gtc_matrix_projection + +// Dependency: +#include "../glm.hpp" +#include "../gtc/matrix_operation.hpp" + +namespace glm +{ + namespace test{ + bool main_gtc_matrix_projection(); + }//namespace test + + namespace gtc{ + //! GLM_GTC_matrix_projection: Varius ways to build and operate on projection matrices + namespace matrix_projection + { + using namespace gtc::matrix_operation; + + //! Creates a matrix for projecting two-dimensional coordinates onto the screen. + //! From GLM_GTC_matrix_projection extension. + template + detail::tmat4x4 ortho( + valType const & left, + valType const & right, + valType const & bottom, + valType const & top); + + //! Creates a matrix for an orthographic parallel viewing volume. + //! From GLM_GTC_matrix_projection extension. + template + detail::tmat4x4 ortho( + valType const & left, + valType const & right, + valType const & bottom, + valType const & top, + valType const & zNear, + valType const & zFar); + + //! Creates a frustum matrix. + //! From GLM_GTC_matrix_projection extension. + template + detail::tmat4x4 frustum( + valType const & left, + valType const & right, + valType const & bottom, + valType const & top, + valType const & nearVal, + valType const & farVal); + + //! Creates a matrix for a symetric perspective-view frustum. + //! From GLM_GTC_matrix_projection extension. + template + detail::tmat4x4 perspective( + valType const & fovy, + valType const & aspect, + valType const & zNear, + valType const & zFar); + + //! Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. + //! From GLM_GTC_matrix_projection extension. + template + detail::tvec3 project( + detail::tvec3 const & obj, + detail::tmat4x4 const & model, + detail::tmat4x4 const & proj, + detail::tvec4 const & viewport); + + //! Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. + //! From GLM_GTC_matrix_projection extension. + template + detail::tvec3 unProject( + detail::tvec3 const & win, + detail::tmat4x4 const & model, + detail::tmat4x4 const & proj, + detail::tvec4 const & viewport); + + }//namespace matrix_projection + }//namespace gtc +}//namespace glm + +#define GLM_GTC_matrix_projection namespace gtc::matrix_projection +#ifndef GLM_GTC_GLOBAL +namespace glm {using GLM_GTC_matrix_projection;} +#endif//GLM_GTC_GLOBAL + +#include "matrix_projection.inl" + +#endif//glm_gtc_matrix_projection diff --git a/glm/gtc/matrix_projection.inl b/glm/gtc/matrix_projection.inl new file mode 100644 index 00000000..8aa4bc47 --- /dev/null +++ b/glm/gtc/matrix_projection.inl @@ -0,0 +1,132 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-04-29 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtc/matrix_projection.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtc{ +namespace matrix_projection +{ + template + inline detail::tmat4x4 ortho( + valType const & left, + valType const & right, + valType const & bottom, + valType const & top) + { + detail::tmat4x4 Result(1); + Result[0][0] = valType(2) / (right - left); + Result[1][1] = valType(2) / (top - bottom); + Result[2][2] = - valType(1); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + return Result; + } + + template + inline detail::tmat4x4 ortho( + valType const & left, + valType const & right, + valType const & bottom, + valType const & top, + valType const & zNear, + valType const & zFar) + { + detail::tmat4x4 Result(1); + Result[0][0] = valType(2) / (right - left); + Result[1][1] = valType(2) / (top - bottom); + Result[2][2] = - valType(2) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - (zFar + zNear) / (zFar - zNear); + return Result; + } + + template + inline detail::tmat4x4 frustum( + valType const & left, + valType const & right, + valType const & bottom, + valType const & top, + valType const & nearVal, + valType const & farVal) + { + detail::tmat4x4 Result(0); + Result[0][0] = (valType(2) * nearVal) / (right - left); + Result[1][1] = (valType(2) * nearVal) / (top - bottom); + Result[2][0] = (right + left) / (right - left); + Result[2][1] = (top + bottom) / (top - bottom); + Result[2][2] = -(farVal + nearVal) / (farVal - nearVal); + Result[2][3] = valType(-1); + Result[3][2] = -(valType(2) * farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + inline detail::tmat4x4 perspective( + valType const & fovy, + valType const & aspect, + valType const & zNear, + valType const & zFar) + { + valType range = tan(radians(fovy / valType(2))) * zNear; + valType left = -range * aspect; + valType right = range * aspect; + valType bottom = -range; + valType top = range; + + detail::tmat4x4 Result(valType(0)); + Result[0][0] = (valType(2) * zNear) / (right - left); + Result[1][1] = (valType(2) * zNear) / (top - bottom); + Result[2][2] = - (zFar + zNear) / (zFar - zNear); + Result[2][3] = - valType(1); + Result[3][2] = - (valType(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + inline detail::tvec3 project( + detail::tvec3 const & obj, + detail::tmat4x4 const & model, + detail::tmat4x4 const & proj, + detail::tvec4 const & viewport) + { + detail::tvec4 tmp = detail::tvec4(obj, valTypeT(1)); + tmp = model * tmp; + tmp = proj * tmp; + + tmp /= tmp.w; + tmp = tmp * valTypeT(0.5) + valTypeT(0.5); + tmp[0] = tmp[0] * valTypeT(viewport[2]) + valTypeT(viewport[0]); + tmp[1] = tmp[1] * valTypeT(viewport[3]) + valTypeT(viewport[1]); + + return detail::tvec3(tmp); + } + + template + inline detail::tvec3 unProject( + detail::tvec3 const & win, + detail::tmat4x4 const & model, + detail::tmat4x4 const & proj, + detail::tvec4 const & viewport) + { + detail::tmat4x4 inverse = glm::inverse(proj * model); + + detail::tvec4 tmp = detail::tvec4(win, valTypeT(1)); + tmp.x = (tmp.x - valTypeT(viewport[0])) / valTypeT(viewport[2]); + tmp.y = (tmp.y - valTypeT(viewport[1])) / valTypeT(viewport[3]); + tmp = tmp * valTypeT(2) - valTypeT(1); + + detail::tvec4 obj = inverse * tmp; + obj /= obj.w; + + return detail::tvec3(obj); + } + +}//namespace matrix_projection +}//namespace gtc +}//namespace glm diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp new file mode 100644 index 00000000..eee260cf --- /dev/null +++ b/glm/gtc/matrix_transform.hpp @@ -0,0 +1,66 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-04-29 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtc/matrix_transform.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTC_matrix_operation +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtc_matrix_transform +#define glm_gtc_matrix_transform + +// Dependency: +#include "../glm.hpp" +#include "../gtc/matrix_operation.hpp" + +namespace glm +{ + namespace test{ + bool main_gtc_matrix_transform(); + }//namespace test + + namespace gtc{ + //! GLM_GTC_matrix_transform extension: Add transformation matrices + namespace matrix_transform + { + using namespace gtc::matrix_operation; + + //! Builds a translation 4 * 4 matrix created from a vector of 3 components. + //! From GLM_GTC_matrix_transform extension. + template + detail::tmat4x4 translate( + detail::tmat4x4 const & m, + detail::tvec3 const & v); + + //! Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees. + //! From GLM_GTC_matrix_transform extension. + template + detail::tmat4x4 rotate( + detail::tmat4x4 const & m, + valType const & angle, + detail::tvec3 const & v); + + //! Builds a scale 4 * 4 matrix created from 3 scalars. + //! From GLM_GTC_matrix_transform extension. + template + detail::tmat4x4 scale( + detail::tmat4x4 const & m, + detail::tvec3 const & v); + + }//namespace matrix_transform + }//namespace gtc +}//namespace glm + +#define GLM_GTC_matrix_transform namespace gtc::matrix_transform +#ifndef GLM_GTC_GLOBAL +namespace glm {using GLM_GTC_matrix_transform;} +#endif//GLM_GTC_GLOBAL + +#include "matrix_transform.inl" + +#endif//glm_gtc_matrix_transform diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl new file mode 100644 index 00000000..02e29c8d --- /dev/null +++ b/glm/gtc/matrix_transform.inl @@ -0,0 +1,136 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-04-29 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtc/matrix_transform.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtc{ +namespace matrix_transform +{ + template + inline detail::tmat4x4 translate( + detail::tmat4x4 const & m, + detail::tvec3 const & v) + { + detail::tmat4x4 Result(m); + Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3]; + return Result; + } + + template + inline detail::tmat4x4 rotate( + detail::tmat4x4 const & m, + valType const & angle, + detail::tvec3 const & v) + { + valType a = radians(angle); + valType c = cos(a); + valType s = sin(a); + + detail::tvec3 axis = normalize(v); + + detail::tvec3 temp = (valType(1) - c) * axis; + + detail::tmat4x4 Rotate(detail::tmat4x4::null); + Rotate[0][0] = c + temp[0] * axis[0]; + Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; + Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; + + Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; + Rotate[1][1] = c + temp[1] * axis[1]; + Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; + + Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; + Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; + Rotate[2][2] = c + temp[2] * axis[2]; + + detail::tmat4x4 Result(detail::tmat4x4::null); + Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; + Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; + Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; + Result[3] = m[3]; + return Result; + } + + template + inline detail::tmat4x4 scale( + detail::tmat4x4 const & m, + detail::tvec3 const & v) + { + detail::tmat4x4 Result(detail::tmat4x4::null); + Result[0] = m[0] * v[0]; + Result[1] = m[1] * v[1]; + Result[2] = m[2] * v[2]; + Result[3] = m[3]; + return Result; + } + + template + inline detail::tmat4x4 translate_slow( + detail::tmat4x4 const & m, + detail::tvec3 const & v) + { + detail::tmat4x4 Result(valType(1)); + Result[3] = detail::tvec4(v, valType(1)); + return m * Result; + + //detail::tmat4x4 Result(m); + Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3]; + //Result[3][0] = m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0]; + //Result[3][1] = m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1]; + //Result[3][2] = m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2]; + //Result[3][3] = m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3]; + //return Result; + } + + template + inline detail::tmat4x4 rotate_slow( + detail::tmat4x4 const & m, + valType const & angle, + detail::tvec3 const & v) + { + valType a = radians(angle); + valType c = cos(a); + valType s = sin(a); + detail::tmat4x4 Result; + + detail::tvec3 axis = normalize(v); + + Result[0][0] = c + (1 - c) * axis.x * axis.x; + Result[0][1] = (1 - c) * axis.x * axis.y + s * axis.z; + Result[0][2] = (1 - c) * axis.x * axis.z - s * axis.y; + Result[0][3] = 0; + + Result[1][0] = (1 - c) * axis.y * axis.x - s * axis.z; + Result[1][1] = c + (1 - c) * axis.y * axis.y; + Result[1][2] = (1 - c) * axis.y * axis.z + s * axis.x; + Result[1][3] = 0; + + Result[2][0] = (1 - c) * axis.z * axis.x + s * axis.y; + Result[2][1] = (1 - c) * axis.z * axis.y - s * axis.x; + Result[2][2] = c + (1 - c) * axis.z * axis.z; + Result[2][3] = 0; + + Result[3] = detail::tvec4(0, 0, 0, 1); + return m * Result; + } + + template + inline detail::tmat4x4 scale_slow( + detail::tmat4x4 const & m, + detail::tvec3 const & v) + { + detail::tmat4x4 Result(valType(1)); + Result[0][0] = v.x; + Result[1][1] = v.y; + Result[2][2] = v.z; + return m * Result; + } + +}//namespace matrix_transform +}//namespace gtc +}//namespace glm diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp new file mode 100644 index 00000000..a9f9fa4b --- /dev/null +++ b/glm/gtc/quaternion.hpp @@ -0,0 +1,198 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-21 +// Updated : 2009-06-04 +// Licence : This source is under MIT License +// File : glm/gtc/quaternion.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// +// ToDo: +// - Study constructors with angles and axis +// - Study constructors with vec3 that are the imaginary component of quaternion +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtc_quaternion +#define glm_gtc_quaternion + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + bool main_gtc_quaternion(); + }//namespace test + + namespace detail + { + //! \brief Template for quaternion. + //! From GLM_GTC_quaternion extension. + template + class tquat + { + public: + valType x, y, z, w; + + // Constructors + tquat(); + explicit tquat(valType const & s, tvec3 const & v); + explicit tquat(valType const & w, valType const & x, valType const & y, valType const & z); + + // Convertions + //explicit tquat(valType const & pitch, valType const & yaw, valType const & roll); + //! pitch, yaw, roll + explicit tquat(tvec3 const & eulerAngles); + explicit tquat(tmat3x3 const & m); + explicit tquat(tmat4x4 const & m); + + // Accesses + valType& operator[](int i); + valType operator[](int i) const; + + // Operators + tquat& operator*=(valType const & s); + tquat& operator/=(valType const & s); + }; + + template + detail::tquat operator- ( + detail::tquat const & q); + + template + detail::tvec3 operator* ( + detail::tquat const & q, + detail::tvec3 const & v); + + template + detail::tvec3 operator* ( + detail::tvec3 const & v, + detail::tquat const & q); + + template + detail::tvec4 operator* ( + detail::tquat const & q, + detail::tvec4 const & v); + + template + detail::tvec4 operator* ( + detail::tvec4 const & v, + detail::tquat const & q); + + template + detail::tquat operator* ( + detail::tquat const & q, + valType const & s); + + template + detail::tquat operator* ( + valType const & s, + detail::tquat const & q); + + template + detail::tquat operator/ ( + detail::tquat const & q, + valType const & s); + + } //namespace detail + + namespace gtc{ + //! GLM_GTC_quaternion extension: Quaternion types and functions + namespace quaternion + { + //! Returns the length of the quaternion x. + //! From GLM_GTC_quaternion extension. + template + valType length( + detail::tquat const & q); + + //! Returns the normalized quaternion of from x. + //! From GLM_GTC_quaternion extension. + template + detail::tquat normalize( + detail::tquat const & q); + + //! Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... + //! From GLM_GTC_quaternion extension. + template + valType dot( + detail::tquat const & q1, + detail::tquat const & q2); + + //! Returns the cross product of q1 and q2. + //! From GLM_GTC_quaternion extension. + template + detail::tquat cross( + detail::tquat const & q1, + detail::tquat const & q2); + + //! Returns a LERP interpolated quaternion of x and y according a. + //! From GLM_GTC_quaternion extension. + template + detail::tquat mix( + detail::tquat const & x, + detail::tquat const & y, + valType const & a); + + //! Returns the q conjugate. + //! From GLM_GTC_quaternion extension. + template + detail::tquat conjugate( + detail::tquat const & q); + + //! Returns the q inverse. + //! From GLM_GTC_quaternion extension. + template + detail::tquat inverse( + detail::tquat const & q); + + //! Rotates a quaternion from an vector of 3 components axis and an angle expressed in degrees. + //! From GLM_GTC_quaternion extension. + template + detail::tquat rotate( + detail::tquat const & q, + valType const & angle, + detail::tvec3 const & v); + + //! Converts a quaternion to a 3 * 3 matrix. + //! From GLM_GTC_quaternion extension. + template + detail::tmat3x3 mat3_cast( + detail::tquat const & x); + + //! Converts a quaternion to a 4 * 4 matrix. + //! From GLM_GTC_quaternion extension. + template + detail::tmat4x4 mat4_cast( + detail::tquat const & x); + + //! Converts a 3 * 3 matrix to a quaternion. + //! From GLM_GTC_quaternion extension. + template + detail::tquat quat_cast( + detail::tmat3x3 const & x); + + //! Converts a 4 * 4 matrix to a quaternion. + //! From GLM_GTC_quaternion extension. + template + detail::tquat quat_cast( + detail::tmat4x4 const & x); + + //! Quaternion of floating-point numbers. + //! From GLM_GTC_quaternion extension. + typedef detail::tquat quat; + + }//namespace quaternion + }//namespace gtc +} //namespace glm + +#define GLM_GTC_quaternion namespace gtc::quaternion +#ifndef GLM_GTC_GLOBAL +namespace glm {using GLM_GTC_quaternion;} +#endif//GLM_GTC_GLOBAL + +#include "quaternion.inl" + +#endif//glm_gtc_quaternion diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl new file mode 100644 index 00000000..ce258a7a --- /dev/null +++ b/glm/gtc/quaternion.inl @@ -0,0 +1,481 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-21 +// Updated : 2009-06-04 +// Licence : This source is under MIT License +// File : glm/gtc/quaternion.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +namespace glm{ +namespace detail{ + + template + inline tquat::tquat() : + x(0), + y(0), + z(0), + w(1) + {} + + template + inline tquat::tquat + ( + valType const & s, + tvec3 const & v + ) : + x(v.x), + y(v.y), + z(v.z), + w(s) + {} + + template + inline tquat::tquat + ( + valType const & w, + valType const & x, + valType const & y, + valType const & z + ) : + x(x), + y(y), + z(z), + w(w) + {} + + ////////////////////////////////////////////////////////////// + // tquat conversions + + //template + //inline tquat::tquat + //( + // valType const & pitch, + // valType const & yaw, + // valType const & roll + //) + //{ + // tvec3 eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5)); + // tvec3 c = glm::cos(eulerAngle * valType(0.5)); + // tvec3 s = glm::sin(eulerAngle * valType(0.5)); + // + // this->w = c.x * c.y * c.z + s.x * s.y * s.z; + // this->x = s.x * c.y * c.z - c.x * s.y * s.z; + // this->y = c.x * s.y * c.z + s.x * c.y * s.z; + // this->z = c.x * c.y * s.z - s.x * s.y * c.z; + //} + + template + inline tquat::tquat + ( + tvec3 const & eulerAngle + ) + { + tvec3 c = glm::cos(eulerAngle * valType(0.5)); + tvec3 s = glm::sin(eulerAngle * valType(0.5)); + + this->w = c.x * c.y * c.z + s.x * s.y * s.z; + this->x = s.x * c.y * c.z - c.x * s.y * s.z; + this->y = c.x * s.y * c.z + s.x * c.y * s.z; + this->z = c.x * c.y * s.z - s.x * s.y * c.z; + } + + template + inline tquat::tquat + ( + tmat3x3 const & m + ) + { + *this = toQuat(m); + } + + template + inline tquat::tquat + ( + tmat4x4 const & m + ) + { + *this = toQuat(m); + } + + ////////////////////////////////////////////////////////////// + // tquat accesses + + template + inline valType& tquat::operator [] (int i) + { + return (&x)[i]; + } + + template + inline valType tquat::operator [] (int i) const + { + return (&x)[i]; + } + + ////////////////////////////////////////////////////////////// + // tquat operators + + template + inline tquat& tquat::operator *= + ( + valType const & s + ) + { + this->w *= s; + this->x *= s; + this->y *= s; + this->z *= s; + return *this; + } + + template + inline tquat& tquat::operator /= + ( + valType const & s + ) + { + this->w /= s; + this->x /= s; + this->y /= s; + this->z /= s; + return *this; + } + + ////////////////////////////////////////////////////////////// + // tquat external operators + + template + inline detail::tquat operator- + ( + detail::tquat const & q + ) + { + return detail::tquat(-q.w, -q.x, -q.y, -q.z); + } + + // Transformation + template + inline detail::tvec3 operator* + ( + detail::tquat const & q, + detail::tvec3 const & v + ) + { + detail::tvec3 uv, uuv; + detail::tvec3 QuatVector(q.x, q.y, q.z); + uv = glm::cross(QuatVector, v); + uuv = glm::cross(QuatVector, uv); + uv *= (valType(2) * q.w); + uuv *= valType(2); + + return v + uv + uuv; + } + + template + inline detail::tvec3 operator* + ( + detail::tvec3 const & v, + detail::tquat const & q + ) + { + return gtc::quaternion::inverse(q) * v; + } + + template + inline detail::tvec4 operator* + ( + detail::tquat const & q, + detail::tvec4 const & v + ) + { + return detail::tvec4(q * detail::tvec3(v), v.w); + } + + template + inline detail::tvec4 operator* + ( + detail::tvec4 const & v, + detail::tquat const & q + ) + { + return gtc::quaternion::inverse(q) * v; + } + + template + inline detail::tquat operator* + ( + detail::tquat const & q, + valType const & s + ) + { + return detail::tquat( + q.w * s, q.x * s, q.y * s, q.z * s); + } + + template + inline detail::tquat operator* + ( + valType const & s, + detail::tquat const & q + ) + { + return q * s; + } + + template + inline detail::tquat operator/ + ( + detail::tquat const & q, + valType const & s + ) + { + return detail::tquat( + q.w / s, q.x / s, q.y / s, q.z / s); + } + +}//namespace detail + +namespace gtc{ +namespace quaternion{ + + //////////////////////////////////////////////////////// + template + inline valType length + ( + detail::tquat const & q + ) + { + return static_cast(glm::sqrt(dot(q, q))); + } + + template + inline detail::tquat normalize + ( + detail::tquat const & q + ) + { + T len = static_cast(length(q)); + if(len <= 0) // Problem + return detail::tquat(1, 0, 0, 0); + T oneOverLen = 1 / len; + return detail::tquat(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); + } + + template + inline valType dot + ( + detail::tquat const & q1, + detail::tquat const & q2 + ) + { + return q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w; + } + + template + inline detail::tquat cross + ( + detail::tquat const & q1, + detail::tquat const & q2 + ) + { + return detail::tquat( + q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, + q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, + q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, + q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); + } + + template + inline detail::tquat mix + ( + detail::tquat const & x, + detail::tquat const & y, + T const & a + ) + { + if(a <= T(0)) return x; + if(a >= T(1)) return y; + + float fCos = dot(x, y); + detail::tquat y2(y); //BUG!!! tquat y2; + if(fCos < T(0)) + { + y2 = -y; + fCos = -fCos; + } + + //if(fCos > 1.0f) // problem + float k0, k1; + if(fCos > T(0.9999)) + { + k0 = T(1) - a; + k1 = T(0) + a; //BUG!!! 1.0f + a; + } + else + { + T fSin = sqrt(T(1) - fCos * fCos); + T fAngle = atan(fSin, fCos); + T fOneOverSin = T(1) / fSin; + k0 = sin((T(1) - a) * fAngle) * fOneOverSin; + k1 = sin((T(0) + a) * fAngle) * fOneOverSin; + } + + return detail::tquat( + k0 * x.w + k1 * y2.w, + k0 * x.x + k1 * y2.x, + k0 * x.y + k1 * y2.y, + k0 * x.z + k1 * y2.z); + } + + template + inline detail::tquat conjugate + ( + detail::tquat const & q + ) + { + return detail::tquat(q.w, -q.x, -q.y, -q.z); + } + + template + inline detail::tquat inverse + ( + detail::tquat const & q + ) + { + return gtc::quaternion::conjugate(q) / gtc::quaternion::length(q); + } + + template + inline detail::tquat rotate + ( + detail::tquat const & q, + valType const & angle, + detail::tvec3 const & v + ) + { + detail::tvec3 Tmp = v; + + // Axis of rotation must be normalised + valType len = glm::core::function::geometric::length(Tmp); + if(abs(len - valType(1)) > valType(0.001)) + { + valType oneOverLen = valType(1) / len; + Tmp.x *= oneOverLen; + Tmp.y *= oneOverLen; + Tmp.z *= oneOverLen; + } + + valType AngleRad = radians(angle); + valType fSin = sin(AngleRad * valType(0.5)); + + return gtc::quaternion::cross(q, detail::tquat(cos(AngleRad * valType(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); + } + + template + inline detail::tmat3x3 mat3_cast + ( + detail::tquat const & q + ) + { + detail::tmat3x3 Result(valType(1)); + Result[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z; + Result[0][1] = 2 * q.x * q.y + 2 * q.w * q.z; + Result[0][2] = 2 * q.x * q.z - 2 * q.w * q.y; + + Result[1][0] = 2 * q.x * q.y - 2 * q.w * q.z; + Result[1][1] = 1 - 2 * q.x * q.x - 2 * q.z * q.z; + Result[1][2] = 2 * q.y * q.z + 2 * q.w * q.x; + + Result[2][0] = 2 * q.x * q.z + 2 * q.w * q.y; + Result[2][1] = 2 * q.y * q.z - 2 * q.w * q.x; + Result[2][2] = 1 - 2 * q.x * q.x - 2 * q.y * q.y; + return Result; + } + + template + inline detail::tmat4x4 mat4_cast + ( + detail::tquat const & q + ) + { + return detail::tmat4x4(mat3_cast(q)); + } + + template + inline detail::tquat quat_cast + ( + detail::tmat3x3 const & m + ) + { + T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; + T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2]; + T fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1]; + T fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2]; + + int biggestIndex = 0; + T fourBiggestSquaredMinus1 = fourWSquaredMinus1; + if(fourXSquaredMinus1 > fourBiggestSquaredMinus1) + { + fourBiggestSquaredMinus1 = fourXSquaredMinus1; + biggestIndex = 1; + } + if(fourYSquaredMinus1 > fourBiggestSquaredMinus1) + { + fourBiggestSquaredMinus1 = fourYSquaredMinus1; + biggestIndex = 2; + } + if(fourZSquaredMinus1 > fourBiggestSquaredMinus1) + { + fourBiggestSquaredMinus1 = fourZSquaredMinus1; + biggestIndex = 3; + } + + T biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5); + T mult = T(0.25) / biggestVal; + + detail::tquat Result; + switch(biggestIndex) + { + case 0: + Result.w = biggestVal; + Result.x = (m[1][2] - m[2][1]) * mult; + Result.y = (m[2][0] - m[0][2]) * mult; + Result.z = (m[0][1] - m[1][0]) * mult; + break; + case 1: + Result.w = (m[1][2] - m[2][1]) * mult; + Result.x = biggestVal; + Result.y = (m[0][1] + m[1][0]) * mult; + Result.z = (m[2][1] + m[1][2]) * mult; + break; + case 2: + Result.w = (m[2][0] - m[0][2]) * mult; + Result.x = (m[0][1] + m[1][0]) * mult; + Result.y = biggestVal; + Result.z = (m[1][2] + m[2][1]) * mult; + break; + case 3: + Result.w = (m[0][1] - m[1][0]) * mult; + Result.x = (m[2][0] + m[0][2]) * mult; + Result.y = (m[1][2] + m[2][1]) * mult; + Result.z = biggestVal; + break; + } + return Result; + } + + template + inline detail::tquat quat_cast + ( + detail::tmat4x4 const & m4 + ) + { + return quat_cast(detail::tmat3x3(m4)); + } + +}//namespace quaternion +}//namespace gtc +}//namespace glm diff --git a/glm/gtc/type_precision.hpp b/glm/gtc/type_precision.hpp new file mode 100644 index 00000000..cb342265 --- /dev/null +++ b/glm/gtc/type_precision.hpp @@ -0,0 +1,204 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-06-04 +// Updated : 2009-06-04 +// Licence : This source is under MIT License +// File : glm/gtc/type_precision.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTC_half +// - GLM_GTC_double +// - GLM_GTC_quaternion +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtc_type_precision +#define glm_gtc_type_precision + +// Dependency: +#include "../glm.hpp" +#include "../gtc/half_float.hpp" +#include "../gtc/double_float.hpp" +#include "../gtc/quaternion.hpp" + +namespace glm +{ + namespace test{ + bool main_gtc_type_precision(); + }//namespace test + + namespace gtc{ + //! GLM_GTC_type_precision extension: Defined types with specific size. + namespace type_precision + { + /////////////////////////// + // Dependences + + using namespace gtc::half_float; + using namespace gtc::double_float; + using namespace gtc::quaternion; + + /////////////////////////// + // Signed int vector types + + typedef detail::int8 int8; //!< \brief 8bit signed integer. (from GLM_GTC_type_precision extension) + typedef detail::int16 int16; //!< \brief 16bit signed integer. (from GLM_GTC_type_precision extension) + typedef detail::int32 int32; //!< \brief 32bit signed integer. (from GLM_GTC_type_precision extension) + typedef detail::int64 int64; //!< \brief 64bit signed integer. (from GLM_GTC_type_precision extension) + + typedef int8 i8; //!< \brief 8bit signed integer. (from GLM_GTC_type_precision extension) + typedef int16 i16; //!< \brief 16bit signed integer. (from GLM_GTC_type_precision extension) + typedef int32 i32; //!< \brief 32bit signed integer. (from GLM_GTC_type_precision extension) + typedef int64 i64; //!< \brief 64bit signed integer. (from GLM_GTC_type_precision extension) + + //typedef i8 i8vec1; //!< \brief 8bit signed integer scalar. (from GLM_GTC_type_precision extension) + typedef detail::tvec2 i8vec2; //!< \brief 8bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec3 i8vec3; //!< \brief 8bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec4 i8vec4; //!< \brief 8bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension) + + //typedef i16 i16vec1; //!< \brief 16bit signed integer scalar. (from GLM_GTC_type_precision extension) + typedef detail::tvec2 i16vec2; //!< \brief 16bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec3 i16vec3; //!< \brief 16bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec4 i16vec4; //!< \brief 16bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension) + + //typedef i32 i32vec1; //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension) + typedef detail::tvec2 i32vec2; //!< \brief 32bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec3 i32vec3; //!< \brief 32bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec4 i32vec4; //!< \brief 32bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension) + + //typedef i64 i64vec1; //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension) + typedef detail::tvec2 i64vec2; //!< \brief 64bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec3 i64vec3; //!< \brief 64bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec4 i64vec4; //!< \brief 64bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension) + + ///////////////////////////// + // Unsigned int vector types + + typedef detail::uint8 uint8; //!< \brief 8bit unsigned integer. (from GLM_GTC_type_precision extension) + typedef detail::uint16 uint16; //!< \brief 16bit unsigned integer. (from GLM_GTC_type_precision extension) + typedef detail::uint32 uint32; //!< \brief 32bit unsigned integer. (from GLM_GTC_type_precision extension) + typedef detail::uint64 uint64; //!< \brief 64bit unsigned integer. (from GLM_GTC_type_precision extension) + + typedef uint8 u8; //!< \brief 8bit unsigned integer. (from GLM_GTC_type_precision extension) + typedef uint16 u16; //!< \brief 16bit unsigned integer. (from GLM_GTC_type_precision extension) + typedef uint32 u32; //!< \brief 32bit unsigned integer. (from GLM_GTC_type_precision extension) + typedef uint64 u64; //!< \brief 64bit unsigned integer. (from GLM_GTC_type_precision extension) + + //typedef u8 u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTC_type_precision extension) + typedef detail::tvec2 u8vec2; //!< \brief 8bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec3 u8vec3; //!< \brief 8bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec4 u8vec4; //!< \brief 8bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension) + + //typedef u16 u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTC_type_precision extension) + typedef detail::tvec2 u16vec2; //!< \brief 16bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec3 u16vec3; //!< \brief 16bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec4 u16vec4; //!< \brief 16bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension) + + //typedef u32 u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTC_type_precision extension) + typedef detail::tvec2 u32vec2; //!< \brief 32bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec3 u32vec3; //!< \brief 32bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec4 u32vec4; //!< \brief 32bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension) + + //typedef u64 u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTC_type_precision extension) + typedef detail::tvec2 u64vec2; //!< \brief 64bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec3 u64vec3; //!< \brief 64bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec4 u64vec4; //!< \brief 64bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension) + + ////////////////////// + // Float vector types + + typedef detail::float16 float16; //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef detail::float32 float32; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef detail::float64 float64; //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension) + + typedef float16 f16; //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef float32 f32; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef float64 f64; //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension) + + //typedef f16 f16vec1; //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef detail::tvec2 f16vec2; //!< \brief Half-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec3 f16vec3; //!< \brief Half-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec4 f16vec4; //!< \brief Half-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension) + + //typedef f32 f32vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef detail::tvec2 f32vec2; //!< \brief Single-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec3 f32vec3; //!< \brief Single-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec4 f32vec4; //!< \brief Single-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension) + + //typedef f64 f64vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef detail::tvec2 f64vec2; //!< \brief Double-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec3 f64vec3; //!< \brief Double-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension) + typedef detail::tvec4 f64vec4; //!< \brief Double-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension) + + ////////////////////// + // Float matrix types + + //typedef f16 f16mat1; //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x2 f16mat2; //!< \brief Half-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x3 f16mat3; //!< \brief Half-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x4 f16mat4; //!< \brief Half-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension) + + //typedef f16 f16mat1x1; //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x2 f16mat2x2; //!< \brief Half-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x3 f16mat2x3; //!< \brief Half-precision floating-point 2x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x4 f16mat2x4; //!< \brief Half-precision floating-point 2x4 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x2 f16mat3x2; //!< \brief Half-precision floating-point 3x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x3 f16mat3x3; //!< \brief Half-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x4 f16mat3x4; //!< \brief Half-precision floating-point 3x4 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x2 f16mat4x2; //!< \brief Half-precision floating-point 4x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x3 f16mat4x3; //!< \brief Half-precision floating-point 4x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x4 f16mat4x4; //!< \brief Half-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension) + + //typedef f32 f32mat1; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x2 f32mat2; //!< \brief Single-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x3 f32mat3; //!< \brief Single-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x4 f32mat4; //!< \brief Single-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension) + + //typedef f32 f32mat1x1; //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x2 f32mat2x2; //!< \brief Single-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x3 f32mat2x3; //!< \brief Single-precision floating-point 2x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x4 f32mat2x4; //!< \brief Single-precision floating-point 2x4 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x2 f32mat3x2; //!< \brief Single-precision floating-point 3x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x3 f32mat3x3; //!< \brief Single-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x4 f32mat3x4; //!< \brief Single-precision floating-point 3x4 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x2 f32mat4x2; //!< \brief Single-precision floating-point 4x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x3 f32mat4x3; //!< \brief Single-precision floating-point 4x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x4 f32mat4x4; //!< \brief Single-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension) + + //typedef f64 f64mat1; //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x2 f64mat2; //!< \brief Double-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x3 f64mat3; //!< \brief Double-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x4 f64mat4; //!< \brief Double-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension) + + //typedef f64 f64mat1x1; //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x2 f64mat2x2; //!< \brief Double-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x3 f64mat2x3; //!< \brief Double-precision floating-point 2x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat2x4 f64mat2x4; //!< \brief Double-precision floating-point 2x4 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x2 f64mat3x2; //!< \brief Double-precision floating-point 3x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x3 f64mat3x3; //!< \brief Double-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat3x4 f64mat3x4; //!< \brief Double-precision floating-point 3x4 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x2 f64mat4x2; //!< \brief Double-precision floating-point 4x2 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x3 f64mat4x3; //!< \brief Double-precision floating-point 4x3 matrix. (from GLM_GTC_type_precision extension) + typedef detail::tmat4x4 f64mat4x4; //!< \brief Double-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension) + + ////////////////////////// + // Float quaternion types + + typedef detail::tquat f16quat; //!< \brief Half-precision floating-point quaternion. (from GLM_GTC_type_precision extension) + typedef detail::tquat f32quat; //!< \brief Single-precision floating-point quaternion. (from GLM_GTC_type_precision extension) + typedef detail::tquat f64quat; //!< \brief Double-precision floating-point quaternion. (from GLM_GTC_type_precision extension) + + }//namespace type_precision + }//namespace gtc +}//namespace glm + +#define GLM_GTC_type_precision namespace gtc::type_precision + +#ifndef GLM_GTC_GLOBAL +namespace glm {using GLM_GTC_type_precision;} +#endif//GLM_GTC_GLOBAL + +#include "type_precision.inl" + +#endif//glm_gtc_type_precision diff --git a/glm/gtc/type_precision.inl b/glm/gtc/type_precision.inl new file mode 100644 index 00000000..ade6adf1 --- /dev/null +++ b/glm/gtc/type_precision.inl @@ -0,0 +1,13 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-06-14 +// Updated : 2009-06-14 +// Licence : This source is under MIT License +// File : glm/gtc/type_precision.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + +} diff --git a/glm/gtx.hpp b/glm/gtx.hpp new file mode 100644 index 00000000..d6179184 --- /dev/null +++ b/glm/gtx.hpp @@ -0,0 +1,83 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-04-03 +// Updated : 2009-05-01 +// Licence : This source is under MIT License +// File : glm/gtx.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Note: +// GTX extensions are experimental extensions +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx +#define glm_gtx + +#define GLM_GTX_GLOBAL 1 + +//#include "./gtx/array_range.hpp" +#include "./gtx/associated_min_max.hpp" +#include "./gtx/bit.hpp" +#include "./gtx/closest_point.hpp" +#include "./gtx/color_cast.hpp" +#include "./gtx/color_space.hpp" +#include "./gtx/color_space_YCoCg.hpp" +#include "./gtx/compatibility.hpp" +#include "./gtx/component_wise.hpp" +//#include "./gtx/complex.hpp" +#include "./gtx/determinant.hpp" +#include "./gtx/double_float.hpp" +#include "./gtx/epsilon.hpp" +#include "./gtx/euler_angles.hpp" +#include "./gtx/extend.hpp" +#include "./gtx/extented_min_max.hpp" +#include "./gtx/fast_exponential.hpp" +#include "./gtx/fast_square_root.hpp" +#include "./gtx/fast_trigonometry.hpp" +//#include "./gtx/flexible_mix.hpp" +//#include "./gtx/gpu_shader4.hpp" +#include "./gtx/gradient_paint.hpp" +#include "./gtx/half_float.hpp" +#include "./gtx/handed_coordinate_space.hpp" +#include "./gtx/inertia.hpp" +#include "./gtx/integer.hpp" +#include "./gtx/intersect.hpp" +#include "./gtx/inverse.hpp" +#include "./gtx/inverse_transpose.hpp" +//#include "./gtx/mat_mn.hpp" +#include "./gtx/log_base.hpp" +#include "./gtx/matrix_access.hpp" +#include "./gtx/matrix_cross_product.hpp" +#include "./gtx/matrix_major_storage.hpp" +#include "./gtx/matrix_projection.hpp" +#include "./gtx/matrix_query.hpp" +#include "./gtx/matrix_selection.hpp" +//#include "./gtx/matx.hpp" +#include "./gtx/mixed_product.hpp" +#include "./gtx/norm.hpp" +#include "./gtx/normal.hpp" +#include "./gtx/normalize_dot.hpp" +#include "./gtx/number_precision.hpp" +#include "./gtx/optimum_pow.hpp" +#include "./gtx/orthonormalize.hpp" +#include "./gtx/perpendicular.hpp" +#include "./gtx/polar_coordinates.hpp" +#include "./gtx/projection.hpp" +#include "./gtx/quaternion.hpp" +#include "./gtx/random.hpp" +#include "./gtx/raw_data.hpp" +#include "./gtx/reciprocal.hpp" +#include "./gtx/rotate_vector.hpp" +#include "./gtx/spline.hpp" +#include "./gtx/std_based_type.hpp" +#include "./gtx/string_cast.hpp" +#include "./gtx/transform.hpp" +#include "./gtx/transform2.hpp" +#include "./gtx/unsigned_int.hpp" +#include "./gtx/vector_access.hpp" +#include "./gtx/vector_angle.hpp" +#include "./gtx/vector_query.hpp" +//#include "./gtx/vecx.hpp" +#include "./gtx/verbose_operator.hpp" + +#endif//glm_gtx diff --git a/glm/gtx/associated_min_max.hpp b/glm/gtx/associated_min_max.hpp new file mode 100644 index 00000000..58d5240c --- /dev/null +++ b/glm/gtx/associated_min_max.hpp @@ -0,0 +1,86 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-03-10 +// Updated : 2008-03-15 +// Licence : This source is under MIT License +// File : gtx_associated_min_max.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_extented_min_max +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_associated_min_max +#define glm_gtx_associated_min_max + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_associated_min_max(); + }//namespace test + + namespace gtx + { + //! GLM_GTX_associated_min_max extension: Min and max functions that return associated values not the compared onces. + namespace associated_min_max + { + //! \brief Min comparison between 2 variables + template + genTypeU associatedMin( + const genTypeT& x, const genTypeU& a, + const genTypeT& y, const genTypeU& b); + + //! \brief Min comparison between 3 variables + template + genTypeU associatedMin( + const genTypeT& x, const genTypeU& a, + const genTypeT& y, const genTypeU& b, + const genTypeT& z, const genTypeU& c); + + //! \brief Min comparison between 4 variables + template + genTypeU associatedMin( + const genTypeT& x, const genTypeU& a, + const genTypeT& y, const genTypeU& b, + const genTypeT& z, const genTypeU& c, + const genTypeT& w, const genTypeU& d); + + //! \brief Max comparison between 2 variables + template + genTypeU associatedMax( + const genTypeT& x, const genTypeU& a, + const genTypeT& y, const genTypeU& b); + + //! \brief Max comparison between 3 variables + template + genTypeU associatedMax( + const genTypeT& x, const genTypeU& a, + const genTypeT& y, const genTypeU& b, + const genTypeT& z, const genTypeU& c); + + //! \brief Max comparison between 4 variables + template + genTypeU associatedMax( + const genTypeT& x, const genTypeU& a, + const genTypeT& y, const genTypeU& b, + const genTypeT& z, const genTypeU& c, + const genTypeT& w, const genTypeU& d); + + }//namespace associated_min_max + + bool test(); + }//namespace gtx +}//namespace glm + +#define GLM_GTX_associated_min_max namespace gtx::associated_min_max +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_associated_min_max;} +#endif//GLM_GTC_GLOBAL + +#include "associated_min_max.inl" + +#endif//glm_gtx_associated_min_max diff --git a/glm/gtx/associated_min_max.inl b/glm/gtx/associated_min_max.inl new file mode 100644 index 00000000..6e6ac754 --- /dev/null +++ b/glm/gtx/associated_min_max.inl @@ -0,0 +1,916 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-03-10 +// Updated : 2008-03-15 +// Licence : This source is under MIT License +// File : gtx_associated_min_max.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace associated_min_max{ + + // Min comparison between 2 variables + template + inline U associatedMin(T x, U a, T y, U b) + { + return x < y ? a : b; + } + + template + inline detail::tvec2 associatedMin + ( + const detail::tvec2& x, const detail::tvec2& a, + const detail::tvec2& y, const detail::tvec2& b + ) + { + detail::tvec2 Result; + //Result.x = x[0] < y[0] ? a[0] : b[0]; + //Result.y = x[1] < y[1] ? a[1] : b[1]; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = x[i] < y[i] ? a[i] : b[i]; + return Result; + } + + template + inline detail::tvec3 associatedMin + ( + const detail::tvec3& x, const detail::tvec3& a, + const detail::tvec3& y, const detail::tvec3& b + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = x[i] < y[i] ? a[i] : b[i]; + return Result; + } + + template + inline detail::tvec4 associatedMin + ( + const detail::tvec4& x, const detail::tvec4& a, + const detail::tvec4& y, const detail::tvec4& b + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = x[i] < y[i] ? a[i] : b[i]; + return Result; + } + + template + inline detail::tvec2 associatedMin + ( + T x, const detail::tvec2& a, + T y, const detail::tvec2& b + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = x < y ? a[i] : b[i]; + return Result; + } + + template + inline detail::tvec3 associatedMin + ( + T x, const detail::tvec3& a, + T y, const detail::tvec3& b + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = x < y ? a[i] : b[i]; + return Result; + } + + template + inline detail::tvec4 associatedMin + ( + T x, const detail::tvec4& a, + T y, const detail::tvec4& b + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = x < y ? a[i] : b[i]; + return Result; + } + + template + inline detail::tvec2 associatedMin + ( + const detail::tvec2& x, U a, + const detail::tvec2& y, U b + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = x[i] < y[i] ? a : b; + return Result; + } + + template + inline detail::tvec3 associatedMin + ( + const detail::tvec3& x, U a, + const detail::tvec3& y, U b + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = x[i] < y[i] ? a : b; + return Result; + } + + template + inline detail::tvec4 associatedMin + ( + const detail::tvec4& x, U a, + const detail::tvec4& y, U b + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = x[i] < y[i] ? a : b; + return Result; + } + + // Min comparison between 3 variables + template + inline U associatedMin + ( + T x, U a, + T y, U b, + T z, U c + ) + { + U Result = x < y ? (x < z ? a : c) : (y < z ? b : c); + return Result; + } + + template + inline detail::tvec2 associatedMin + ( + const detail::tvec2& x, const detail::tvec2& a, + const detail::tvec2& y, const detail::tvec2& b, + const detail::tvec2& z, const detail::tvec2& c + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); + return Result; + } + + template + inline detail::tvec3 associatedMin + ( + const detail::tvec3& x, const detail::tvec3& a, + const detail::tvec3& y, const detail::tvec3& b, + const detail::tvec3& z, const detail::tvec3& c + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); + return Result; + } + + template + inline detail::tvec4 associatedMin + ( + const detail::tvec4& x, const detail::tvec4& a, + const detail::tvec4& y, const detail::tvec4& b, + const detail::tvec4& z, const detail::tvec4& c + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); + return Result; + } + + // Min comparison between 4 variables + template + inline U associatedMin + ( + T x, U a, + T y, U b, + T z, U c, + T w, U d + ) + { + T Test1 = min(x, y); + T Test2 = min(z, w);; + U Result1 = x < y ? a : b; + U Result2 = z < w ? c : d; + U Result = Test1 < Test2 ? Result1 : Result2; + return Result; + } + + // Min comparison between 4 variables + template + inline detail::tvec2 associatedMin + ( + const detail::tvec2& x, const detail::tvec2& a, + const detail::tvec2& y, const detail::tvec2& b, + const detail::tvec2& z, const detail::tvec2& c, + const detail::tvec2& w, const detail::tvec2& d + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + { + T Test1 = min(x[i], y[i]); + T Test2 = min(z[i], w[i]); + U Result1 = x[i] < y[i] ? a[i] : b[i]; + U Result2 = z[i] < w[i] ? c[i] : d[i]; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; + } + + // Min comparison between 4 variables + template + inline detail::tvec3 associatedMin + ( + const detail::tvec3& x, const detail::tvec3& a, + const detail::tvec3& y, const detail::tvec3& b, + const detail::tvec3& z, const detail::tvec3& c, + const detail::tvec3& w, const detail::tvec3& d + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + { + T Test1 = min(x[i], y[i]); + T Test2 = min(z[i], w[i]); + U Result1 = x[i] < y[i] ? a[i] : b[i]; + U Result2 = z[i] < w[i] ? c[i] : d[i]; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; + } + + // Min comparison between 4 variables + template + inline detail::tvec4 associatedMin + ( + const detail::tvec4& x, const detail::tvec4& a, + const detail::tvec4& y, const detail::tvec4& b, + const detail::tvec4& z, const detail::tvec4& c, + const detail::tvec4& w, const detail::tvec4& d + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + { + T Test1 = min(x[i], y[i]); + T Test2 = min(z[i], w[i]); + U Result1 = x[i] < y[i] ? a[i] : b[i]; + U Result2 = z[i] < w[i] ? c[i] : d[i]; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; + } + + // Min comparison between 4 variables + template + inline detail::tvec2 associatedMin + ( + T x, const detail::tvec2& a, + T y, const detail::tvec2& b, + T z, const detail::tvec2& c, + T w, const detail::tvec2& d + ) + { + T Test1 = min(x, y); + T Test2 = min(z, w); + + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + { + U Result1 = x < y ? a[i] : b[i]; + U Result2 = z < w ? c[i] : d[i]; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; + } + + // Min comparison between 4 variables + template + inline detail::tvec3 associatedMin + ( + T x, const detail::tvec3& a, + T y, const detail::tvec3& b, + T z, const detail::tvec3& c, + T w, const detail::tvec3& d + ) + { + T Test1 = min(x, y); + T Test2 = min(z, w); + + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + { + U Result1 = x < y ? a[i] : b[i]; + U Result2 = z < w ? c[i] : d[i]; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; + } + + // Min comparison between 4 variables + template + inline detail::tvec4 associatedMin + ( + T x, const detail::tvec4& a, + T y, const detail::tvec4& b, + T z, const detail::tvec4& c, + T w, const detail::tvec4& d + ) + { + T Test1 = min(x, y); + T Test2 = min(z, w); + + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + { + U Result1 = x < y ? a[i] : b[i]; + U Result2 = z < w ? c[i] : d[i]; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; + } + + // Min comparison between 4 variables + template + inline detail::tvec2 associatedMin + ( + const detail::tvec2& x, U a, + const detail::tvec2& y, U b, + const detail::tvec2& z, U c, + const detail::tvec2& w, U d + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + { + T Test1 = min(x[i], y[i]); + T Test2 = min(z[i], w[i]);; + U Result1 = x[i] < y[i] ? a : b; + U Result2 = z[i] < w[i] ? c : d; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; + } + + // Min comparison between 4 variables + template + inline detail::tvec3 associatedMin + ( + const detail::tvec3& x, U a, + const detail::tvec3& y, U b, + const detail::tvec3& z, U c, + const detail::tvec3& w, U d + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + { + T Test1 = min(x[i], y[i]); + T Test2 = min(z[i], w[i]);; + U Result1 = x[i] < y[i] ? a : b; + U Result2 = z[i] < w[i] ? c : d; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; + } + + // Min comparison between 4 variables + template + inline detail::tvec4 associatedMin + ( + const detail::tvec4& x, U a, + const detail::tvec4& y, U b, + const detail::tvec4& z, U c, + const detail::tvec4& w, U d + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + { + T Test1 = min(x[i], y[i]); + T Test2 = min(z[i], w[i]);; + U Result1 = x[i] < y[i] ? a : b; + U Result2 = z[i] < w[i] ? c : d; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; + } + + // Max comparison between 2 variables + template + inline U associatedMax(T x, U a, T y, U b) + { + return x > y ? a : b; + } + + // Max comparison between 2 variables + template + inline detail::tvec2 associatedMax + ( + const detail::tvec2& x, const detail::tvec2& a, + const detail::tvec2& y, const detail::tvec2& b + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = x[i] > y[i] ? a[i] : b[i]; + return Result; + } + + // Max comparison between 2 variables + template + inline detail::tvec3 associatedMax + ( + const detail::tvec3& x, const detail::tvec3& a, + const detail::tvec3& y, const detail::tvec3& b + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = x[i] > y[i] ? a[i] : b[i]; + return Result; + } + + // Max comparison between 2 variables + template + inline detail::tvec4 associatedMax + ( + const detail::tvec4& x, const detail::tvec4& a, + const detail::tvec4& y, const detail::tvec4& b + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = x[i] > y[i] ? a[i] : b[i]; + return Result; + } + + // Max comparison between 2 variables + template + inline detail::tvec2 associatedMax + ( + T x, const detail::tvec2& a, + T y, const detail::tvec2& b + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = x > y ? a[i] : b[i]; + return Result; + } + + // Max comparison between 2 variables + template + inline detail::tvec3 associatedMax + ( + T x, const detail::tvec3& a, + T y, const detail::tvec3& b + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = x > y ? a[i] : b[i]; + return Result; + } + + // Max comparison between 2 variables + template + inline detail::tvec4 associatedMax + ( + T x, const detail::tvec4& a, + T y, const detail::tvec4& b + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = x > y ? a[i] : b[i]; + return Result; + } + + // Max comparison between 2 variables + template + inline detail::tvec2 associatedMax + ( + const detail::tvec2& x, U a, + const detail::tvec2& y, U b + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = x[i] > y[i] ? a : b; + return Result; + } + + // Max comparison between 2 variables + template + inline detail::tvec3 associatedMax + ( + const detail::tvec3& x, U a, + const detail::tvec3& y, U b + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = x[i] > y[i] ? a : b; + return Result; + } + + // Max comparison between 2 variables + template + inline detail::tvec4 associatedMax + ( + const detail::tvec4& x, U a, + const detail::tvec4& y, U b + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = x[i] > y[i] ? a : b; + return Result; + } + + // Max comparison between 3 variables + template + inline U associatedMax + ( + T x, U a, + T y, U b, + T z, U c + ) + { + U Result = x > y ? (x > z ? a : c) : (y > z ? b : c); + return Result; + } + + // Max comparison between 3 variables + template + inline detail::tvec2 associatedMax + ( + const detail::tvec2& x, const detail::tvec2& a, + const detail::tvec2& y, const detail::tvec2& b, + const detail::tvec2& z, const detail::tvec2& c + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); + return Result; + } + + // Max comparison between 3 variables + template + inline detail::tvec3 associatedMax + ( + const detail::tvec3& x, const detail::tvec3& a, + const detail::tvec3& y, const detail::tvec3& b, + const detail::tvec3& z, const detail::tvec3& c + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); + return Result; + } + + // Max comparison between 3 variables + template + inline detail::tvec4 associatedMax + ( + const detail::tvec4& x, const detail::tvec4& a, + const detail::tvec4& y, const detail::tvec4& b, + const detail::tvec4& z, const detail::tvec4& c + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); + return Result; + } + + // Max comparison between 3 variables + template + inline detail::tvec2 associatedMax + ( + T x, const detail::tvec2& a, + T y, const detail::tvec2& b, + T z, const detail::tvec2& c + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); + return Result; + } + + // Max comparison between 3 variables + template + inline detail::tvec3 associatedMax + ( + T x, const detail::tvec3& a, + T y, const detail::tvec3& b, + T z, const detail::tvec3& c + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); + return Result; + } + + // Max comparison between 3 variables + template + inline detail::tvec4 associatedMax + ( + T x, const detail::tvec4& a, + T y, const detail::tvec4& b, + T z, const detail::tvec4& c + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); + return Result; + } + + // Max comparison between 3 variables + template + inline detail::tvec2 associatedMax + ( + const detail::tvec2& x, U a, + const detail::tvec2& y, U b, + const detail::tvec2& z, U c + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); + return Result; + } + + // Max comparison between 3 variables + template + inline detail::tvec3 associatedMax + ( + const detail::tvec3& x, U a, + const detail::tvec3& y, U b, + const detail::tvec3& z, U c + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); + return Result; + } + + // Max comparison between 3 variables + template + inline detail::tvec4 associatedMax + ( + const detail::tvec4& x, U a, + const detail::tvec4& y, U b, + const detail::tvec4& z, U c + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); + return Result; + } + + // Max comparison between 4 variables + template + inline U associatedMax + ( + T x, U a, + T y, U b, + T z, U c, + T w, U d + ) + { + T Test1 = max(x, y); + T Test2 = max(z, w);; + U Result1 = x > y ? a : b; + U Result2 = z > w ? c : d; + U Result = Test1 > Test2 ? Result1 : Result2; + return Result; + } + + // Max comparison between 4 variables + template + inline detail::tvec2 associatedMax + ( + const detail::tvec2& x, const detail::tvec2& a, + const detail::tvec2& y, const detail::tvec2& b, + const detail::tvec2& z, const detail::tvec2& c, + const detail::tvec2& w, const detail::tvec2& d + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + { + T Test1 = max(x[i], y[i]); + T Test2 = max(z[i], w[i]); + U Result1 = x[i] > y[i] ? a[i] : b[i]; + U Result2 = z[i] > w[i] ? c[i] : d[i]; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; + } + + // Max comparison between 4 variables + template + inline detail::tvec3 associatedMax + ( + const detail::tvec3& x, const detail::tvec3& a, + const detail::tvec3& y, const detail::tvec3& b, + const detail::tvec3& z, const detail::tvec3& c, + const detail::tvec3& w, const detail::tvec3& d + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + { + T Test1 = max(x[i], y[i]); + T Test2 = max(z[i], w[i]); + U Result1 = x[i] > y[i] ? a[i] : b[i]; + U Result2 = z[i] > w[i] ? c[i] : d[i]; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; + } + + // Max comparison between 4 variables + template + inline detail::tvec4 associatedMax + ( + const detail::tvec4& x, const detail::tvec4& a, + const detail::tvec4& y, const detail::tvec4& b, + const detail::tvec4& z, const detail::tvec4& c, + const detail::tvec4& w, const detail::tvec4& d + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + { + T Test1 = max(x[i], y[i]); + T Test2 = max(z[i], w[i]); + U Result1 = x[i] > y[i] ? a[i] : b[i]; + U Result2 = z[i] > w[i] ? c[i] : d[i]; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; + } + + // Max comparison between 4 variables + template + inline detail::tvec2 associatedMax + ( + T x, const detail::tvec2& a, + T y, const detail::tvec2& b, + T z, const detail::tvec2& c, + T w, const detail::tvec2& d + ) + { + T Test1 = max(x, y); + T Test2 = max(z, w); + + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + { + U Result1 = x > y ? a[i] : b[i]; + U Result2 = z > w ? c[i] : d[i]; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; + } + + // Max comparison between 4 variables + template + inline detail::tvec3 associatedMax + ( + T x, const detail::tvec3& a, + T y, const detail::tvec3& b, + T z, const detail::tvec3& c, + T w, const detail::tvec3& d + ) + { + T Test1 = max(x, y); + T Test2 = max(z, w); + + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + { + U Result1 = x > y ? a[i] : b[i]; + U Result2 = z > w ? c[i] : d[i]; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; + } + + // Max comparison between 4 variables + template + inline detail::tvec4 associatedMax + ( + T x, const detail::tvec4& a, + T y, const detail::tvec4& b, + T z, const detail::tvec4& c, + T w, const detail::tvec4& d + ) + { + T Test1 = max(x, y); + T Test2 = max(z, w); + + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + { + U Result1 = x > y ? a[i] : b[i]; + U Result2 = z > w ? c[i] : d[i]; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; + } + + // Max comparison between 4 variables + template + inline detail::tvec2 associatedMax + ( + const detail::tvec2& x, U a, + const detail::tvec2& y, U b, + const detail::tvec2& z, U c, + const detail::tvec2& w, U d + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + { + T Test1 = max(x[i], y[i]); + T Test2 = max(z[i], w[i]);; + U Result1 = x[i] > y[i] ? a : b; + U Result2 = z[i] > w[i] ? c : d; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; + } + + // Max comparison between 4 variables + template + inline detail::tvec3 associatedMax + ( + const detail::tvec3& x, U a, + const detail::tvec3& y, U b, + const detail::tvec3& z, U c, + const detail::tvec3& w, U d + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + { + T Test1 = max(x[i], y[i]); + T Test2 = max(z[i], w[i]);; + U Result1 = x[i] > y[i] ? a : b; + U Result2 = z[i] > w[i] ? c : d; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; + } + + // Max comparison between 4 variables + template + inline detail::tvec4 associatedMax + ( + const detail::tvec4& x, U a, + const detail::tvec4& y, U b, + const detail::tvec4& z, U c, + const detail::tvec4& w, U d + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + { + T Test1 = max(x[i], y[i]); + T Test2 = max(z[i], w[i]);; + U Result1 = x[i] > y[i] ? a : b; + U Result2 = z[i] > w[i] ? c : d; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; + } + +}//namespace associated_min_max +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/bit.hpp b/glm/gtx/bit.hpp new file mode 100644 index 00000000..21d904a3 --- /dev/null +++ b/glm/gtx/bit.hpp @@ -0,0 +1,106 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-03-14 +// Updated : 2008-11-14 +// Licence : This source is under MIT License +// File : glm/gtx/bit.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTC_half_float +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_bit +#define glm_gtx_bit + +// Dependency: +#include "../glm.hpp" +#include "../gtc/half_float.hpp" +#include + +namespace glm +{ + namespace test{ + void main_gtx_bit(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_bit extension: Allow to perform bit operations on integer values + namespace bit + { + using namespace gtc::half_float; + + //! Build a mask of 'count' bits + //! From GLM_GTX_bit extension. + template + genIType mask(genIType const & count); + + //! Component wise extraction of bit fields. + //! genType and genIType could be a scalar or a vector. + //! From GLM_GTX_bit extension. + template + genIType extractField(genType const & v, genIType const & first, genIType const & count); + + //! Find the lowest bit set to 1 in a integer variable. + //! From GLM_GTX_bit extension. + template + int lowestBit(genType const & value); + + //! Find the highest bit set to 1 in a integer variable. + //! From GLM_GTX_bit extension. + template + int highestBit(genType const & value); + + //! Find the highest bit set to 1 in a integer variable and return its value. + //! From GLM_GTX_bit extension. + template + genType highestBitValue(genType const & value); + + //! Return true if the value is a power of two number. + //! From GLM_GTX_bit extension. + template + bool isPowerOfTwo(genType const & value); + + //! Return the power of two number which value is just higher the input value. + //! From GLM_GTX_bit extension. + template + genType powerOfTwoAbove(genType const & value); + + //! Return the power of two number which value is just lower the input value. + //! From GLM_GTX_bit extension. + template + genType powerOfTwoBelow(genType const & value); + + //! Return the power of two number which value is the closet to the input value. + //! From GLM_GTX_bit extension. + template + genType powerOfTwoNearest(genType const & value); + + //! Revert all bits of any integer based type. + //! From GLM_GTX_bit extension. + template + genType bitRevert(genType const & value); + + //! Rotate all bits to the right. + //! From GLM_GTX_bit extension. + template + genType bitRotateRight(genType const & In, std::size_t Shift); + + //! Rotate all bits to the left. + //! From GLM_GTX_bit extension. + template + genType bitRotateLeft(genType const & In, std::size_t Shift); + + }//namespace bit + }//namespace gtx +}//namespace glm + +#define GLM_GTX_bit namespace gtx::bit +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_bit;} +#endif//GLM_GTX_GLOBAL + +#include "bit.inl" + +#endif//glm_gtx_bit diff --git a/glm/gtx/bit.inl b/glm/gtx/bit.inl new file mode 100644 index 00000000..e6630288 --- /dev/null +++ b/glm/gtx/bit.inl @@ -0,0 +1,733 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-03-14 +// Updated : 2008-11-14 +// Licence : This source is under MIT License +// File : glm/gtx/bit.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "../core/_detail.hpp" + +namespace glm{ +namespace gtx{ +namespace bit{ + +template +inline genIType mask +( + genIType const & count +) +{ + return ((genIType(1) << (count)) - genIType(1)); +} + +template +inline detail::tvec2 mask +( + detail::tvec2 const & count +) +{ + return detail::tvec2( + mask(count[0]), + mask(count[1])); +} + +template +inline detail::tvec3 mask +( + detail::tvec3 const & count +) +{ + return detail::tvec3( + mask(count[0]), + mask(count[1]), + mask(count[2])); +} + +template +inline detail::tvec4 mask +( + detail::tvec4 const & count +) +{ + return detail::tvec4( + mask(count[0]), + mask(count[1]), + mask(count[2]), + mask(count[3])); +} + +// extractField +template +inline genIType extractField +( + gtc::half_float::half const & value, + genIType const & first, + genIType const & count +) +{ + assert(first + count < sizeof(gtc::half_float::half)); + return (value._data() << first) >> ((sizeof(gtc::half_float::half) << 3) - count); +} + +template +inline genIType extractField +( + float const & value, + genIType const & first, + genIType const & count +) +{ + assert(first + count < sizeof(float)); + return (detail::uif32(value).i << first) >> ((sizeof(float) << 3) - count); +} + +template +inline genIType extractField +( + double const & value, + genIType const & first, + genIType const & count +) +{ + assert(first + count < sizeof(double)); + return (detail::uif64(value).i << first) >> ((sizeof(double) << 3) - count); +} + +template +inline genIType extractField +( + genType const & value, + genIType const & first, + genIType const & count +) +{ + assert(first + count < sizeof(genType)); + return (value << first) >> ((sizeof(genType) << 3) - count); +} + +template +inline detail::tvec2 extractField +( + detail::tvec2 const & value, + valIType const & first, + valIType const & count +) +{ + return detail::tvec2( + extractField(value[0], first, count), + extractField(value[1], first, count)); +} + +template +inline detail::tvec3 extractField +( + detail::tvec3 const & value, + valIType const & first, + valIType const & count +) +{ + return detail::tvec3( + extractField(value[0], first, count), + extractField(value[1], first, count), + extractField(value[2], first, count)); +} + +template +inline detail::tvec4 extractField +( + detail::tvec4 const & value, + valIType const & first, + valIType const & count +) +{ + return detail::tvec4( + extractField(value[0], first, count), + extractField(value[1], first, count), + extractField(value[2], first, count), + extractField(value[3], first, count)); +} + +template +inline detail::tvec2 extractField +( + detail::tvec2 const & value, + detail::tvec2 const & first, + detail::tvec2 const & count +) +{ + return detail::tvec2( + extractField(value[0], first[0], count[0]), + extractField(value[1], first[1], count[1])); +} + +template +inline detail::tvec3 extractField +( + detail::tvec3 const & value, + detail::tvec3 const & first, + detail::tvec3 const & count +) +{ + return detail::tvec3( + extractField(value[0], first[0], count[0]), + extractField(value[1], first[1], count[1]), + extractField(value[2], first[2], count[2])); +} + +template +inline detail::tvec4 extractField +( + detail::tvec4 const & value, + detail::tvec4 const & first, + detail::tvec4 const & count +) +{ + return detail::tvec4( + extractField(value[0], first[0], count[0]), + extractField(value[1], first[1], count[1]), + extractField(value[2], first[2], count[2]), + extractField(value[3], first[3], count[3])); +} + +template +inline detail::tvec2 extractField +( + valType const & value, + detail::tvec2 const & first, + detail::tvec2 const & count +) +{ + return detail::tvec2( + extractField(value, first[0], count[0]), + extractField(value, first[1], count[1])); +} + +template +inline detail::tvec3 extractField +( + valType const & value, + detail::tvec3 const & first, + detail::tvec3 const & count +) +{ + return detail::tvec3( + extractField(value, first[0], count[0]), + extractField(value, first[1], count[1]), + extractField(value, first[2], count[2])); +} + +template +inline detail::tvec4 extractField +( + valType const & value, + detail::tvec4 const & first, + detail::tvec4 const & count +) +{ + return detail::tvec4( + extractField(value, first[0], count[0]), + extractField(value, first[1], count[1]), + extractField(value, first[2], count[2]), + extractField(value, first[3], count[3])); +} + +// lowestBit +template +inline int lowestBit +( + genType const & Value +) +{ + genType Bit; + for(Bit = genType(0); !(Value & (1 << Bit)); ++Bit){} + return Bit; +} + +template +inline detail::tvec2 lowestBit +( + detail::tvec2 const & value +) +{ + return detail::tvec2( + lowestBit(value[0]), + lowestBit(value[1])); +} + +template +inline detail::tvec3 lowestBit +( + detail::tvec3 const & value +) +{ + return detail::tvec3( + lowestBit(value[0]), + lowestBit(value[1]), + lowestBit(value[2])); +} + +template +inline detail::tvec4 lowestBit +( + detail::tvec4 const & value +) +{ + return detail::tvec4( + lowestBit(value[0]), + lowestBit(value[1]), + lowestBit(value[2]), + lowestBit(value[3])); +} + +// highestBit +template +inline int highestBit +( + genType const & value +) +{ + genType bit = genType(-1); + for(genType tmp = value; tmp; tmp >>= 1, ++bit){} + return bit; +} + +//template <> +//inline int highestBit +//( +// int value +//) +//{ +// int bit = -1; +// for(int tmp = value; tmp; tmp >>= 1, ++bit); +// return bit; +//} + +template +inline detail::tvec2 highestBit +( + detail::tvec2 const & value +) +{ + return detail::tvec2( + highestBit(value[0]), + highestBit(value[1])); +} + +template +inline detail::tvec3 highestBit +( + detail::tvec3 const & value +) +{ + return detail::tvec3( + highestBit(value[0]), + highestBit(value[1]), + highestBit(value[2])); +} + +template +inline detail::tvec4 highestBit +( + detail::tvec4 const & value +) +{ + return detail::tvec4( + highestBit(value[0]), + highestBit(value[1]), + highestBit(value[2]), + highestBit(value[3])); +} + +// highestBitValue +template +inline genType highestBitValue +( + genType const & value +) +{ + genType tmp = value; + genType result = genType(0); + while(tmp) + { + result = (tmp & (~tmp + 1)); // grab lowest bit + tmp &= ~result; // clear lowest bit + } + return result; +} + +template +inline detail::tvec2 highestBitValue +( + detail::tvec2 const & value +) +{ + return detail::tvec2( + highestBitValue(value[0]), + highestBitValue(value[1])); +} + +template +inline detail::tvec3 highestBitValue +( + detail::tvec3 const & value +) +{ + return detail::tvec3( + highestBitValue(value[0]), + highestBitValue(value[1]), + highestBitValue(value[2])); +} + +template +inline detail::tvec4 highestBitValue +( + detail::tvec4 const & value +) +{ + return detail::tvec4( + highestBitValue(value[0]), + highestBitValue(value[1]), + highestBitValue(value[2]), + highestBitValue(value[3])); +} + +// isPowerOfTwo +template +inline bool isPowerOfTwo(genType const & Value) +{ + //detail::If::is_signed>::apply(abs, Value); + //return !(Value & (Value - 1)); + + // For old complier? + genType Result = Value; + if(std::numeric_limits::is_signed) + Result = abs(Result); + return !(Result & (Result - 1)); +} + +template +inline detail::tvec2 isPowerOfTwo +( + detail::tvec2 const & value +) +{ + return detail::tvec2( + isPowerOfTwo(value[0]), + isPowerOfTwo(value[1])); +} + +template +inline detail::tvec3 isPowerOfTwo +( + detail::tvec3 const & value +) +{ + return detail::tvec3( + isPowerOfTwo(value[0]), + isPowerOfTwo(value[1]), + isPowerOfTwo(value[2])); +} + +template +inline detail::tvec4 isPowerOfTwo +( + detail::tvec4 const & value +) +{ + return detail::tvec4( + isPowerOfTwo(value[0]), + isPowerOfTwo(value[1]), + isPowerOfTwo(value[2]), + isPowerOfTwo(value[3])); +} + +// powerOfTwoAbove +template +inline genType powerOfTwoAbove(genType const & value) +{ + return isPowerOfTwo(value) ? value : highestBitValue(value) << 1; +} + +template +inline detail::tvec2 powerOfTwoAbove +( + detail::tvec2 const & value +) +{ + return detail::tvec2( + powerOfTwoAbove(value[0]), + powerOfTwoAbove(value[1])); +} + +template +inline detail::tvec3 powerOfTwoAbove +( + detail::tvec3 const & value +) +{ + return detail::tvec3( + powerOfTwoAbove(value[0]), + powerOfTwoAbove(value[1]), + powerOfTwoAbove(value[2])); +} + +template +inline detail::tvec4 powerOfTwoAbove +( + detail::tvec4 const & value +) +{ + return detail::tvec4( + powerOfTwoAbove(value[0]), + powerOfTwoAbove(value[1]), + powerOfTwoAbove(value[2]), + powerOfTwoAbove(value[3])); +} + +// powerOfTwoBelow +template +inline genType powerOfTwoBelow +( + genType const & value +) +{ + return isPowerOfTwo(value) ? value : highestBitValue(value); +} + +template +inline detail::tvec2 powerOfTwoBelow +( + detail::tvec2 const & value +) +{ + return detail::tvec2( + powerOfTwoBelow(value[0]), + powerOfTwoBelow(value[1])); +} + +template +inline detail::tvec3 powerOfTwoBelow +( + detail::tvec3 const & value +) +{ + return detail::tvec3( + powerOfTwoBelow(value[0]), + powerOfTwoBelow(value[1]), + powerOfTwoBelow(value[2])); +} + +template +inline detail::tvec4 powerOfTwoBelow +( + detail::tvec4 const & value +) +{ + return detail::tvec4( + powerOfTwoBelow(value[0]), + powerOfTwoBelow(value[1]), + powerOfTwoBelow(value[2]), + powerOfTwoBelow(value[3])); +} + +// powerOfTwoNearest +template +inline genType powerOfTwoNearest +( + genType const & value +) +{ + if(isPowerOfTwo(value)) + return value; + + genType prev = highestBitValue(value); + genType next = prev << 1; + return (next - value) < (value - prev) ? next : prev; +} + +template +inline detail::tvec2 powerOfTwoNearest +( + detail::tvec2 const & value +) +{ + return detail::tvec2( + powerOfTwoNearest(value[0]), + powerOfTwoNearest(value[1])); +} + +template +inline detail::tvec3 powerOfTwoNearest +( + detail::tvec3 const & value +) +{ + return detail::tvec3( + powerOfTwoNearest(value[0]), + powerOfTwoNearest(value[1]), + powerOfTwoNearest(value[2])); +} + +template +inline detail::tvec4 powerOfTwoNearest +( + detail::tvec4 const & value +) +{ + return detail::tvec4( + powerOfTwoNearest(value[0]), + powerOfTwoNearest(value[1]), + powerOfTwoNearest(value[2]), + powerOfTwoNearest(value[3])); +} + +template +inline genType bitRevert(genType const & In) +{ + GLM_STATIC_ASSERT(std::numeric_limits::is_integer); + + genType Out = 0; + std::size_t BitSize = sizeof(genType) * 8; + for(std::size_t i = 0; i < BitSize; ++i) + if(In & (1 << i)) + Out |= 1 << (BitSize - 1 - i); + return Out; +} + +template +inline detail::tvec2 bitRevert +( + detail::tvec2 const & Value +) +{ + return detail::tvec2( + bitRevert(Value[0]), + bitRevert(Value[1])); +} + +template +inline detail::tvec3 bitRevert +( + detail::tvec3 const & Value +) +{ + return detail::tvec3( + bitRevert(Value[0]), + bitRevert(Value[1]), + bitRevert(Value[2])); +} + +template +inline detail::tvec4 bitRevert +( + detail::tvec4 const & Value +) +{ + return detail::tvec4( + bitRevert(Value[0]), + bitRevert(Value[1]), + bitRevert(Value[2]), + bitRevert(Value[3])); +} + +template +inline genType bitRotateRight(genType const & In, std::size_t Shift) +{ + GLM_STATIC_ASSERT(std::numeric_limits::is_integer); + + std::size_t BitSize = sizeof(genType) * 8; + return (In << Shift) | (In >> (BitSize - Shift)); +} + +template +inline detail::tvec2 bitRotateRight +( + detail::tvec2 const & Value, + std::size_t Shift +) +{ + return detail::tvec2( + bitRotateRight(Value[0], Shift), + bitRotateRight(Value[1], Shift)); +} + +template +inline detail::tvec3 bitRotateRight +( + detail::tvec3 const & Value, + std::size_t Shift +) +{ + return detail::tvec3( + bitRotateRight(Value[0], Shift), + bitRotateRight(Value[1], Shift), + bitRotateRight(Value[2], Shift)); +} + +template +inline detail::tvec4 bitRotateRight +( + detail::tvec4 const & Value, + std::size_t Shift +) +{ + return detail::tvec4( + bitRotateRight(Value[0], Shift), + bitRotateRight(Value[1], Shift), + bitRotateRight(Value[2], Shift), + bitRotateRight(Value[3], Shift)); +} + +template +inline genType bitRotateLeft(genType const & In, std::size_t Shift) +{ + GLM_STATIC_ASSERT(std::numeric_limits::is_integer); + + std::size_t BitSize = sizeof(genType) * 8; + return (In >> Shift) | (In << (BitSize - Shift)); +} + +template +inline detail::tvec2 bitRotateLeft +( + detail::tvec2 const & Value, + std::size_t Shift +) +{ + return detail::tvec2( + bitRotateLeft(Value[0], Shift), + bitRotateLeft(Value[1], Shift)); +} + +template +inline detail::tvec3 bitRotateLeft +( + detail::tvec3 const & Value, + std::size_t Shift +) +{ + return detail::tvec3( + bitRotateLeft(Value[0], Shift), + bitRotateLeft(Value[1], Shift), + bitRotateLeft(Value[2], Shift)); +} + +template +inline detail::tvec4 bitRotateLeft +( + detail::tvec4 const & Value, + std::size_t Shift +) +{ + return detail::tvec4( + bitRotateLeft(Value[0], Shift), + bitRotateLeft(Value[1], Shift), + bitRotateLeft(Value[2], Shift), + bitRotateLeft(Value[3], Shift)); +} + +}//namespace bit +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/closest_point.hpp b/glm/gtx/closest_point.hpp new file mode 100644 index 00000000..116d0966 --- /dev/null +++ b/glm/gtx/closest_point.hpp @@ -0,0 +1,48 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-30 +// Updated : 2008-10-05 +// Licence : This source is under MIT License +// File : glm/gtx/closest_point.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_closest_point +#define glm_gtx_closest_point + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_closest_point(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_closest_point extension: Find the point on a straight line which is the closet of a point. + namespace closest_point{ + + //! Find the point on a straight line which is the closet of a point. + //! From GLM_GTX_closest_point extension. + template + detail::tvec3 closestPointOnLine( + detail::tvec3 const & point, + detail::tvec3 const & a, + detail::tvec3 const & b); + + }//namespace closest_point + }//namespace gtx +}//namespace glm + +#define GLM_GTX_closest_point namespace gtx::closest_point +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_closest_point;} +#endif//GLM_GTC_GLOBAL + +#include "closest_point.inl" + +#endif//glm_gtx_closest_point diff --git a/glm/gtx/closest_point.inl b/glm/gtx/closest_point.inl new file mode 100644 index 00000000..b4232055 --- /dev/null +++ b/glm/gtx/closest_point.inl @@ -0,0 +1,41 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-30 +// Updated : 2008-10-05 +// Licence : This source is under MIT License +// File : glm/gtx/closest_point.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_closest_point +#define glm_gtx_closest_point + +namespace glm{ +namespace gtx{ +namespace closest_point{ + +template +inline detail::tvec3 closestPointOnLine +( + detail::tvec3 const & point, + detail::tvec3 const & a, + detail::tvec3 const & b +) +{ + valType LineLength = distance(a, b); + detail::tvec3 Vector = point - a; + detail::tvec3 LineDirection = (b - a) / LineLength; + + // Project Vector to LineDirection to get the distance of point from a + valType Distance = dot(Vector, LineDirection); + + if(Distance <= valType(0)) return a; + if(Distance >= LineLength) return b; + return a + LineDirection * Distance; +} + +}//namespace closest_point +}//namespace gtx +}//namespace glm + +#endif//glm_gtx_closest_point diff --git a/glm/gtx/color_cast.hpp b/glm/gtx/color_cast.hpp new file mode 100644 index 00000000..17b3cddb --- /dev/null +++ b/glm/gtx/color_cast.hpp @@ -0,0 +1,107 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-06-21 +// Updated : 2009-06-05 +// Licence : This source is under MIT License +// File : glm/gtx/color_cast.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_number_precision +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_color_cast +#define glm_gtx_color_cast + +// Dependency: +#include "../glm.hpp" +#include "../gtx/number_precision.hpp" + +namespace glm +{ + namespace test{ + void main_ext_gtx_color_cast(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_color_cast extension: Conversion between two color types + namespace color_cast + { + using namespace gtx::number_precision; + + //! Conversion of a floating value into a 8bit unsigned int value. + //! From GLM_GTX_color_cast extension. + template gtc::type_precision::uint8 u8channel_cast(valType a); + + //! Conversion of a floating value into a 16bit unsigned int value. + //! From GLM_GTX_color_cast extension. + template gtc::type_precision::uint16 u16channel_cast(valType a); + + template gtc::type_precision::uint32 u32_rgbx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint32 u32_xrgb_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint32 u32_bgrx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint32 u32_xbgr_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + + template gtc::type_precision::uint32 u32_rgba_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint32 u32_argb_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint32 u32_bgra_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint32 u32_abgr_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) + + template gtc::type_precision::uint64 u64_rgbx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint64 u64_xrgb_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint64 u64_bgrx_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint64 u64_xbgr_cast(const detail::tvec3& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + + template gtc::type_precision::uint64 u64_rgba_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint64 u64_argb_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint64 u64_bgra_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + template gtc::type_precision::uint64 u64_abgr_cast(const detail::tvec4& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) + + template gtx::number_precision::f16vec1 f16_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) + + template gtc::type_precision::f16vec3 f16_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f16vec3 f16_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f16vec3 f16_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f16vec3 f16_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + + template gtc::type_precision::f16vec4 f16_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f16vec4 f16_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f16vec4 f16_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f16vec4 f16_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + + template gtx::number_precision::f32vec1 f32_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) + + template gtc::type_precision::f32vec3 f32_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f32vec3 f32_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f32vec3 f32_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f32vec3 f32_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + + template gtc::type_precision::f32vec4 f32_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f32vec4 f32_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f32vec4 f32_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f32vec4 f32_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + + template gtx::number_precision::f64vec1 f64_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) + + template gtc::type_precision::f64vec3 f64_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f64vec3 f64_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f64vec3 f64_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f64vec3 f64_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) + + template gtc::type_precision::f64vec4 f64_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f64vec4 f64_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f64vec4 f64_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + template gtc::type_precision::f64vec4 f64_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) + }//namespace color_space + }//namespace gtx +}//namespace glm + +#define GLM_GTX_color_cast namespace gtx::color_cast +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_color_cast;} +#endif//GLM_GTC_GLOBAL + +#include "color_cast.inl" + +#endif//glm_gtx_color_cast diff --git a/glm/gtx/color_cast.inl b/glm/gtx/color_cast.inl new file mode 100644 index 00000000..5bb385f3 --- /dev/null +++ b/glm/gtx/color_cast.inl @@ -0,0 +1,739 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-06-21 +// Updated : 2007-08-03 +// Licence : This source is under MIT License +// File : glm/gtx/color_cast.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +//! GLM_GTX_color_cast extension: Conversion between two color types +namespace color_cast{ + +template +inline gtc::type_precision::uint8 u8channel_cast(T a) +{ + return static_cast(a * T(255)); +} + +template +inline gtc::type_precision::uint16 u16channel_cast(T a) +{ + return static_cast(a * T(65535)); +} + +template +inline gtc::type_precision::uint32 u32_rgbx_cast(const detail::tvec3& c) +{ + gtc::type_precision::uint32 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(255)) << 0; + result += static_cast(c.y * detail::tvec3::value_type(255)) << 8; + result += static_cast(c.z * detail::tvec3::value_type(255)) << 16; + return result; +} + +template +inline gtc::type_precision::uint32 u32_xrgb_cast(const detail::tvec3& c) +{ + gtc::type_precision::uint32 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(255)) << 8; + result += static_cast(c.y * detail::tvec3::value_type(255)) << 16; + result += static_cast(c.z * detail::tvec3::value_type(255)) << 24; + return result; +} + +template +inline gtc::type_precision::uint32 u32_bgrx_cast(const detail::tvec3& c) +{ + gtc::type_precision::uint32 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(255)) << 16; + result += static_cast(c.y * detail::tvec3::value_type(255)) << 8; + result += static_cast(c.z * detail::tvec3::value_type(255)) << 0; + return result; +} + +template +inline gtc::type_precision::uint32 u32_xbgr_cast(const detail::tvec3& c) +{ + gtc::type_precision::uint32 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(255)) << 24; + result += static_cast(c.y * detail::tvec3::value_type(255)) << 16; + result += static_cast(c.z * detail::tvec3::value_type(255)) << 8; + result += static_cast(c.w * detail::tvec3::value_type(255)) << 0; + return result; +} + +template +inline gtc::type_precision::uint32 u32_rgba_cast(const detail::tvec4& c) +{ + gtc::type_precision::uint32 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(255)) << 0; + result += static_cast(c.y * detail::tvec4::value_type(255)) << 8; + result += static_cast(c.z * detail::tvec4::value_type(255)) << 16; + result += static_cast(c.w * detail::tvec4::value_type(255)) << 24; + return result; +} + +template +inline gtc::type_precision::uint32 u32_argb_cast(const detail::tvec4& c) +{ + gtc::type_precision::uint32 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(255)) << 8; + result += static_cast(c.y * detail::tvec4::value_type(255)) << 16; + result += static_cast(c.z * detail::tvec4::value_type(255)) << 24; + result += static_cast(c.w * detail::tvec4::value_type(255)) << 0; + return result; +} + +template +inline gtc::type_precision::uint32 u32_bgra_cast(const detail::tvec4& c) +{ + gtc::type_precision::uint32 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(255)) << 16; + result += static_cast(c.y * detail::tvec4::value_type(255)) << 8; + result += static_cast(c.z * detail::tvec4::value_type(255)) << 0; + result += static_cast(c.w * detail::tvec4::value_type(255)) << 24; + return result; +} + +template +inline gtc::type_precision::uint32 u32_abgr_cast(const detail::tvec4& c) +{ + gtc::type_precision::uint32 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(255)) << 24; + result += static_cast(c.y * detail::tvec4::value_type(255)) << 16; + result += static_cast(c.z * detail::tvec4::value_type(255)) << 8; + result += static_cast(c.w * detail::tvec4::value_type(255)) << 0; + return result; +} + +template +inline gtc::type_precision::uint64 u64_rgbx_cast(const detail::tvec3& c) +{ + gtc::type_precision::uint64 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(65535)) << 0; + result += static_cast(c.y * detail::tvec3::value_type(65535)) << 16; + result += static_cast(c.z * detail::tvec3::value_type(65535)) << 32; + return result; +} + +template +inline gtc::type_precision::uint64 u32_xrgb_cast(const detail::tvec3& c) +{ + gtc::type_precision::uint64 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(65535)) << 16; + result += static_cast(c.y * detail::tvec3::value_type(65535)) << 32; + result += static_cast(c.z * detail::tvec3::value_type(65535)) << 48; + return result; +} + +template +inline gtc::type_precision::uint64 u32_bgrx_cast(const detail::tvec3& c) +{ + gtc::type_precision::uint64 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(65535)) << 32; + result += static_cast(c.y * detail::tvec3::value_type(65535)) << 16; + result += static_cast(c.z * detail::tvec3::value_type(65535)) << 0; + return result; +} + +template +inline gtc::type_precision::uint64 u32_xbgr_cast(const detail::tvec3& c) +{ + gtc::type_precision::uint64 result = 0; + result += static_cast(c.x * detail::tvec3::value_type(65535)) << 48; + result += static_cast(c.y * detail::tvec3::value_type(65535)) << 32; + result += static_cast(c.z * detail::tvec3::value_type(65535)) << 16; + result += static_cast(c.w * detail::tvec3::value_type(65535)) << 0; + return result; +} + +template +inline gtc::type_precision::uint64 u64_rgba_cast(const detail::tvec4& c) +{ + gtc::type_precision::uint64 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(65535)) << 0; + result += static_cast(c.y * detail::tvec4::value_type(65535)) << 16; + result += static_cast(c.z * detail::tvec4::value_type(65535)) << 32; + result += static_cast(c.w * detail::tvec4::value_type(65535)) << 48; + return result; +} + +template +inline gtc::type_precision::uint64 u64_argb_cast(const detail::tvec4& c) +{ + gtc::type_precision::uint64 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(65535)) << 16; + result += static_cast(c.y * detail::tvec4::value_type(65535)) << 32; + result += static_cast(c.z * detail::tvec4::value_type(65535)) << 48; + result += static_cast(c.w * detail::tvec4::value_type(65535)) << 0; + return result; +} + +template +inline gtc::type_precision::uint64 u64_bgra_cast(const detail::tvec4& c) +{ + gtc::type_precision::uint64 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(65535)) << 32; + result += static_cast(c.y * detail::tvec4::value_type(65535)) << 16; + result += static_cast(c.z * detail::tvec4::value_type(65535)) << 0; + result += static_cast(c.w * detail::tvec4::value_type(65535)) << 48; + return result; +} + +template +inline gtc::type_precision::uint64 u64_abgr_cast(const detail::tvec4& c) +{ + gtc::type_precision::uint64 result = 0; + result += static_cast(c.x * detail::tvec4::value_type(65535)) << 48; + result += static_cast(c.y * detail::tvec4::value_type(65535)) << 32; + result += static_cast(c.z * detail::tvec4::value_type(65535)) << 16; + result += static_cast(c.w * detail::tvec4::value_type(65535)) << 0; + return result; +} + +template <> +inline f16vec1 f16_channel_cast(gtc::type_precision::uint32 color) +{ + return gtc::type_precision::f16(static_cast(color >> 0) / static_cast(255)); +} + +template <> +inline gtc::type_precision::f16vec3 f16_rgbx_cast(gtc::type_precision::uint32 color) +{ + gtc::type_precision::f16vec3 result; + result.x = gtc::type_precision::f16(static_cast(color >> 0) / static_cast(255)); + result.y = gtc::type_precision::f16(static_cast(color >> 8) / static_cast(255)); + result.z = gtc::type_precision::f16(static_cast(color >> 16) / static_cast(255)); + return result; +} + +template <> +inline gtc::type_precision::f16vec3 f16_xrgb_cast(gtc::type_precision::uint32 color) +{ + gtc::type_precision::f16vec3 result; + result.x = gtc::type_precision::f16(static_cast(color >> 8) / static_cast(255)); + result.y = gtc::type_precision::f16(static_cast(color >> 16) / static_cast(255)); + result.z = gtc::type_precision::f16(static_cast(color >> 24) / static_cast(255)); + return result; +} + +template <> +inline f16vec3 f16_bgrx_cast(uint32 color) +{ + f16vec3 result; + result.x = f16(static_cast(color >> 16) / static_cast(255)); + result.y = f16(static_cast(color >> 8) / static_cast(255)); + result.z = f16(static_cast(color >> 0) / static_cast(255)); + return result; +} + +template <> +inline f16vec3 f16_xbgr_cast(uint32 color) +{ + f16vec3 result; + result.x = f16(static_cast(color >> 24) / static_cast(255)); + result.y = f16(static_cast(color >> 16) / static_cast(255)); + result.z = f16(static_cast(color >> 8) / static_cast(255)); + return result; +} + +template <> +inline f16vec4 f16_rgba_cast(uint32 color) +{ + f16vec4 result; + result.x = f16(static_cast(color >> 0) / static_cast(255)); + result.y = f16(static_cast(color >> 8) / static_cast(255)); + result.z = f16(static_cast(color >> 16) / static_cast(255)); + result.w = f16(static_cast(color >> 24) / static_cast(255)); + return result; +} + +template <> +inline f16vec4 f16_argb_cast(uint32 color) +{ + f16vec4 result; + result.x = f16(static_cast(color >> 8) / static_cast(255)); + result.y = f16(static_cast(color >> 16) / static_cast(255)); + result.z = f16(static_cast(color >> 24) / static_cast(255)); + result.w = f16(static_cast(color >> 0) / static_cast(255)); + return result; +} + +template <> +inline f16vec4 f16_bgra_cast(uint32 color) +{ + f16vec4 result; + result.x = f16(static_cast(color >> 16) / static_cast(255)); + result.y = f16(static_cast(color >> 8) / static_cast(255)); + result.z = f16(static_cast(color >> 0) / static_cast(255)); + result.w = f16(static_cast(color >> 24) / static_cast(255)); + return result; +} + +template <> +inline f16vec4 f16_abgr_cast(uint32 color) +{ + f16vec4 result; + result.x = f16(static_cast(color >> 24) / static_cast(255)); + result.y = f16(static_cast(color >> 16) / static_cast(255)); + result.z = f16(static_cast(color >> 8) / static_cast(255)); + result.w = f16(static_cast(color >> 0) / static_cast(255)); + return result; +} + +template <> +inline float f32_channel_cast(uint8 color) +{ + return static_cast(color >> 0) / static_cast(255); +} + +template <> +inline detail::tvec3 f32_rgbx_cast(uint32 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 0) / static_cast(255); + result.y = static_cast(color >> 8) / static_cast(255); + result.z = static_cast(color >> 16) / static_cast(255); + return result; +} + +template <> +inline detail::tvec3 f32_xrgb_cast(uint32 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 8) / static_cast(255); + result.y = static_cast(color >> 16) / static_cast(255); + result.z = static_cast(color >> 24) / static_cast(255); + return result; +} + +template <> +inline detail::tvec3 f32_bgrx_cast(uint32 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 16) / static_cast(255); + result.y = static_cast(color >> 8) / static_cast(255); + result.z = static_cast(color >> 0) / static_cast(255); + return result; +} + +template <> +inline detail::tvec3 f32_xbgr_cast(uint32 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 24) / static_cast(255); + result.y = static_cast(color >> 16) / static_cast(255); + result.z = static_cast(color >> 8) / static_cast(255); + return result; +} + +template <> +inline detail::tvec4 f32_rgba_cast(uint32 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 0) / static_cast(255); + result.y = static_cast(color >> 8) / static_cast(255); + result.z = static_cast(color >> 16) / static_cast(255); + result.w = static_cast(color >> 24) / static_cast(255); + return result; +} + +template <> +inline detail::tvec4 f32_argb_cast(uint32 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 8) / static_cast(255); + result.y = static_cast(color >> 16) / static_cast(255); + result.z = static_cast(color >> 24) / static_cast(255); + result.w = static_cast(color >> 0) / static_cast(255); + return result; +} + +template <> +inline detail::tvec4 f32_bgra_cast(uint32 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 16) / static_cast(255); + result.y = static_cast(color >> 8) / static_cast(255); + result.z = static_cast(color >> 0) / static_cast(255); + result.w = static_cast(color >> 24) / static_cast(255); + return result; +} + +template <> +inline detail::tvec4 f32_abgr_cast(uint32 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 24) / static_cast(255); + result.y = static_cast(color >> 16) / static_cast(255); + result.z = static_cast(color >> 8) / static_cast(255); + result.w = static_cast(color >> 0) / static_cast(255); + return result; +} + +template <> +inline double f64_channel_cast(uint8 color) +{ + return static_cast(color >> 0) / static_cast(255); +} + +template <> +inline detail::tvec3 f64_rgbx_cast(uint32 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 0) / static_cast(255); + result.y = static_cast(color >> 8) / static_cast(255); + result.z = static_cast(color >> 16) / static_cast(255); + return result; +} + +template <> +inline detail::tvec3 f64_xrgb_cast(uint32 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 8) / static_cast(255); + result.y = static_cast(color >> 16) / static_cast(255); + result.z = static_cast(color >> 24) / static_cast(255); + return result; +} + +template <> +inline detail::tvec3 f64_bgrx_cast(uint32 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 16) / static_cast(255); + result.y = static_cast(color >> 8) / static_cast(255); + result.z = static_cast(color >> 0) / static_cast(255); + return result; +} + +template <> +inline detail::tvec3 f64_xbgr_cast(uint32 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 24) / static_cast(255); + result.y = static_cast(color >> 16) / static_cast(255); + result.z = static_cast(color >> 8) / static_cast(255); + return result; +} + +template <> +inline detail::tvec4 f64_rgba_cast(uint32 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 0) / static_cast(255); + result.y = static_cast(color >> 8) / static_cast(255); + result.z = static_cast(color >> 16) / static_cast(255); + result.w = static_cast(color >> 24) / static_cast(255); + return result; +} + +template <> +inline detail::tvec4 f64_argb_cast(uint32 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 8) / static_cast(255); + result.y = static_cast(color >> 16) / static_cast(255); + result.z = static_cast(color >> 24) / static_cast(255); + result.w = static_cast(color >> 0) / static_cast(255); + return result; +} + +template <> +inline detail::tvec4 f64_bgra_cast(uint32 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 16) / static_cast(255); + result.y = static_cast(color >> 8) / static_cast(255); + result.z = static_cast(color >> 0) / static_cast(255); + result.w = static_cast(color >> 24) / static_cast(255); + return result; +} + +template <> +inline detail::tvec4 f64_abgr_cast(uint32 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 24) / static_cast(255); + result.y = static_cast(color >> 16) / static_cast(255); + result.z = static_cast(color >> 8) / static_cast(255); + result.w = static_cast(color >> 0) / static_cast(255); + return result; +} + +template <> +inline detail::thalf f16_channel_cast(uint16 color) +{ + return detail::thalf(static_cast(color >> 0) / static_cast(65535)); +} + +template <> +inline detail::tvec3 f16_rgbx_cast(uint64 color) +{ + detail::tvec3 result; + result.x = detail::thalf(static_cast(color >> 0) / static_cast(65535)); + result.y = detail::thalf(static_cast(color >> 16) / static_cast(65535)); + result.z = detail::thalf(static_cast(color >> 32) / static_cast(65535)); + return result; +} + +template <> +inline detail::tvec3 f16_xrgb_cast(uint64 color) +{ + detail::tvec3 result; + result.x = detail::thalf(static_cast(color >> 16) / static_cast(65535)); + result.y = detail::thalf(static_cast(color >> 32) / static_cast(65535)); + result.z = detail::thalf(static_cast(color >> 48) / static_cast(65535)); + return result; +} + +template <> +inline detail::tvec3 f16_bgrx_cast(uint64 color) +{ + detail::tvec3 result; + result.x = detail::thalf(static_cast(color >> 32) / static_cast(65535)); + result.y = detail::thalf(static_cast(color >> 16) / static_cast(65535)); + result.z = detail::thalf(static_cast(color >> 0) / static_cast(65535)); + return result; +} + +template <> +inline detail::tvec3 f16_xbgr_cast(uint64 color) +{ + detail::tvec3 result; + result.x = detail::thalf(static_cast(color >> 48) / static_cast(65535)); + result.y = detail::thalf(static_cast(color >> 32) / static_cast(65535)); + result.z = detail::thalf(static_cast(color >> 16) / static_cast(65535)); + return result; +} + +template <> +inline detail::tvec4 f16_rgba_cast(uint64 color) +{ + detail::tvec4 result; + result.x = detail::thalf(static_cast(color >> 0) / static_cast(65535)); + result.y = detail::thalf(static_cast(color >> 16) / static_cast(65535)); + result.z = detail::thalf(static_cast(color >> 32) / static_cast(65535)); + result.w = detail::thalf(static_cast(color >> 48) / static_cast(65535)); + return result; +} + +template <> +inline detail::tvec4 f16_argb_cast(uint64 color) +{ + detail::tvec4 result; + result.x = detail::thalf(static_cast(color >> 16) / static_cast(65535)); + result.y = detail::thalf(static_cast(color >> 32) / static_cast(65535)); + result.z = detail::thalf(static_cast(color >> 48) / static_cast(65535)); + result.w = detail::thalf(static_cast(color >> 0) / static_cast(65535)); + return result; +} + +template <> +inline detail::tvec4 f16_bgra_cast(uint64 color) +{ + detail::tvec4 result; + result.x = detail::thalf(static_cast(color >> 32) / static_cast(65535)); + result.y = detail::thalf(static_cast(color >> 16) / static_cast(65535)); + result.z = detail::thalf(static_cast(color >> 0) / static_cast(65535)); + result.w = detail::thalf(static_cast(color >> 48) / static_cast(65535)); + return result; +} + +template <> +inline detail::tvec4 f16_abgr_cast(uint64 color) +{ + detail::tvec4 result; + result.x = detail::thalf(static_cast(color >> 48) / static_cast(65535)); + result.y = detail::thalf(static_cast(color >> 32) / static_cast(65535)); + result.z = detail::thalf(static_cast(color >> 16) / static_cast(65535)); + result.w = detail::thalf(static_cast(color >> 0) / static_cast(65535)); + return result; +} + +template <> +inline float f32_channel_cast(uint16 color) +{ + return static_cast(color >> 0) / static_cast(65535); +} + +template <> +inline detail::tvec3 f32_rgbx_cast(uint64 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 0) / static_cast(65535); + result.y = static_cast(color >> 16) / static_cast(65535); + result.z = static_cast(color >> 32) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec3 f32_xrgb_cast(uint64 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 16) / static_cast(65535); + result.y = static_cast(color >> 32) / static_cast(65535); + result.z = static_cast(color >> 48) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec3 f32_bgrx_cast(uint64 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 32) / static_cast(65535); + result.y = static_cast(color >> 16) / static_cast(65535); + result.z = static_cast(color >> 0) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec3 f32_xbgr_cast(uint64 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 48) / static_cast(65535); + result.y = static_cast(color >> 32) / static_cast(65535); + result.z = static_cast(color >> 16) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec4 f32_rgba_cast(uint64 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 0) / static_cast(65535); + result.y = static_cast(color >> 16) / static_cast(65535); + result.z = static_cast(color >> 32) / static_cast(65535); + result.w = static_cast(color >> 48) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec4 f32_argb_cast(uint64 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 16) / static_cast(65535); + result.y = static_cast(color >> 32) / static_cast(65535); + result.z = static_cast(color >> 48) / static_cast(65535); + result.w = static_cast(color >> 0) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec4 f32_bgra_cast(uint64 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 32) / static_cast(65535); + result.y = static_cast(color >> 16) / static_cast(65535); + result.z = static_cast(color >> 0) / static_cast(65535); + result.w = static_cast(color >> 48) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec4 f32_abgr_cast(uint64 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 48) / static_cast(65535); + result.y = static_cast(color >> 32) / static_cast(65535); + result.z = static_cast(color >> 16) / static_cast(65535); + result.w = static_cast(color >> 0) / static_cast(65535); + return result; +} + +template <> +inline double f64_channel_cast(uint16 color) +{ + return static_cast(color >> 0) / static_cast(65535); +} + +template <> +inline detail::tvec3 f64_rgbx_cast(uint64 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 0) / static_cast(65535); + result.y = static_cast(color >> 16) / static_cast(65535); + result.z = static_cast(color >> 32) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec3 f64_xrgb_cast(uint64 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 16) / static_cast(65535); + result.y = static_cast(color >> 32) / static_cast(65535); + result.z = static_cast(color >> 48) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec3 f64_bgrx_cast(uint64 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 32) / static_cast(65535); + result.y = static_cast(color >> 16) / static_cast(65535); + result.z = static_cast(color >> 0) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec3 f64_xbgr_cast(uint64 color) +{ + detail::tvec3 result; + result.x = static_cast(color >> 48) / static_cast(65535); + result.y = static_cast(color >> 32) / static_cast(65535); + result.z = static_cast(color >> 16) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec4 f64_rgba_cast(uint64 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 0) / static_cast(65535); + result.y = static_cast(color >> 16) / static_cast(65535); + result.z = static_cast(color >> 32) / static_cast(65535); + result.w = static_cast(color >> 48) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec4 f64_argb_cast(uint64 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 16) / static_cast(65535); + result.y = static_cast(color >> 32) / static_cast(65535); + result.z = static_cast(color >> 48) / static_cast(65535); + result.w = static_cast(color >> 0) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec4 f64_bgra_cast(uint64 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 32) / static_cast(65535); + result.y = static_cast(color >> 16) / static_cast(65535); + result.z = static_cast(color >> 0) / static_cast(65535); + result.w = static_cast(color >> 48) / static_cast(65535); + return result; +} + +template <> +inline detail::tvec4 f64_abgr_cast(uint64 color) +{ + detail::tvec4 result; + result.x = static_cast(color >> 48) / static_cast(65535); + result.y = static_cast(color >> 32) / static_cast(65535); + result.z = static_cast(color >> 16) / static_cast(65535); + result.w = static_cast(color >> 0) / static_cast(65535); + return result; +} + +}//namespace color_space +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/color_space.hpp b/glm/gtx/color_space.hpp new file mode 100644 index 00000000..cc3512dd --- /dev/null +++ b/glm/gtx/color_space.hpp @@ -0,0 +1,78 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2007-02-22 +// Licence : This source is under MIT License +// File : glm/gtx/color_space.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_color_space +#define glm_gtx_color_space + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_color_space(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_color_space extension: Related to RGB to HSV conversions and operations + namespace color_space + { + //! Converts a color from HSV color space to its color in RGB color space. + //! From GLM_GTX_color_space extension. + template + detail::tvec3 rgbColor( + detail::tvec3 const & hsvValue); + + //! Converts a color from RGB color space to its color in HSV color space. + //! From GLM_GTX_color_space extension. + template + detail::tvec3 hsvColor( + detail::tvec3 const & rgbValue); + + //! Build a saturation matrix. + //! From GLM_GTX_color_space extension + template + detail::tmat4x4 saturation( + valType const s); + + //! Modify the saturation of a color. + //! From GLM_GTX_color_space extension. + template + detail::tvec3 saturation( + valType const s, + detail::tvec3 const & color); + + //! Modify the saturation of a color. + //! From GLM_GTX_color_space extension. + template + detail::tvec4 saturation( + valType const s, + detail::tvec4 const & color); + + //! Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals. + //! From GLM_GTX_color_space extension. + template + valType luminosity( + detail::tvec3 const & color); + + }//namespace color_space + }//namespace gtx +}//namespace glm + +#define GLM_GTX_color_space namespace gtx::color_space +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_color_space;} +#endif//GLM_GTC_GLOBAL + +#include "color_space.inl" + +#endif//glm_gtx_color_space diff --git a/glm/gtx/color_space.inl b/glm/gtx/color_space.inl new file mode 100644 index 00000000..015d5a36 --- /dev/null +++ b/glm/gtx/color_space.inl @@ -0,0 +1,154 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2007-02-22 +// Licence : This source is under MIT License +// File : glm/gtx/color_space.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace color_space +{ + template + inline detail::tvec3 rgbColor(const detail::tvec3& hsvColor) + { + detail::tvec3 hsv = hsvColor; + detail::tvec3 rgbColor; + + if(hsv.y == T(0)) + // achromatic (grey) + rgbColor = detail::tvec3(hsv.z); + else + { + T sector = floor(hsv.x / T(60)); + T frac = (hsv.x / T(60)) - sector; + // factorial part of h + T o = hsv.z * (T(1) - hsv.y); + T p = hsv.z * (T(1) - hsv.y * frac); + T q = hsv.z * (T(1) - hsv.y * (T(1) - frac)); + + switch(int(sector)) + { + default: + case 0: + rgbColor.r = hsv.z; + rgbColor.g = q; + rgbColor.b = o; + break; + case 1: + rgbColor.r = p; + rgbColor.g = hsv.z; + rgbColor.b = o; + break; + case 2: + rgbColor.r = o; + rgbColor.g = hsv.z; + rgbColor.b = q; + break; + case 3: + rgbColor.r = o; + rgbColor.g = p; + rgbColor.b = hsv.z; + break; + case 4: + rgbColor.r = q; + rgbColor.g = o; + rgbColor.b = hsv.z; + break; + case 5: + rgbColor.r = hsv.z; + rgbColor.g = o; + rgbColor.b = p; + break; + } + } + + return rgbColor; + } + + template + inline detail::tvec3 hsvColor(const detail::tvec3& rgbColor) + { + detail::tvec3 hsv = rgbColor; + float Min = min(min(rgbColor.r, rgbColor.g), rgbColor.b); + float Max = max(max(rgbColor.r, rgbColor.g), rgbColor.b); + float Delta = Max - Min; + + hsv.z = Max; + + if(Max != T(0)) + { + hsv.y = Delta / hsv.z; + T h = T(0); + + if(rgbColor.r == Max) + // between yellow & magenta + h = T(0) + T(60) * (rgbColor.g - rgbColor.b) / Delta; + else if(rgbColor.g == Max) + // between cyan & yellow + h = T(120) + T(60) * (rgbColor.b - rgbColor.r) / Delta; + else + // between magenta & cyan + h = T(240) + T(60) * (rgbColor.r - rgbColor.g) / Delta; + + if(h < T(0)) + hsv.x = h + T(360); + else + hsv.x = h; + } + else + { + // If r = g = b = 0 then s = 0, h is undefined + hsv.y = T(0); + hsv.x = T(0); + } + + return hsv; + } + + template + inline detail::tmat4x4 saturation(const T s) + { + detail::tvec3 rgbw = detail::tvec3(T(0.2126), T(0.7152), T(0.0722)); + + T col0 = (T(1) - s) * rgbw.r; + T col1 = (T(1) - s) * rgbw.g; + T col2 = (T(1) - s) * rgbw.b; + + detail::tmat4x4 result(T(1)); + result[0][0] = col0 + s; + result[0][1] = col0; + result[0][2] = col0; + result[1][0] = col1; + result[1][1] = col1 + s; + result[1][2] = col1; + result[2][0] = col2; + result[2][1] = col2; + result[2][2] = col2 + s; + return result; + } + + template + inline detail::tvec3 saturation(const T s, const detail::tvec3& color) + { + return detail::tvec3(saturation(s) * detail::tvec4(color, T(0))); + } + + template + inline detail::tvec4 saturation(const T s, const detail::tvec4& color) + { + return saturation(s) * color; + } + + template + inline T luminosity(const detail::tvec3& color) + { + const detail::tvec3 tmp = detail::tvec3(0.33, 0.59, 0.11); + return dot(color, tmp); + } + +}//namespace color_space +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/color_space_YCoCg.hpp b/glm/gtx/color_space_YCoCg.hpp new file mode 100644 index 00000000..5062b818 --- /dev/null +++ b/glm/gtx/color_space_YCoCg.hpp @@ -0,0 +1,66 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-28 +// Updated : 2008-10-28 +// Licence : This source is under MIT License +// File : glm/gtx/color_space_YCoCg.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_color_space_YCoCg +#define glm_gtx_color_space_YCoCg + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_color_space_YCoCg(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_color_space_YCoCg extension: RGB to YCoCg conversions and operations + namespace color_space_YCoCg + { + //! Convert a color from RGB color space to YCoCg color space. + //! From GLM_GTX_color_space_YCoCg extension. + template + detail::tvec3 rgb2YCoCg( + detail::tvec3 const & rgbColor); + + //! Convert a color from YCoCg color space to RGB color space. + //! From GLM_GTX_color_space_YCoCg extension. + template + detail::tvec3 YCoCg2rgb( + detail::tvec3 const & YCoCgColor); + + //! Convert a color from RGB color space to YCoCgR color space. + //! \see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" + //! From GLM_GTX_color_space_YCoCg extension. + template + detail::tvec3 rgb2YCoCgR( + detail::tvec3 const & rgbColor); + + //! Convert a color from YCoCgR color space to RGB color space. + //! \see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" + //! From GLM_GTX_color_space_YCoCg extension. + template + detail::tvec3 YCoCgR2rgb( + detail::tvec3 const & YCoCgColor); + + }//namespace color_space_YCoCg + }//namespace gtx +}//namespace glm + +#define GLM_GTX_color_space_YCoCg namespace gtx::color_space_YCoCg +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_color_space_YCoCg;} +#endif//GLM_GTC_GLOBAL + +#include "color_space_YCoCg.inl" + +#endif//glm_gtx_color_space_YCoCg diff --git a/glm/gtx/color_space_YCoCg.inl b/glm/gtx/color_space_YCoCg.inl new file mode 100644 index 00000000..b68a6cf7 --- /dev/null +++ b/glm/gtx/color_space_YCoCg.inl @@ -0,0 +1,69 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-28 +// Updated : 2008-10-28 +// Licence : This source is under MIT License +// File : glm/gtx/color_space_YCoCg.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace color_space_YCoCg{ + +template +inline detail::tvec3 rgb2YCoCg +( + detail::tvec3 const & rgbColor +) +{ + detail::tvec3 result; + result.x/*Y */ = rgbColor.r / valType(4) + rgbColor.g / valType(2) + rgbColor.b / valType(4); + result.y/*Co*/ = rgbColor.r / valType(2) + rgbColor.g * valType(0) - rgbColor.b / valType(2); + result.z/*Cg*/ = - rgbColor.r / valType(4) + rgbColor.g / valType(2) - rgbColor.b / valType(4); + return result; +} + +template +inline detail::tvec3 rgb2YCoCgR +( + detail::tvec3 const & rgbColor +) +{ + detail::tvec3 result; + result.x/*Y */ = rgbColor.g / valType(2) + (rgbColor.r + rgbColor.b) / valType(4); + result.y/*Co*/ = rgbColor.r - rgbColor.b; + result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) / valType(2); + return result; +} + +template +inline detail::tvec3 YCoCg2rgb +( + detail::tvec3 const & YCoCgColor +) +{ + detail::tvec3 result; + result.r = YCoCgColor.x + YCoCgColor.y - YCoCgColor.z; + result.g = YCoCgColor.x + YCoCgColor.z; + result.b = YCoCgColor.x - YCoCgColor.y - YCoCgColor.z; + return result; +} + +template +inline detail::tvec3 YCoCgR2rgb +( + detail::tvec3 const & YCoCgRColor +) +{ + detail::tvec3 result; + valType tmp = YCoCgRColor.x - (YCoCgRColor.z / valType(2)); + result.g = YCoCgRColor.z + tmp; + result.b = tmp - (YCoCgRColor.y / valType(2)); + result.r = result.b + YCoCgRColor.y; + return result; +} + +}//namespace color_space_YCoCg +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/comparison.hpp b/glm/gtx/comparison.hpp new file mode 100644 index 00000000..1f252751 --- /dev/null +++ b/glm/gtx/comparison.hpp @@ -0,0 +1,50 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-06-22 +// Updated : 2008-10-27 +// Licence : This source is under MIT License +// File : glm/gtx/comparison.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_comparison +#define glm_gtx_comparison + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_comparison(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_comparison extension: Defined comparison operators for vectors. + namespace comparison{ + + //! Define == operator for vectors + //! From GLM_GTX_comparison extension. + template + bool operator== (vecType const & x, vecType const & y); + + //! Define != operator for vectors + //! From GLM_GTX_comparison extension. + template + bool operator!= (vecType const & x, vecType const & y); + + }//namespace comparison + }//namespace gtx +}//namespace glm + +#define GLM_GTX_comparison namespace glm::gtx::comparison +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_comparison;} +#endif//GLM_GTC_GLOBAL + +#include "comparison.inl" + +#endif//glm_gtx_comparison diff --git a/glm/gtx/comparison.inl b/glm/gtx/comparison.inl new file mode 100644 index 00000000..7e2cfcb9 --- /dev/null +++ b/glm/gtx/comparison.inl @@ -0,0 +1,76 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-06-22 +// Updated : 2008-10-27 +// Licence : This source is under MIT License +// File : glm/gtx/comparison.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace comparison{ + +template +inline bool operator== +( + detail::tvec2 const & x, + detail::tvec2 const & y +) +{ + return glm::all(glm::equal(x, y)); +} + +template +inline bool operator== +( + detail::tvec3 const & x, + detail::tvec3 const & y +) +{ + return glm::all(glm::equal(x, y)); +} + +template +inline bool operator== +( + detail::tvec4 const & x, + detail::tvec4 const & y +) +{ + return glm::all(glm::equal(x, y)); +} + +template +inline bool operator!= +( + detail::tvec2 const & x, + detail::tvec2 const & y +) +{ + return glm::any(glm::notEqual(x, y)); +} + +template +inline bool operator!= +( + detail::tvec3 const & x, + detail::tvec3 const & y +) +{ + return glm::any(glm::notEqual(x, y)); +} + +template +inline bool operator!= +( + detail::tvec4 const & x, + detail::tvec4 const & y +) +{ + return glm::any(glm::notEqual(x, y)); +} + +}//namespace comparison +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/compatibility.hpp b/glm/gtx/compatibility.hpp new file mode 100644 index 00000000..0dedb412 --- /dev/null +++ b/glm/gtx/compatibility.hpp @@ -0,0 +1,174 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-01-24 +// Updated : 2008-10-24 +// Licence : This source is under MIT License +// File : glm/gtx/compatibility.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_half_float +// - GLM_GTX_double_float +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_compatibility +#define glm_gtx_compatibility + +// Dependency: +#include "../glm.hpp" +#include "../gtc/half_float.hpp" +#include "../gtc/double_float.hpp" + +#ifdef GLM_COMPILER_VC +#include +#endif +#ifdef GLM_COMPILER_GCC +#include +#endif + +namespace glm +{ + namespace test{ + void main_gtx_compatibility(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_compatibility extension: Provide functions to increase the compatibility with Cg and HLSL languages + namespace compatibility + { + template inline T lerp(T x, T y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template inline detail::tvec2 lerp(const detail::tvec2& x, const detail::tvec2& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template inline detail::tvec3 lerp(const detail::tvec3& x, const detail::tvec3& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template inline detail::tvec4 lerp(const detail::tvec4& x, const detail::tvec4& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template inline detail::tvec2 lerp(const detail::tvec2& x, const detail::tvec2& y, const detail::tvec2& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template inline detail::tvec3 lerp(const detail::tvec3& x, const detail::tvec3& y, const detail::tvec3& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template inline detail::tvec4 lerp(const detail::tvec4& x, const detail::tvec4& y, const detail::tvec4& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + + template inline T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template inline detail::tvec2 saturate(const detail::tvec2& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template inline detail::tvec3 saturate(const detail::tvec3& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template inline detail::tvec4 saturate(const detail::tvec4& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + + template inline T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template inline detail::tvec2 atan2(const detail::tvec2& x, const detail::tvec2& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template inline detail::tvec3 atan2(const detail::tvec3& x, const detail::tvec3& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template inline detail::tvec4 atan2(const detail::tvec4& x, const detail::tvec4& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + + template bool isfinite(genType const & x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template detail::tvec2 isfinite(const detail::tvec2& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template detail::tvec3 isfinite(const detail::tvec3& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template detail::tvec4 isfinite(const detail::tvec4& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + + template bool isinf(genType const & x); //!< \brief Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension) + template detail::tvec2 isinf(const detail::tvec2& x); //!< \brief Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension) + template detail::tvec3 isinf(const detail::tvec3& x); //!< \brief Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension) + template detail::tvec4 isinf(const detail::tvec4& x); //!< \brief Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension) + + template bool isnan(genType const & x); //!< \brief Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension) + template detail::tvec2 isnan(const detail::tvec2& x); //!< \brief Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension) + template detail::tvec3 isnan(const detail::tvec3& x); //!< \brief Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension) + template detail::tvec4 isnan(const detail::tvec4& x); //!< \brief Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension) + + typedef bool bool1; //!< \brief boolean type with 1 component. (From GLM_GTX_compatibility extension) + typedef detail::tvec2 bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec3 bool3; //!< \brief boolean type with 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec4 bool4; //!< \brief boolean type with 4 components. (From GLM_GTX_compatibility extension) + + typedef bool bool1x1; //!< \brief boolean matrix with 1 x 1 component. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x2 bool2x2; //!< \brief boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x3 bool2x3; //!< \brief boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x4 bool2x4; //!< \brief boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x2 bool3x2; //!< \brief boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x3 bool3x3; //!< \brief boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x4 bool3x4; //!< \brief boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x2 bool4x2; //!< \brief boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x3 bool4x3; //!< \brief boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x4 bool4x4; //!< \brief boolean matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + typedef int int1; //!< \brief integer vector with 1 component. (From GLM_GTX_compatibility extension) + typedef detail::tvec2 int2; //!< \brief integer vector with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec3 int3; //!< \brief integer vector with 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec4 int4; //!< \brief integer vector with 4 components. (From GLM_GTX_compatibility extension) + + typedef int int1x1; //!< \brief integer matrix with 1 component. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x2 int2x2; //!< \brief integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x3 int2x3; //!< \brief integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x4 int2x4; //!< \brief integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x2 int3x2; //!< \brief integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x3 int3x3; //!< \brief integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x4 int3x4; //!< \brief integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x2 int4x2; //!< \brief integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x3 int4x3; //!< \brief integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x4 int4x4; //!< \brief integer matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + typedef gtc::half_float::half half1; //!< \brief half-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension) + typedef detail::tvec2 half2; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec3 half3; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec4 half4; //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + + typedef gtc::half_float::half half1x1; //!< \brief half-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x2 half2x2; //!< \brief half-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x3 half2x3; //!< \brief half-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x4 half2x4; //!< \brief half-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x2 half3x2; //!< \brief half-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x3 half3x3; //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x4 half3x4; //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x2 half4x2; //!< \brief half-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x3 half4x3; //!< \brief half-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x4 half4x4; //!< \brief half-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + typedef float float1; //!< \brief single-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension) + typedef detail::tvec2 float2; //!< \brief single-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec3 float3; //!< \brief single-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec4 float4; //!< \brief single-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension) + + typedef float float1x1; //!< \brief single-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x2 float2x2; //!< \brief single-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x3 float2x3; //!< \brief single-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x4 float2x4; //!< \brief single-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x2 float3x2; //!< \brief single-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x3 float3x3; //!< \brief single-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x4 float3x4; //!< \brief single-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x2 float4x2; //!< \brief single-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x3 float4x3; //!< \brief single-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x4 float4x4; //!< \brief single-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + typedef double double1; //!< \brief double-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension) + typedef detail::tvec2 double2; //!< \brief double-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec3 double3; //!< \brief double-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tvec4 double4; //!< \brief double-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension) + + typedef double double1x1; //!< \brief double-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x2 double2x2; //!< \brief double-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x3 double2x3; //!< \brief double-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat2x4 double2x4; //!< \brief double-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x2 double3x2; //!< \brief double-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x3 double3x3; //!< \brief double-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat3x4 double3x4; //!< \brief double-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x2 double4x2; //!< \brief double-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x3 double4x3; //!< \brief double-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef detail::tmat4x4 double4x4; //!< \brief double-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + }//namespace compatibility + }//namespace gtx +}//namespace glm + +#define GLM_GTX_compatibility namespace gtx::compatibility +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_compatibility;} +#endif//GLM_GTC_GLOBAL + +#include "compatibility.inl" + +#endif//glm_gtx_compatibility + + + + + + + + + + diff --git a/glm/gtx/compatibility.inl b/glm/gtx/compatibility.inl new file mode 100644 index 00000000..13903696 --- /dev/null +++ b/glm/gtx/compatibility.inl @@ -0,0 +1,141 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-03-16 +// Updated : 2008-10-24 +// Licence : This source is under MIT License +// File : glm/gtx/compatibility.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace compatibility{ + +// isfinite +template +inline bool isfinite( + genType const & x) +{ +#ifdef GLM_COMPILER_VC + return _finite(x); +#else//GLM_COMPILER_GCC + return std::isfinite(x); +#endif +} + +template +inline detail::tvec2 isfinite( + detail::tvec2 const & x) +{ + return detail::tvec2( + isfinite(x.x), + isfinite(x.y)); +} + +template +inline detail::tvec3 isfinite( + detail::tvec3 const & x) +{ + return detail::tvec3( + isfinite(x.x), + isfinite(x.y), + isfinite(x.z)); +} + +template +inline detail::tvec4 isfinite( + detail::tvec4 const & x) +{ + return detail::tvec4( + isfinite(x.x), + isfinite(x.y), + isfinite(x.z), + isfinite(x.w)); +} + +// isinf +template +inline bool isinf( + genType const & x) +{ +#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC)) + return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; +#else + return std::isinf(x); +#endif +} + +template +inline detail::tvec2 isinf( + detail::tvec2 const & x) +{ + return detail::tvec2( + isinf(x.x), + isinf(x.y)); +} + +template +inline detail::tvec3 isinf( + detail::tvec3 const & x) +{ + return detail::tvec3( + isinf(x.x), + isinf(x.y), + isinf(x.z)); +} + +template +inline detail::tvec4 isinf( + detail::tvec4 const & x) +{ + return detail::tvec4( + isinf(x.x), + isinf(x.y), + isinf(x.z), + isinf(x.w)); +} + +// isnan +template +inline bool isnan(genType const & x) +{ +#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC)) + return _isnan(x); +#else + return std::isnan(x); +#endif +} + +template +inline detail::tvec2 isnan( + detail::tvec2 const & x) +{ + return detail::tvec2( + isnan(x.x), + isnan(x.y)); +} + +template +inline detail::tvec3 isnan( + detail::tvec3 const & x) +{ + return detail::tvec3( + isnan(x.x), + isnan(x.y), + isnan(x.z)); +} + +template +inline detail::tvec4 isnan( + detail::tvec4 const & x) +{ + return detail::tvec4( + isnan(x.x), + isnan(x.y), + isnan(x.z), + isnan(x.w)); +} + +}//namespace compatibility +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/component_wise.hpp b/glm/gtx/component_wise.hpp new file mode 100644 index 00000000..6083809c --- /dev/null +++ b/glm/gtx/component_wise.hpp @@ -0,0 +1,64 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-05-21 +// Updated : 2007-05-21 +// Licence : This source is under MIT License +// File : glm/gtx/component_wise.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_component_wise +#define glm_gtx_component_wise + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_component_wise(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_component_wise extension: Operations between components of a type + namespace component_wise + { + //! Add all vector components together. + //! From GLM_GTX_component_wise extension. + template + typename genType::value_type compAdd( + genType const & v); + + //! Multiply all vector components together. + //! From GLM_GTX_component_wise extension. + template + typename genType::value_type compMul( + genType const & v); + + //! Find the minimum value between single vector components. + //! From GLM_GTX_component_wise extension. + template + typename genType::value_type compMin( + genType const & v); + + //! Find the maximum value between single vector components. + //! From GLM_GTX_component_wise extension. + template + typename genType::value_type compMax( + genType const & v); + + }//namespace component_wise + }//namespace gtx +}//namespace glm + +#define GLM_GTX_component_wise namespace gtx::component_wise +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_component_wise;} +#endif//GLM_GTC_GLOBAL + +#include "component_wise.inl" + +#endif//glm_gtx_component_wise diff --git a/glm/gtx/component_wise.inl b/glm/gtx/component_wise.inl new file mode 100644 index 00000000..fb90f390 --- /dev/null +++ b/glm/gtx/component_wise.inl @@ -0,0 +1,88 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-05-21 +// Updated : 2007-05-21 +// Licence : This source is under MIT License +// File : gtx_component_wise.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace component_wise +{ + template + inline typename genType::value_type compAdd(const genType& v) + { + typename genType::size_type result = typename genType::value_type(0); + for(typename genType::size_type i = 0; i < genType::value_size(); ++i) + result += v[i]; + return result; + } +/* + template + inline valType compAdd(const genType& v) + { + valType result = valType(0); + for(sizeType i = 0; i < valSize; ++i) + result += v[i]; + return result; + } +*/ + template + inline typename genType::value_type compMul(const genType& v) + { + typename genType::value_type result = typename genType::value_type(1); + for(typename genType::size_type i = 0; i < genType::value_size(); ++i) + result *= v[i]; + return result; + } +/* + template + inline typename genType::value_type compMul(const genType& v) + { + valType result = valType(0); + for(GLMsizeType i = 0; i < valSize; ++i) + result *= v[i]; + return result; + } +*/ + template + inline typename genType::value_type compMin(const genType& v) + { + typename genType::value_type result = typename genType::value_type(v[0]); + for(typename genType::size_type i = 1; i < genType::value_size(); ++i) + result = min(result, v[i]); + return result; + } +/* + template + inline typename genType::value_type compMin(const genType& v) + { + valType result = valType(0); + for(GLMsizeType i = 0; i < valSize; ++i) + result = min(result, v[i]); + return result; + } +*/ + template + inline typename genType::value_type compMax(const genType& v) + { + typename genType::value_type result = typename genType::value_type(v[0]); + for(typename genType::size_type i = 1; i < genType::value_size(); ++i) + result = max(result, v[i]); + return result; + } +/* + template + inline typename genType::value_type compMax(const genType& v) + { + GLMvalType result = GLMvalType(0); + for(GLMsizeType i = 0; i < GLMvalSize; ++i) + result = max(result, v[i]); + return result; + } +*/ +}//namespace component_wise +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/determinant.hpp b/glm/gtx/determinant.hpp new file mode 100644 index 00000000..0652d58e --- /dev/null +++ b/glm/gtx/determinant.hpp @@ -0,0 +1,43 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2008-04-23 +// Licence : This source is under MIT License +// File : glm/gtx/determinant.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_determinant +#define glm_gtx_determinant + +// Dependency: +#include "../glm.hpp" +#include "../gtc/matrix_operation.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_determinant(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_determinant extension: Compute the determinant of a matrix + namespace determinant + { + using namespace gtc::matrix_operation; + + }//namespace determinant + }//namespace gtx +}//namespace glm + +#define GLM_GTX_determinant namespace gtx::determinant +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_determinant;} +#endif//GLM_GTC_GLOBAL + +#include "determinant.inl" + +#endif//glm_gtx_determinant diff --git a/glm/gtx/determinant.inl b/glm/gtx/determinant.inl new file mode 100644 index 00000000..4d577cec --- /dev/null +++ b/glm/gtx/determinant.inl @@ -0,0 +1,13 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2005-12-21 +// Licence : This source is under MIT License +// File : glm/gtx/determinant.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + +} diff --git a/glm/gtx/double_float.hpp b/glm/gtx/double_float.hpp new file mode 100644 index 00000000..ffbbc0e4 --- /dev/null +++ b/glm/gtx/double_float.hpp @@ -0,0 +1,56 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2008-10-05 +// Licence : This source is under MIT License +// File : glm/gtx/double_float.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTC_double_float +// - GLM_GTX_quaternion +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Note: +// - This implementation doesn't need to redefine all build-in functions to +// support double based type. +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_double_float +#define glm_gtx_double_float + +// Dependency: +#include "../glm.hpp" +#include "../gtc/double_float.hpp" +#include "../gtx/quaternion.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_double_float(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_double_float extension: Add support for double precision flotting-point types + namespace double_float + { + //! Quaternion of single-precision floating-point numbers. + //! From GLM_GTX_double extension. + typedef detail::tquat fquat; + + //! Quaternion of double-precision floating-point numbers. + //! From GLM_GTX_double extension. + typedef detail::tquat dquat; + + }//namespace double_float + }//namespace gtx +}//namespace glm + +#define GLM_GTX_double_float namespace gtc::double_float; using namespace gtx::double_float +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_double_float;} +#endif//GLM_GTX_GLOBAL + +#include "double_float.inl" + +#endif//glm_gtx_double_float diff --git a/glm/gtx/double_float.inl b/glm/gtx/double_float.inl new file mode 100644 index 00000000..6d14a352 --- /dev/null +++ b/glm/gtx/double_float.inl @@ -0,0 +1,13 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-04-29 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtc/double_float.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + +} diff --git a/glm/gtx/epsilon.hpp b/glm/gtx/epsilon.hpp new file mode 100644 index 00000000..524a1199 --- /dev/null +++ b/glm/gtx/epsilon.hpp @@ -0,0 +1,60 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2006-11-13 +// Licence : This source is under MIT License +// File : glm/gtx/epsilon.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_double +// - GLM_GTX_half +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_epsilon +#define glm_gtx_epsilon + +// Dependency: +#include "../glm.hpp" +#include "../gtc/double_float.hpp" +#include "../gtc/half_float.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_epsilon(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_epsilon extension: Comparaison functions for a user defined epsilon values. + namespace epsilon + { + //! Returns the component-wise compare of |x - y| < epsilon. + //! From GLM_GTX_epsilon extension. + template + bool equalEpsilon( + genTypeT const & x, + genTypeT const & y, + genTypeU const & epsilon); + + //! Returns the component-wise compare of |x - y| >= epsilon. + //! From GLM_GTX_epsilon extension. + template + bool notEqualEpsilon( + genTypeT const & x, + genTypeT const & y, + genTypeU const & epsilon); + + }//namespace epsilon + }//namespace gtx +}//namespace glm + +#define GLM_GTX_epsilon namespace gtx::epsilon +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_epsilon;} +#endif//GLM_GTX_GLOBAL + +#include "epsilon.inl" + +#endif//glm_gtx_epsilon diff --git a/glm/gtx/epsilon.inl b/glm/gtx/epsilon.inl new file mode 100644 index 00000000..72600a7d --- /dev/null +++ b/glm/gtx/epsilon.inl @@ -0,0 +1,204 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2006-01-16 +// Licence : This source is under MIT License +// File : glm/gtx/epsilon.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace epsilon{ + +template +inline bool equalEpsilon +( + genType const & x, + genType const & y, + genType const & epsilon +) +{ + return abs(x - y) < epsilon; +} + +template +inline bool notEqualEpsilon +( + genType const & x, + genType const & y, + genType const & epsilon +) +{ + return abs(x - y) >= epsilon; +} + +template +inline detail::tvec2 equalEpsilon +( + detail::tvec2 const & x, + detail::tvec2 const & y, + valType const & epsilon) +{ + return detail::tvec2( + abs(x.x - y.x) < epsilon, + abs(x.y - y.y) < epsilon); +} + +template +inline detail::tvec3 equalEpsilon +( + detail::tvec3 const & x, + detail::tvec3 const & y, + valType const & epsilon) +{ + return detail::tvec3( + abs(x.x - y.x) < epsilon, + abs(x.y - y.y) < epsilon, + abs(x.z - y.z) < epsilon); +} + +template +inline detail::tvec4 equalEpsilon +( + detail::tvec4 const & x, + detail::tvec4 const & y, + valType const & epsilon +) +{ + return detail::tvec4( + abs(x.x - y.x) < epsilon, + abs(x.y - y.y) < epsilon, + abs(x.z - y.z) < epsilon, + abs(x.w - y.w) < epsilon); +} + +template +inline detail::tvec2 notEqualEpsilon +( + detail::tvec2 const & x, + detail::tvec2 const & y, + valType const & epsilon +) +{ + return detail::tvec2( + abs(x.x - y.x) >= epsilon, + abs(x.y - y.y) >= epsilon); +} + +template +inline detail::tvec3 notEqualEpsilon +( + detail::tvec3 const & x, + detail::tvec3 const & y, + valType const & epsilon +) +{ + return detail::tvec3( + abs(x.x - y.x) >= epsilon, + abs(x.y - y.y) >= epsilon, + abs(x.z - y.z) >= epsilon); +} + +template +inline detail::tvec4 notEqualEpsilon +( + detail::tvec4 const & x, + detail::tvec4 const & y, + valType const & epsilon +) +{ + return detail::tvec4( + abs(x.x - y.x) >= epsilon, + abs(x.y - y.y) >= epsilon, + abs(x.z - y.z) >= epsilon, + abs(x.w - y.w) >= epsilon); +} + +template +inline detail::tvec2 equalEpsilon +( + detail::tvec2 const & x, + detail::tvec2 const & y, + detail::tvec2 const & epsilon +) +{ + return detail::tvec2( + abs(x.x - y.x) < epsilon.x, + abs(x.y - y.y) < epsilon.y); +} + +template +inline detail::tvec3 equalEpsilon +( + detail::tvec3 const & x, + detail::tvec3 const & y, + detail::tvec3 const & epsilon +) +{ + return detail::tvec3( + abs(x.x - y.x) < epsilon.x, + abs(x.y - y.y) < epsilon.y, + abs(x.z - y.z) < epsilon.z); +} + +template +inline detail::tvec4 equalEpsilon +( + detail::tvec4 const & x, + detail::tvec4 const & y, + detail::tvec4 const & epsilon +) +{ + return detail::tvec4( + abs(x.x - y.x) < epsilon.x, + abs(x.y - y.y) < epsilon.y, + abs(x.z - y.z) < epsilon.z, + abs(x.w - y.w) < epsilon.w); +} + +template +inline detail::tvec2 notEqualEpsilon +( + detail::tvec2 const & x, + detail::tvec2 const & y, + detail::tvec2 const & epsilon +) +{ + return detail::tvec2( + abs(x.x - y.x) >= epsilon.x, + abs(x.y - y.y) >= epsilon.y); +} + +template +inline detail::tvec3 notEqualEpsilon +( + detail::tvec3 const & x, + detail::tvec3 const & y, + detail::tvec3 const & epsilon +) +{ + return detail::tvec3( + abs(x.x - y.x) >= epsilon.x, + abs(x.y - y.y) >= epsilon.y, + abs(x.z - y.z) >= epsilon.z); +} + +template +inline detail::tvec4 notEqualEpsilon +( + detail::tvec4 const & x, + detail::tvec4 const & y, + detail::tvec4 const & epsilon +) +{ + return detail::tvec4( + abs(x.x - y.x) >= epsilon.x, + abs(x.y - y.y) >= epsilon.y, + abs(x.z - y.z) >= epsilon.z, + abs(x.w - y.w) >= epsilon.w); +} + +}//namespace epsilon +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/euler_angles.hpp b/glm/gtx/euler_angles.hpp new file mode 100644 index 00000000..7888c93c --- /dev/null +++ b/glm/gtx/euler_angles.hpp @@ -0,0 +1,139 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2007-08-14 +// Licence : This source is under MIT License +// File : glm/gtx/euler_angles.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTC_double_float +// - GLM_GTC_half_float +/////////////////////////////////////////////////////////////////////////////////////////////////// +// ToDo: +// - mat2 mat2GTX(const vec2& angles) undefined +// - mat3 mat3GTX(const vec2& angles) undefined +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_euler_angles +#define glm_gtx_euler_angles + +// Dependency: +#include "../glm.hpp" +#include "../gtc/double_float.hpp" +#include "../gtc/half_float.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_euler_angles extension: Build matrices from euler angles. + namespace euler_angles + { + //! Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X. + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 eulerAngleX( + valType const & angleX); + + //! Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y. + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 eulerAngleY( + valType const & angleY); + + //! Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z. + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 eulerAngleZ( + valType const & angleZ); + + //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y). + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 eulerAngleXY( + valType const & angleX, + valType const & angleY); + + //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X). + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 eulerAngleYX( + valType const & angleY, + valType const & angleX); + + //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z). + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 eulerAngleXZ( + valType const & angleX, + valType const & angleZ); + + //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X). + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 eulerAngleZX( + valType const & angleZ, + valType const & angleX); + + //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z). + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 eulerAngleYZ( + valType const & angleY, + valType const & angleZ); + + //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y). + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 eulerAngleZY( + valType const & angleZ, + valType const & angleY); + + //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 eulerAngleYXZ( + valType const & yaw, + valType const & pitch, + valType const & roll); + + //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 yawPitchRoll( + valType const & yaw, + valType const & pitch, + valType const & roll); + + //! Creates a 2D 2 * 2 rotation matrix from an euler angle. + //! From GLM_GTX_euler_angles extension. + template + detail::tmat2x2 orientate2(T const & angle); + + //! Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle. + //! From GLM_GTX_euler_angles extension. + template + detail::tmat3x3 orientate3(T const & angle); + + //! Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z). + //! From GLM_GTX_euler_angles extension. + template + detail::tmat3x3 orientate3(detail::tvec3 const & angles); + + //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). + //! From GLM_GTX_euler_angles extension. + template + detail::tmat4x4 orientate4(detail::tvec3 const & angles); + }//namespace euler_angles + }//namespace gtx +}//namespace glm + +#define GLM_GTX_euler_angles namespace gtx::euler_angles +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_euler_angles;} +#endif//GLM_GTX_GLOBAL + +#include "euler_angles.inl" + +#endif//glm_gtx_euler_angles diff --git a/glm/gtx/euler_angles.inl b/glm/gtx/euler_angles.inl new file mode 100644 index 00000000..fcdc8465 --- /dev/null +++ b/glm/gtx/euler_angles.inl @@ -0,0 +1,249 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2007-08-14 +// Licence : This source is under MIT License +// File : glm/gtx/euler_angles.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace euler_angles{ + +template +inline detail::tmat4x4 eulerAngleX +( + valType const & angleX +) +{ + valType cosX = glm::cos(angleX); + valType sinX = glm::sin(angleX); + + return detail::tmat4x4( + valType(1), valType(0), valType(0), valType(0), + valType(0), cosX, sinX, valType(0), + valType(0),-sinX, cosX, valType(0), + valType(0), valType(0), valType(0), valType(1)); +} + +template +inline detail::tmat4x4 eulerAngleY +( + valType const & angleY +) +{ + valType cosY = glm::cos(angleY); + valType sinY = glm::sin(angleY); + + return detail::tmat4x4( + cosY, valType(0), sinY, valType(0), + valType(0), valType(1), valType(0), valType(0), + -sinY, valType(0), cosY, valType(0), + valType(0), valType(0), valType(0), valType(1)); +} + +template +inline detail::tmat4x4 eulerAngleZ +( + valType const & angleZ +) +{ + valType cosZ = glm::cos(angleZ); + valType sinZ = glm::sin(angleZ); + + return detail::tmat4x4( + cosZ, sinZ, valType(0), valType(0), + -sinZ, cosZ, valType(0), valType(0), + valType(0), valType(0), valType(1), valType(0), + valType(0), valType(0), valType(0), valType(1)); +} + +template +inline detail::tmat4x4 eulerAngleXY +( + valType const & angleX, + valType const & angleY +) +{ + valType cosX = glm::cos(angleX); + valType sinX = glm::sin(angleX); + valType cosY = glm::cos(angleY); + valType sinY = glm::sin(angleY); + + return detail::tmat4x4( + cosY, -sinX * sinY, cosX * sinY, valType(0), + valType(0), cosX, sinX, valType(0), + -sinY , -sinX * cosY, cosX * cosY, valType(0), + valType(0), valType(0), valType(0), valType(1)); +} + +template +inline detail::tmat4x4 eulerAngleYX +( + valType const & angleY, + valType const & angleX +) +{ + valType cosX = glm::cos(angleX); + valType sinX = glm::sin(angleX); + valType cosY = glm::cos(angleY); + valType sinY = glm::sin(angleY); + + return detail::tmat4x4( + cosY, valType(0), sinY, valType(0), + -sinX * sinY, cosX, sinX * cosY, valType(0), + -cosX * sinY, -sinX, cosX * cosY, valType(0), + valType(0), valType(0), valType(0), valType(1)); +} + +template +inline detail::tmat4x4 eulerAngleXZ +( + valType const & angleX, + valType const & angleZ +) +{ + return eulerAngleX(angleX) * eulerAngleZ(angleZ); +} + +template +inline detail::tmat4x4 eulerAngleZX +( + valType const & angleZ, + valType const & angleX +) +{ + return eulerAngleZ(angleZ) * eulerAngleX(angleX); +} + +template +inline detail::tmat4x4 eulerAngleYXZ +( + valType const & yaw, + valType const & pitch, + valType const & roll +) +{ + valType tmp_ch = glm::cos(yaw); + valType tmp_sh = glm::sin(yaw); + valType tmp_cp = glm::cos(pitch); + valType tmp_sp = glm::sin(pitch); + valType tmp_cb = glm::cos(roll); + valType tmp_sb = glm::sin(roll); + + detail::tmat4x4 Result; + Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; + Result[0][1] = tmp_sb * tmp_cp; + Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; + Result[0][3] = valType(0); + Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; + Result[1][1] = tmp_cb * tmp_cp; + Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; + Result[1][3] = valType(0); + Result[2][0] = tmp_sh * tmp_cp; + Result[2][1] = -tmp_sp; + Result[2][2] = tmp_ch * tmp_cp; + Result[2][3] = valType(0); + Result[3][0] = valType(0); + Result[3][1] = valType(0); + Result[3][2] = valType(0); + Result[3][3] = valType(1); + return Result; +} + +template +inline detail::tmat4x4 yawPitchRoll +( + valType const & yaw, + valType const & pitch, + valType const & roll +) +{ + valType tmp_ch = glm::cos(yaw); + valType tmp_sh = glm::sin(yaw); + valType tmp_cp = glm::cos(pitch); + valType tmp_sp = glm::sin(pitch); + valType tmp_cb = glm::cos(roll); + valType tmp_sb = glm::sin(roll); + + detail::tmat4x4 Result; + Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; + Result[0][1] = tmp_sb * tmp_cp; + Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; + Result[0][3] = valType(0); + Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; + Result[1][1] = tmp_cb * tmp_cp; + Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; + Result[1][3] = valType(0); + Result[2][0] = tmp_sh * tmp_cp; + Result[2][1] = -tmp_sp; + Result[2][2] = tmp_ch * tmp_cp; + Result[2][3] = valType(0); + Result[3][0] = valType(0); + Result[3][1] = valType(0); + Result[3][2] = valType(0); + Result[3][3] = valType(1); + return Result; +} + +template +inline detail::tmat2x2 orientate2 +( + valType const & angle +) +{ + valType c = glm::cos(angle); + valType s = glm::sin(angle); + + detail::tmat2x2 Result; + Result[0][0] = c; + Result[0][1] = s; + Result[1][0] = -s; + Result[1][1] = c; + return Result; +} + +template +inline detail::tmat3x3 orientate3 +( + valType const & angle +) +{ + valType c = glm::cos(angle); + valType s = glm::sin(angle); + + detail::tmat3x3 Result; + Result[0][0] = c; + Result[0][1] = s; + Result[0][2] = 0.0f; + Result[1][0] = -s; + Result[1][1] = c; + Result[1][2] = 0.0f; + Result[2][0] = 0.0f; + Result[2][1] = 0.0f; + Result[2][2] = 1.0f; + return Result; +} + +template +inline detail::tmat3x3 orientate3 +( + detail::tvec3 const & angles +) +{ + return detail::tmat3x3(yawPitchRoll(angles.x, angles.y, angles.z)); +} + +template +inline detail::tmat4x4 orientate4 +( + detail::tvec3 const & angles +) +{ + return yawPitchRoll(angles.z, angles.x, angles.y); +} + +}//namespace euler_angles +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/extend.hpp b/glm/gtx/extend.hpp new file mode 100644 index 00000000..d9a02313 --- /dev/null +++ b/glm/gtx/extend.hpp @@ -0,0 +1,48 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-07 +// Updated : 2006-11-13 +// Licence : This source is under MIT License +// File : glm/gtx/extend.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_extend +#define glm_gtx_extend + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_extend(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_extend extension: Extend a position from a source to a position at a defined length. + namespace extend + { + //! Extends of Length the Origin position using the (Source - Origin) direction. + //! From GLM_GTX_extend extension. + template + genType extend( + genType const & Origin, + genType const & Source, + typename genType::value_type const Length); + + }//namespace extend + }//namespace gtx +}//namespace glm + +#define GLM_GTX_extend namespace gtx::extend +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_extend;} +#endif//GLM_GTX_GLOBAL + +#include "extend.inl" + +#endif//glm_gtx_extend diff --git a/glm/gtx/extend.inl b/glm/gtx/extend.inl new file mode 100644 index 00000000..e78e7a80 --- /dev/null +++ b/glm/gtx/extend.inl @@ -0,0 +1,60 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-07 +// Updated : 2008-10-05 +// Licence : This source is under MIT License +// File : glm/gtx/extend.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace extend{ + +template +genType extend +( + genType const & Origin, + genType const & Source, + genType const & Distance +) +{ + return Origin + (Source - Origin) * Distance; +} + +template +detail::tvec2 extend +( + detail::tvec2 const & Origin, + detail::tvec2 const & Source, + valType const & Distance +) +{ + return Origin + (Source - Origin) * Distance; +} + +template +detail::tvec3 extend +( + detail::tvec3 const & Origin, + detail::tvec3 const & Source, + valType const & Distance +) +{ + return Origin + (Source - Origin) * Distance; +} + +template +detail::tvec4 extend +( + detail::tvec4 const & Origin, + detail::tvec4 const & Source, + valType const & Distance +) +{ + return Origin + (Source - Origin) * Distance; +} + +}//namespace extend +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/extented_min_max.hpp b/glm/gtx/extented_min_max.hpp new file mode 100644 index 00000000..500054f9 --- /dev/null +++ b/glm/gtx/extented_min_max.hpp @@ -0,0 +1,82 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-03-14 +// Updated : 2007-08-14 +// Licence : This source is under MIT License +// File : gtx_extented_min_max.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_half_float +// - GLM_GTX_double_float +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_extented_min_max +#define glm_gtx_extented_min_max + +// Dependency: +#include "../glm.hpp" +#include "../gtc/half_float.hpp" +#include "../gtc/double_float.hpp" + +namespace glm +{ + namespace test{ + void main_ext_gtx_extented_min_max(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_extented_min_max extension: Min and max functions for 3 to 4 parameters. + namespace extented_min_max + { + template T min(const T x, const T y, const T z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + template T min(const T x, const T y, const T z, const T w); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + + template detail::tvec2 min(const detail::tvec2& x, const T y, const T z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec3 min(const detail::tvec3& x, const T y, const T z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec4 min(const detail::tvec4& x, const T y, const T z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + + template detail::tvec2 min(const detail::tvec2& x, const T y, const T z, const T w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec3 min(const detail::tvec3& x, const T y, const T z, const T w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec4 min(const detail::tvec4& x, const T y, const T z, const T w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + + template detail::tvec2 min(const detail::tvec2& x, const detail::tvec2& y, const detail::tvec2& z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec3 min(const detail::tvec3& x, const detail::tvec3& y, const detail::tvec3& z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec4 min(const detail::tvec4& x, const detail::tvec4& y, const detail::tvec4& z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + + template detail::tvec2 min(const detail::tvec2& x, const detail::tvec2& y, const detail::tvec2& z, const detail::tvec2& w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec3 min(const detail::tvec3& x, const detail::tvec3& y, const detail::tvec3& z, const detail::tvec3& w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec4 min(const detail::tvec4& x, const detail::tvec4& y, const detail::tvec4& z, const detail::tvec4& w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + + template T max(const T x, const T y, const T z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + template T max(const T x, const T y, const T z, const T w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + + template detail::tvec2 max(const detail::tvec2& x, const T y, const T z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec3 max(const detail::tvec3& x, const T y, const T z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec4 max(const detail::tvec4& x, const T y, const T z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + + template detail::tvec2 max(const detail::tvec2& x, const T y, const T z, const T w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec3 max(const detail::tvec3& x, const T y, const T z, const T w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec4 max(const detail::tvec4& x, const T y, const T z, const T w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + + template detail::tvec2 max(const detail::tvec2& x, const detail::tvec2& y, const detail::tvec2& z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec3 max(const detail::tvec3& x, const detail::tvec3& y, const detail::tvec3& z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec4 max(const detail::tvec4& x, const detail::tvec4& y, const detail::tvec4& z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) + + template detail::tvec2 max(const detail::tvec2& x, const detail::tvec2& y, const detail::tvec2& z, const detail::tvec2& w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec3 max(const detail::tvec3& x, const detail::tvec3& y, const detail::tvec3& z, const detail::tvec3& w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + template detail::tvec4 max(const detail::tvec4& x, const detail::tvec4& y, const detail::tvec4& z, const detail::tvec4& w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) + + }//namespace extented_min_max + }//namespace gtx +}//namespace glm + +#define GLM_GTX_extented_min_max namespace gtx::extented_min_max +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_extented_min_max;} +#endif//GLM_GTX_GLOBAL + +#include "extented_min_max.inl" + +#endif//glm_gtx_extented_min_max diff --git a/glm/gtx/extented_min_max.inl b/glm/gtx/extented_min_max.inl new file mode 100644 index 00000000..c2f6323f --- /dev/null +++ b/glm/gtx/extented_min_max.inl @@ -0,0 +1,282 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-03-14 +// Updated : 2007-03-14 +// Licence : This source is under MIT License +// File : gtx_extented_min_max.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace extented_min_max +{ + template + inline T min( + const T x, + const T y, + const T z) + { + return min(min(x, y), z); + } + + template + inline T min( + const T x, + const T y, + const T z, + const T w) + { + return min(min(x, y), min(z, w)); + } + + template + inline detail::tvec2 min( + const detail::tvec2& x, + const T y, + const T z) + { + return min(x, min(y, z)); + } + + template + inline detail::tvec3 min( + const detail::tvec3& x, + const T y, + const T z) + { + return min(x, min(y, z)); + } + + template + inline detail::tvec4 min( + const detail::tvec4& x, + const T y, + const T z) + { + return min(x, min(y, z)); + } + + template + inline detail::tvec2 min( + const detail::tvec2& x, + const T y, + const T z, + const T w) + { + return min(x, min(y, min(z, w))); + } + + template + inline detail::tvec3 min( + const detail::tvec3& x, + const T y, + const T z, + const T w) + { + return min(x, min(y, min(z, w))); + } + + template + inline detail::tvec4 min( + const detail::tvec4& x, + const T y, + const T z, + const T w) + { + return min(x, min(y, min(z, w))); + } + + template + inline detail::tvec2 min( + const detail::tvec2& x, + const detail::tvec2& y, + const detail::tvec2& z) + { + return min(x, min(y, z)); + } + + template + inline detail::tvec3 min( + const detail::tvec3& x, + const detail::tvec3& y, + const detail::tvec3& z) + { + return min(x, min(y, z)); + } + + template + inline detail::tvec4 min( + const detail::tvec4& x, + const detail::tvec4& y, + const detail::tvec4& z) + { + return min(x, min(y, z)); + } + + template + inline detail::tvec2 min( + const detail::tvec2& x, + const detail::tvec2& y, + const detail::tvec2& z, + const detail::tvec2& w) + { + return min(min(x, y), min(z, w)); + } + + template + inline detail::tvec3 min( + const detail::tvec3& x, + const detail::tvec3& y, + const detail::tvec3& z, + const detail::tvec3& w) + { + return min(min(x, y), min(z, w)); + } + + template + inline detail::tvec4 min( + const detail::tvec4& x, + const detail::tvec4& y, + const detail::tvec4& z, + const detail::tvec4& w) + { + return min(min(x, y), min(z, w)); + } + + template + inline T max( + const T x, + const T y, + const T z) + { + return max(max(x, y), z); + } + + template + inline T max( + const T x, + const T y, + const T z, + const T w) + { + return max(max(x, y), max(z, w)); + } + + template + inline detail::tvec2 max( + const detail::tvec2& x, + const T y, + const T z) + { + return max(x, max(y, z)); + } + + template + inline detail::tvec3 max( + const detail::tvec3& x, + const T y, + const T z) + { + return max(x, max(y, z)); + } + + template + inline detail::tvec4 max( + const detail::tvec4& x, + const T y, + const T z) + { + return max(x, max(y, z)); + } + + template + inline detail::tvec2 max( + const detail::tvec2& x, + const T y, + const T z, + const T w) + { + return max(max(x, y), max(z, w)); + } + + template + inline detail::tvec3 max( + const detail::tvec3& x, + const T y, + const T z, + const T w) + { + return max(max(x, y), max(z, w)); + } + + template + inline detail::tvec4 max( + const detail::tvec4& x, + const T y, + const T z, + const T w) + { + return max(max(x, y), max(z, w)); + } + + template + inline detail::tvec2 max( + const detail::tvec2& x, + const detail::tvec2& y, + const detail::tvec2& z) + { + return max(max(x, y), z); + } + + template + inline detail::tvec3 max( + const detail::tvec3& x, + const detail::tvec3& y, + const detail::tvec3& z) + { + return max(max(x, y), z); + } + + template + inline detail::tvec4 max( + const detail::tvec4& x, + const detail::tvec4& y, + const detail::tvec4& z) + { + return max(max(x, y), z); + } + + template + inline detail::tvec2 max( + const detail::tvec2& x, + const detail::tvec2& y, + const detail::tvec2& z, + const detail::tvec2& w) + { + return max(max(x, y), max(z, w)); + } + + template + inline detail::tvec3 max( + const detail::tvec3& x, + const detail::tvec3& y, + const detail::tvec3& z, + const detail::tvec3& w) + { + return max(max(x, y), max(z, w)); + } + + template + inline detail::tvec4 max( + const detail::tvec4& x, + const detail::tvec4& y, + const detail::tvec4& z, + const detail::tvec4& w) + { + return max(max(x, y), max(z, w)); + } + +}//namespace extented_min_max +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/fast_exponential.hpp b/glm/gtx/fast_exponential.hpp new file mode 100644 index 00000000..2af84ee9 --- /dev/null +++ b/glm/gtx/fast_exponential.hpp @@ -0,0 +1,86 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-09 +// Updated : 2006-11-13 +// Licence : This source is under MIT License +// File : glm/gtx/fast_exponential.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_half +// - GLM_GTX_double +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_fast_exponential +#define glm_gtx_fast_exponential + +// Dependency: +#include "../glm.hpp" +#include "../gtc/half_float.hpp" +#include "../gtc/double_float.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_fast_exponential(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_fast_exponential extension: Fast but less accurate implementations of exponential based functions. + namespace fast_exponential + { + using namespace gtc::half_float; + using namespace gtc::double_float; + + //! Faster than the common pow function but less accurate. + //! From GLM_GTX_fast_exponential extension. + template + valType fastPow( + valType const & x, + valType const & y); + + //! Faster than the common pow function but less accurate. + //! From GLM_GTX_fast_exponential extension. + template + T fastPow( + const T& x, + const U& y); + + //! Faster than the common exp function but less accurate. + //! From GLM_GTX_fast_exponential extension. + template + T fastExp(const T& x); + + //! Faster than the common log function but less accurate. + //! From GLM_GTX_fast_exponential extension. + template + T fastLog(const T& x); + + //! Faster than the common exp2 function but less accurate. + //! From GLM_GTX_fast_exponential extension. + template + T fastExp2(const T& x); + + //! Faster than the common log2 function but less accurate. + //! From GLM_GTX_fast_exponential extension. + template + T fastLog2(const T& x); + + //! Faster than the common ln function but less accurate. + //! From GLM_GTX_fast_exponential extension. + template + T fastLn(const T& x); + + }//namespace fast_exponential + }//namespace gtx +}//namespace glm + +#define GLM_GTX_fast_exponential namespace gtx::fast_exponential +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_fast_exponential;} +#endif//GLM_GTX_GLOBAL + +#include "fast_exponential.inl" + +#endif//glm_gtx_fast_exponential diff --git a/glm/gtx/fast_exponential.inl b/glm/gtx/fast_exponential.inl new file mode 100644 index 00000000..6c0ec1cd --- /dev/null +++ b/glm/gtx/fast_exponential.inl @@ -0,0 +1,294 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-09 +// Updated : 2006-01-09 +// Licence : This source is under MIT License +// File : glm/gtx/fast_exponential.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace fast_exponential +{ + // fastPow: + template + inline T fastPow(const T x, const T y) + { + return exp(y * log(x)); + } + + template + inline detail::tvec2 fastPow( + const detail::tvec2& x, + const detail::tvec2& y) + { + return detail::tvec2( + fastPow(x.x, y.x), + fastPow(x.y, y.y)); + } + + template + inline detail::tvec3 fastPow( + const detail::tvec3& x, + const detail::tvec3& y) + { + return detail::tvec3( + fastPow(x.x, y.x), + fastPow(x.y, y.y), + fastPow(x.z, y.z)); + } + + template + inline detail::tvec4 fastPow( + const detail::tvec4& x, + const detail::tvec4& y) + { + return detail::tvec4( + fastPow(x.x, y.x), + fastPow(x.y, y.y), + fastPow(x.z, y.z), + fastPow(x.w, y.w)); + } + + template + inline T fastPow(const T x, int y) + { + T f = T(1); + for(int i = 0; i < y; ++i) + f *= x; + return f; + } + + template + inline detail::tvec2 fastPow( + const detail::tvec2& x, + const detail::tvec2& y) + { + return detail::tvec2( + fastPow(x.x, y.x), + fastPow(x.y, y.y)); + } + + template + inline detail::tvec3 fastPow( + const detail::tvec3& x, + const detail::tvec3& y) + { + return detail::tvec3( + fastPow(x.x, y.x), + fastPow(x.y, y.y), + fastPow(x.z, y.z)); + } + + template + inline detail::tvec4 fastPow( + const detail::tvec4& x, + const detail::tvec4& y) + { + return detail::tvec4( + fastPow(x.x, y.x), + fastPow(x.y, y.y), + fastPow(x.z, y.z), + fastPow(x.w, y.w)); + } + + // fastExp + // Note: This function provides accurate results only for value between -1 and 1, else avoid it. + template + inline T fastExp(const T x) + { + // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. + // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); + T x2 = x * x; + T x3 = x2 * x; + T x4 = x3 * x; + T x5 = x4 * x; + return T(1) + x + (x2 * T(0.5)) + (x3 * T(0.1666666667)) + (x4 * T(0.041666667)) + (x5 * T(0.008333333333)); + } +/* // Try to handle all values of float... but often shower than std::exp, glm::floor and the loop kill the performance + inline float fastExp(float x) + { + const float e = 2.718281828f; + const float IntegerPart = floor(x); + const float FloatPart = x - IntegerPart; + float z = 1.f; + + for(int i = 0; i < int(IntegerPart); ++i) + z *= e; + + const float x2 = FloatPart * FloatPart; + const float x3 = x2 * FloatPart; + const float x4 = x3 * FloatPart; + const float x5 = x4 * FloatPart; + return z * (1.0f + FloatPart + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)); + } + + // Increase accuracy on number bigger that 1 and smaller than -1 but it's not enough for high and negative numbers + inline float fastExp(float x) + { + // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. + // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); + float x2 = x * x; + float x3 = x2 * x; + float x4 = x3 * x; + float x5 = x4 * x; + float x6 = x5 * x; + float x7 = x6 * x; + float x8 = x7 * x; + return 1.0f + x + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)+ (x6 * 0.00138888888888f) + (x7 * 0.000198412698f) + (x8 * 0.0000248015873f);; + } +*/ + template + inline detail::tvec2 fastExp( + const detail::tvec2& x) + { + return detail::tvec2( + fastExp(x.x), + fastExp(x.y)); + } + + template + inline detail::tvec3 fastExp( + const detail::tvec3& x) + { + return detail::tvec3( + fastExp(x.x), + fastExp(x.y), + fastExp(x.z)); + } + + template + inline detail::tvec4 fastExp( + const detail::tvec4& x) + { + return detail::tvec4( + fastExp(x.x), + fastExp(x.y), + fastExp(x.z), + fastExp(x.w)); + } + + // fastLog + template + inline T fastLog(const T x) + { + return std::log(x); + } + + /* Slower than the VC7.1 function... + inline float fastLog(float x) + { + float y1 = (x - 1.0f) / (x + 1.0f); + float y2 = y1 * y1; + return 2.0f * y1 * (1.0f + y2 * (0.3333333333f + y2 * (0.2f + y2 * 0.1428571429f))); + } + */ + + template + inline detail::tvec2 fastLog( + const detail::tvec2& x) + { + return detail::tvec2( + fastLog(x.x), + fastLog(x.y)); + } + + template + inline detail::tvec3 fastLog( + const detail::tvec3& x) + { + return detail::tvec3( + fastLog(x.x), + fastLog(x.y), + fastLog(x.z)); + } + + template + inline detail::tvec4 fastLog( + const detail::tvec4& x) + { + return detail::tvec4( + fastLog(x.x), + fastLog(x.y), + fastLog(x.z), + fastLog(x.w)); + } + + //fastExp2, ln2 = 0.69314718055994530941723212145818f + template + inline T fastExp2(const T x) + { + return fastExp(0.69314718055994530941723212145818f * x); + } + + template + inline detail::tvec2 fastExp2( + const detail::tvec2& x) + { + return detail::tvec2( + fastExp2(x.x), + fastExp2(x.y)); + } + + template + inline detail::tvec3 fastExp2( + const detail::tvec3& x) + { + return detail::tvec3( + fastExp2(x.x), + fastExp2(x.y), + fastExp2(x.z)); + } + + template + inline detail::tvec4 fastExp2( + const detail::tvec4& x) + { + return detail::tvec4( + fastExp2(x.x), + fastExp2(x.y), + fastExp2(x.z), + fastExp2(x.w)); + } + + // fastLog2, ln2 = 0.69314718055994530941723212145818f + template + inline T fastLog2(const T x) + { + return fastLog(x) / 0.69314718055994530941723212145818f; + } + + template + inline detail::tvec2 fastLog2( + const detail::tvec2& x) + { + return detail::tvec2( + fastLog2(x.x), + fastLog2(x.y)); + } + + template + inline detail::tvec3 fastLog2( + const detail::tvec3& x) + { + return detail::tvec3( + fastLog2(x.x), + fastLog2(x.y), + fastLog2(x.z)); + } + + template + inline detail::tvec4 fastLog2( + const detail::tvec4& x) + { + return detail::tvec4( + fastLog2(x.x), + fastLog2(x.y), + fastLog2(x.z), + fastLog2(x.w)); + } + +}//namespace fast_exponential +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/fast_square_root.hpp b/glm/gtx/fast_square_root.hpp new file mode 100644 index 00000000..b9c0eb5c --- /dev/null +++ b/glm/gtx/fast_square_root.hpp @@ -0,0 +1,69 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-04 +// Updated : 2008-10-07 +// Licence : This source is under MIT License +// File : glm/gtx/fast_square_root.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Note: +// - Sqrt optimisation based on Newton's method, +// www.gamedev.net/community/forums/topic.asp?topic id=139956 +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_fast_square_root +#define glm_gtx_fast_square_root + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_fast_square_root(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_fast_square_root extension: Fast but less accurate implementations of square root based functions. + namespace fast_square_root + { + //! Faster than the common sqrt function but less accurate. + //! From GLM_GTX_fast_square_root extension. + template + genType fastSqrt(genType const & x); + + //! Faster than the common inversesqrt function but less accurate. + //! From GLM_GTX_fast_square_root extension. + template + genType fastInverseSqrt(genType const & x); + + //! Faster than the common length function but less accurate. + //! From GLM_GTX_fast_square_root extension. + template + typename genType::value_type fastLength(genType const & x); + + //! Faster than the common distance function but less accurate. + //! From GLM_GTX_fast_square_root extension. + template + typename genType::value_type fastDistance(genType const & x, genType const & y); + + //! Faster than the common normalize function but less accurate. + //! From GLM_GTX_fast_square_root extension. + template + genType fastNormalize(genType const & x); + + }//namespace fast_square_root + }// namespace gtx +}//namespace glm + +#define GLM_GTX_fast_square_root namespace gtx::fast_square_root +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_fast_square_root;} +#endif//GLM_GTX_GLOBAL + +#include "fast_square_root.inl" + +#endif//glm_gtx_fast_square_root diff --git a/glm/gtx/fast_square_root.inl b/glm/gtx/fast_square_root.inl new file mode 100644 index 00000000..737e8f3a --- /dev/null +++ b/glm/gtx/fast_square_root.inl @@ -0,0 +1,237 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-04 +// Updated : 2008-10-07 +// Licence : This source is under MIT License +// File : glm/gtx/fast_square_root.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace fast_square_root{ + +// fastSqrt +template +inline genType fastSqrt +( + genType const & x +) +{ + return genType(1) / fastInverseSqrt(x); +} + +template +inline detail::tvec2 fastSqrt +( + detail::tvec2 const & x +) +{ + return detail::tvec2( + fastSqrt(x.x), + fastSqrt(x.y)); +} + +template +inline detail::tvec3 fastSqrt +( + detail::tvec3 const & x +) +{ + return detail::tvec3( + fastSqrt(x.x), + fastSqrt(x.y), + fastSqrt(x.z)); +} + +template +inline detail::tvec4 fastSqrt +( + detail::tvec4 const & x +) +{ + return detail::tvec4( + fastSqrt(x.x), + fastSqrt(x.y), + fastSqrt(x.z), + fastSqrt(x.w)); +} + +// fastInversesqrt +template +inline genType fastInverseSqrt +( + genType const & x +) +{ + genType tmp = x; + float xhalf = 0.5f * float(tmp); + uint i = *(uint*)&x; + i = 0x5f375a86 - (i >> 1); + //x = *(float*)&i; + //x = *((float*)(char*)&i); + tmp = detail::uif(i).f; + tmp = tmp * (1.5f - xhalf * tmp * tmp); + return genType(tmp); +} + +template +inline detail::tvec2 fastInverseSqrt +( + detail::tvec2 const & x +) +{ + return detail::tvec2( + fastInverseSqrt(x.x), + fastInverseSqrt(x.y)); +} + +template +inline detail::tvec3 fastInverseSqrt +( + detail::tvec3 const & x +) +{ + return detail::tvec3( + fastInverseSqrt(x.x), + fastInverseSqrt(x.y), + fastInverseSqrt(x.z)); +} + +template +inline detail::tvec4 fastInverseSqrt +( + detail::tvec4 const & x +) +{ + return detail::tvec4( + fastInverseSqrt(x.x), + fastInverseSqrt(x.y), + fastInverseSqrt(x.z), + fastInverseSqrt(x.w)); +} + +// fastLength +template +inline genType fastLength +( + genType const & x +) +{ + return abs(x); +} + +template +inline valType fastLength +( + detail::tvec2 const & x +) +{ + valType sqr = x.x * x.x + x.y * x.y; + return fastSqrt(sqr); +} + +template +inline valType fastLength +( + detail::tvec3 const & x +) +{ + valType sqr = x.x * x.x + x.y * x.y + x.z * x.z; + return fastSqrt(sqr); +} + +template +inline valType fastLength +( + detail::tvec4 const & x +) +{ + valType sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; + return fastSqrt(sqr); +} + +// fastDistance +template +inline genType fastDistance +( + genType const & x, + genType const & y +) +{ + return fastLength(y - x); +} + +template +inline valType fastDistance +( + detail::tvec2 const & x, + detail::tvec2 const & y +) +{ + return fastLength(y - x); +} + +template +inline valType fastDistance +( + detail::tvec3 const & x, + detail::tvec3 const & y +) +{ + return fastLength(y - x); +} + +template +inline valType fastDistance +( + detail::tvec4 const & x, + detail::tvec4 const & y +) +{ + return fastLength(y - x); +} + +// fastNormalize +template +inline genType fastNormalize +( + genType const & x +) +{ + return x > genType(0) ? genType(1) : -genType(1); +} + +template +inline detail::tvec2 fastNormalize +( + detail::tvec2 const & x +) +{ + valType sqr = x.x * x.x + x.y * x.y; + return x * fastInverseSqrt(sqr); +} + +template +inline detail::tvec3 fastNormalize +( + detail::tvec3 const & x +) +{ + valType sqr = x.x * x.x + x.y * x.y + x.z * x.z; + return x * fastInverseSqrt(sqr); +} + +template +inline detail::tvec4 fastNormalize +( + detail::tvec4 const & x +) +{ + valType sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; + return x * fastInverseSqrt(sqr); +} + +}//namespace fast_square_root +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/fast_trigonometry.hpp b/glm/gtx/fast_trigonometry.hpp new file mode 100644 index 00000000..732b4a41 --- /dev/null +++ b/glm/gtx/fast_trigonometry.hpp @@ -0,0 +1,82 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-08 +// Updated : 2006-11-13 +// Licence : This source is under MIT License +// File : glm/gtx/fast_trigonometry.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_fast_trigonometry +#define glm_gtx_fast_trigonometry + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_fast_trigonometry(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_fast_trigonometry extension: Fast but less accurate implementations of trigonometric functions. + namespace fast_trigonometry + { + //! Faster than the common sin function but less accurate. + //! Defined between -2pi and 2pi. + //! From GLM_GTX_fast_trigonometry extension. + template + T fastSin(const T& angle); + + //! Faster than the common cos function but less accurate. + //! Defined between -2pi and 2pi. + //! From GLM_GTX_fast_trigonometry extension. + template + T fastCos(const T& angle); + + //! Faster than the common tan function but less accurate. + //! Defined between -2pi and 2pi. + //! From GLM_GTX_fast_trigonometry extension. + template + T fastTan(const T& angle); + + //! Faster than the common asin function but less accurate. + //! Defined between -2pi and 2pi. + //! From GLM_GTX_fast_trigonometry extension. + template + T fastAsin(const T& angle); + + //! Faster than the common acos function but less accurate. + //! Defined between -2pi and 2pi. + //! From GLM_GTX_fast_trigonometry extension. + template + T fastAcos(const T& angle); + + //! Faster than the common atan function but less accurate. + //! Defined between -2pi and 2pi. + //! From GLM_GTX_fast_trigonometry extension. + template + T fastAtan(const T& y, const T& x); + + //! Faster than the common atan function but less accurate. + //! Defined between -2pi and 2pi. + //! From GLM_GTX_fast_trigonometry extension. + template + T fastAtan(const T& angle); + + }//namespace fast_trigonometry + }//namespace gtx +}//namespace glm + +#define GLM_GTX_fast_trigonometry namespace gtx::fast_trigonometry +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_fast_trigonometry;} +#endif//GLM_GTX_GLOBAL + +#include "fast_trigonometry.inl" + +#endif//glm_gtx_fast_trigonometry diff --git a/glm/gtx/fast_trigonometry.inl b/glm/gtx/fast_trigonometry.inl new file mode 100644 index 00000000..4b37c27f --- /dev/null +++ b/glm/gtx/fast_trigonometry.inl @@ -0,0 +1,272 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-08 +// Updated : 2006-01-08 +// Licence : This source is under MIT License +// File : glm/gtx/fast_trigonometry.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace fast_trigonometry +{ + // sin + template + inline T fastSin(const T x) + { + return x - ((x * x * x) / T(6)) + ((x * x * x * x * x) / T(120)) - ((x * x * x * x * x * x * x) / T(5040)); + } + + template + inline detail::tvec2 fastSin( + const detail::tvec2& x) + { + return detail::tvec2( + fastSin(x.x), + fastSin(x.y)); + } + + template + inline detail::tvec3 fastSin( + const detail::tvec3& x) + { + return detail::tvec3( + fastSin(x.x), + fastSin(x.y), + fastSin(x.z)); + } + + template + inline detail::tvec4 fastSin( + const detail::tvec4& x) + { + return detail::tvec4( + fastSin(x.x), + fastSin(x.y), + fastSin(x.z), + fastSin(x.w)); + } + + // cos + template + inline T fastCos(const T x) + { + return T(1) - (x * x * T(0.5)) + (x * x * x * x * T(0.041666666666)) - (x * x * x * x * x * x * T(0.00138888888888)); + } + + template + inline detail::tvec2 fastCos( + const detail::tvec2& x) + { + return detail::tvec2( + fastCos(x.x), + fastCos(x.y)); + } + + template + inline detail::tvec3 fastCos( + const detail::tvec3& x) + { + return detail::tvec3( + fastCos(x.x), + fastCos(x.y), + fastCos(x.z)); + } + + template + inline detail::tvec4 fastCos( + const detail::tvec4& x) + { + return detail::tvec4( + fastCos(x.x), + fastCos(x.y), + fastCos(x.z), + fastCos(x.w)); + } + + // tan + template + inline T fastTan(const T x) + { + 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)); + } + + template + inline detail::tvec2 fastTan( + const detail::tvec2& x) + { + return detail::tvec2( + fastTan(x.x), + fastTan(x.y)); + } + + template + inline detail::tvec3 fastTan( + const detail::tvec3& x) + { + return detail::tvec3( + fastTan(x.x), + fastTan(x.y), + fastTan(x.z)); + } + + template + inline detail::tvec4 fastTan( + const detail::tvec4& x) + { + return detail::tvec4( + fastTan(x.x), + fastTan(x.y), + fastTan(x.z), + fastTan(x.w)); + } + + // asin + template + inline T fastAsin(const T x) + { + 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)); + } + + template detail::tvec2 fastAsin( + const detail::tvec2& x) + { + return detail::tvec2( + fastAsin(x.x), + fastAsin(x.y)); + } + + template detail::tvec3 fastAsin( + const detail::tvec3& x) + { + return detail::tvec3( + fastAsin(x.x), + fastAsin(x.y), + fastAsin(x.z)); + } + + template detail::tvec4 fastAsin( + const detail::tvec4& x) + { + return detail::tvec4( + fastAsin(x.x), + fastAsin(x.y), + fastAsin(x.z), + fastAsin(x.w)); + } + + // acos + template + inline T fastAcos(const T x) + { + return T(1.5707963267948966192313216916398) - fastAsin(x); //(PI / 2) + } + + template detail::tvec2 fastAcos( + const detail::tvec2& x) + { + return detail::tvec2( + fastAcos(x.x), + fastAcos(x.y)); + } + + template detail::tvec3 fastAcos( + const detail::tvec3& x) + { + return detail::tvec3( + fastAcos(x.x), + fastAcos(x.y), + fastAcos(x.z)); + } + + template detail::tvec4 fastAcos( + const detail::tvec4& x) + { + return detail::tvec4( + fastAcos(x.x), + fastAcos(x.y), + fastAcos(x.z), + fastAcos(x.w)); + } + + // atan + template + inline T fastAtan(const T y, const T x) + { + T sgn = sign(y) * sign(x); + return abs(fastAtan(y / x)) * sgn; + } + + template + inline detail::tvec2 fastAtan( + const detail::tvec2& y, + const detail::tvec2& x) + { + return detail::tvec2( + fastAtan(y.x, x.x), + fastAtan(y.y, x.y)); + } + + template + inline detail::tvec3 fastAtan( + const detail::tvec3& y, + const detail::tvec3& x) + { + return detail::tvec3( + fastAtan(y.x, x.x), + fastAtan(y.y, x.y), + fastAtan(y.z, x.z)); + } + + template + inline detail::tvec4 fastAtan( + const detail::tvec4& y, + const detail::tvec4& x) + { + return detail::tvec4( + fastAtan(y.x, x.x), + fastAtan(y.y, x.y), + fastAtan(y.z, x.z), + fastAtan(y.w, x.w)); + } + + template + inline T fastAtan(const T x) + { + 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)); + } + + template + inline detail::tvec2 fastAtan( + const detail::tvec2& x) + { + return detail::tvec2( + fastAtan(x.x), + fastAtan(x.y)); + } + + template + inline detail::tvec3 fastAtan( + const detail::tvec3& x) + { + return detail::tvec3( + fastAtan(x.x), + fastAtan(x.y), + fastAtan(x.z)); + } + + template + inline detail::tvec4 fastAtan( + const detail::tvec4& x) + { + return detail::tvec4( + fastAtan(x.x), + fastAtan(x.y), + fastAtan(x.z), + fastAtan(x.w)); + } + +}//namespace fast_trigonometry +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/flexible_mix.inl b/glm/gtx/flexible_mix.inl new file mode 100644 index 00000000..48424097 --- /dev/null +++ b/glm/gtx/flexible_mix.inl @@ -0,0 +1,60 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-09-21 +// Updated : 2007-09-21 +// Licence : This source is under MIT licence +// File : glm/gtx/flexible_mix.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + // mix + template + inline T mixGTX(T x, T y, U a) + { + //GLM_STATIC_ASSERT(detail::traits::is_float); + //return T(x * (U(1) - a) + y * a); + return T(x + a * (y - x)); + } + + template + inline detail::tvec2 mixGTX(const detail::tvec2& x, const detail::tvec2& y, U a) + { + return detail::tvec2(detail::tvec2(x) * (U(1) - a) + detail::tvec2(y) * a); + //return x * (U(1) - a) + y * a; + } + + template + inline detail::tvec3 mixGTX(const detail::tvec3& x, const detail::tvec3& y, U a) + { + return detail::tvec3(detail::tvec3(x) * (U(1) - a) + detail::tvec3(y) * a); + //return x * (U(1) - a) + y * a; + //return mix(x, y, tvec3(a)); + } + + template + inline detail::tvec4 mixGTX(const detail::tvec4& x, const detail::tvec4& y, U a) + { + return detail::tvec4(detail::tvec4(x) * (U(1) - a) + detail::tvec4(y) * a); + //return x * (U(1) - a) + y * a; + } + + template + inline detail::tvec2 mixGTX(const detail::tvec2& x, const detail::tvec2& y, const detail::tvec2& a) + { + return detail::tvec2(detail::tvec2(x) * (U(1) - a) + detail::tvec2(y) * a); + } + + template + inline detail::tvec3 mixGTX(const detail::tvec3& x, const detail::tvec3& y, const detail::tvec3& a) + { + return detail::tvec3(detail::tvec3(x) * (U(1) - a) + detail::tvec3(y) * a); + } + + template + inline detail::tvec4 mixGTX(const detail::tvec4& x, const detail::tvec4& y, const detail::tvec4& a) + { + return detail::tvec4(detail::tvec4(x) * (U(1) - a) + detail::tvec4(y) * a); + } +} diff --git a/glm/gtx/gradient_paint.hpp b/glm/gtx/gradient_paint.hpp new file mode 100644 index 00000000..aa6ba3d6 --- /dev/null +++ b/glm/gtx/gradient_paint.hpp @@ -0,0 +1,56 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-03-06 +// Updated : 2009-03-09 +// Licence : This source is under MIT License +// File : glm/gtx/gradient_paint.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_gradient_paint +#define glm_gtx_gradient_paint + +// Dependency: +#include "../glm.hpp" +#include "../gtx/optimum_pow.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_gradient_paint(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_gradient_paint extension: Compute a radient gradient according section OpenVG 1.1 specifications, 9.3.2 Radial Gradients + namespace gradient_paint + { + using namespace gtx::optimum_pow; + + template + valType radialGradient( + glm::detail::tvec2 const & Center, + valType const & Radius, + glm::detail::tvec2 const & Focal, + glm::detail::tvec2 const & Position); + + template + valType linearGradient( + glm::detail::tvec2 const & Point0, + glm::detail::tvec2 const & Point1, + glm::detail::tvec2 const & Position); + + }//namespace gradient_paint + }//namespace gtx +}//namespace glm + +#define GLM_GTX_gradient_paint namespace gtx::gradient_paint +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_gradient_paint;} +#endif//GLM_GTX_GLOBAL + +#include "gradient_paint.inl" + +#endif//glm_gtx_gradient_paint diff --git a/glm/gtx/gradient_paint.inl b/glm/gtx/gradient_paint.inl new file mode 100644 index 00000000..52ee912a --- /dev/null +++ b/glm/gtx/gradient_paint.inl @@ -0,0 +1,44 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-03-06 +// Updated : 2009-03-09 +// Licence : This source is under MIT License +// File : glm/gtx/gradient_paint.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace gradient_paint{ + + template + valType radialGradient( + glm::detail::tvec2 const & Center, + valType const & Radius, + glm::detail::tvec2 const & Focal, + glm::detail::tvec2 const & Position) + { + glm::detail::tvec2 F = Focal - Center; + glm::detail::tvec2 D = Position - Focal; + valType Radius2 = gtx::optimum_pow::pow2(Radius); + valType Fx2 = gtx::optimum_pow::pow2(F.x); + valType Fy2 = gtx::optimum_pow::pow2(F.y); + + valType Numerator = (D.x * F.x + D.y * F.y) + glm::sqrt(Radius2 * (gtx::optimum_pow::pow2(D.x) + gtx::optimum_pow::pow2(D.y)) - gtx::optimum_pow::pow2(D.x * F.y - D.y * F.x)); + valType Denominator = Radius2 - (Fx2 + Fy2); + return Numerator / Denominator; + } + + template + valType linearGradient( + glm::detail::tvec2 const & Point0, + glm::detail::tvec2 const & Point1, + glm::detail::tvec2 const & Position) + { + glm::detail::tvec2 Dist = Point1 - Point0; + return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); + } + +}//namespace gradient_paint +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/half_float.hpp b/glm/gtx/half_float.hpp new file mode 100644 index 00000000..519cb23a --- /dev/null +++ b/glm/gtx/half_float.hpp @@ -0,0 +1,48 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtx/half_float.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTC_half_float +// - GLM_GTX_quaternion +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_half_float +#define glm_gtx_half_float + +// Dependency: +#include "../glm.hpp" +#include "../gtc/half_float.hpp" +#include "../gtx/quaternion.hpp" + +namespace glm +{ + namespace test{ + void main_ext_gtx_half_float(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_half_float extension: Add support for half precision flotting-point types + namespace half_float + { + //! Quaternion of half-precision floating-point numbers. + //! From GLM_GTX_half_float extension. + typedef detail::tquat hquat; + + }//namespace half_float + }//namespace gtx +}//namespace glm + +#define GLM_GTX_half_float namespace gtc::half_float; using namespace gtx::half_float; using namespace gtx::quaternion +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_half_float;} +#endif//GLM_GTX_GLOBAL + +#include "half_float.inl" + +#endif//glm_gtx_half_float diff --git a/glm/gtx/half_float.inl b/glm/gtx/half_float.inl new file mode 100644 index 00000000..82ccb4ec --- /dev/null +++ b/glm/gtx/half_float.inl @@ -0,0 +1,16 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2008-10-02 +// Licence : This source is under MIT License +// File : glm/gtx/half.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail{ + + + +}//namespace detail +}//namespace glm diff --git a/glm/gtx/handed_coordinate_space.hpp b/glm/gtx/handed_coordinate_space.hpp new file mode 100644 index 00000000..d7d851a8 --- /dev/null +++ b/glm/gtx/handed_coordinate_space.hpp @@ -0,0 +1,52 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-02-19 +// Licence : This source is under MIT License +// File : glm/gtx/handed_coordinate_space.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_handed_coordinate_space +#define glm_gtx_handed_coordinate_space + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_handed_coordinate_space extension: To know if a triedron is right or left handed + namespace handed_coordinate_space + { + //! Return if a trihedron right handed or not. + //! From GLM_GTX_handed_coordinate_space extension. + template + bool rightHanded( + detail::tvec3 const & tangent, + detail::tvec3 const & binormal, + detail::tvec3 const & normal); + + //! Return if a trihedron left handed or not. + //! From GLM_GTX_handed_coordinate_space extension. + template + bool leftHanded( + detail::tvec3 const & tangent, + detail::tvec3 const & binormal, + detail::tvec3 const & normal); + + }//namespace handed_coordinate_space + }//namespace gtx +}//namespace glm + +#define GLM_GTX_handed_coordinate_space namespace gtx::handed_coordinate_space +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_handed_coordinate_space;} +#endif//GLM_GTX_GLOBAL + +#include "handed_coordinate_space.inl" + +#endif//glm_gtx_handed_coordinate_space diff --git a/glm/gtx/handed_coordinate_space.inl b/glm/gtx/handed_coordinate_space.inl new file mode 100644 index 00000000..ac1d93ea --- /dev/null +++ b/glm/gtx/handed_coordinate_space.inl @@ -0,0 +1,34 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-02-19 +// Licence : This source is under MIT License +// File : glm/gtx/handed_coordinate_space.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace handed_coordinate_space +{ + template + inline bool rightHanded( + detail::tvec3 const & tangent, + detail::tvec3 const & binormal, + detail::tvec3 const & normal) + { + return dot(cross(normal, tangent), binormal) > T(0); + } + + template + inline bool leftHanded( + detail::tvec3 const & tangent, + detail::tvec3 const & binormal, + detail::tvec3 const & normal) + { + return dot(cross(normal, tangent), binormal) < T(0); + } + +}//namespace handed_coordinate_space +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/inertia.hpp b/glm/gtx/inertia.hpp new file mode 100644 index 00000000..8c28cf2a --- /dev/null +++ b/glm/gtx/inertia.hpp @@ -0,0 +1,92 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-04-21 +// Updated : 2006-11-13 +// Licence : This source is under MIT License +// File : glm/gtx/inertia.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_inertia +#define glm_gtx_inertia + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_inertia extension: Create inertia matrices + namespace inertia + { + //! Build an inertia matrix for a box. + //! From GLM_GTX_inertia extension. + template + detail::tmat3x3 boxInertia3( + const T Mass, + const detail::tvec3& Scale); + + //! Build an inertia matrix for a box. + //! From GLM_GTX_inertia extension. + template + detail::tmat4x4 boxInertia4( + const T Mass, + const detail::tvec3& Scale); + + //! Build an inertia matrix for a disk. + //! From GLM_GTX_inertia extension. + template + detail::tmat3x3 diskInertia3( + const T Mass, + const T Radius); + + //! Build an inertia matrix for a disk. + //! From GLM_GTX_inertia extension. + template + detail::tmat4x4 diskInertia4( + const T Mass, + const T Radius); + + //! Build an inertia matrix for a ball. + //! From GLM_GTX_inertia extension. + template + detail::tmat3x3 ballInertia3( + const T Mass, + const T Radius); + + //! Build an inertia matrix for a ball. + //! From GLM_GTX_inertia extension. + template + detail::tmat4x4 ballInertia4( + const T Mass, + const T Radius); + + //! Build an inertia matrix for a sphere. + //! From GLM_GTX_inertia extension. + template + detail::tmat3x3 sphereInertia3( + const T Mass, + const T Radius); + + //! Build an inertia matrix for a sphere. + //! From GLM_GTX_inertia extension. + template + detail::tmat4x4 sphereInertia4( + const T Mass, + const T Radius); + + }//namespace inertia + }//namespace gtx +}//namespace glm + +#define GLM_GTX_inertia namespace gtx::inertia +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_inertia;} +#endif//GLM_GTX_GLOBAL + +#include "inertia.inl" + +#endif//glm_gtx_inertia diff --git a/glm/gtx/inertia.inl b/glm/gtx/inertia.inl new file mode 100644 index 00000000..49b7268a --- /dev/null +++ b/glm/gtx/inertia.inl @@ -0,0 +1,103 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-04-21 +// Updated : 2006-12-06 +// Licence : This source is under MIT License +// File : glm/gtx/inertia.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace inertia{ + + template + inline detail::tmat3x3 boxInertia3( + const T Mass, + const detail::tvec3& Scale) + { + detail::tmat3x3 Result(T(1)); + Result[0][0] = (Scale.y * Scale.y + Scale.z * Scale.z) * Mass / T(12); + Result[1][1] = (Scale.x * Scale.x + Scale.z * Scale.z) * Mass / T(12); + Result[2][2] = (Scale.x * Scale.x + Scale.y * Scale.y) * Mass / T(12); + return Result; + } + + template + inline detail::tmat4x4 boxInertia4( + const T Mass, + const detail::tvec3& Scale) + { + detail::tmat4x4 Result(T(1)); + Result[0][0] = (Scale.y * Scale.y + Scale.z * Scale.z) * Mass / T(12); + Result[1][1] = (Scale.x * Scale.x + Scale.z * Scale.z) * Mass / T(12); + Result[2][2] = (Scale.x * Scale.x + Scale.y * Scale.y) * Mass / T(12); + return Result; + } + + template + inline detail::tmat3x3 diskInertia3( + const T Mass, + const T Radius) + { + T a = Mass * Radius * Radius / T(2); + detail::tmat3x3 Result(a); + Result[2][2] *= T(2); + return Result; + } + + template + inline detail::tmat4x4 diskInertia4( + const T Mass, + const T Radius) + { + T a = Mass * Radius * Radius / T(2); + detail::tmat4x4 Result(a); + Result[2][2] *= T(2); + Result[3][3] = T(1); + return Result; + } + + template + inline detail::tmat3x3 ballInertia3( + const T Mass, + const T Radius) + { + T a = T(2) * Mass * Radius * Radius / T(5); + return detail::tmat3x3(a); + } + + template + inline detail::tmat4x4 ballInertia4( + const T Mass, + const T Radius) + { + T a = T(2) * Mass * Radius * Radius / T(5); + detail::tmat4x4 Result(a); + Result[3][3] = T(1); + return Result; + } + + template + inline detail::tmat3x3 sphereInertia3( + const T Mass, + const T Radius) + { + T a = T(2) * Mass * Radius * Radius / T(3); + return detail::tmat3x3(a); + } + + template + inline detail::tmat4x4 sphereInertia4( + const T Mass, + const T Radius) + { + T a = T(2) * Mass * Radius * Radius / T(3); + detail::tmat4x4 Result(a); + Result[3][3] = T(1); + return Result; + } + +}//namespace inertia +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/integer.hpp b/glm/gtx/integer.hpp new file mode 100644 index 00000000..0bce9c8e --- /dev/null +++ b/glm/gtx/integer.hpp @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-24 +// Updated : 2006-11-14 +// Licence : This source is under MIT License +// File : glm/gtx/integer.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_integer +#define glm_gtx_integer + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_integer extension: Add support for integer for core functions + namespace integer + { + //! Returns x raised to the y power. + //! From GLM_GTX_integer extension. + int pow(int x, int y); + + //! Returns the positive square root of x. + //! From GLM_GTX_integer extension. + int sqrt(int x); + + //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. + //! From GLM_GTX_integer extension. + int mod(int x, int y); + + //! Return the factorial value of a number (!12 max, integer only) + //! From GLM_GTX_integer extension. + template + genType factorial(genType const & x); + + }//namespace integer + }//namespace gtx +}//namespace glm + +#define GLM_GTX_integer namespace gtx::integer +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_integer;} +#endif//GLM_GTX_GLOBAL + +#include "integer.inl" + +#endif//glm_gtx_integer diff --git a/glm/gtx/integer.inl b/glm/gtx/integer.inl new file mode 100644 index 00000000..0ff039ae --- /dev/null +++ b/glm/gtx/integer.inl @@ -0,0 +1,90 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-24 +// Updated : 2006-12-06 +// Licence : This source is under MIT License +// File : glm/gtx/integer.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace integer +{ + // pow + inline int pow(int x, int y) + { + if(y == 0) + return 1; + int result = x; + for(int i = 1; i < y; ++i) + result *= x; + return result; + } + + // sqrt: From Christopher J. Musial, An integer square root, Graphics Gems, 1990, page 387 + inline int sqrt(int x) + { + if(x <= 1) return x; + + int NextTrial = x >> 1; + int CurrentAnswer; + + do + { + CurrentAnswer = NextTrial; + NextTrial = (NextTrial + x / NextTrial) >> 1; + } while(NextTrial < CurrentAnswer); + + return CurrentAnswer; + } + + // mod + inline int mod(int x, int y) + { + return x - y * (x / y); + } + + // factorial (!12 max, integer only) + template + inline genType factorial(genType const & x) + { + genType Result; + for(Result = 1; x > 1; --x) + Result *= x; + return Result; + } + + template + inline detail::tvec2 factorial( + detail::tvec2 const & x) + { + return detail::tvec2( + factorial(x.x), + factorial(x.y)); + } + + template + inline detail::tvec3 factorial( + detail::tvec3 const & x) + { + return detail::tvec3( + factorial(x.x), + factorial(x.y), + factorial(x.z)); + } + + template + inline detail::tvec4 factorial( + detail::tvec4 const & x) + { + return detail::tvec4( + factorial(x.x), + factorial(x.y), + factorial(x.z), + factorial(x.w)); + } + +}//namespace integer +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/intersect.hpp b/glm/gtx/intersect.hpp new file mode 100644 index 00000000..cb8a7adf --- /dev/null +++ b/glm/gtx/intersect.hpp @@ -0,0 +1,74 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-04-03 +// Updated : 2009-01-20 +// Licence : This source is under MIT License +// File : glm/gtx/intersect.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_closest_point +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_intersect +#define glm_gtx_intersect + +// Dependency: +#include "../glm.hpp" +#include "../gtx/closest_point.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_intesect(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_intersect extension: Add intersection functions + namespace intersect + { + //! Compute the intersection of a ray and a triangle. + //! From GLM_GTX_intersect extension. + template + bool intersectRayTriangle( + genType const & orig, genType const & dir, + genType const & vert0, genType const & vert1, genType const & vert2, + genType & baryPosition); + + //! Compute the intersection of a line and a triangle. + //! From GLM_GTX_intersect extension. + template + bool intersectLineTriangle( + genType const & orig, genType const & dir, + genType const & vert0, genType const & vert1, genType const & vert2, + genType & position); + + //! Compute the intersection of a ray and a sphere. + //! From GLM_GTX_intersect extension. + template + bool intersectRaySphere( + genType const & orig, genType const & dir, + genType const & center, typename genType::value_type radius, + genType & position, genType & normal); + + //! Compute the intersection of a line and a sphere. + //! From GLM_GTX_intersect extension + template + bool intersectLineSphere( + genType const & point0, genType const & point1, + genType const & center, typename genType::value_type radius, + genType & position, genType & normal); + + }//namespace intersect +}//namespace gtx +}//namespace glm + +#define GLM_GTX_intersect namespace gtx::intersect +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_intersect;} +#endif//GLM_GTX_GLOBAL + +#include "intersect.inl" + +#endif//glm_gtx_intersect diff --git a/glm/gtx/intersect.inl b/glm/gtx/intersect.inl new file mode 100644 index 00000000..db47df00 --- /dev/null +++ b/glm/gtx/intersect.inl @@ -0,0 +1,201 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-04-03 +// Updated : 2009-01-20 +// Licence : This source is under MIT licence +// File : glm/gtx/intersect.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +namespace glm{ +namespace gtx{ +namespace intersect{ + +template +inline bool intersectRayTriangle +( + genType const & orig, genType const & dir, + genType const & v0, genType const & v1, genType const & v2, + genType & baryPosition +) +{ + genType e1 = v1 - v0; + genType e2 = v2 - v0; + + genType p = glm::cross(dir, e2); + + typename genType::value_type a = glm::dot(e1, p); + + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + if(a < Epsilon) + return false; + + typename genType::value_type f = typename genType::value_type(1.0f) / a; + + genType s = orig - v0; + baryPosition.x = f * glm::dot(s, p); + if(baryPosition.x < typename genType::value_type(0.0f)) + return false; + if(baryPosition.x > typename genType::value_type(1.0f)) + return false; + + genType q = glm::cross(s, e1); + baryPosition.y = f * glm::dot(dir, q); + if(baryPosition.y < typename genType::value_type(0.0f)) + return false; + if(baryPosition.y + baryPosition.x > typename genType::value_type(1.0f)) + return false; + + baryPosition.z = f * glm::dot(e2, q); + + return baryPosition.z >= typename genType::value_type(0.0f); +} + +//template +//inline bool intersectRayTriangle +//( +// genType const & orig, genType const & dir, +// genType const & vert0, genType const & vert1, genType const & vert2, +// genType & position +//) +//{ +// typename genType::value_type Epsilon = std::numeric_limits::epsilon(); +// +// genType edge1 = vert1 - vert0; +// genType edge2 = vert2 - vert0; +// +// genType pvec = cross(dir, edge2); +// +// float det = dot(edge1, pvec); +// if(det < Epsilon) +// return false; +// +// genType tvec = orig - vert0; +// +// position.y = dot(tvec, pvec); +// if (position.y < typename genType::value_type(0) || position.y > det) +// return typename genType::value_type(0); +// +// genType qvec = cross(tvec, edge1); +// +// position.z = dot(dir, qvec); +// if (position.z < typename genType::value_type(0) || position.y + position.z > det) +// return typename genType::value_type(0); +// +// position.x = dot(edge2, qvec); +// position *= typename genType::value_type(1) / det; +// +// return typename genType::value_type(1); +//} + +template +inline bool intersectLineTriangle +( + genType const & orig, genType const & dir, + genType const & vert0, genType const & vert1, genType const & vert2, + genType & position +) +{ + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + + genType edge1 = vert1 - vert0; + genType edge2 = vert2 - vert0; + + genType pvec = cross(dir, edge2); + + float det = dot(edge1, pvec); + + if (det > -Epsilon && det < Epsilon) + return false; + float inv_det = typename genType::value_type(1) / det; + + genType tvec = orig - vert0; + + position.y = dot(tvec, pvec) * inv_det; + if (position.y < typename genType::value_type(0) || position.y > typename genType::value_type(1)) + return false; + + genType qvec = cross(tvec, edge1); + + position.z = dot(dir, qvec) * inv_det; + if (position.z < typename genType::value_type(0) || position.y + position.z > typename genType::value_type(1)) + return false; + + position.x = dot(edge2, qvec) * inv_det; + + return true; +} + +template +inline bool intersectRaySphere +( + genType const & rayStarting, genType const & rayDirection, + genType const & sphereCenter, typename genType::value_type sphereRadius, + genType & position, genType & normal +) +{ + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + + typename genType::value_type a = dot(rayDirection, rayDirection); + typename genType::value_type b = typename genType::value_type(2) * dot(rayStarting, rayDirection); + typename genType::value_type c = dot(rayStarting, rayStarting) - sphereRadius * sphereRadius; + typename genType::value_type d = b * b - typename genType::value_type(4) * a * c; + typename genType::value_type e = sqrt(d); + typename genType::value_type x1 = (-b - e) / (typename genType::value_type(2) * a); + typename genType::value_type x2 = (-b + e) / (typename genType::value_type(2) * a); + + if(x1 > Epsilon) + { + position = rayStarting + rayDirection * sphereRadius; + normal = (position - sphereCenter) / sphereRadius; + return true; + } + else if(x2 > Epsilon) + { + position = rayStarting + rayDirection * sphereRadius; + normal = (position - sphereCenter) / sphereRadius; + return true; + } + return false; +} + +template +inline bool intersectLineSphere +( + genType const & point0, genType const & point1, + genType const & center, typename genType::value_type radius, + genType & position, genType & normal +) +{ + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + + genType dir = point1 - point0; + typename genType::value_type a = dot(dir, dir); + typename genType::value_type b = typename genType::value_type(2) * dot(center, dir); + typename genType::value_type c = dot(center, center) - radius * radius; + typename genType::value_type d = b * b - typename genType::value_type(4) * a * c; + typename genType::value_type e = sqrt(d); + typename genType::value_type x1 = (-b - e) / (typename genType::value_type(2) * a); + typename genType::value_type x2 = (-b + e) / (typename genType::value_type(2) * a); + + if(x1 > Epsilon) + { + position = center + dir * radius; + normal = (position - center) / radius; + return true; + } + else if(x2 > Epsilon) + { + position = center + dir * radius; + normal = (position - center) / radius; + return true; + } + return false; +} + +}//namespace intersect +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/inverse.hpp b/glm/gtx/inverse.hpp new file mode 100644 index 00000000..a48222ae --- /dev/null +++ b/glm/gtx/inverse.hpp @@ -0,0 +1,43 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2008-09-30 +// Licence : This source is under MIT License +// File : glm/gtx/inverse.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_inverse +#define glm_gtx_inverse + +// Dependency: +#include "../glm.hpp" +#include "../gtc/matrix_operation.hpp" + +namespace glm{ +namespace gtx{ +//! GLM_GTX_inverse extension: Inverse matrix functions +namespace inverse +{ + using namespace gtc::matrix_operation; + + //! Fast matrix inverse for affine matrix. + //! From GLM_GTX_inverse extension. + template + genType affineInverse(genType const & m); + +}//namespace inverse +}//namespace gtx +}//namespace glm + +#define GLM_GTX_inverse namespace gtx::inverse +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_inverse;} +#endif//GLM_GTX_GLOBAL + +#include "inverse.inl" + +#endif//glm_gtx_inverse diff --git a/glm/gtx/inverse.inl b/glm/gtx/inverse.inl new file mode 100644 index 00000000..394bc802 --- /dev/null +++ b/glm/gtx/inverse.inl @@ -0,0 +1,44 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2008-09-30 +// Licence : This source is under MIT License +// File : glm/gtx/inverse.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace inverse +{ + template + inline detail::tmat3x3 affineInverse + ( + detail::tmat3x3 const & m + ) + { + detail::tmat3x3 Result(m); + Result[2] = detail::tvec3(0, 0, 1); + Result = transpose(Result); + detail::tvec3 Translation = Result * detail::tvec3(-detail::tvec2(m[2]), m[2][2]); + Result[2] = Translation; + return Result; + } + + template + inline detail::tmat4x4 affineInverse + ( + detail::tmat4x4 const & m + ) + { + detail::tmat4x4 Result(m); + Result[3] = detail::tvec4(0, 0, 0, 1); + Result = transpose(Result); + detail::tvec4 Translation = Result * detail::tvec4(-detail::tvec3(m[3]), m[3][3]); + Result[3] = Translation; + return Result; + } + +}//namespace inverse +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/inverse_transpose.hpp b/glm/gtx/inverse_transpose.hpp new file mode 100644 index 00000000..fefd43bf --- /dev/null +++ b/glm/gtx/inverse_transpose.hpp @@ -0,0 +1,42 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-04 +// Updated : 2008-10-23 +// Licence : This source is under MIT License +// File : glm/gtx/inverse_transpose.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_inverse_transpose +#define glm_gtx_inverse_transpose + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_inverse_transpose extension: Inverse transpose matrix functions + namespace inverse_transpose + { + //! Compute the inverse transpose of a matrix. + //! From GLM_GTX_inverse extension. + template + inline typename genType::value_type inverseTranspose( + genType const & m); + + }//namespace inverse_transpose + }//namespace gtx +}//namespace glm + +#define GLM_GTX_inverse_transpose namespace gtx::inverse_transpose +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_inverse_transpose;} +#endif//GLM_GTX_GLOBAL + +#include "inverse_transpose.inl" + +#endif//glm_gtx_inverse_transpose diff --git a/glm/gtx/inverse_transpose.inl b/glm/gtx/inverse_transpose.inl new file mode 100644 index 00000000..d4609311 --- /dev/null +++ b/glm/gtx/inverse_transpose.inl @@ -0,0 +1,112 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-04 +// Updated : 2008-12-02 +// Licence : This source is under MIT License +// File : glm/gtx/inverse_transpose.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +//! GLM_GTX_inverse_transpose extension: Inverse transpose matrix functions +namespace inverse_transpose{ + +template +inline detail::tmat2x2 inverseTranspose( + detail::tmat2x2 const & m) +{ + valType Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; + + detail::tmat2x2 Inverse( + + m[1][1] / Determinant, + - m[0][1] / Determinant, + - m[1][0] / Determinant, + + m[0][0] / Determinant); + + return Inverse; +} + +template +inline detail::tmat3x3 inverseTranspose( + detail::tmat3x3 const & m) +{ + valType Determinant = + + m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) + - m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) + + m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]); + + detail::tmat3x3 Inverse; + Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]); + Inverse[0][1] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]); + Inverse[0][2] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]); + Inverse[1][0] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]); + Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]); + Inverse[1][2] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]); + Inverse[2][0] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]); + Inverse[2][1] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]); + Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]); + Inverse /= Determinant; + + return Inverse; +} + +template +inline detail::tmat4x4 inverseTranspose( + detail::tmat4x4 const & m) +{ + valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + valType SubFactor11 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + detail::tmat4x4 Inverse; + Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02); + Inverse[0][1] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04); + Inverse[0][2] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05); + Inverse[0][3] = - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05); + + Inverse[1][0] = - (m[0][1] * SubFactor00 - m[0][2] * SubFactor01 + m[0][3] * SubFactor02); + Inverse[1][1] = + (m[0][0] * SubFactor00 - m[0][2] * SubFactor03 + m[0][3] * SubFactor04); + Inverse[1][2] = - (m[0][0] * SubFactor01 - m[0][1] * SubFactor03 + m[0][3] * SubFactor05); + Inverse[1][3] = + (m[0][0] * SubFactor02 - m[0][1] * SubFactor04 + m[0][2] * SubFactor05); + + Inverse[2][0] = + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08); + Inverse[2][1] = - (m[0][0] * SubFactor06 - m[0][2] * SubFactor09 + m[0][3] * SubFactor10); + Inverse[2][2] = + (m[0][0] * SubFactor11 - m[0][1] * SubFactor09 + m[0][3] * SubFactor12); + Inverse[2][3] = - (m[0][0] * SubFactor08 - m[0][1] * SubFactor10 + m[0][2] * SubFactor12); + + Inverse[3][0] = - (m[0][1] * SubFactor13 - m[0][2] * SubFactor14 + m[0][3] * SubFactor15); + Inverse[3][1] = + (m[0][0] * SubFactor13 - m[0][2] * SubFactor16 + m[0][3] * SubFactor17); + Inverse[3][2] = - (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][3] * SubFactor18); + Inverse[3][3] = + (m[0][0] * SubFactor15 - m[0][1] * SubFactor17 + m[0][2] * SubFactor18); + + valType Determinant = + + m[0][0] * Inverse[0][0] + + m[0][1] * Inverse[0][1] + + m[0][2] * Inverse[0][2] + + m[0][3] * Inverse[0][3]; + + Inverse /= Determinant; + + return Inverse; +} + +}//namespace inverse_transpose +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/log_base.hpp b/glm/gtx/log_base.hpp new file mode 100644 index 00000000..d9a6e9bb --- /dev/null +++ b/glm/gtx/log_base.hpp @@ -0,0 +1,47 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-24 +// Updated : 2008-10-24 +// Licence : This source is under MIT License +// File : glm/gtx/log_base.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_log_base +#define glm_gtx_log_base + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_ext_gtx_log_base(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_log_base extension: Logarithm for any base. base can be a vector or a scalar. + namespace log_base + { + //! Logarithm for any base. + //! From GLM_GTX_log_base. + template + genType log( + genType const & x, + genType const & base); + + }//namespace extend + }//namespace gtx +}//namespace glm + +#define GLM_GTX_log_base namespace gtx::log_base +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_log_base;} +#endif//GLM_GTX_GLOBAL + +#include "log_base.inl" + +#endif//glm_gtx_log_base diff --git a/glm/gtx/log_base.inl b/glm/gtx/log_base.inl new file mode 100644 index 00000000..43587671 --- /dev/null +++ b/glm/gtx/log_base.inl @@ -0,0 +1,92 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-24 +// Updated : 2008-10-24 +// Licence : This source is under MIT License +// File : glm/gtx/log_base.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace log_base{ + +template +inline genType log( + genType const & x, + genType const & base) +{ + assert(x != genType(0)); + + return glm::log(x) / glm::log(base); +} + +template +inline detail::tvec2 log( + detail::tvec2 const & v, + valType const & base) +{ + return detail::tvec2( + log(v.x, base), + log(v.y, base)); +} + +template +inline detail::tvec3 log( + detail::tvec3 const & v, + valType const & base) +{ + return detail::tvec3( + log(v.x, base), + log(v.y, base), + log(v.z, base)); +} + +template +inline detail::tvec4 log( + detail::tvec4 const & v, + valType const & base) +{ + return detail::tvec4( + log(v.x, base), + log(v.y, base), + log(v.z, base), + log(v.w, base)); +} + +template +inline detail::tvec2 log( + detail::tvec2 const & v, + detail::tvec2 const & base) +{ + return detail::tvec2( + log(v.x, base.x), + log(v.y, base.y)); +} + +template +inline detail::tvec3 log( + detail::tvec3 const & v, + detail::tvec3 const & base) +{ + return detail::tvec3( + log(v.x, base.x), + log(v.y, base.y), + log(v.z, base.z)); +} + +template +inline detail::tvec4 log( + detail::tvec4 const & v, + detail::tvec4 const & base) +{ + return detail::tvec4( + log(v.x, base.x), + log(v.y, base.y), + log(v.z, base.z), + log(v.w, base.w)); +} + +}//namespace log_base +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/mat4x3.inl b/glm/gtx/mat4x3.inl new file mode 100644 index 00000000..d6f56ab8 --- /dev/null +++ b/glm/gtx/mat4x3.inl @@ -0,0 +1,405 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-04-17 +// Updated : 2006-04-17 +// Licence : This source is under MIT licence +// File : glm/gtx/mat4x3.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + ////////////////////////////////////////////////////////////// + // Constructors + + template + inline _xmat4x3GTX::_xmat4x3GTX() + { + this->value[0] = tvec3(1, 0, 0); + this->value[1] = tvec3(0, 1, 0); + this->value[2] = tvec3(0, 0, 1); + this->value[3] = tvec3(0, 0, 0); + } + + template + inline _xmat4x3GTX::_xmat4x3GTX(const T f) + { + this->value[0] = tvec3(f, 0, 0); + this->value[1] = tvec3(0, f, 0); + this->value[2] = tvec3(0, 0, f); + this->value[3] = tvec3(0, 0, 0); + } + + template + inline _xmat4x3GTX::_xmat4x3GTX + ( + const T x0, const T y0, const T z0, + const T x1, const T y1, const T z1, + const T x2, const T y2, const T z2, + const T x3, const T y3, const T z3 + ) + { + this->value[0] = tvec3(x0, y0, z0); + this->value[1] = tvec3(x1, y1, z1); + this->value[2] = tvec3(x2, y2, z2); + this->value[3] = tvec3(x3, y3, z3); + } + + template + inline _xmat4x3GTX::_xmat4x3GTX + ( + const tvec3 & v0, + const tvec3 & v1, + const tvec3 & v2, + const tvec3 & v3 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; + } + + ////////////////////////////////////////////////////////////// + // Unary updatable operators + + template + inline _xmat4x3GTX& _xmat4x3GTX::operator= (const _xmat4x3GTX& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } + + template + inline _xmat4x3GTX& _xmat4x3GTX::operator+= (const T s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } + + template + inline _xmat4x3GTX& _xmat4x3GTX::operator+= (const _xmat4x3GTX& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } + + template + inline _xmat4x3GTX& _xmat4x3GTX::operator-= (const T s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } + + template + inline _xmat4x3GTX& _xmat4x3GTX::operator-= (const _xmat4x3GTX& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } + + template + inline _xmat4x3GTX& _xmat4x3GTX::operator*= (const T s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } + + template + inline _xmat4x3GTX& _xmat4x3GTX::operator*= (const _xmat4x3GTX& m) + { + return (*this = *this * m); + } + + template + inline _xmat4x3GTX & _xmat4x3GTX::operator/= (const T s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } +/* + template + inline _xmat4x3GTX& _xmat4x3GTX::operator/= (const _xmat4x3GTX& m) + { + return (*this = *this / m); + } +*/ + template + inline _xmat4x3GTX& _xmat4x3GTX::operator++ () + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } + + template + inline _xmat4x3GTX& _xmat4x3GTX::operator-- () + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } + + ////////////////////////////////////////////////////////////// + // Unary constant operators + template + inline const _xmat4x3GTX _xmat4x3GTX::operator- () const + { + return _xmat4x3GTX( + -this->value[0], + -this->value[1], + -this->value[2], + -this->value[3]); + } + + template + inline const _xmat4x3GTX _xmat4x3GTX::operator-- (int n) const + { + _xmat4x3GTX m = *this; + --m.value[0]; + --m.value[1]; + --m.value[2]; + --m.value[3]; + return m; + } + + template + inline const _xmat4x3GTX _xmat4x3GTX::operator++ (int n) const + { + detail::tmat4x4 m = *this; + ++m.value[0]; + ++m.value[1]; + ++m.value[2]; + ++m.value[3]; + return m; + } + + ////////////////////////////////////////////////////////////// + // Binary operators + + template + inline _xmat4x3GTX operator+ (const _xmat4x3GTX& m, const T s) + { + return _xmat4x3GTX( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } + + template + inline _xmat4x3GTX operator+ (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) + { + return _xmat4x3GTX( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } + + template + inline _xmat4x3GTX operator- (const _xmat4x3GTX& m, const T s) + { + return _xmat4x3GTX( + m[0] - s, + m[1] - s, + m[2] - s, + m[3] - s); + } + + template + inline _xmat4x3GTX operator- (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) + { + return _xmat4x3GTX( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } + + template + inline _xmat4x3GTX operator* (const _xmat4x3GTX& m, const T s) + { + return _xmat4x3GTX( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + inline _xmat4x3GTX operator* (const T s, const _xmat4x3GTX & m) + { + return _xmat4x3GTX( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + inline tvec3 operator* (const _xmat4x3GTX& m, const tvec4& v) + { + return tvec3( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); + } + + template + inline tvec3 operator* (const tvec4& v, const _xmat4x3GTX& m) + { + return tvec3( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); + } + + template + inline _xmat4x3GTX operator* (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA02 = m1[0][2]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA12 = m1[1][2]; + const T SrcA20 = m1[2][0]; + const T SrcA21 = m1[2][1]; + const T SrcA22 = m1[2][2]; + const T SrcA30 = m1[3][0]; + const T SrcA31 = m1[3][1]; + const T SrcA32 = m1[3][2]; + + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB02 = m2[0][2]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB12 = m2[1][2]; + const T SrcB20 = m2[2][0]; + const T SrcB21 = m2[2][1]; + const T SrcB22 = m2[2][2]; + const T SrcB30 = m2[3][0]; + const T SrcB31 = m2[3][1]; + const T SrcB32 = m2[3][2]; + + _xmat4x3GTX Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; + Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32 + SrcA30; + Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32 + SrcA31; + Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32 + SrcA32; + return Result; + } + + template + inline _xmat4x3GTX operator/ (const _xmat4x3GTX& m, const T s) + { + return _xmat4x3GTX( + m.value[0] / s, + m.value[1] / s, + m.value[2] / s, + m.value[3] / s); + } +/* + template + inline _xmat4x3GTX operator/ (const T s, const _xmat4x3GTX& m) + { + return _xmat4x3GTX( + s / m.value[0], + s / m.value[1], + s / m.value[2], + s / m.value[3]); + } + + template + tvec3 operator/ (const _xmat4x3GTX& m, const tvec4& v) + { + + } + + template + tvec3 operator/ (const tvec4& v, const _xmat4x3GTX& m) + { + + } +*/ + + template + inline _xmat4x3GTX operator/ (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) + { + T SubFactor01 = m2[2][1] * m2[3][2] - m2[3][1] * m2[2][2]; + T SubFactor02 = m2[2][0] * m2[3][2] - m2[3][0] * m2[2][2]; + T SubFactor03 = m2[2][0] * m2[3][1] - m2[3][0] * m2[2][1]; + T SubFactor04 = m2[1][1] * m2[3][2] - m2[3][1] * m2[1][2]; + T SubFactor05 = m2[1][0] * m2[3][2] - m2[3][0] * m2[1][2]; + T SubFactor06 = m2[1][0] * m2[3][1] - m2[3][0] * m2[1][1]; + T SubFactor07 = m2[1][1] * m2[2][2] - m2[2][1] * m2[1][2]; + T SubFactor08 = m2[1][0] * m2[2][2] - m2[2][0] * m2[1][2]; + T SubFactor09 = m2[1][0] * m2[2][1] - m2[2][0] * m2[1][1]; + + _xmat4x3GTX Inverse( + + m2[1][3] * SubFactor01, + - m2[1][3] * SubFactor02, + + m2[1][3] * SubFactor03, + -(m2[1][0] * SubFactor01 - m2[1][1] * SubFactor02 + m2[1][2] * SubFactor03), + + - m2[0][3] * SubFactor01, + + m2[0][3] * SubFactor02, + - m2[0][3] * SubFactor03, + +(m2[0][0] * SubFactor02 - m2[0][1] * SubFactor02 + m2[0][2] * SubFactor03), + + + m2[0][3] * SubFactor04, + - m2[0][3] * SubFactor05, + + m2[0][3] * SubFactor06, + -(m2[0][0] * SubFactor04 - m2[0][1] * SubFactor05 + m2[0][2] * SubFactor06), + + - m2[0][3] * SubFactor07, + + m2[0][3] * SubFactor08, + - m2[0][3] * SubFactor09, + +(m2[0][0] * SubFactor07 - m2[0][1] * SubFactor08 + m2[0][2] * SubFactor09)); + + T Determinant = m2[0][0] * Inverse[0][0] + + m2[0][1] * Inverse[1][0] + + m2[0][2] * Inverse[2][0] + + m2[0][3] * Inverse[3][0]; + + Inverse /= Determinant; + + return m1 * Inverse; + } + +} //namespace glm diff --git a/glm/gtx/matrix_access.hpp b/glm/gtx/matrix_access.hpp new file mode 100644 index 00000000..62bb9d13 --- /dev/null +++ b/glm/gtx/matrix_access.hpp @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-27 +// Updated : 2006-12-06 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_access.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_access +#define glm_gtx_matrix_access + +// Dependency: +#include "../glm.hpp" + +namespace glm{ +namespace gtx{ +//! GLM_GTX_matrix_access extension: Set a column or a row of a matrix +namespace matrix_access +{ + //! Set a specific row to a matrix. + //! From GLM_GTX_matrix_access extension. + template + genType row( + const genType& m, + int index, + typename genType::row_type const & x); + + //! Set a specific column to a matrix. + //! From GLM_GTX_matrix_access extension. + template + genType column( + const genType& m, + int index, + typename genType::col_type const & x); + +}//namespace matrix_access +}//namespace gtx +}//namespace glm + +#define GLM_GTX_matrix_access namespace gtx::matrix_access +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_matrix_access;} +#endif//GLM_GTX_GLOBAL + +#include "matrix_access.inl" + +#endif//glm_gtx_matrix_access diff --git a/glm/gtx/matrix_access.inl b/glm/gtx/matrix_access.inl new file mode 100644 index 00000000..35f65e6e --- /dev/null +++ b/glm/gtx/matrix_access.inl @@ -0,0 +1,40 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-27 +// Updated : 2005-12-27 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_access.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace matrix_access{ + + template + inline genType row( + genType const & m, + int index, + typename genType::row_type const & x) + { + genType Result = m; + for(typename genType::size_type i = 0; i < genType::row_size(); ++i) + Result[i][index] = x[i]; + return Result; + } + + template + inline genType column( + genType const & m, + int index, + typename genType::col_type const & x) + { + genType Result = m; + Result[index] = x; + return Result; + } + +}//namespace matrix_access +}//namespace gtx +}//namespace glm + diff --git a/glm/gtx/matrix_cross_product.hpp b/glm/gtx/matrix_cross_product.hpp new file mode 100644 index 00000000..49fb8bd7 --- /dev/null +++ b/glm/gtx/matrix_cross_product.hpp @@ -0,0 +1,52 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2006-11-13 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_cross_product.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_cross_product +#define glm_gtx_matrix_cross_product + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_matrix_cross_product(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_matrix_cross_product: Build cross product matrices + namespace matrix_cross_product + { + //! Build a cross product matrix. + //! From GLM_GTX_matrix_cross_product extension. + template + detail::tmat3x3 matrixCross3( + detail::tvec3 const & x); + + //! Build a cross product matrix. + //! From GLM_GTX_matrix_cross_product extension. + template + detail::tmat4x4 matrixCross4( + detail::tvec3 const & x); + + }//namespace matrix_cross_product + }//namespace gtx +}//namespace glm + +#define GLM_GTX_matrix_cross_product namespace gtx::matrix_cross_product +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_matrix_cross_product;} +#endif//GLM_GTX_GLOBAL + +#include "matrix_cross_product.inl" + +#endif//glm_gtx_matrix_cross_product diff --git a/glm/gtx/matrix_cross_product.inl b/glm/gtx/matrix_cross_product.inl new file mode 100644 index 00000000..caebb8ef --- /dev/null +++ b/glm/gtx/matrix_cross_product.inl @@ -0,0 +1,44 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2005-12-21 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_cross_product.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace matrix_cross_product +{ + template + inline detail::tmat3x3 matrixCross3( + detail::tvec3 const & x) + { + detail::tmat3x3 Result(T(0)); + Result[0][1] = x.z; + Result[1][0] = -x.z; + Result[0][2] = -x.y; + Result[2][0] = x.y; + Result[1][2] = x.x; + Result[2][1] = -x.x; + return Result; + } + + template + inline detail::tmat4x4 matrixCross4( + detail::tvec3 const & x) + { + detail::tmat4x4 Result(T(0)); + Result[0][1] = x.z; + Result[1][0] = -x.z; + Result[0][2] = -x.y; + Result[2][0] = x.y; + Result[1][2] = x.x; + Result[2][1] = -x.x; + return Result; + } + +}//namespace matrix_cross_product +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/matrix_major_storage.hpp b/glm/gtx/matrix_major_storage.hpp new file mode 100644 index 00000000..d15dfc0d --- /dev/null +++ b/glm/gtx/matrix_major_storage.hpp @@ -0,0 +1,120 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-04-19 +// Updated : 2009-02-19 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_major_storage.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_major_storage +#define glm_gtx_matrix_major_storage + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_matrix_cross_product: Build matrices with specific matrix order, row or column + namespace matrix_major_storage + { + //! Build a row major matrix from row vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat2x2 rowMajor2( + const detail::tvec2& v1, + const detail::tvec2& v2); + + //! Build a row major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat2x2 rowMajor2( + const detail::tmat2x2& m); + + //! Build a row major matrix from row vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat3x3 rowMajor3( + const detail::tvec3& v1, + const detail::tvec3& v2, + const detail::tvec3& v3); + + //! Build a row major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat3x3 rowMajor3( + const detail::tmat3x3& m); + + //! Build a row major matrix from row vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat4x4 rowMajor4( + const detail::tvec4& v1, + const detail::tvec4& v2, + const detail::tvec4& v3, + const detail::tvec4& v4); + + //! Build a row major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat4x4 rowMajor4( + const detail::tmat4x4& m); + + //! Build a column major matrix from column vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat2x2 colMajor2( + const detail::tvec2& v1, + const detail::tvec2& v2); + + //! Build a column major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat2x2 colMajor2( + const detail::tmat2x2& m); + + //! Build a column major matrix from column vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat3x3 colMajor3( + const detail::tvec3& v1, + const detail::tvec3& v2, + const detail::tvec3& v3); + + //! Build a column major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat3x3 colMajor3( + const detail::tmat3x3& m); + + //! Build a column major matrix from column vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat4x4 colMajor4( + const detail::tvec4& v1, + const detail::tvec4& v2, + const detail::tvec4& v3, + const detail::tvec4& v4); + + //! Build a column major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + detail::tmat4x4 colMajor4( + const detail::tmat4x4& m); + + }//namespace matrix_major_storage + }//namespace gtx +}//namespace glm + +#define GLM_GTX_matrix_major_storage namespace gtx::matrix_major_storage +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_matrix_major_storage;} +#endif//GLM_GTX_GLOBAL + +#include "matrix_major_storage.inl" + +#endif//glm_gtx_matrix_major_storage diff --git a/glm/gtx/matrix_major_storage.inl b/glm/gtx/matrix_major_storage.inl new file mode 100644 index 00000000..a031c674 --- /dev/null +++ b/glm/gtx/matrix_major_storage.inl @@ -0,0 +1,176 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-04-19 +// Updated : 2009-02-19 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_major_storage.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace matrix_major_storage +{ + template + inline detail::tmat2x2 rowMajor2( + const detail::tvec2& v1, + const detail::tvec2& v2) + { + detail::tmat2x2 Result; + Result[0][0] = v1.x; + Result[1][0] = v1.y; + Result[0][1] = v2.x; + Result[1][1] = v2.y; + return Result; + } + + template + inline detail::tmat2x2 rowMajor2( + const detail::tmat2x2& m) + { + detail::tmat2x2 Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + return Result; + } + + template + inline detail::tmat3x3 rowMajor3( + const detail::tvec3& v1, + const detail::tvec3& v2, + const detail::tvec3& v3) + { + detail::tmat3x3 Result; + Result[0][0] = v1.x; + Result[1][0] = v1.y; + Result[2][0] = v1.z; + Result[0][1] = v2.x; + Result[1][1] = v2.y; + Result[2][1] = v2.z; + Result[0][2] = v3.x; + Result[1][2] = v3.y; + Result[2][2] = v3.z; + return Result; + } + + template + inline detail::tmat3x3 rowMajor3( + const detail::tmat3x3& m) + { + detail::tmat3x3 Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + return Result; + } + + template + inline detail::tmat4x4 rowMajor4( + const detail::tvec4& v1, + const detail::tvec4& v2, + const detail::tvec4& v3, + const detail::tvec4& v4) + { + detail::tmat4x4 Result; + Result[0][0] = v1.x; + Result[1][0] = v1.y; + Result[2][0] = v1.z; + Result[3][0] = v1.w; + Result[0][1] = v2.x; + Result[1][1] = v2.y; + Result[2][1] = v2.z; + Result[3][1] = v2.w; + Result[0][2] = v3.x; + Result[1][2] = v3.y; + Result[2][2] = v3.z; + Result[3][2] = v3.w; + Result[0][3] = v4.x; + Result[1][3] = v4.y; + Result[2][3] = v4.z; + Result[3][3] = v4.w; + return Result; + } + + template + inline detail::tmat4x4 rowMajor4( + const detail::tmat4x4& m) + { + detail::tmat4x4 Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[0][3] = m[3][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[1][3] = m[3][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + Result[2][3] = m[3][2]; + Result[3][0] = m[0][3]; + Result[3][1] = m[1][3]; + Result[3][2] = m[2][3]; + Result[3][3] = m[3][3]; + return Result; + } + + template + inline detail::tmat2x2 colMajor2( + const detail::tvec2& v1, + const detail::tvec2& v2) + { + return detail::tmat2x2(v1, v2); + } + + template + inline detail::tmat2x2 colMajor2( + const detail::tmat2x2& m) + { + return detail::tmat2x2(m); + } + + template + inline detail::tmat3x3 colMajor3( + const detail::tvec3& v1, + const detail::tvec3& v2, + const detail::tvec3& v3) + { + return detail::tmat3x3(v1, v2, v3); + } + + template + inline detail::tmat3x3 colMajor3( + const detail::tmat3x3& m) + { + return detail::tmat3x3(m); + } + + template + inline detail::tmat4x4 colMajor4( + const detail::tvec4& v1, + const detail::tvec4& v2, + const detail::tvec4& v3, + const detail::tvec4& v4) + { + return detail::tmat4x4(v1, v2, v3, v4); + } + + template + inline detail::tmat4x4 colMajor4( + const detail::tmat4x4& m) + { + return detail::tmat4x4(m); + } + +}//namespace matrix_major_storage +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/matrix_operation.hpp b/glm/gtx/matrix_operation.hpp new file mode 100644 index 00000000..6bcff5bb --- /dev/null +++ b/glm/gtx/matrix_operation.hpp @@ -0,0 +1,94 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-08-29 +// Updated : 2009-08-29 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_operation.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_operation +#define glm_gtx_matrix_operation + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_matrix_operation(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_matrix_operation: Build cross product matrices + namespace matrix_operation + { + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + detail::tmat2x2 diagonal2x2( + detail::tvec2 const & v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + detail::tmat2x3 diagonal2x3( + detail::tvec2 const & v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + detail::tmat2x4 diagonal2x4( + detail::tvec2 const & v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + detail::tmat3x2 diagonal3x2( + detail::tvec2 const & v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + detail::tmat3x3 diagonal3x3( + detail::tvec3 const & v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + detail::tmat3x4 diagonal3x4( + detail::tvec3 const & v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + detail::tmat4x2 diagonal4x2( + detail::tvec2 const & v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + detail::tmat4x3 diagonal4x3( + detail::tvec3 const & v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + detail::tmat4x4 diagonal4x4( + detail::tvec4 const & v); + + }//namespace matrix_operation + }//namespace gtx +}//namespace glm + +#define GLM_GTX_matrix_operation namespace gtx::matrix_operation +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_matrix_operation;} +#endif//GLM_GTX_GLOBAL + +#include "matrix_operation.inl" + +#endif//glm_gtx_matrix_operation diff --git a/glm/gtx/matrix_operation.inl b/glm/gtx/matrix_operation.inl new file mode 100644 index 00000000..4db10bc1 --- /dev/null +++ b/glm/gtx/matrix_operation.inl @@ -0,0 +1,129 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-08-29 +// Updated : 2009-08-29 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_operation.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtc{ +namespace matrix_operation +{ + template + inline detail::tmat2x2 diagonal2x2 + ( + detail::tvec2 const & v + ) + { + detail::tmat2x2 Result(valType(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + inline detail::tmat2x3 diagonal2x3 + ( + detail::tvec2 const & v + ) + { + detail::tmat2x3 Result(valType(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + inline detail::tmat2x4 diagonal2x4 + ( + detail::tvec2 const & v + ) + { + detail::tmat2x4 Result(valType(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + inline detail::tmat3x2 diagonal3x2 + ( + detail::tvec2 const & v + ) + { + detail::tmat3x2 Result(valType(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + inline detail::tmat3x3 diagonal3x3 + ( + detail::tvec3 const & v + ) + { + detail::tmat3x3 Result(valType(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + return Result; + } + + template + inline detail::tmat3x4 diagonal3x4 + ( + detail::tvec3 const & v + ) + { + detail::tmat3x4 Result(valType(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + return Result; + } + + template + inline detail::tmat4x4 diagonal4x4 + ( + detail::tvec4 const & v + ) + { + detail::tmat4x4 Result(valType(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + Result[3][3] = v[3]; + return Result; + } + + template + inline detail::tmat4x3 diagonal4x3 + ( + detail::tvec3 const & v + ) + { + detail::tmat4x3 Result(valType(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + return Result; + } + + template + inline detail::tmat4x2 diagonal4x2 + ( + detail::tvec2 const & v + ) + { + detail::tmat4x2 Result(valType(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + +}//namespace matrix_operation +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/matrix_projection.hpp b/glm/gtx/matrix_projection.hpp new file mode 100644 index 00000000..bc8d50f5 --- /dev/null +++ b/glm/gtx/matrix_projection.hpp @@ -0,0 +1,64 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_projection.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTC_matrix_projection +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_projection +#define glm_gtx_matrix_projection + +// Dependency: +#include "../glm.hpp" +#include "../gtc/matrix_projection.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_matrix_projection(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_matrix_projection: Varius ways to build and operate on projection matrices + namespace matrix_projection + { + //! Builds a perspective projection matrix based on a field of view + //! From GLM_GTX_matrix_projection extension. + template + detail::tmat4x4 perspectiveFov( + valType const & fov, + valType const & width, + valType const & height, + valType const & zNear, + valType const & zFar); + + //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite . + //! From GLM_GTX_matrix_projection extension. + template + detail::tmat4x4 infinitePerspective( + T fovy, T aspect, T zNear); + + //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. + //! From GLM_GTX_matrix_projection extension. + template + detail::tmat4x4 tweakedInfinitePerspective( + T fovy, T aspect, T zNear); + + }//namespace matrix_projection + }//namespace gtx +}//namespace glm + +#define GLM_GTX_matrix_projection namespace gtc::matrix_projection; using namespace gtx::matrix_projection +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_matrix_projection;} +#endif//GLM_GTX_GLOBAL + +#include "matrix_projection.inl" + +#endif//glm_gtx_matrix_projection diff --git a/glm/gtx/matrix_projection.inl b/glm/gtx/matrix_projection.inl new file mode 100644 index 00000000..e6b5127a --- /dev/null +++ b/glm/gtx/matrix_projection.inl @@ -0,0 +1,81 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_projection.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace matrix_projection +{ + template + inline detail::tmat4x4 perspectiveFov + ( + valType const & fov, + valType const & width, + valType const & height, + valType const & zNear, + valType const & zFar + ) + { + valType rad = glm::radians(fov); + valType h = glm::cos(valType(0.5) * rad) / glm::sin(valType(0.5) * rad); + valType w = h * height / width; + + detail::tmat4x4 Result(valType(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = (zFar + zNear) / (zFar - zNear); + Result[2][3] = valType(1); + Result[3][2] = -(valType(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + inline detail::tmat4x4 infinitePerspective( + T fovy, + T aspect, + T zNear) + { + T range = tan(radians(fovy / T(2))) * zNear; + T left = -range * aspect; + T right = range * aspect; + T bottom = -range; + T top = range; + + detail::tmat4x4 Result(T(0)); + Result[0][0] = (T(2) * zNear) / (right - left); + Result[1][1] = (T(2) * zNear) / (top - bottom); + Result[2][2] = - T(1); + Result[2][3] = - T(1); + Result[3][2] = - T(2) * zNear; + return Result; + } + + template + inline detail::tmat4x4 tweakedInfinitePerspective( + T fovy, + T aspect, + T zNear) + { + T range = tan(radians(fovy / T(2))) * zNear; + T left = -range * aspect; + T right = range * aspect; + T bottom = -range; + T top = range; + + detail::tmat4x4 Result(T(0)); + Result[0][0] = (T(2) * zNear) / (right - left); + Result[1][1] = (T(2) * zNear) / (top - bottom); + Result[2][2] = T(0.0001) - T(1); + Result[2][3] = T(-1); + Result[3][2] = - (T(0.0001) - T(2)) * zNear; + return Result; + } + +}//namespace matrix_projection +}//namespace gtc +}//namespace glm diff --git a/glm/gtx/matrix_query.hpp b/glm/gtx/matrix_query.hpp new file mode 100644 index 00000000..f23a5a34 --- /dev/null +++ b/glm/gtx/matrix_query.hpp @@ -0,0 +1,98 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-03-05 +// Updated : 2007-03-05 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_query.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_query +#define glm_gtx_matrix_query + +// Dependency: +#include "../glm.hpp" +//#include +#include + +namespace glm +{ + namespace test{ + void main_gtx_matrix_query(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_matrix_query: Query to evaluate matrices properties + namespace matrix_query + { + //! Return if a matrix a null matrix. + //! From GLM_GTX_matrix_query extension. + template + bool isNull( + const detail::tmat2x2& m, + const T epsilon = std::numeric_limits::epsilon()); + + //! Return if a matrix a null matrix. + //! From GLM_GTX_matrix_query extension. + template + bool isNull( + const detail::tmat3x3& m, + const T epsilon = std::numeric_limits::epsilon()); + + //! Return if a matrix a null matrix. + //! From GLM_GTX_matrix_query extension. + template + bool isNull( + const detail::tmat4x4& m, + const T epsilon = std::numeric_limits::epsilon()); + + //! Return if a matrix an identity matrix. + //! From GLM_GTX_matrix_query extension. + template + bool isIdentity( + const genType& m, + const typename genType::value_type epsilon = std::numeric_limits::epsilon()); + + //! Return if a matrix a normalized matrix. + //! From GLM_GTX_matrix_query extension. + template + bool isNormalized( + const detail::tmat2x2& m, + const T epsilon = std::numeric_limits::epsilon()); + + //! Return if a matrix a normalized matrix. + //! From GLM_GTX_matrix_query extension. + template + bool isNormalized( + const detail::tmat3x3& m, + const T epsilon = std::numeric_limits::epsilon()); + + //! Return if a matrix a normalized matrix. + //! From GLM_GTX_matrix_query extension. + template + bool isNormalized( + const detail::tmat4x4& m, + const T epsilon = std::numeric_limits::epsilon()); + + //! Return if a matrix an orthonormalized matrix. + //! From GLM_GTX_matrix_query extension. + template + bool isOrthogonal( + const genType& m, + const typename genType::value_type epsilon = std::numeric_limits::epsilon()); + + }//namespace matrix_query + }//namespace gtx +}//namespace glm + +#define GLM_GTX_matrix_query namespace gtx::matrix_query +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_matrix_query;} +#endif//GLM_GTX_GLOBAL + +#include "matrix_query.inl" + +#endif//glm_gtx_matrix_query diff --git a/glm/gtx/matrix_query.inl b/glm/gtx/matrix_query.inl new file mode 100644 index 00000000..4e335421 --- /dev/null +++ b/glm/gtx/matrix_query.inl @@ -0,0 +1,144 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-03-05 +// Updated : 2007-03-05 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_query.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace matrix_query +{ + template + inline bool isNull( + const detail::tmat2x2& m, + const T epsilon) + { + bool result = true; + for(int i = 0; result && i < 2 ; ++i) + result = isNull(m[i], epsilon); + return result; + } + + template + inline bool isNull( + const detail::tmat3x3& m, + const T epsilon) + { + bool result = true; + for(int i = 0; result && i < 3 ; ++i) + result = isNull(m[i], epsilon); + return result; + } + + template + inline bool isNull( + const detail::tmat4x4& m, + const T epsilon) + { + bool result = true; + for(int i = 0; result && i < 4 ; ++i) + result = isNull(m[i], epsilon); + return result; + } + + template + inline bool isIdentity( + const genType& m, + const typename genType::value_type epsilon) + { + bool result = true; + for(typename genType::value_type i = typename genType::value_type(0); result && i < genType::col_size(); ++i) + { + for(typename genType::value_type j = typename genType::value_type(0); result && j < i ; ++j) + result = abs(m[i][j]) <= epsilon; + if(result) + result = abs(m[i][i] - typename genType::value_type(1)) <= epsilon; + for(typename genType::value_type j = i + typename genType::value_type(1); result && j < genType::row_size(); ++j) + result = abs(m[i][j]) <= epsilon; + } + return result; + } + + template + inline bool isNormalized( + const detail::tmat2x2& m, + const T epsilon) + { + bool result = true; + for(int i = 0; result && i < 2; ++i) + result = isNormalized(m[i], epsilon); + for(int i = 0; result && i < 2; ++i) + { + detail::tvec2 v; + for(int j = 0; j < 2; ++j) + v[j] = m[j][i]; + result = isNormalized(v, epsilon); + } + return result; + } + + template + inline bool isNormalized( + const detail::tmat3x3& m, + const T epsilon) + { + bool result = true; + for(int i = 0; result && i < 3; ++i) + result = isNormalized(m[i], epsilon); + for(int i = 0; result && i < 3; ++i) + { + detail::tvec3 v; + for(int j = 0; j < 3; ++j) + v[j] = m[j][i]; + result = isNormalized(v, epsilon); + } + return result; + } + + template + inline bool isNormalized( + const detail::tmat4x4& m, + const T epsilon) + { + bool result = true; + for(int i = 0; result && i < 4; ++i) + result = isNormalized(m[i], epsilon); + for(int i = 0; result && i < 4; ++i) + { + detail::tvec4 v; + for(int j = 0; j < 4; ++j) + v[j] = m[j][i]; + result = isNormalized(v, epsilon); + } + return result; + } + + template + inline bool isOrthogonal( + const genType& m, + const typename genType::value_type epsilon) + { + bool result = true; + for(int i = 0; result && i < genType::col_size() - 1; ++i) + for(int j= i + 1; result && j < genType::col_size(); ++j) + result = areOrthogonal(m[i], m[j], epsilon); + + if(result) + { + genType tmp = transpose(m); + for(int i = 0; result && i < genType::col_size() - 1 ; ++i) + for(int j = i + 1; result && j < genType::col_size(); ++j) + result = areOrthogonal(tmp[i], tmp[j], epsilon); + } + return result; + } + +}//namespace matrix_query +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/matrix_selection.hpp b/glm/gtx/matrix_selection.hpp new file mode 100644 index 00000000..0027fa79 --- /dev/null +++ b/glm/gtx/matrix_selection.hpp @@ -0,0 +1,82 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-02-19 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_selection.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matrix_selection +#define glm_gtx_matrix_selection + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_matrix_selection(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_matrix_selection extension: Access to matrix columns or rows. + namespace matrix_selection + { + //! Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the row index. + //! From GLM_GTX_matrix_selection extension. + template + detail::tvec2 row( + const detail::tmat2x2& m, + int index); + + //! Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the row index. + //! From GLM_GTX_matrix_selection extension. + template + detail::tvec3 row( + const detail::tmat3x3& m, + int index); + + //! Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the row index. + //! From GLM_GTX_matrix_selection extension. + template + detail::tvec4 row( + const detail::tmat4x4& m, + int index); + + //! Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the column index. + //! From GLM_GTX_matrix_selection extension. + template + detail::tvec2 column( + const detail::tmat2x2& m, + int index); + + //! Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the column index. + //! From GLM_GTX_matrix_selection extension. + template + detail::tvec3 column( + const detail::tmat3x3& m, + int index); + + //! Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the column index. + //! From GLM_GTX_matrix_selection extension. + template + detail::tvec4 column( + const detail::tmat4x4& m, + int index); + + }//namespace matrix_selection + }//namespace gtx +}//namespace glm + +#define GLM_GTX_matrix_selection namespace gtx::matrix_selection +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_matrix_selection;} +#endif//GLM_GTX_GLOBAL + +#include "matrix_selection.inl" + +#endif//glm_gtx_matrix_selection diff --git a/glm/gtx/matrix_selection.inl b/glm/gtx/matrix_selection.inl new file mode 100644 index 00000000..d303965f --- /dev/null +++ b/glm/gtx/matrix_selection.inl @@ -0,0 +1,65 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-02-19 +// Licence : This source is under MIT License +// File : glm/gtx/matrix_selection.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace matrix_selection +{ + template + inline detail::tvec2 row( + const detail::tmat2x2& m, + int index) + { + return detail::tvec2(m[0][index], m[1][index]); + } + + template + inline detail::tvec3 row( + const detail::tmat3x3& m, + int index) + { + return detail::tvec3(m[0][index], m[1][index], m[2][index]); + } + + template + inline detail::tvec4 row( + const detail::tmat4x4& m, + int index) + { + return detail::tvec4(m[0][index], m[1][index], m[2][index], m[3][index]); + } + + template + inline detail::tvec2 column( + const detail::tmat2x2& m, + int index) + { + return m[index]; + } + + template + inline detail::tvec3 column( + const detail::tmat3x3& m, + int index) + { + return m[index]; + } + + template + inline detail::tvec4 column( + const detail::tmat4x4& m, + int index) + { + return m[index]; + } + +}//namespace matrix_selection +}//namespace gtx +}//namespace glm + diff --git a/glm/gtx/matx.hpp b/glm/gtx/matx.hpp new file mode 100644 index 00000000..507ea6e5 --- /dev/null +++ b/glm/gtx/matx.hpp @@ -0,0 +1,182 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-02-21 +// Updated : 2007-03-01 +// Licence : This source is under MIT License +// File : glm/gtx/matx.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_vecx +// - GLM_GTX_matrix_selection +// - GLM_GTX_matrix_access +// - GLM_GTX_inverse_transpose +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_matx +#define glm_gtx_matx + +// Dependency: +#include "../glm.hpp" +#include "../gtx/vecx.hpp" + +namespace glm{ +namespace detail{ + + template + class _xmatxGTX + { + private: + // Data + _xvecxGTX value[N]; + + public: + _xmatxGTX _inverse() const; + + public: + typedef T value_type; + typedef int size_type; + static const size_type value_size; + + // Constructors + _xmatxGTX(); + explicit _xmatxGTX(const T x); + + // Accesses + _xvecxGTX& operator[](int i) {return value[i];} + const _xvecxGTX & operator[](int i) const {return value[i];} + operator T*() {return &value[0][0];} + operator const T*() const {return &value[0][0];} + + // Unary updatable operators + _xmatxGTX& operator= (const _xmatxGTX& m); + _xmatxGTX& operator+= (const T s); + _xmatxGTX& operator+= (const _xmatxGTX& m); + _xmatxGTX& operator-= (const T s); + _xmatxGTX& operator-= (const _xmatxGTX& m); + _xmatxGTX& operator*= (const T s); + _xmatxGTX& operator*= (const _xmatxGTX& m); + _xmatxGTX& operator/= (const T s); + _xmatxGTX& operator/= (const _xmatxGTX& m); + _xmatxGTX& operator++ (); + _xmatxGTX& operator-- (); + }; + + // Binary operators + template + _xmatxGTX operator+ (const _xmatxGTX& m, const T s); + + template + _xmatxGTX operator+ (const T s, const _xmatxGTX& m); + + template + _xvecxGTX operator+ (const _xmatxGTX& m, const _xvecxGTX& v); + + template + _xvecxGTX operator+ (const _xvecxGTX& v, const _xmatxGTX& m); + + template + _xmatxGTX operator+ (const _xmatxGTX& m1, const _xmatxGTX& m2); + + template + _xmatxGTX operator- (const _xmatxGTX& m, const T s); + + template + _xmatxGTX operator- (const T s, const _xmatxGTX& m); + + template + _xvecxGTX operator- (const _xmatxGTX& m, const _xvecxGTX& v); + + template + _xvecxGTX operator- (const _xvecxGTX& v, const _xmatxGTX& m); + + template + _xmatxGTX operator- (const _xmatxGTX& m1, const _xmatxGTX& m2); + + template + _xmatxGTX operator* (const _xmatxGTX& m, const T s); + + template + _xmatxGTX operator* (const T s, const _xmatxGTX& m); + + template + _xvecxGTX operator* (const _xmatxGTX& m, const _xvecxGTX& v); + + template + _xvecxGTX operator* (const _xvecxGTX& v, const _xmatxGTX& m); + + template + _xmatxGTX operator* (const _xmatxGTX& m1, const _xmatxGTX& m2); + + template + _xmatxGTX operator/ (const _xmatxGTX& m, const T s); + + template + _xmatxGTX operator/ (const T s, const _xmatxGTX& m); + + template + _xvecxGTX operator/ (const _xmatxGTX& m, const _xvecxGTX& v); + + template + _xvecxGTX operator/ (const _xvecxGTX& v, const _xmatxGTX& m); + + template + _xmatxGTX operator/ (const _xmatxGTX& m1, const _xmatxGTX& m2); + + // Unary constant operators + template + const _xmatxGTX operator- (const _xmatxGTX& m); + + template + const _xmatxGTX operator-- (const _xmatxGTX& m, int); + + template + const _xmatxGTX operator++ (const _xmatxGTX& m, int); + +}//namespace detail + + // Extension functions + template detail::_xmatxGTX matrixCompMultGTX(const detail::_xmatxGTX& x, const detail::_xmatxGTX& y); + template detail::_xmatxGTX outerProductGTX(const detail::_xvecxGTX& c, const detail::_xvecxGTX& r); + template detail::_xmatxGTX transposeGTX(const detail::_xmatxGTX& x); + + template T determinantGTX(const detail::_xmatxGTX& m); + template detail::_xmatxGTX inverseTransposeGTX(const detail::_xmatxGTX & m); + + template void columnGTX(detail::_xmatxGTX& m, int ColIndex, const detail::_xvecxGTX& v); + template void rowGTX(detail::_xmatxGTX& m, int RowIndex, const detail::_xvecxGTX& v); + + template detail::_xvecxGTX columnGTX(const detail::_xmatxGTX& m, int ColIndex); + template detail::_xvecxGTX rowGTX(const detail::_xmatxGTX& m, int RowIndex); + + namespace gtx + { + //! GLM_GTX_matx extension: - Work in progress - NxN matrix types. + namespace matx + { + // Matrix Functions + template inline detail::_xmatxGTX matrixCompMult(const detail::_xmatxGTX& x, const detail::_xmatxGTX& y){return matrixCompMult(x, y);} + template inline detail::_xmatxGTX outerProduct(const detail::_xvecxGTX& c, const detail::_xvecxGTX& r){return outerProductGTX(c, r);} + template inline detail::_xmatxGTX transpose(const detail::_xmatxGTX& x){return transposeGTX(x);} + + template inline T determinant(const detail::_xmatxGTX& m){return determinantGTX(m);} + template inline detail::_xmatxGTX inverseTranspose(const detail::_xmatxGTX& m){return inverseTransposeGTX(m);} + + template inline void column(detail::_xmatxGTX& m, int ColIndex, const detail::_xvecxGTX& v){setColumnGTX(m, v);} + template inline void row(detail::_xmatxGTX& m, int RowIndex, const detail::_xvecxGTX& v){setRowGTX(m, v);} + + template inline detail::_xvecxGTX column(const detail::_xmatxGTX& m, int ColIndex){return column(m, ColIndex);} + template inline detail::_xvecxGTX row(const detail::_xmatxGTX& m, int RowIndex){return row(m, RowIndex);} + } + } +} + +#define GLM_GTX_matx namespace gtx::matx +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_matx;} +#endif//GLM_GTX_GLOBAL + +#include "matx.inl" + +#endif//glm_gtx_matx diff --git a/glm/gtx/matx.inl b/glm/gtx/matx.inl new file mode 100644 index 00000000..120c29e8 --- /dev/null +++ b/glm/gtx/matx.inl @@ -0,0 +1,479 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-02-21 +// Updated : 2007-02-21 +// Licence : This source is under MIT License +// File : glm/gtx/matx.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +namespace glm{ +namespace detail{ + + template const typename _xmatxGTX::size_type _xmatxGTX::value_size = N; + + ////////////////////////////////////////////////////////////// + // _xmatxGTX constructors + + template + inline _xmatxGTX::_xmatxGTX() + { + for(int i = 0; i < N; ++i) + this->value[i][i] = T(0); + } + + template + inline _xmatxGTX::_xmatxGTX(const T f) + { + for(int i = 0; i < N; ++i) + this->value[i][i] = f; + } + + ////////////////////////////////////////////////////////////// + // _xmatxGTX operators + + // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared + template + inline _xmatxGTX& _xmatxGTX::operator= (const _xmatxGTX& m) + { + //memcpy could be faster + //memcpy(&this->value, &m.value, 16 * sizeof(T)); + for(int i = 0; i < N; ++i) + this->value[i] = m[i]; + return *this; + } + + template + inline _xmatxGTX& _xmatxGTX::operator+= (const T s) + { + for(int i = 0; i < N; ++i) + this->value[i] += s; + return *this; + } + + template + inline _xmatxGTX& _xmatxGTX::operator+= (const _xmatxGTX& m) + { + for(int i = 0; i < N; ++i) + this->value[i] += m[i]; + return *this; + } + + template + inline _xmatxGTX& _xmatxGTX::operator-= (const T s) + { + for(int i = 0; i < N; ++i) + this->value[i] -= s; + return *this; + } + + template + inline _xmatxGTX& _xmatxGTX::operator-= (const _xmatxGTX& m) + { + for(int i = 0; i < N; ++i) + this->value[i] -= m[i]; + return *this; + } + + template + inline _xmatxGTX& _xmatxGTX::operator*= (const T s) + { + for(int i = 0; i < N; ++i) + this->value[i] *= s; + return *this; + } + + template + inline _xmatxGTX& _xmatxGTX::operator*= (const _xmatxGTX& m) + { + return (*this = *this * m); + } + + template + inline _xmatxGTX& _xmatxGTX::operator/= (const T s) + { + for(int i = 0; i < N; ++i) + this->value[i] /= s; + return *this; + } + + template + inline _xmatxGTX& _xmatxGTX::operator/= (const _xmatxGTX& m) + { + return (*this = *this / m); + } + + template + inline _xmatxGTX& _xmatxGTX::operator-- () + { + for(int i = 0; i < N; ++i) + --this->value[i]; + return *this; + } + + template + inline _xmatxGTX& _xmatxGTX::operator++ () + { + for(int i = 0; i < N; ++i) + ++this->value[i]; + return *this; + } + + // Private functions + template + inline _xmatxGTX _xmatxGTX::_inverse() const + { + _xmatxGTX Result = *this; + + int ColIndex[N]; + int RowIndex[N]; + bool Pivoted[N]; + memset(ColIndex, 0, N * sizeof(int)); + memset(RowIndex, 0, N * sizeof(int)); + memset(Pivoted, 0, N * sizeof(bool)); + + int iRow = 0, iCol = 0; + + // elimination by full pivoting + for(int i0 = 0; i0 < N; i0++) + { + // search matrix (excluding pivoted rows) for maximum absolute entry + T fMax = T(0); + for(int i1 = 0; i1 < N; i1++) + { + if(Pivoted[i1]) + continue; + + for(int i2 = 0; i2 < N; i2++) + { + if(Pivoted[i2]) + continue; + + T Abs = abs(Result[i1][i2]); + if(Abs > fMax) + { + fMax = Abs; + iRow = i1; + iCol = i2; + } + } + } + + if(fMax == T(0)) + { + return _xmatxGTX(1.0f); // Error + } + + Pivoted[iCol] = true; + + // swap rows so that A[iCol][iCol] contains the pivot entry + if(iRow != iCol) + { + _xvecxGTX Row = rowGTX(Result, iRow); + _xvecxGTX Col = rowGTX(Result, iCol); + rowGTX(Result, iRow, Col); + rowGTX(Result, iCol, Row); + } + + // keep track of the permutations of the rows + RowIndex[i0] = iRow; + ColIndex[i0] = iCol; + + // scale the row so that the pivot entry is 1 + T fInv = T(1) / Result[iCol][iCol]; + Result[iCol][iCol] = T(1); + for(int i2 = 0; i2 < N; i2++) + Result[iCol][i2] *= fInv; + + // zero out the pivot column locations in the other rows + for(int i1 = 0; i1 < N; ++i1) + { + if(i1 == iCol) + continue; + + T Tmp = Result[i1][iCol]; + Result[i1][iCol] = T(0); + for(int i2 = 0; i2 < N; i2++) + Result[i1][i2] -= Result[iCol][i2] * Tmp; + } + } + + // reorder rows so that A[][] stores the inverse of the original matrix + for(int i1 = N-1; i1 >= 0; --i1) + { + if(RowIndex[i1] == ColIndex[i1]) + continue; + for(int i2 = 0; i2 < N; ++i2) + std::swap(Result[i2][RowIndex[i1]], Result[i2][ColIndex[i1]]); + } + + return Result; + } + + // Binary operators + template + inline _xmatxGTX operator+ (const _xmatxGTX& m, const T s) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = m[i] + s; + return result; + } + + template + inline _xmatxGTX operator+ (const T s, const _xmatxGTX& m) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = s + m[i]; + return result; + } +/* + template + inline tvec4 operator+ (const _xmatxGTX& m, const tvec4& v) + { + + } + + template + inline tvec4 operator+ (const tvec4& v, const _xmatxGTX& m) + { + + } +*/ + template + inline _xmatxGTX operator+ (const _xmatxGTX& m1, const _xmatxGTX& m2) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = m1[i] + m2[i]; + return result; + } + + template + inline _xmatxGTX operator- (const _xmatxGTX& m, const T s) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = m[i] - s; + return result; + } + + template + inline _xmatxGTX operator- (const T s, const _xmatxGTX& m) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = s - m[i]; + return result; + } +/* + template + inline tvec4 operator- (const _xmatxGTX& m, const tvec4& v) + { + + } + + template + inline tvec4 operator- (const tvec4& v, const _xmatxGTX& m) + { + + } +*/ + template + inline _xmatxGTX operator- (const _xmatxGTX& m1, const _xmatxGTX& m2) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = m1[i] - m2[i]; + return result; + } + + template + inline _xmatxGTX operator* (const _xmatxGTX& m, const T s) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = m[i] * s; + return result; + } + + template + inline _xmatxGTX operator* (const T s, const _xmatxGTX& m) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = s * m[i]; + return result; + } + + template + inline _xvecxGTX operator* (const _xmatxGTX& m, const _xvecxGTX& v) + { + _xvecxGTX result(T(0)); + for(int j = 0; j < N; ++j) + for(int i = 0; i < N; ++i) + result[j] += m[i][j] * v[i]; + return result; + } + + template + inline _xvecxGTX operator* (const _xvecxGTX& v, const _xmatxGTX& m) + { + _xvecxGTX result(T(0)); + for(int j = 0; j < N; ++j) + for(int i = 0; i < N; ++i) + result[j] += m[j][i] * v[i]; + return result; + } + + template + inline _xmatxGTX operator* (const _xmatxGTX& m1, const _xmatxGTX& m2) + { + _xmatxGTX Result(T(0)); + for(int k = 0; k < N; ++k) + for(int j = 0; j < N; ++j) + for(int i = 0; i < N; ++i) + Result[k][j] += m1[i][j] * m2[k][i]; + return Result; + } + + template + inline _xmatxGTX operator/ (const _xmatxGTX& m, const T s) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = m[i] / s; + return result; + } + + template + inline _xmatxGTX operator/ (const T s, const _xmatxGTX& m) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = s / m[i]; + return result; + } + + template + inline _xvecxGTX operator/ (const _xmatxGTX& m, const _xvecxGTX& v) + { + return m._inverse() * v; + } + + template + inline _xvecxGTX operator/ (const _xvecxGTX& v, const _xmatxGTX& m) + { + return v * m._inverse(); + } + + template + inline _xmatxGTX operator/ (const _xmatxGTX& m1, const _xmatxGTX& m2) + { + return m1 * m2._inverse(); + } + + // Unary constant operators + template + inline const _xmatxGTX operator- (const _xmatxGTX& m) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = -m[i]; + return result; + } + + template + inline const _xmatxGTX operator++ (const _xmatxGTX& m, int) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = m[i] + T(1); + return result; + } + + template + inline const _xmatxGTX operator-- (const _xmatxGTX& m, int) + { + _xmatxGTX result; + for(int i = 0; i < N; ++i) + result[i] = m[i] - T(1); + return result; + } +}//namespace detail + + // Matrix Functions + template + inline detail::_xmatxGTX matrixCompMultGTX(const detail::_xmatxGTX& x, const detail::_xmatxGTX& y) + { + detail::_xmatxGTX result; + for(int j = 0; j < N; ++j) + for(int i = 0; i < N; ++i) + result[j][i] = x[j][i] * y[j][i]; + return result; + } + + template + inline detail::_xmatxGTX outerProductGTX(const detail::_xvecxGTX& c, const detail::_xvecxGTX& r) + { + detail::_xmatxGTX result; + for(int j = 0; j < N; ++j) + for(int i = 0; i < N; ++i) + result[j][i] = c[i] * r[j]; + return result; + } + + template + inline detail::_xmatxGTX transposeGTX(const detail::_xmatxGTX& m) + { + detail::_xmatxGTX result; + for(int j = 0; j < N; ++j) + for(int i = 0; i < N; ++i) + result[j][i] = m[i][j]; + return result; + } + + template + inline T determinantGTX(const detail::_xmatxGTX& m) + { + + } + + template + inline detail::_xmatxGTX inverseTransposeGTX(const detail::_xmatxGTX& m) + { + + } + + template + inline void columnGTX(detail::_xmatxGTX& m, int ColIndex, const detail::_xvecxGTX& v) + { + m[ColIndex] = v; + } + + template + inline void rowGTX(detail::_xmatxGTX& m, int RowIndex, const detail::_xvecxGTX& v) + { + for(int i = 0; i < N; ++i) + m[i][RowIndex] = v[i]; + } + + template + inline detail::_xvecxGTX columnGTX(const detail::_xmatxGTX& m, int ColIndex) + { + return m[ColIndex]; + } + + template + inline detail::_xvecxGTX rowGTX(const detail::_xmatxGTX& m, int RowIndex) + { + detail::_xvecxGTX v; + for(int i = 0; i < N; ++i) + v[i] = m[i][RowIndex]; + return v; + } +} //namespace glm diff --git a/glm/gtx/mixed_product.hpp b/glm/gtx/mixed_product.hpp new file mode 100644 index 00000000..8dcf2319 --- /dev/null +++ b/glm/gtx/mixed_product.hpp @@ -0,0 +1,46 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-04-03 +// Updated : 2008-09-17 +// Licence : This source is under MIT License +// File : glm/gtx/mixed_product.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_mixed_product +#define glm_gtx_mixed_product + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_matrix_selection(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_mixed_product extension: Mixed product of 3 vectors. + namespace mixed_product + { + //! \brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) + template + valType mixedProduct( + detail::tvec3 const & v1, + detail::tvec3 const & v2, + detail::tvec3 const & v3); + }//namespace mixed_product + }//namespace gtx +}//namespace glm + +#define GLM_GTX_mixed_product namespace gtx::mixed_product +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_mixed_product;} +#endif//GLM_GTX_GLOBAL + +#include "mixed_product.inl" + +#endif//glm_gtx_mixed_product diff --git a/glm/gtx/mixed_product.inl b/glm/gtx/mixed_product.inl new file mode 100644 index 00000000..4322a70b --- /dev/null +++ b/glm/gtx/mixed_product.inl @@ -0,0 +1,36 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-04-03 +// Updated : 2008-09-17 +// Licence : This source is under MIT License +// File : glm/gtx/mixed_product.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ + +namespace mixed_product +{ + template + inline valType mixedProduct( + detail::tvec3 const & v1, + detail::tvec3 const & v2, + detail::tvec3 const & v3) + { + return dot(cross(v1, v2), v3); + } +} +//namespace mixed_product + +}//namespace gtx +}//namespace glm + + + + + + + + + diff --git a/glm/gtx/norm.hpp b/glm/gtx/norm.hpp new file mode 100644 index 00000000..bf05d870 --- /dev/null +++ b/glm/gtx/norm.hpp @@ -0,0 +1,146 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2008-07-24 +// Licence : This source is under MIT License +// File : glm/gtx/norm.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_quaternion +// - GLM_GTC_double_float +/////////////////////////////////////////////////////////////////////////////////////////////////// +// ToDo: +// - Study the validity of the notion of length2 to quaternion +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_norm +#define glm_gtx_norm + +// Dependency: +#include "../glm.hpp" +#include "../gtc/double_float.hpp" +#include "../gtx/quaternion.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_norm(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_norm extension: Varius way to compute vector norms. + namespace norm + { + //! Returns the squared length of x. + //! From GLM_GTX_norm extension. + template + T length2( + const T x); + + //! Returns the squared length of x. + //! From GLM_GTX_norm extension. + template + T length2( + const detail::tvec2 & x); + + //! Returns the squared length of x. + //! From GLM_GTX_norm extension. + template + T length2( + const detail::tvec3& x); + + //! Returns the squared length of x. + //! From GLM_GTX_norm extension. + template + T length2( + const detail::tvec4& x); + + //! Returns the squared length of x. + //! From GLM_GTX_norm extension. + template + T length2( + const detail::tquat& q); + + //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). + //! From GLM_GTX_norm extension. + template + T distance2( + const T p0, + const T p1); + + //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). + //! From GLM_GTX_norm extension. + template + T distance2( + const detail::tvec2& p0, + const detail::tvec2& p1); + + //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). + //! From GLM_GTX_norm extension. + template + T distance2( + const detail::tvec3& p0, + const detail::tvec3& p1); + + //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). + //! From GLM_GTX_norm extension. + template + T distance2( + const detail::tvec4& p0, + const detail::tvec4& p1); + + //! Returns the L1 norm between x and y. + //! From GLM_GTX_norm extension. + template + T l1Norm( + const detail::tvec3& x, + const detail::tvec3& y); + + //! Returns the L1 norm of v. + //! From GLM_GTX_norm extension. + template + T l1Norm( + const detail::tvec3& v); + + //! Returns the L2 norm between x and y. + //! From GLM_GTX_norm extension. + template + T l2Norm( + const detail::tvec3& x, + const detail::tvec3& y); + + //! Returns the L2 norm of v. + //! From GLM_GTX_norm extension. + template + T l2Norm( + const detail::tvec3& x); + + //! Returns the L norm between x and y. + //! From GLM_GTX_norm extension. + template + T lxNorm( + const detail::tvec3& x, + const detail::tvec3& y, + unsigned int Depth); + + //! Returns the L norm of v. + //! From GLM_GTX_norm extension. + template + T lxNorm( + const detail::tvec3& x, + unsigned int Depth); + + }//namespace norm + }//namespace gtx +}//namespace glm + +#define GLM_GTX_norm namespace gtx::norm +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_norm;} +#endif//GLM_GTX_GLOBAL + +#include "norm.inl" + +#endif//glm_gtx_norm diff --git a/glm/gtx/norm.inl b/glm/gtx/norm.inl new file mode 100644 index 00000000..6ccb18da --- /dev/null +++ b/glm/gtx/norm.inl @@ -0,0 +1,130 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2008-07-24 +// Licence : This source is under MIT License +// File : glm/gtx/norm.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace norm +{ + template + inline T length2( + const T x) + { + return x * x; + } + + template + inline T length2( + const detail::tvec2& x) + { + return dot(x, x); + } + + template + inline T length2( + const detail::tvec3& x) + { + return dot(x, x); + } + + template + inline T length2( + const detail::tvec4& x) + { + return dot(x, x); + } + + template + inline T length2( + const detail::tquat& q) + { + return q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w; + } + + template + T distance2( + const T p0, + const T p1) + { + return length2(p1 - p0); + } + + template + T distance2( + const detail::tvec2& p0, + const detail::tvec2& p1) + { + return length2(p1 - p0); + } + + template + T distance2( + const detail::tvec3& p0, + const detail::tvec3& p1) + { + return length2(p1 - p0); + } + + template + T distance2( + const detail::tvec4& p0, + const detail::tvec4& p1) + { + return length2(p1 - p0); + } + + template + inline T l1Norm( + const detail::tvec3& a, + const detail::tvec3& b) + { + return abs(b.x - a.x) + abs(b.y - a.y) + abs(b.z - a.z); + } + + template + inline T l1Norm( + const detail::tvec3& v) + { + return abs(v.x) + abs(v.y) + abs(v.z); + } + + template + inline T l2Norm( + const detail::tvec3& a, + const detail::tvec3& b) + { + return length(b - a); + } + + template + inline T l2Norm( + const detail::tvec3& v) + { + return length(v); + } + + template + inline T lxNorm( + const detail::tvec3& x, + const detail::tvec3& y, + unsigned int Depth) + { + return pow(pow(y.x - x.x, T(Depth)) + pow(y.y - x.y, T(Depth)) + pow(y.z - x.z, T(Depth)), T(1) / T(Depth)); + } + + template + inline T lxNorm( + const detail::tvec3& v, + unsigned int Depth) + { + return pow(pow(v.x, T(Depth)) + pow(v.y, T(Depth)) + pow(v.z, T(Depth)), T(1) / T(Depth)); + } + +}//namespace norm +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/normal.hpp b/glm/gtx/normal.hpp new file mode 100644 index 00000000..e487c673 --- /dev/null +++ b/glm/gtx/normal.hpp @@ -0,0 +1,48 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2006-11-13 +// Licence : This source is under MIT License +// File : glm/gtx/normal.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_normal +#define glm_gtx_normal + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_normal(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_normal extension: Compute the normal of a triangle. + namespace normal + { + //! Computes triangle normal from triangle points. + //! From GLM_GTX_normal extension. + template + detail::tvec3 triangleNormal( + detail::tvec3 const & p1, + detail::tvec3 const & p2, + detail::tvec3 const & p3); + + }//namespace normal + }//namespace gtx +}//namespace glm + +#define GLM_GTX_normal namespace gtx::normal +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_normal;} +#endif//GLM_GTX_GLOBAL + +#include "normal.inl" + +#endif//glm_gtx_normal diff --git a/glm/gtx/normal.inl b/glm/gtx/normal.inl new file mode 100644 index 00000000..3633fe14 --- /dev/null +++ b/glm/gtx/normal.inl @@ -0,0 +1,27 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2005-12-21 +// Licence : This source is under MIT License +// File : glm/gtx/normal.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace normal{ + + template + inline detail::tvec3 triangleNormal + ( + detail::tvec3 const & p1, + detail::tvec3 const & p2, + detail::tvec3 const & p3 + ) + { + return normalize(cross(p1 - p2, p1 - p3)); + } + +}//namespace normal +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/normalize_dot.hpp b/glm/gtx/normalize_dot.hpp new file mode 100644 index 00000000..b29ed553 --- /dev/null +++ b/glm/gtx/normalize_dot.hpp @@ -0,0 +1,54 @@ +////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-09-28 +// Updated : 2008-10-07 +// Licence : This source is under MIT License +// File : glm/gtx/normalize_dot.h +////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_fast_square_root +////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_normalize_dot +#define glm_gtx_normalize_dot + +// Dependency: +#include "../glm.hpp" +#include "../gtx/fast_square_root.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_normalize_dot extension: Dot product of vectors that need to be normalize with a single square root. + namespace normalize_dot + { + //! Normalize parameters and returns the dot product of x and y. + //! It's faster that dot(normalize(x), normalize(y)). + //! From GLM_GTX_normalize_dot extension. + template + typename genType::value_type normalizeDot( + genType const & x, + genType const & y); + + //! Normalize parameters and returns the dot product of x and y. + //! Faster that dot(fastNormalize(x), fastNormalize(y)). + //! From GLM_GTX_normalize_dot extension. + template + typename genType::value_type fastNormalizeDot( + genType const & x, + genType const & y); + + }//namespace normalize_dot + }//namespace gtx +}//namespace glm + +#define GLM_GTX_normalize_dot namespace gtx::fast_square_root; using namespace gtx::normalize_dot +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_normalize_dot;} +#endif//GLM_GTX_GLOBAL + +#include "normalize_dot.inl" + +#endif//glm_gtx_normalize_dot diff --git a/glm/gtx/normalize_dot.inl b/glm/gtx/normalize_dot.inl new file mode 100644 index 00000000..c959dd0a --- /dev/null +++ b/glm/gtx/normalize_dot.inl @@ -0,0 +1,120 @@ +////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-09-28 +// Updated : 2008-10-07 +// Licence : This source is under MIT License +// File : glm/gtx/normalize_dot.inl +////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace normalize_dot{ + +template +inline genType normalizeDot +( + genType const & x, + genType const & y +) +{ + return + glm::dot(x, y) * + glm::inversesqrt(glm::dot(x, x) * + glm::dot(y, y)); +} + +template +inline valType normalizeDot +( + detail::tvec2 const & x, + detail::tvec2 const & y +) +{ + return + glm::dot(x, y) * + glm::inversesqrt(glm::dot(x, x) * + glm::dot(y, y)); +} + +template +inline valType normalizeDot +( + detail::tvec3 const & x, + detail::tvec3 const & y +) +{ + return + glm::dot(x, y) * + glm::inversesqrt(glm::dot(x, x) * + glm::dot(y, y)); +} + +template +inline valType normalizeDot +( + detail::tvec4 const & x, + detail::tvec4 const & y +) +{ + return + glm::dot(x, y) * + glm::inversesqrt(glm::dot(x, x) * + glm::dot(y, y)); +} + +template +inline genType fastNormalizeDot +( + genType const & x, + genType const & y +) +{ + return + glm::dot(x, y) * + glm::gtx::fast_square_root::fastInverseSqrt(glm::dot(x, x) * + glm::dot(y, y)); +} + +template +inline valType fastNormalizeDot +( + detail::tvec2 const & x, + detail::tvec2 const & y +) +{ + return + glm::dot(x, y) * + glm::gtx::fast_square_root::fastInverseSqrt(glm::dot(x, x) * + glm::dot(y, y)); +} + +template +inline valType fastNormalizeDot +( + detail::tvec3 const & x, + detail::tvec3 const & y +) +{ + return + glm::dot(x, y) * + glm::gtx::fast_square_root::fastInverseSqrt(glm::dot(x, x) * + glm::dot(y, y)); +} + +template +inline valType fastNormalizeDot +( + detail::tvec4 const & x, + detail::tvec4 const & y +) +{ + return + glm::dot(x, y) * + glm::gtx::fast_square_root::fastInverseSqrt(glm::dot(x, x) * + glm::dot(y, y)); +} + +}//namespace normalize_dot +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/number_precision.hpp b/glm/gtx/number_precision.hpp new file mode 100644 index 00000000..d8dbcf10 --- /dev/null +++ b/glm/gtx/number_precision.hpp @@ -0,0 +1,65 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-05-10 +// Updated : 2009-06-04 +// Licence : This source is under MIT License +// File : glm/gtx/number_precision.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTC_type_precision +// - GLM_GTC_quaternion +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_number_precision +#define glm_gtx_number_precision + +// Dependency: +#include "../glm.hpp" +#include "../gtc/type_precision.hpp" + +namespace glm{ +namespace gtx{ +//! GLM_GTX_number_precision extension: Defined size types. +namespace number_precision +{ + using namespace gtc::type_precision; + + ///////////////////////////// + // Unsigned int vector types + + typedef u8 u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + typedef u16 u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + typedef u32 u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + typedef u64 u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + + ////////////////////// + // Float vector types + + typedef f16 f16vec1; //!< \brief Half-precision floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f32 f32vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f64 f64vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) + + ////////////////////// + // Float matrix types + + typedef f16 f16mat1; //!< \brief Half-precision floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f16 f16mat1x1; //!< \brief Half-precision floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f32 f32mat1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f32 f32mat1x1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f64 f64mat1; //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f64 f64mat1x1; //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension) + +}//namespace number_precision +}//namespace gtx +}//namespace glm + +#define GLM_GTX_number_precision namespace gtx::number_precision +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_number_precision;} +#endif//GLM_GTX_GLOBAL + +#include "number_precision.inl" + +#endif//glm_gtx_number_precision diff --git a/glm/gtx/number_precision.inl b/glm/gtx/number_precision.inl new file mode 100644 index 00000000..770e3deb --- /dev/null +++ b/glm/gtx/number_precision.inl @@ -0,0 +1,13 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-05-10 +// Updated : 2007-05-10 +// Licence : This source is under MIT License +// File : glm/gtx/number_precision.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + +} diff --git a/glm/gtx/ocl_type.hpp b/glm/gtx/ocl_type.hpp new file mode 100644 index 00000000..003557cc --- /dev/null +++ b/glm/gtx/ocl_type.hpp @@ -0,0 +1,106 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-07 +// Updated : 2009-05-07 +// Licence : This source is under MIT License +// File : glm/gtx/number_precision.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_ocl_type +#define glm_gtx_ocl_type + +// Dependency: +#include "../glm.hpp" + +namespace glm{ +namespace gtx{ +//! GLM_GTX_ocl_type extension: OpenCL types. +namespace ocl_type +{ + /////////////////////////// + // Scalar types + + typedef detail::int8 cl_char; //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::int16 cl_short; //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::int32 cl_int; //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::int64 cl_long; //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension) + + typedef detail::uint8 cl_uchar; //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::uint16 cl_ushort; //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::uint32 cl_uint; //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::uint64 cl_ulong; //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension) + + typedef detail::float16 cl_half; //!< \brief Half-precision floating-point scalar. (from GLM_GTX_ocl_type extension) + typedef detail::float32 cl_float; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension) + + + typedef detail::int8 cl_char1; //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::int16 cl_short1; //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::int32 cl_int1; //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::int64 cl_long1; //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension) + + typedef detail::uint8 cl_uchar1; //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::uint16 cl_ushort1; //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::uint32 cl_uint1; //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::uint64 cl_ulong1; //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension) + + //typedef detail::float16 cl_half1; //!< \brief Half-precision floating-point scalar. (from GLM_GTX_ocl_type extension) + typedef detail::float32 cl_float1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension) + + + typedef detail::tvec2 cl_char2; //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec2 cl_short2; //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec2 cl_int2; //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec2 cl_long2; //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension) + + typedef detail::tvec2 cl_uchar2; //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec2 cl_ushort2; //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec2 cl_uint2; //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec2 cl_ulong2; //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension) + + //typedef detail::tvec2 cl_half2; //!< \brief Half-precision floating-point scalar. (from GLM_GTX_ocl_type extension) + typedef detail::tvec2 cl_float2; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension) + + + typedef detail::tvec3 cl_char3; //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec3 cl_short3; //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec3 cl_int3; //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec3 cl_long3; //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension) + + typedef detail::tvec3 cl_uchar3; //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec3 cl_ushort3; //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec3 cl_uint3; //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec3 cl_ulong3; //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension) + + //typedef detail::tvec3 cl_half3; //!< \brief Half-precision floating-point scalar. (from GLM_GTX_ocl_type extension) + typedef detail::tvec3 cl_float3; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension) + + + typedef detail::tvec4 cl_char4; //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec4 cl_short4; //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec4 cl_int4; //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec4 cl_long4; //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec4 cl_uchar4; //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec4 cl_ushort4; //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec4 cl_uint4; //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension) + typedef detail::tvec4 cl_ulong4; //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension) + + //typedef detail::tvec4 cl_half4; //!< \brief Half-precision floating-point scalar. (from GLM_GTX_ocl_type extension) + typedef detail::tvec4 cl_float4; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension) + +}//namespace ocl_type +}//namespace gtx +}//namespace glm + +#define GLM_GTX_ocl_type namespace gtx::ocl_type; +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_ocl_type;} +#endif//GLM_GTX_GLOBAL + +#include "ocl_type.inl" + +#endif//glm_gtx_ocl_type diff --git a/glm/gtx/ocl_type.inl b/glm/gtx/ocl_type.inl new file mode 100644 index 00000000..e69de29b diff --git a/glm/gtx/optimum_pow.hpp b/glm/gtx/optimum_pow.hpp new file mode 100644 index 00000000..0a8889e0 --- /dev/null +++ b/glm/gtx/optimum_pow.hpp @@ -0,0 +1,71 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2006-11-13 +// Licence : This source is under MIT License +// File : glm/gtx/optimum_pow.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_optimum_pow +#define glm_gtx_optimum_pow + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_optimum_pow(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_optimum_pow extension: Integer exponenciation of power functions. + namespace optimum_pow + { + //! Returns x raised to the power of 2. + //! From GLM_GTX_optimum_pow extension. + template + genType pow2(const genType& x); + + //! Returns x raised to the power of 3. + //! From GLM_GTX_optimum_pow extension. + template + genType pow3(const genType& x); + + //! Returns x raised to the power of 4. + //! From GLM_GTX_optimum_pow extension. + template + genType pow4(const genType& x); + + //! Checks if the parameter is a power of 2 number. + //! From GLM_GTX_optimum_pow extension. + bool powOfTwo(int num); + + //! Checks to determine if the parameter component are power of 2 numbers. + //! From GLM_GTX_optimum_pow extension. + detail::tvec2 powOfTwo(const detail::tvec2& x); + + //! Checks to determine if the parameter component are power of 2 numbers. + //! From GLM_GTX_optimum_pow extension. + detail::tvec3 powOfTwo(const detail::tvec3& x); + + //! Checks to determine if the parameter component are power of 2 numbers. + //! From GLM_GTX_optimum_pow extension. + detail::tvec4 powOfTwo(const detail::tvec4& x); + + }//namespace optimum_pow + }//namespace gtx +}//namespace glm + +#define GLM_GTX_optimum_pow namespace gtx::optimum_pow +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_optimum_pow;} +#endif//GLM_GTX_GLOBAL + +#include "optimum_pow.inl" + +#endif//glm_gtx_optimum_pow diff --git a/glm/gtx/optimum_pow.inl b/glm/gtx/optimum_pow.inl new file mode 100644 index 00000000..5f7d7a7b --- /dev/null +++ b/glm/gtx/optimum_pow.inl @@ -0,0 +1,63 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2005-12-27 +// Licence : This source is under MIT License +// File : glm/gtx/optimum_pow.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace optimum_pow{ + + template + inline genType pow2(const genType& x) + { + return x * x; + } + + template + inline genType pow3(const genType& x) + { + return x * x * x; + } + + template + inline genType pow4(const genType& x) + { + return x * x * x * x; + } + + inline bool powOfTwo(int x) + { + return !(x & (x - 1)); + } + + inline detail::tvec2 powOfTwo(const detail::tvec2& x) + { + return detail::tvec2( + powOfTwo(x.x), + powOfTwo(x.y)); + } + + inline detail::tvec3 powOfTwo(const detail::tvec3& x) + { + return detail::tvec3( + powOfTwo(x.x), + powOfTwo(x.y), + powOfTwo(x.z)); + } + + inline detail::tvec4 powOfTwo(const detail::tvec4& x) + { + return detail::tvec4( + powOfTwo(x.x), + powOfTwo(x.y), + powOfTwo(x.z), + powOfTwo(x.w)); + } + +}//namespace optimum_pow +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/orthonormalize.hpp b/glm/gtx/orthonormalize.hpp new file mode 100644 index 00000000..d75520c6 --- /dev/null +++ b/glm/gtx/orthonormalize.hpp @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2006-11-13 +// Licence : This source is under MIT License +// File : glm/gtx/orthonormalize.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_orthonormalize +#define glm_gtx_orthonormalize + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_orthonormalize(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_orthonormalize extension: Orthonormalize matrices. + namespace orthonormalize + { + //! Returns the orthonormalized matrix of m. + //! From GLM_GTX_orthonormalize extension. + template + detail::tmat3x3 orthonormalize( + const detail::tmat3x3& m); + + //! Orthonormalizes x according y. + //! From GLM_GTX_orthonormalize extension. + template + detail::tvec3 orthonormalize( + const detail::tvec3& x, + const detail::tvec3& y); + + }//namespace orthonormalize + }//namespace gtx +}//namespace glm + +#define GLM_GTX_orthonormalize namespace gtx::orthonormalize +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_orthonormalize;} +#endif//GLM_GTX_GLOBAL + +#include "orthonormalize.inl" + +#endif//glm_gtx_orthonormalize diff --git a/glm/gtx/orthonormalize.inl b/glm/gtx/orthonormalize.inl new file mode 100644 index 00000000..7cfb6326 --- /dev/null +++ b/glm/gtx/orthonormalize.inl @@ -0,0 +1,49 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2005-12-21 +// Licence : This source is under MIT License +// File : glm/gtx/orthonormalize.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace orthonormalize{ + + template + inline detail::tmat3x3 orthonormalize + ( + const detail::tmat3x3& m + ) + { + detail::tmat3x3 r = m; + + r[0] = normalize(r[0]); + + float d0 = dot(r[0], r[1]); + r[1] -= r[0] * d0; + r[1] = normalize(r[1]); + + float d1 = dot(r[1], r[2]); + d0 = dot(r[0], r[2]); + r[2] -= r[0] * d0 + r[1] * d1; + r[2] = normalize(r[2]); + + return r; + } + + template + inline detail::tvec3 orthonormalize + ( + const detail::tvec3& x, + const detail::tvec3& y + ) + { + return normalize(x - y * dot(y, x)); + } + +}//namespace orthonormalize +}//namespace gtx +}//namespace glm + diff --git a/glm/gtx/perpendicular.hpp b/glm/gtx/perpendicular.hpp new file mode 100644 index 00000000..3537fdf3 --- /dev/null +++ b/glm/gtx/perpendicular.hpp @@ -0,0 +1,63 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-03-06 +// Licence : This source is under MIT License +// File : glm/gtx/perpendicular.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_projection +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_perpendicular +#define glm_gtx_perpendicular + +// Dependency: +#include "../glm.hpp" +#include "../gtx/projection.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_perpendicular(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_perpendicular extension: Perpendicular of a vector from other one + namespace perpendicular + { + //! Projects x a perpendicular axis of Normal. + //! From GLM_GTX_perpendicular extension. + template + detail::tvec2 perp( + detail::tvec2 const & x, + detail::tvec2 const & Normal); + + //! Projects x a perpendicular axis of Normal. + //! From GLM_GTX_perpendicular extension. + template + detail::tvec3 perp( + detail::tvec3 const & x, + detail::tvec3 const & Normal); + + //! Projects x a perpendicular axis of Normal. + //! From GLM_GTX_perpendicular extension. + template + detail::tvec4 perp( + detail::tvec4 const & x, + detail::tvec4 const & Normal); + + }//namespace perpendicular + }//namespace gtx +}//namespace glm + +#define GLM_GTX_perpendicular namespace gtx::perpendicular +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_perpendicular;} +#endif//GLM_GTX_GLOBAL + +#include "perpendicular.inl" + +#endif//glm_gtx_perpendicular diff --git a/glm/gtx/perpendicular.inl b/glm/gtx/perpendicular.inl new file mode 100644 index 00000000..cc89dc57 --- /dev/null +++ b/glm/gtx/perpendicular.inl @@ -0,0 +1,40 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-03-06 +// Licence : This source is under MIT License +// File : glm/gtx/perpendicular.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace perpendicular{ + +template +inline detail::tvec2 perp( + detail::tvec2 const & x, + detail::tvec2 const & Normal) +{ + return x - projection::proj(x, Normal); +} + +template +inline detail::tvec3 perp( + detail::tvec3 const & x, + detail::tvec3 const & Normal) +{ + return x - projection::proj(x, Normal); +} + +template +inline detail::tvec4 perp( + detail::tvec4 const & x, + detail::tvec4 const & Normal) +{ + return x - projection::proj(x, Normal); +} + +}//namespace perpendicular +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/polar_coordinates.hpp b/glm/gtx/polar_coordinates.hpp new file mode 100644 index 00000000..be5e7019 --- /dev/null +++ b/glm/gtx/polar_coordinates.hpp @@ -0,0 +1,46 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-03-06 +// Updated : 2009-05-01 +// Licence : This source is under MIT License +// File : glm/gtx/polar_coordinates.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_polar_coordinates +#define glm_gtx_polar_coordinates + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_polar_coordinates extension: Conversion from Euclidean space to polar space and revert. + namespace polar_coordinates + { + //! Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude. + //! From GLM_GTX_polar_coordinates extension. + template + detail::tvec3 polar(const detail::tvec3& euclidean); + + //! Convert Polar to Euclidean coordinates. + //! From GLM_GTX_polar_coordinates extension. + template + detail::tvec3 euclidean(const detail::tvec3& polar); + + }//namespace polar_coordinates + }//namespace gtx +}//namespace glm + +#define GLM_GTX_polar_coordinates namespace gtx::polar_coordinates +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_polar_coordinates;} +#endif//GLM_GTX_GLOBAL + +#include "polar_coordinates.inl" + +#endif//glm_gtx_polar_coordinates diff --git a/glm/gtx/polar_coordinates.inl b/glm/gtx/polar_coordinates.inl new file mode 100644 index 00000000..74b6902e --- /dev/null +++ b/glm/gtx/polar_coordinates.inl @@ -0,0 +1,42 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-03-06 +// Updated : 2009-05-01 +// Licence : This source is under MIT License +// File : glm/gtx/polar_coordinates.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace polar_coordinates +{ + template + inline detail::tvec3 polar( + const detail::tvec3& euclidean) + { + T length = length(euclidean); + detail::tvec3 tmp = euclidean / length; + T xz_dist = sqrt(tmp.x * tmp.x + tmp.z * tmp.z); + + return detail::tvec3( + degrees(atan(xz_dist, tmp.y)), // latitude + degrees(atan(tmp.x, tmp.z)), // longitude + xz_dist); // xz distance + } + + template + inline detail::tvec3 euclidean( + const detail::tvec3& polar) + { + T latitude = radians(polar.x); + T longitude = radians(polar.y); + return detail::tvec3( + cos(latitude) * sin(longitude), + sin(latitude), + cos(latitude) * cos(longitude)); + } + +}//namespace polar_coordinates +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/projection.hpp b/glm/gtx/projection.hpp new file mode 100644 index 00000000..abc0fd36 --- /dev/null +++ b/glm/gtx/projection.hpp @@ -0,0 +1,61 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-03-06 +// Licence : This source is under MIT License +// File : glm/gtx/projection.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_projection +#define glm_gtx_projection + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_projection(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_projection extension: Projection of a vector to other one + namespace projection + { + //! Projects x on Normal. + //! From GLM_GTX_projection extension. + template + detail::tvec2 proj( + detail::tvec2 const & x, + detail::tvec2 const & Normal); + + //! Projects x on Normal. + //! From GLM_GTX_projection extension. + template + detail::tvec3 proj( + detail::tvec3 const & x, + detail::tvec3 const & Normal); + + //! Projects x on Normal. + //! From GLM_GTX_projection extension. + template + detail::tvec4 proj( + detail::tvec4 const & x, + detail::tvec4 const & Normal); + + }//namespace projection + }//namespace gtx +}//namespace glm + +#define GLM_GTX_projection namespace gtx::projection +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_projection;} +#endif//GLM_GTX_GLOBAL + +#include "projection.inl" + +#endif//glm_gtx_projection diff --git a/glm/gtx/projection.inl b/glm/gtx/projection.inl new file mode 100644 index 00000000..935be529 --- /dev/null +++ b/glm/gtx/projection.inl @@ -0,0 +1,40 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-03-06 +// Licence : This source is under MIT License +// File : glm/gtx/projection.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace projection{ + +template +inline detail::tvec2 proj( + detail::tvec2 const & x, + detail::tvec2 const & Normal) +{ + return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; +} + +template +inline detail::tvec3 proj( + detail::tvec3 const & x, + detail::tvec3 const & Normal) +{ + return dot(x, Normal) / glm::dot(Normal, Normal) * Normal; +} + +template +inline detail::tvec4 proj( + detail::tvec4 const & x, + detail::tvec4 const & Normal) +{ + return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; +} + +}//namespace projection +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/quaternion.hpp b/glm/gtx/quaternion.hpp new file mode 100644 index 00000000..1e2c0b52 --- /dev/null +++ b/glm/gtx/quaternion.hpp @@ -0,0 +1,198 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-05-21 +// Licence : This source is under MIT License +// File : glm/gtx/quaternion.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// +// ToDo: +// - Study constructors with angles and axis +// - Study constructors with vec3 that are the imaginary component of quaternion +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_quaternion +#define glm_gtx_quaternion + +// Dependency: +#include "../glm.hpp" +#include "../gtc/quaternion.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_quaternion extension: Quaternion types and functions + namespace quaternion + { + using namespace gtc::quaternion; + + //! Compute a cross product between a quaternion and a vector. + //! From GLM_GTX_quaternion extension. + template + detail::tvec3 cross( + detail::tquat const & q, + detail::tvec3 const & v); + + //! Compute a cross product between a vector and a quaternion. + //! From GLM_GTX_quaternion extension. + template + detail::tvec3 cross( + detail::tvec3 const & v, + detail::tquat const & q); + + //! Compute a point on a path according squad equation. + //! q1 and q2 are control points; s1 and s2 are intermediate control points. + //! From GLM_GTX_quaternion extension. + template + detail::tquat squad( + detail::tquat const & q1, + detail::tquat const & q2, + detail::tquat const & s1, + detail::tquat const & s2, + valType const & h); + + //! Returns an intermediate control point for squad interpolation. + //! From GLM_GTX_quaternion extension. + template + detail::tquat intermediate( + detail::tquat const & prev, + detail::tquat const & curr, + detail::tquat const & next); + + //! Returns a exp of a quaternion. + //! From GLM_GTX_quaternion extension. + template + detail::tquat exp( + detail::tquat const & q, + valType const & exponent); + + //! Returns a log of a quaternion. + //! From GLM_GTX_quaternion extension. + template + detail::tquat log( + detail::tquat const & q); + + //! Returns x raised to the y power. + //! From GLM_GTX_quaternion extension. + template + detail::tquat pow( + detail::tquat const & x, + valType const & y); + + //! Returns quarternion square root. + //! From GLM_GTX_quaternion extension. + //template + //detail::tquat sqrt( + // detail::tquat const & q); + + //! Rotates a 3 components vector by a quaternion. + //! From GLM_GTX_transform extension. + template + detail::tvec3 rotate( + detail::tquat const & q, + detail::tvec3 const & v); + + //! Rotates a 4 components vector by a quaternion. + //! From GLM_GTX_transform extension. + template + detail::tvec4 rotate( + detail::tquat const & q, + detail::tvec4 const & v); + + //! Returns the q rotation angle. + //! From GLM_GTX_quaternion extension. + template + valType angle( + detail::tquat const & x); + + //! Returns the q rotation axis. + //! From GLM_GTX_quaternion extension. + template + detail::tvec3 axis( + detail::tquat const & x); + + //! Build a quaternion from an angle and an axis. + //! From GLM_GTX_quaternion extension. + template + detail::tquat angleAxis( + valType const & angle, + valType const & x, + valType const & y, + valType const & z); + + //! Build a quaternion from an angle and an axis. + //! From GLM_GTX_quaternion extension. + template + detail::tquat angleAxis( + valType const & angle, + detail::tvec3 const & v); + + //! Extract the real component of a quaternion. + //! From GLM_GTX_quaternion extension. + template + valType extractRealComponent( + detail::tquat const & q); + + //! Returns roll value of euler angles. + //! From GLM_GTX_quaternion extension. + template + valType roll( + detail::tquat const & x); + + //! Returns pitch value of euler angles. + //! From GLM_GTX_quaternion extension. + template + valType pitch( + detail::tquat const & x); + + //! Returns yaw value of euler angles. + //! From GLM_GTX_quaternion extension. + template + valType yaw( + detail::tquat const & x); + + //! Returns euler angles, yitch as x, yaw as y, roll as z. + //! From GLM_GTX_quaternion extension. + template + detail::tvec3 eularAngles( + detail::tquat const & x); + + //! Converts a quaternion to a 3 * 3 matrix. + //! From GLM_GTX_quaternion extension. + template + detail::tmat3x3 toMat3( + detail::tquat const & x){return gtc::quaternion::mat3_cast(x);} + + //! Converts a quaternion to a 4 * 4 matrix. + //! From GLM_GTX_quaternion extension. + template + detail::tmat4x4 toMat4( + detail::tquat const & x){return gtc::quaternion::mat4_cast(x);} + + //! Converts a 3 * 3 matrix to a quaternion. + //! From GLM_GTX_quaternion extension. + template + detail::tquat toQuat( + detail::tmat3x3 const & x){return gtc::quaternion::quat_cast(x);} + + //! Converts a 4 * 4 matrix to a quaternion. + //! From GLM_GTX_quaternion extension. + template + detail::tquat toQuat( + detail::tmat4x4 const & x){return gtc::quaternion::quat_cast(x);} + + }//namespace quaternion + }//namespace gtx +} //namespace glm + +#define GLM_GTX_quaternion namespace gtx::quaternion +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_quaternion;} +#endif//GLM_GTX_GLOBAL + +#include "quaternion.inl" + +#endif//glm_gtx_quaternion diff --git a/glm/gtx/quaternion.inl b/glm/gtx/quaternion.inl new file mode 100644 index 00000000..155d589a --- /dev/null +++ b/glm/gtx/quaternion.inl @@ -0,0 +1,251 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2008-11-27 +// Licence : This source is under MIT License +// File : glm/gtx/quaternion.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +namespace glm{ +namespace gtx{ +namespace quaternion +{ + template + inline detail::tvec3 cross + ( + detail::tvec3 const & v, + detail::tquat const & q + ) + { + return gtc::quaternion::inverse(q) * v; + } + + template + inline detail::tvec3 cross + ( + detail::tquat const & q, + detail::tvec3 const & v + ) + { + return q * v; + } + + template + inline detail::tquat squad + ( + detail::tquat const & q1, + detail::tquat const & q2, + detail::tquat const & s1, + detail::tquat const & s2, + T const & h) + { + return mix(mix(q1, q2, h), mix(s1, s2, h), T(2) * h (T(1) - h)); + } + + template + inline detail::tquat intermediate + ( + detail::tquat const & prev, + detail::tquat const & curr, + detail::tquat const & next + ) + { + detail::tquat invQuat = gtc::quaternion::inverse(curr); + return ext((log(next + invQuat) + log(prev + invQuat)) / T(-4)) * curr; + } + + template + inline detail::tquat exp + ( + detail::tquat const & q, + T const & exponent + ) + { + detail::tvec3 u(q.x, q.y, q.z); + float a = glm::length(u); + detail::tvec3 v(u / a); + return detail::tquat(cos(a), sin(a) * v); + } + + template + inline detail::tquat log + ( + detail::tquat const & q + ) + { + if((q.x == T(0)) && (q.y == T(0)) && (q.z == T(0))) + { + if(q.w > T(0)) + return detail::tquat(log(q.w), T(0), T(0), T(0)); + else if(q.w < T(0)) + return detail::tquat(log(-q.w), T(3.1415926535897932384626433832795), T(0),T(0)); + else + return detail::tquat(std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity()); + } + else + { + T Vec3Len = sqrt(q.x * q.x + q.y * q.y + q.z * q.z); + T QuatLen = sqrt(Vec3Len * Vec3Len + q.w * q.w); + T t = atan(Vec3Len, T(q.w)) / Vec3Len; + return detail::tquat(t * q.x, t * q.y, t * q.z, log(QuatLen)); + } + } + + template + inline detail::tquat pow + ( + detail::tquat const & x, + T const & y + ) + { + if(abs(x.w) > T(0.9999)) + return x; + float Angle = acos(y); + float NewAngle = Angle * y; + float Div = sin(NewAngle) / sin(Angle); + return detail::tquat( + cos(NewAngle), + x.x * Div, + x.y * Div, + x.z * Div); + } + + //template + //inline detail::tquat sqrt + //( + // detail::tquat const & q + //) + //{ + // T q0 = T(1) - dot(q, q); + // return T(2) * (T(1) + q0) * q; + //} + + template + inline detail::tvec3 rotate + ( + detail::tquat const & q, + detail::tvec3 const & v + ) + { + return q * v; + } + + template + inline detail::tvec4 rotate + ( + detail::tquat const & q, + detail::tvec4 const & v + ) + { + return q * v; + } + + template + inline T angle + ( + detail::tquat const & x + ) + { + return acos(x.w) * T(2); + } + + template + inline detail::tvec3 axis + ( + detail::tquat const & x + ) + { + T tmp1 = T(1) - x.w * x.w; + if(tmp1 <= T(0)) + return detail::tvec3(0, 0, 1); + T tmp2 = T(1) / sqrt(tmp1); + return detail::tvec3(x.x * tmp2, x.y * tmp2, x.z * tmp2); + } + + template + inline detail::tquat angleAxis + ( + valType const & angle, + valType const & x, + valType const & y, + valType const & z + ) + { + return angleAxis(angle, detail::tvec3(x, y, z)); + } + + template + inline detail::tquat angleAxis + ( + valType const & angle, + detail::tvec3 const & v + ) + { + detail::tquat result; + detail::tvec3 v_normalized = glm::normalize(v); + + valType a = glm::radians(angle); + valType s = glm::sin(a * valType(0.5)); + + result.w = glm::cos(a * valType(0.5)); + result.x = v.x * s; + result.y = v.y * s; + result.z = v.z * s; + return result; + } + + template + inline T extractRealComponent + ( + detail::tquat const & q + ) + { + T w = T(1.0) - q.x * q.x - q.y * q.y - q.z * q.z; + if(w < T(0)) + return T(0); + else + return -sqrt(w); + } + + template + inline valType roll + ( + detail::tquat const & q + ) + { + return atan2(valType(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z); + } + + template + inline valType pitch + ( + detail::tquat const & q + ) + { + return atan2(valType(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z); + } + + template + inline valType yaw + ( + detail::tquat const & q + ) + { + return asin(valType(-2) * (q.x * q.z - q.w * q.y)); + } + + template + inline detail::tvec3 eularAngles + ( + detail::tquat const & x + ) + { + return detail::tvec3(pitch(x), yaw(x), roll(x)); + } + +}//namespace quaternion +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/random.hpp b/glm/gtx/random.hpp new file mode 100644 index 00000000..85a4232f --- /dev/null +++ b/glm/gtx/random.hpp @@ -0,0 +1,85 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-16 +// Updated : 2007-08-30 +// Licence : This source is under MIT License +// File : glm/gtx/random.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_vecx +// - GLM_GTX_half_float +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_random +#define glm_gtx_random + +// Dependency: +#include "../glm.hpp" +#include "../gtx/half_float.hpp" + +namespace glm{ +namespace gtx{ +//! GLM_GTX_random extension: Generate random number from varius distribution methods +namespace random +{ + //! Generate a random number in the interval [-1, 1], according a linear distribution. + //! From GLM_GTX_random extension. + template T signedRand1(); + + template <> float signedRand1(); //!< \brief Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) + template <> double signedRand1(); //!< \brief Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) + template detail::tvec2 signedRand2(); //!< \brief Generate 2 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) + template detail::tvec3 signedRand3(); //!< \brief Generate 3 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) + template detail::tvec4 signedRand4(); //!< \brief Generate 4 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) + + template detail::tvec2 normalizedRand2(); //!< \brief Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) + template detail::tvec2 normalizedRand2(T Min, T Max); //!< \brief Generate a scaled and normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) + template detail::tvec3 normalizedRand3(); //!< \brief Generate a normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension) + template detail::tvec3 normalizedRand3(T Min, T Max); //!< \brief Generate a scaled and normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension) + + template T compRand1(); //!< \brief Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) + template <> float compRand1(); //!< \brief Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) + template <> double compRand1(); //!< \brief Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) + template T compRand1(T Min, T Max); //!< \brief Generate a random number in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) + template detail::tvec2 compRand2(T Min, T Max); //!< \brief Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) + template detail::tvec3 compRand3(T Min, T Max); //!< \brief Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) + template detail::tvec4 compRand4(T Min, T Max); //!< \brief Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) + template detail::tvec2 compRand2(const detail::tvec2& Min, const detail::tvec2& Max); //!< \brief Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) + template detail::tvec3 compRand3(const detail::tvec3& Min, const detail::tvec3& Max); //!< \brief Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) + template detail::tvec3 compRand4(const detail::tvec4& Min, const detail::tvec4& Max); //!< \brief Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) + + template detail::tvec2 vecRand2(); //!< \brief Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) + template detail::tvec2 vecRand2(T MinRadius, T MaxRadius); //!< \brief Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) + template detail::tvec3 vecRand3(); //!< \brief Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) + template detail::tvec3 vecRand3(T MinRadius, T MaxRadius); //!< \brief Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) + template detail::tvec4 vecRand4(); //!< \brief Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) + template detail::tvec4 vecRand4(T MinRadius, T MaxRadius); //!< \brief Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) + + template T gaussRand1(T mean, T std_deviation); //!< \brief Gererate a random floating number according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec2 gaussRand2(T mean, T std_deviation); //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec3 gaussRand3(T mean, T std_deviation); //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec4 gaussRand4(T mean, T std_deviation); //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec2 gaussRand2(const detail::tvec2& mean, T std_deviation); //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec3 gaussRand3(const detail::tvec3& mean, T std_deviation); //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec4 gaussRand4(const detail::tvec4& mean, T std_deviation); //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec2 gaussRand2(T mean, const detail::tvec2& std_deviation); //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec3 gaussRand3(T mean, const detail::tvec3& std_deviation); //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec4 gaussRand4(T mean, const detail::tvec4& std_deviation); //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec2 gaussRand2(const detail::tvec2& mean, const detail::tvec2& std_deviation); //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec3 gaussRand3(const detail::tvec3& mean, const detail::tvec3& std_deviation); //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + template detail::tvec4 gaussRand4(const detail::tvec4& mean, const detail::tvec4& std_deviation); //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) + +}//namespace random +}//namespace gtx +}//namespace glm + +#define GLM_GTX_random namespace gtx::random +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_random;} +#endif//GLM_GTX_GLOBAL + +#include "random.inl" + +#endif//glm_gtx_random diff --git a/glm/gtx/random.inl b/glm/gtx/random.inl new file mode 100644 index 00000000..e257b2ea --- /dev/null +++ b/glm/gtx/random.inl @@ -0,0 +1,536 @@ +////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-16 +// Updated : 2006-01-16 +// Licence : This source is under MIT License +// File : glm/gtx/random.inl +////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +namespace glm{ +namespace gtx{ +namespace random +{ + template <> + inline float signedRand1() + { + #if(GLM_COMPILER == GLM_COMPILER_VC80) + #define RAND_SHIFT_NUM 5 + #else + #define RAND_SHIFT_NUM 0 + #endif + return float((std::rand() - (RAND_MAX >> 1) - 1) << 1) / float(RAND_MAX - RAND_SHIFT_NUM); + } + + template <> + inline double signedRand1() + { + return double(signedRand1()); + } + + template + inline detail::tvec2 signedRand2() + { + return detail::tvec2( + signedRand1(), + signedRand1()); + } + + template + inline detail::tvec3 signedRand3() + { + return detail::tvec3( + signedRand1(), + signedRand1(), + signedRand1()); + } + + template + inline detail::tvec4 signedRand4() + { + return detail::tvec4( + signedRand1(), + signedRand1(), + signedRand1(), + signedRand1()); + } + + template + inline detail::tvec2 normalizedRand2() + { + T a = compRand1(T(0), T(6.283185307179586476925286766559f)); + return detail::tvec2(cos(a), sin(a)); + } + + template + inline detail::tvec3 normalizedRand3() + { + T z = compRand1(T(-1), T(1)); + T a = compRand1(T(0), T(6.283185307179586476925286766559f)); + + T r = sqrt(T(1) - z * z); + + T x = r * cos(a); + T y = r * sin(a); + + return detail::tvec3(x, y, z); + } + + template + inline detail::tvec3 normalizedRand3( + T Min, + T Max) + { + return normalizedRand3() * compRand1(Min, Max); + } + + template <> + inline float compRand1() + { + return float(std::rand()) / float(RAND_MAX); + } + + template <> + inline double compRand1() + { + return double(std::rand()) / double(RAND_MAX); + } + + inline glm::half compRand1( + glm::half Min, + glm::half Max) + { + return compRand1() * (Max - Min) + Min; + } + + inline float compRand1( + float Min, + float Max) + { + return compRand1() * (Max - Min) + Min; + } + + inline double compRand1( + double Min, + double Max) + { + return compRand1() * (Max - Min) + Min; + } + + template + inline T compRand1( + T Min, + T Max) + { + return T(compRand1() * double(Max - Min) + double(Min)); + } + + template + inline detail::tvec2 compRand2( + T Min, + T Max) + { + return detail::tvec2( + compRand1(Min, Max), + compRand1(Min, Max)); + } + + template + inline detail::tvec3 compRand3( + T Min, + T Max) + { + return detail::tvec3( + compRand1(Min, Max), + compRand1(Min, Max), + compRand1(Min, Max)); + } + + template + inline detail::tvec4 compRand4( + T Min, + T Max) + { + return detail::tvec4( + compRand1(Min, Max), + compRand1(Min, Max), + compRand1(Min, Max), + compRand1(Min, Max)); + } + + template + inline detail::tvec2 compRand2( + T Min, + const detail::tvec2& Max) + { + return detail::tvec2( + compRand1(Min.x, Max.x), + compRand1(Min.y, Max.y)); + } + + template + inline detail::tvec3 compRand3( + T Min, + const detail::tvec3& Max) + { + return detail::tvec3( + compRand1(Min.x, Max.x), + compRand1(Min.y, Max.y), + compRand1(Min.z, Max.z)); + } + + template + inline detail::tvec4 compRand4( + T Min, + const detail::tvec4& Max) + { + return detail::tvec4( + compRand1(Min.x, Max.x), + compRand1(Min.y, Max.y), + compRand1(Min.z, Max.z), + compRand1(Min.w, Max.w)); + } + + template + inline detail::tvec2 compRand2( + const detail::tvec2& Min, + T Max) + { + return detail::tvec2( + compRand1(Min.x, Max.x), + compRand1(Min.y, Max.y)); + } + + template + inline detail::tvec3 compRand3( + const detail::tvec3& Min, + T Max) + { + return detail::tvec3( + compRand1(Min.x, Max.x), + compRand1(Min.y, Max.y), + compRand1(Min.z, Max.z)); + } + + template + inline detail::tvec4 compRand4( + const detail::tvec4& Min, + T Max) + { + return detail::tvec4( + compRand1(Min.x, Max.x), + compRand1(Min.y, Max.y), + compRand1(Min.z, Max.z), + compRand1(Min.w, Max.w)); + } + + template + inline detail::tvec2 compRand2( + const detail::tvec2& Min, + const detail::tvec2& Max) + { + return detail::tvec2( + compRand1(Min.x, Max.x), + compRand1(Min.y, Max.y)); + } + + template + inline detail::tvec3 compRand3( + const detail::tvec3& Min, + const detail::tvec3& Max) + { + return detail::tvec3( + compRand1(Min.x, Max.x), + compRand1(Min.y, Max.y), + compRand1(Min.z, Max.z)); + } + + template + inline detail::tvec4 compRand4( + const detail::tvec4& Min, + const detail::tvec4& Max) + { + return detail::tvec4( + compRand1(Min.x, Max.x), + compRand1(Min.y, Max.y), + compRand1(Min.z, Max.z), + compRand1(Min.w, Max.w)); + } + + template + inline detail::tvec2 vecRand2() + { + detail::tvec2 result(float(0)); + do + { + result = compRand2(float(-1), float(1)); + } while (length(result) > float(1)); + + return result; + } + + template + inline detail::tvec2 vecRand2() + { + detail::tvec2 result(double(0)); + do + { + result = compRand2(double(-1), double(1)); + } while (length(result) > double(1)); + + return result; + } + + template + inline detail::tvec2 vecRand2( + T MinRadius, + T MaxRadius) + { + assert(MinRadius <= MaxRadius); + + detail::tvec2 Result(T(0)); + T LenRadius(0); + + do + { + Result = compRand2(-MaxRadius, MaxRadius); + LenRadius = length(Result); + } + while(LenRadius > MaxRadius || LenRadius < MinRadius); + + return Result; + } + + template + inline detail::tvec3 vecRand3() + { + detail::tvec3 Result(T(0)); + do + { + Result = compRand3(T(-1), T(1)); + } + while(length(Result) > T(1)); + + return Result; + } + + template + inline detail::tvec3 vecRand3( + T MinRadius, + T MaxRadius) + { + assert(MinRadius <= MaxRadius); + + detail::tvec3 Result(0); + T LenRadius(0); + + do + { + Result = compRand3(-MaxRadius, MaxRadius); + LenRadius = length(Result); + } + while(LenRadius > MaxRadius || LenRadius < MinRadius); + + return Result; + } + + template + inline detail::tvec4 vecRand4() + { + detail::tvec4 result(float(0)); + do + { + result = compRand4(float(-1), float(1)); + } while (length(result) > float(1)); + + return result; + } + + template + inline detail::tvec4 vecRand4() + { + detail::tvec4 result(double(0)); + do + { + result = compRand4(double(-1), double(1)); + } while (length(result) > double(1)); + + return result; + } + + template + inline detail::tvec4 vecRand4( + T MinRadius, + T MaxRadius) + { + assert(MinRadius <= MaxRadius); + + detail::tvec4 Result(T(0)); + T LenRadius(T(0)); + + do + { + Result = compRand4(-MaxRadius, MaxRadius); + LenRadius = length(Result); + } + while(LenRadius > MaxRadius || LenRadius < MinRadius); + + return Result; + } + + template + inline T gaussRand1( + T mean, + T std_deviation) + { + T w, x1, x2; + + do + { + x1 = compRand1(T(-1), T(1)); + x2 = compRand1(T(-1), T(1)); + + w = x1 * x1 + x2 * x2; + } while(w > T(1)); + + return x2 * std_deviation * std_deviation * sqrt((T(-2) * log(w)) / w) + mean; + } + + template + inline detail::tvec2 gaussRand2( + T mean, + T std_deviation) + { + return detail::tvec2( + gaussRand1(mean, std_deviation), + gaussRand1(mean, std_deviation)); + } + + template + inline detail::tvec3 gaussRand3( + T mean, + T std_deviation) + { + return detail::tvec3( + gaussRand1(mean, std_deviation), + gaussRand1(mean, std_deviation), + gaussRand1(mean, std_deviation)); + } + + template + inline detail::tvec4 gaussRand4( + T mean, + T std_deviation) + { + return detail::tvec4( + gaussRand1(mean, std_deviation), + gaussRand1(mean, std_deviation), + gaussRand1(mean, std_deviation), + gaussRand1(mean, std_deviation)); + } + + template + inline detail::tvec2 gaussRand2( + T mean, + const detail::tvec2& std_deviation) + { + return detail::tvec2( + gaussRand1(mean, std_deviation.x), + gaussRand1(mean, std_deviation.y)); + } + + template + inline detail::tvec3 gaussRand3( + T mean, + const detail::tvec3& std_deviation) + { + return detail::tvec3( + gaussRand1(mean, std_deviation.x), + gaussRand1(mean, std_deviation.y), + gaussRand1(mean, std_deviation.z)); + } + + template + inline detail::tvec4 gaussRand4( + T mean, + const detail::tvec4& std_deviation) + { + return detail::tvec4( + gaussRand1(mean, std_deviation.x), + gaussRand1(mean, std_deviation.y), + gaussRand1(mean, std_deviation.z), + gaussRand1(mean, std_deviation.w)); + } + + template + inline detail::tvec2 gaussRand2( + const detail::tvec2& mean, + T std_deviation) + { + return detail::tvec2( + gaussRand1(mean.x, std_deviation), + gaussRand1(mean.y, std_deviation)); + } + + template + inline detail::tvec3 gaussRand3( + const detail::tvec3& mean, + T std_deviation) + { + return detail::tvec3( + gaussRand1(mean.x, std_deviation), + gaussRand1(mean.y, std_deviation), + gaussRand1(mean.z, std_deviation)); + } + + template + inline detail::tvec4 gaussRand4( + const detail::tvec4& mean, + T std_deviation) + { + return detail::tvec4( + gaussRand1(mean.x, std_deviation), + gaussRand1(mean.y, std_deviation), + gaussRand1(mean.z, std_deviation), + gaussRand1(mean.w, std_deviation)); + } + + template + inline detail::tvec2 gaussRand2( + const detail::tvec2& mean, + const detail::tvec2& std_deviation) + { + return detail::tvec2( + gaussRand1(mean.x, std_deviation.x), + gaussRand1(mean.y, std_deviation.y)); + } + + template + inline detail::tvec3 gaussRand3( + const detail::tvec3& mean, + const detail::tvec3& std_deviation) + { + return detail::tvec3( + gaussRand1(mean.x, std_deviation.x), + gaussRand1(mean.y, std_deviation.y), + gaussRand1(mean.z, std_deviation.z)); + } + + template + inline detail::tvec4 gaussRand4( + const detail::tvec4& mean, + const detail::tvec4& std_deviation) + { + return detail::tvec4( + gaussRand1(mean.x, std_deviation.x), + gaussRand1(mean.y, std_deviation.y), + gaussRand1(mean.z, std_deviation.z), + gaussRand1(mean.w, std_deviation.w)); + } + +}//namespace random +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/raw_data.hpp b/glm/gtx/raw_data.hpp new file mode 100644 index 00000000..6c081ab4 --- /dev/null +++ b/glm/gtx/raw_data.hpp @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-11-19 +// Updated : 2008-11-19 +// Licence : This source is under MIT License +// File : glm/gtx/raw_data.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_raw_data +#define glm_gtx_raw_data + +// Dependency: +#include "../glm.hpp" +#include "../gtc/type_precision.hpp" + +namespace glm +{ + namespace gtx + { + //! GLM_GTX_raw_data extension: Projection of a vector to other one + namespace raw_data + { + //! Type for byte numbers. + //! From GLM_GTX_raw_data extension. + typedef gtc::type_precision::uint8 byte; + + //! Type for word numbers. + //! From GLM_GTX_raw_data extension. + typedef gtc::type_precision::uint16 word; + + //! Type for dword numbers. + //! From GLM_GTX_raw_data extension. + typedef gtc::type_precision::uint32 dword; + + //! Type for qword numbers. + //! From GLM_GTX_raw_data extension. + typedef gtc::type_precision::uint64 qword; + } + } +} + +#define GLM_GTX_raw_data namespace gtx::raw_data +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_raw_data;} +#endif//GLM_GTX_GLOBAL + +#include "raw_data.inl" + +#endif//glm_gtx_raw_data diff --git a/glm/gtx/raw_data.inl b/glm/gtx/raw_data.inl new file mode 100644 index 00000000..f245222c --- /dev/null +++ b/glm/gtx/raw_data.inl @@ -0,0 +1,11 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-11-19 +// Updated : 2008-11-19 +// Licence : This source is under MIT License +// File : glm/gtx/raw_data.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/glm/gtx/reciprocal.hpp b/glm/gtx/reciprocal.hpp new file mode 100644 index 00000000..6834d021 --- /dev/null +++ b/glm/gtx/reciprocal.hpp @@ -0,0 +1,100 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-09 +// Updated : 2008-10-09 +// Licence : This source is under MIT License +// File : glm/gtx/reciprocal.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_reciprocal +#define glm_gtx_reciprocal + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_reciprocal(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_reciprocal extension: Define secant, cosecant and cotangent functions. + namespace reciprocal + { + //! Secant function. + //! hypotenuse / adjacent or 1 / cos(x) + //! From GLM_GTX_reciprocal extension. + template + genType sec(genType const & angle); + + //! Cosecant function. + //! hypotenuse / opposite or 1 / sin(x) + //! From GLM_GTX_reciprocal extension. + template + genType csc(genType const & angle); + + //! Cotangent function. + //! adjacent / opposite or 1 / tan(x) + //! From GLM_GTX_reciprocal extension. + template + genType cot(genType const & angle); + + //! Inverse secant function. + //! From GLM_GTX_reciprocal extension. + template + genType asec(genType const & x); + + //! Inverse cosecant function. + //! From GLM_GTX_reciprocal extension. + template + genType acsc(genType const & x); + + //! Inverse cotangent function. + //! From GLM_GTX_reciprocal extension. + template + genType acot(genType const & x); + + //! Secant hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType sech(genType const & angle); + + //! Cosecant hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType csch(genType const & angle); + + //! Cotangent hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType coth(genType const & angle); + + //! Inverse secant hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType asech(genType const & x); + + //! Inverse cosecant hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType acsch(genType const & x); + + //! Inverse cotangent hyperbolic function. + //! From GLM_GTX_reciprocal extension. + template + genType acoth(genType const & x); + + }//namespace reciprocal + }//namespace gtx +}//namespace glm + +#define GLM_GTX_reciprocal namespace gtx::reciprocal +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_reciprocal;} +#endif//GLM_GTX_GLOBAL + +#include "reciprocal.inl" + +#endif//glm_gtx_reciprocal diff --git a/glm/gtx/reciprocal.inl b/glm/gtx/reciprocal.inl new file mode 100644 index 00000000..71f58fc1 --- /dev/null +++ b/glm/gtx/reciprocal.inl @@ -0,0 +1,593 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-09 +// Updated : 2008-10-09 +// Licence : This source is under MIT License +// File : glm/gtx/reciprocal.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace reciprocal{ + +// sec +template +inline genType sec +( + genType const & angle +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + return genType(1) / glm::cos(angle); +} + +template +inline detail::tvec2 sec +( + detail::tvec2 const & angle +) +{ + return detail::tvec2( + sec(angle.x), + sec(angle.y)); +} + +template +inline detail::tvec3 sec +( + detail::tvec3 const & angle +) +{ + return detail::tvec3( + sec(angle.x), + sec(angle.y), + sec(angle.z)); +} + +template +inline detail::tvec4 sec +( + detail::tvec4 const & angle +) +{ + return detail::tvec4( + sec(angle.x), + sec(angle.y), + sec(angle.z), + sec(angle.w)); +} + +// csc +template +inline genType csc +( + genType const & angle +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + return genType(1) / glm::sin(angle); +} + +template +inline detail::tvec2 csc +( + detail::tvec2 const & angle +) +{ + return detail::tvec2( + csc(angle.x), + csc(angle.y)); +} + +template +inline detail::tvec3 csc +( + detail::tvec3 const & angle +) +{ + return detail::tvec3( + csc(angle.x), + csc(angle.y), + csc(angle.z)); +} + +template +inline detail::tvec4 csc +( + detail::tvec4 const & angle +) +{ + return detail::tvec4( + csc(angle.x), + csc(angle.y), + csc(angle.z), + csc(angle.w)); +} + +// cot +template +inline genType cot +( + genType const & angle +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + return genType(1) / glm::tan(angle); +} + +template +inline detail::tvec2 cot +( + detail::tvec2 const & angle +) +{ + return detail::tvec2( + cot(angle.x), + cot(angle.y)); +} + +template +inline detail::tvec3 cot +( + detail::tvec3 const & angle +) +{ + return detail::tvec3( + cot(angle.x), + cot(angle.y), + cot(angle.z)); +} + +template +inline detail::tvec4 cot +( + detail::tvec4 const & angle +) +{ + return detail::tvec4( + cot(angle.x), + cot(angle.y), + cot(angle.z), + cot(angle.w)); +} + +// asec +template +inline genType asec +( + genType const & x +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + return acos(genType(1) / x); +} + +template +inline detail::tvec2 asec +( + detail::tvec2 const & x +) +{ + return detail::tvec2( + asec(x.x), + asec(x.y)); +} + +template +inline detail::tvec3 asec +( + detail::tvec3 const & x +) +{ + return detail::tvec3( + asec(x.x), + asec(x.y), + asec(x.z)); +} + +template +inline detail::tvec4 asec +( + detail::tvec4 const & x +) +{ + return detail::tvec4( + asec(x.x), + asec(x.y), + asec(x.z), + asec(x.w)); +} + +// acsc +template +inline genType acsc +( + genType const & x +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + return asin(genType(1) / x); +} + +template +inline detail::tvec2 acsc +( + detail::tvec2 const & x +) +{ + return detail::tvec2( + acsc(x.x), + acsc(x.y)); +} + +template +inline detail::tvec3 acsc +( + detail::tvec3 const & x +) +{ + return detail::tvec3( + acsc(x.x), + acsc(x.y), + acsc(x.z)); +} + +template +inline detail::tvec4 acsc +( + detail::tvec4 const & x +) +{ + return detail::tvec4( + acsc(x.x), + acsc(x.y), + acsc(x.z), + acsc(x.w)); +} + +// acot +template +inline genType acot +( + genType const & x +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); + return pi_over_2 - atan(x); +} + +template +inline detail::tvec2 acot +( + detail::tvec2 const & x +) +{ + return detail::tvec2( + acot(x.x), + acot(x.y)); +} + +template +inline detail::tvec3 acot +( + detail::tvec3 const & x +) +{ + return detail::tvec3( + acot(x.x), + acot(x.y), + acot(x.z)); +} + +template +inline detail::tvec4 acot +( + detail::tvec4 const & x +) +{ + return detail::tvec4( + acot(x.x), + acot(x.y), + acot(x.z), + acot(x.w)); +} + +// sech +template +inline genType sech +( + genType const & angle +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + return genType(1) / glm::cosh(angle); +} + +template +inline detail::tvec2 sech +( + detail::tvec2 const & angle +) +{ + return detail::tvec2( + sech(angle.x), + sech(angle.y)); +} + +template +inline detail::tvec3 sech +( + detail::tvec3 const & angle +) +{ + return detail::tvec3( + sech(angle.x), + sech(angle.y), + sech(angle.z)); +} + +template +inline detail::tvec4 sech +( + detail::tvec4 const & angle +) +{ + return detail::tvec4( + sech(angle.x), + sech(angle.y), + sech(angle.z), + sech(angle.w)); +} + +// csch +template +inline genType csch +( + genType const & angle +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + return genType(1) / glm::sinh(angle); +} + +template +inline detail::tvec2 csch +( + detail::tvec2 const & angle +) +{ + return detail::tvec2( + csch(angle.x), + csch(angle.y)); +} + +template +inline detail::tvec3 csch +( + detail::tvec3 const & angle +) +{ + return detail::tvec3( + csch(angle.x), + csch(angle.y), + csch(angle.z)); +} + +template +inline detail::tvec4 csch +( + detail::tvec4 const & angle +) +{ + return detail::tvec4( + csch(angle.x), + csch(angle.y), + csch(angle.z), + csch(angle.w)); +} + +// coth +template +inline genType coth +( + genType const & angle +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + return glm::cosh(angle) / glm::sinh(angle); +} + +template +inline detail::tvec2 coth +( + detail::tvec2 const & angle +) +{ + return detail::tvec2( + coth(angle.x), + coth(angle.y)); +} + +template +inline detail::tvec3 coth +( + detail::tvec3 const & angle +) +{ + return detail::tvec3( + coth(angle.x), + coth(angle.y), + coth(angle.z)); +} + +template +inline detail::tvec4 coth +( + detail::tvec4 const & angle +) +{ + return detail::tvec4( + coth(angle.x), + coth(angle.y), + coth(angle.z), + coth(angle.w)); +} + +// asech +template +inline genType asech +( + genType const & x +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + return acosh(genType(1) / x); +} + +template +inline detail::tvec2 asech +( + detail::tvec2 const & x +) +{ + return detail::tvec2( + asech(x.x), + asech(x.y)); +} + +template +inline detail::tvec3 asech +( + detail::tvec3 const & x +) +{ + return detail::tvec3( + asech(x.x), + asech(x.y), + asech(x.z)); +} + +template +inline detail::tvec4 asech +( + detail::tvec4 const & x +) +{ + return detail::tvec4( + asech(x.x), + asech(x.y), + asech(x.z), + asech(x.w)); +} + +// acsch +template +inline genType acsch +( + genType const & x +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + return asinh(genType(1) / x); +} + +template +inline detail::tvec2 acsch +( + detail::tvec2 const & x +) +{ + return detail::tvec2( + acsch(x.x), + acsch(x.y)); +} + +template +inline detail::tvec3 acsch +( + detail::tvec3 const & x +) +{ + return detail::tvec3( + acsch(x.x), + acsch(x.y), + acsch(x.z)); +} + +template +inline detail::tvec4 acsch +( + detail::tvec4 const & x +) +{ + return detail::tvec4( + acsch(x.x), + acsch(x.y), + acsch(x.z), + acsch(x.w)); +} + +// acoth +template +inline genType acoth +( + genType const & x +) +{ + GLM_STATIC_ASSERT(detail::type::is_float); + + return atanh(genType(1) / x); +} + +template +inline detail::tvec2 acoth +( + detail::tvec2 const & x +) +{ + return detail::tvec2( + acoth(x.x), + acoth(x.y)); +} + +template +inline detail::tvec3 acoth +( + detail::tvec3 const & x +) +{ + return detail::tvec3( + acoth(x.x), + acoth(x.y), + acoth(x.z)); +} + +template +inline detail::tvec4 acoth +( + detail::tvec4 const & x +) +{ + return detail::tvec4( + acoth(x.x), + acoth(x.y), + acoth(x.z), + acoth(x.w)); +} + +}//namespace reciprocal +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/rotate_vector.hpp b/glm/gtx/rotate_vector.hpp new file mode 100644 index 00000000..f9b33da6 --- /dev/null +++ b/glm/gtx/rotate_vector.hpp @@ -0,0 +1,110 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-11-02 +// Updated : 2009-02-19 +// Licence : This source is under MIT License +// File : glm/gtx/rotate_vector.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_rotate_vector +#define glm_gtx_rotate_vector + +// Dependency: +#include "../glm.hpp" +#include "../gtx/transform.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_rotate_vector extension: Function to directly rotate a vector + namespace rotate_vector + { + using namespace transform; + + //! Rotate a two dimentionnals vector. + //! From GLM_GTX_rotate_vector extension. + template + detail::tvec2 rotate( + const detail::tvec2& v, + T angle); + + //! Rotate a three dimentionnals vector around an axis. + //! From GLM_GTX_rotate_vector extension. + template + detail::tvec3 rotate( + const detail::tvec3& v, + T angle, + const detail::tvec3& normal); + + //! Rotate a four dimentionnals vector around an axis. + //! From GLM_GTX_rotate_vector extension. + template + detail::tvec4 rotate( + const detail::tvec4& v, T angle, + const detail::tvec3& normal); + + //! Rotate a three dimentionnals vector around the X axis. + //! From GLM_GTX_rotate_vector extension. + template + detail::tvec3 rotateX( + const detail::tvec3& v, + T angle); + + //! Rotate a three dimentionnals vector around the Y axis. + //! From GLM_GTX_rotate_vector extension. + template + detail::tvec3 rotateY( + const detail::tvec3& v, + T angle); + + //! Rotate a three dimentionnals vector around the Z axis. + //! From GLM_GTX_rotate_vector extension. + template + detail::tvec3 rotateZ( + const detail::tvec3& v, + T angle); + + //! Rotate a four dimentionnals vector around the X axis. + //! From GLM_GTX_rotate_vector extension. + template + detail::tvec4 rotateX( + const detail::tvec4& v, + T angle); + + //! Rotate a four dimentionnals vector around the X axis. + //! From GLM_GTX_rotate_vector extension. + template + detail::tvec4 rotateY( + const detail::tvec4& v, + T angle); + + //! Rotate a four dimentionnals vector around the X axis. + //! From GLM_GTX_rotate_vector extension. + template + detail::tvec4 rotateZ( + const detail::tvec4& v, + T angle); + + //! Build a rotation matrix from a normal and a up vector. + //! From GLM_GTX_rotate_vector extension. + template + detail::tmat4x4 orientation( + const detail::tvec3& Normal, + const detail::tvec3& Up); + + }//namespace rotate_vector + }//namespace gtx +}//namespace glm + +#define GLM_GTX_rotate_vector namespace gtx::rotate_vector +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_rotate_vector;} +#endif//GLM_GTX_GLOBAL + +#include "rotate_vector.inl" + +#endif//glm_gtx_rotate_vector diff --git a/glm/gtx/rotate_vector.inl b/glm/gtx/rotate_vector.inl new file mode 100644 index 00000000..700006cf --- /dev/null +++ b/glm/gtx/rotate_vector.inl @@ -0,0 +1,145 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-11-02 +// Updated : 2009-02-19 +// Licence : This source is under MIT License +// File : glm/gtx/rotate_vector.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace rotate_vector +{ + template + inline detail::tvec2 rotate( + const detail::tvec2& v, + T angle) + { + detail::tvec2 Result; + const T Cos = cos(radians(angle)); + const T Sin = sin(radians(angle)); + Result.x = v.x * Cos - v.y * Sin; + Result.y = v.x * Sin + v.y * Cos; + return Result; + } + + template + inline detail::tvec3 rotate( + const detail::tvec3& v, T angle, + const detail::tvec3& normal) + { + return detail::tmat3x3(transform::rotate(angle, normal)) * v; + } +/* + template + inline detail::tvec3 rotateGTX(const detail::tvec3& x, T angle, const detail::tvec3& normal) + { + const T Cos = cos(radians(angle)); + const T Sin = sin(radians(angle)); + return x * Cos + ((x * normal) * (T(1) - Cos)) * normal + cross(x, normal) * Sin; + } +*/ + template + inline detail::tvec4 rotate( + const detail::tvec4& v, + T angle, + const detail::tvec3& normal) + { + return transform::rotate(angle, normal) * v; + } + + template + inline detail::tvec3 rotateX( + const detail::tvec3& v, + T angle) + { + detail::tvec3 Result = v; + const T Cos = cos(radians(angle)); + const T Sin = sin(radians(angle)); + Result.y = v.y * Cos - v.z * Sin; + Result.z = v.y * Sin + v.z * Cos; + return Result; + } + + template + inline detail::tvec3 rotateY( + const detail::tvec3& v, + T angle) + { + detail::tvec3 Result = v; + const T Cos = cos(radians(angle)); + const T Sin = sin(radians(angle)); + Result.x = v.x * Cos + v.z * Sin; + Result.z = -v.x * Sin + v.z * Cos; + return Result; + } + + template + inline detail::tvec3 rotateZ( + const detail::tvec3& v, + T angle) + { + detail::tvec3 Result = v; + const T Cos = cos(radians(angle)); + const T Sin = sin(radians(angle)); + Result.x = v.x * Cos - v.y * Sin; + Result.y = v.x * Sin + v.y * Cos; + return Result; + } + + template + inline detail::tvec4 rotateX( + const detail::tvec4& v, + T angle) + { + detail::tvec4 Result = v; + const T Cos = cos(radians(angle)); + const T Sin = sin(radians(angle)); + Result.y = v.y * Cos - v.z * Sin; + Result.z = v.y * Sin + v.z * Cos; + return Result; + } + + template + inline detail::tvec4 rotateY( + const detail::tvec4& v, + T angle) + { + detail::tvec4 Result = v; + const T Cos = cos(radians(angle)); + const T Sin = sin(radians(angle)); + Result.x = v.x * Cos + v.z * Sin; + Result.z = -v.x * Sin + v.z * Cos; + return Result; + } + + template + inline detail::tvec4 rotateZ( + const detail::tvec4& v, + T angle) + { + detail::tvec4 Result = v; + const T Cos = cos(radians(angle)); + const T Sin = sin(radians(angle)); + Result.x = v.x * Cos - v.y * Sin; + Result.y = v.x * Sin + v.y * Cos; + return Result; + } + + template + inline detail::tmat4x4 orientation( + const detail::tvec3& Normal, + const detail::tvec3& Up) + { + if(all(equal(Normal, Up))) + return detail::tmat4x4(T(1)); + + detail::tvec3 RotationAxis = cross(Up, Normal); + T Angle = degrees(acos(dot(Normal, Up))); + return rotate(Angle, RotationAxis); + } + +}//namespace rotate_vector +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/simd_common.hpp b/glm/gtx/simd_common.hpp new file mode 100644 index 00000000..e69de29b diff --git a/glm/gtx/simd_common.inl b/glm/gtx/simd_common.inl new file mode 100644 index 00000000..e69de29b diff --git a/glm/gtx/simd_geometric.hpp b/glm/gtx/simd_geometric.hpp new file mode 100644 index 00000000..e69de29b diff --git a/glm/gtx/simd_geometric.inl b/glm/gtx/simd_geometric.inl new file mode 100644 index 00000000..e69de29b diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp new file mode 100644 index 00000000..608a7b9b --- /dev/null +++ b/glm/gtx/simd_mat4.hpp @@ -0,0 +1,144 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-07 +// Updated : 2009-05-07 +// Licence : This source is under MIT License +// File : glm/gtx/simd_vec4.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - intrinsic +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_simd_mat4 +#define glm_gtx_simd_mat4 + +// Dependency: +#include "../glm.hpp" +#include +#include + +namespace glm +{ + namespace detail + { + GLM_ALIGN(16) struct fmat4x4SIMD + { + static __m128 one; + + enum no_init + { + NO_INIT + }; + + typedef float value_type; + typedef fvec4SIMD col_type; + typedef fvec4SIMD row_type; + typedef glm::sizeType size_type; + static size_type value_size(); + static size_type col_size(); + static size_type row_size(); + static bool is_matrix(); + + fvec4SIMD Data[4]; + + ////////////////////////////////////// + // Constructors + + fmat4x4SIMD(); + explicit fmat4x4SIMD(float const & s); + explicit fmat4x4SIMD( + float const & x0, float const & y0, float const & z0, float const & w0, + float const & x1, float const & y1, float const & z1, float const & w1, + float const & x2, float const & y2, float const & z2, float const & w2, + float const & x3, float const & y3, float const & z3, float const & w3); + explicit fmat4x4SIMD( + fvec4SIMD const & v0, + fvec4SIMD const & v1, + fvec4SIMD const & v2, + fvec4SIMD const & v3); + explicit fmat4x4SIMD( + tmat4x4 const & m); + + // Conversions + //template + //explicit tmat4x4(tmat4x4 const & m); + + //explicit tmat4x4(tmat2x2 const & x); + //explicit tmat4x4(tmat3x3 const & x); + //explicit tmat4x4(tmat2x3 const & x); + //explicit tmat4x4(tmat3x2 const & x); + //explicit tmat4x4(tmat2x4 const & x); + //explicit tmat4x4(tmat4x2 const & x); + //explicit tmat4x4(tmat3x4 const & x); + //explicit tmat4x4(tmat4x3 const & x); + + // Accesses + fvec4SIMD & operator[](size_type i); + fvec4SIMD const & operator[](size_type i) const; + + // Unary updatable operators + fmat4x4SIMD & operator= (fmat4x4SIMD const & m); + fmat4x4SIMD & operator+= (float const & s); + fmat4x4SIMD & operator+= (fmat4x4SIMD const & m); + fmat4x4SIMD & operator-= (float const & s); + fmat4x4SIMD & operator-= (fmat4x4SIMD const & m); + fmat4x4SIMD & operator*= (float const & s); + fmat4x4SIMD & operator*= (fmat4x4SIMD const & m); + fmat4x4SIMD & operator/= (float const & s); + fmat4x4SIMD & operator/= (fmat4x4SIMD const & m); + fmat4x4SIMD & operator++ (); + fmat4x4SIMD & operator-- (); + }; + + // Binary operators + fmat4x4SIMD operator+ (fmat4x4SIMD const & m, float const & s); + fmat4x4SIMD operator+ (float const & s, fmat4x4SIMD const & m); + fmat4x4SIMD operator+ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); + + fmat4x4SIMD operator- (fmat4x4SIMD const & m, float const & s); + fmat4x4SIMD operator- (float const & s, fmat4x4SIMD const & m); + fmat4x4SIMD operator- (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); + + fmat4x4SIMD operator* (fmat4x4SIMD const & m, float const & s); + fmat4x4SIMD operator* (float const & s, fmat4x4SIMD const & m); + + fvec4SIMD operator* (fmat4x4SIMD const & m, fvec4SIMD const & v); + fvec4SIMD operator* (fvec4SIMD const & v, fmat4x4SIMD const & m); + + fmat4x4SIMD operator* (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); + + fmat4x4SIMD operator/ (fmat4x4SIMD const & m, float const & s); + fmat4x4SIMD operator/ (float const & s, fmat4x4SIMD const & m); + + fvec4SIMD operator/ (fmat4x4SIMD const & m, fvec4SIMD const & v); + fvec4SIMD operator/ (fvec4SIMD const & v, fmat4x4SIMD const & m); + + fmat4x4SIMD operator/ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); + + // Unary constant operators + fmat4x4SIMD const operator- (fmat4x4SIMD const & m); + fmat4x4SIMD const operator-- (fmat4x4SIMD const & m, int); + fmat4x4SIMD const operator++ (fmat4x4SIMD const & m, int); + + }//namespace detail + + namespace gtx{ + //! GLM_GTX_simd_mat4 extension: SIMD implementation of vec4 type. + namespace simd_mat4 + { + typedef detail::fmat4SIMD mat4SIMD; + + }//namespace simd_mat4 + }//namespace gtx +}//namespace glm + +#define GLM_GTX_simd_mat4 namespace gtx::simd_mat4; +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_simd_mat4;} +#endif//GLM_GTX_GLOBAL + +#include "simd_mat4.inl" + +#endif//glm_gtx_simd_mat4 diff --git a/glm/gtx/simd_mat4.inl b/glm/gtx/simd_mat4.inl new file mode 100644 index 00000000..2c3f62a5 --- /dev/null +++ b/glm/gtx/simd_mat4.inl @@ -0,0 +1,221 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-19 +// Updated : 2009-05-19 +// Licence : This source is under MIT License +// File : glm/gtx/simd_mat4.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail +{ + inline fmat4x4SIMD::fmat4x4SIMD() + {} + + inline fmat4x4SIMD::fmat4x4SIMD(float const & s) + { + this->value[0] = fvec4SIMD(s, 0, 0, 0); + this->value[1] = fvec4SIMD(0, s, 0, 0); + this->value[2] = fvec4SIMD(0, 0, s, 0); + this->value[3] = fvec4SIMD(0, 0, 0, s); + } + + inline fmat4x4SIMD::fmat4x4SIMD + ( + float const & x0, float const & y0, float const & z0, float const & w0, + float const & x1, float const & y1, float const & z1, float const & w1, + float const & x2, float const & y2, float const & z2, float const & w2, + float const & x3, float const & y3, float const & z3, float const & w3 + ) + { + this->value[0] = fvec4SIMD(x0, y0, z0, w0); + this->value[1] = fvec4SIMD(x1, y1, z1, w1); + this->value[2] = fvec4SIMD(x2, y2, z2, w2); + this->value[3] = fvec4SIMD(x3, y3, z3, w3); + } + + inline fmat4x4SIMD::fmat4x4SIMD + ( + fvec4SIMD const & v0, + fvec4SIMD const & v1, + fvec4SIMD const & v2, + fvec4SIMD const & v3 + ) + { + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; + } + + inline fmat4x4SIMD::fmat4x4SIMD + ( + tmat4x4 const & m + ) + { + this->value[0] = fvec4SIMD(m[0]); + this->value[1] = fvec4SIMD(m[1]); + this->value[2] = fvec4SIMD(m[2]); + this->value[3] = fvec4SIMD(m[3]); + } + + ////////////////////////////////////// + // Accesses + + inline fvec4SIMD & fmat4x4SIMD::operator[] + ( + typename fmat4x4SIMD::size_type i + ) + { + assert( + i >= typename tmat4x4::size_type(0) && + i < tmat4x4::col_size()); + + return value[i]; + } + + inline fvec4SIMD const & fmat4x4SIMD::operator[] + ( + typename fmat4x4SIMD::size_type i + ) const + { + assert( + i >= typename fmat4x4SIMD::size_type(0) && + i < fmat4x4SIMD::col_size()); + + return value[i]; + } + + ////////////////////////////////////////////////////////////// + // mat4 operators + + inline fmat4x4SIMD& fmat4x4SIMD::operator= + ( + fmat4x4SIMD const & m + ) + { + this->value[0].Data = m[0].Data; + this->value[1].Data = m[1].Data; + this->value[2].Data = m[2].Data; + this->value[3].Data = m[3].Data; + return *this; + } + + inline fmat4x4SIMD & fmat4x4SIMD::operator+= + ( + fmat4x4SIMD const & m + ) + { + this->value[0].Data = _mm_add_ps(this->value[0].Data, m[0].Data); + this->value[1].Data = _mm_add_ps(this->value[1].Data, m[1].Data); + this->value[2].Data = _mm_add_ps(this->value[2].Data, m[2].Data); + this->value[3].Data = _mm_add_ps(this->value[3].Data, m[3].Data); + return *this; + } + + inline fmat4x4SIMD & fmat4x4SIMD::operator-= + ( + fmat4x4SIMD const & m + ) + { + this->value[0].Data = _mm_sub_ps(this->value[0].Data, m[0].Data); + this->value[1].Data = _mm_sub_ps(this->value[1].Data, m[1].Data); + this->value[2].Data = _mm_sub_ps(this->value[2].Data, m[2].Data); + this->value[3].Data = _mm_sub_ps(this->value[3].Data, m[3].Data); + + return *this; + } + + inline fmat4x4SIMD & fmat4x4SIMD::operator*= + ( + fmat4x4SIMD const & m + ) + { + _mm_mul_ps(this->Data, m.Data, this->Data); + return *this; + } + + inline fmat4x4SIMD & fmat4x4SIMD::operator/= + ( + fmat4x4SIMD const & m + ) + { + __m128 Inv[4]; + _mm_inverse_ps(m.Data, Inv); + _mm_mul_ps(this->Data, Inv, this->Data); + return *this; + } + + inline fmat4x4SIMD & fmat4x4SIMD::operator+= + ( + float const & s + ) + { + __m128 Operand = _mm_set_ps1(s); + this->value[0].Data = _mm_add_ps(this->value[0].Data, Operand); + this->value[1].Data = _mm_add_ps(this->value[1].Data, Operand); + this->value[2].Data = _mm_add_ps(this->value[2].Data, Operand); + this->value[3].Data = _mm_add_ps(this->value[3].Data, Operand); + return *this; + } + + inline fmat4x4SIMD & fmat4x4SIMD::operator-= + ( + float const & s + ) + { + __m128 Operand = _mm_set_ps1(s); + this->value[0].Data = _mm_sub_ps(this->value[0].Data, Operand); + this->value[1].Data = _mm_sub_ps(this->value[1].Data, Operand); + this->value[2].Data = _mm_sub_ps(this->value[2].Data, Operand); + this->value[3].Data = _mm_sub_ps(this->value[3].Data, Operand); + return *this; + } + + inline fmat4x4SIMD & fmat4x4SIMD::operator*= + ( + float const & s + ) + { + __m128 Operand = _mm_set_ps1(s); + this->value[0].Data = _mm_mul_ps(this->value[0].Data, Operand); + this->value[1].Data = _mm_mul_ps(this->value[1].Data, Operand); + this->value[2].Data = _mm_mul_ps(this->value[2].Data, Operand); + this->value[3].Data = _mm_mul_ps(this->value[3].Data, Operand); + return *this; + } + + inline fmat4x4SIMD & fmat4x4SIMD::operator/= + ( + float const & s + ) + { + __m128 Operand = _mm_div_ps(one, s)); + this->value[0].Data = _mm_mul_ps(this->value[0].Data, Operand); + this->value[1].Data = _mm_mul_ps(this->value[1].Data, Operand); + this->value[2].Data = _mm_mul_ps(this->value[2].Data, Operand); + this->value[3].Data = _mm_mul_ps(this->value[3].Data, Operand); + return *this; + } + + inline fmat4x4SIMD & fmat4x4SIMD::operator++ () + { + this->value[0].Data = _mm_add_ps(this->value[0].Data, one); + this->value[1].Data = _mm_add_ps(this->value[1].Data, one); + this->value[2].Data = _mm_add_ps(this->value[2].Data, one); + this->value[3].Data = _mm_add_ps(this->value[3].Data, one); + return *this; + } + + inline fmat4x4SIMD & fmat4x4SIMD::operator-- () + { + this->value[0].Data = _mm_sub_ps(this->value[0].Data, one); + this->value[1].Data = _mm_sub_ps(this->value[1].Data, one); + this->value[2].Data = _mm_sub_ps(this->value[2].Data, one); + this->value[3].Data = _mm_sub_ps(this->value[3].Data, one); + return *this; + } + +}//namespace detail +}//namespace glm diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp new file mode 100644 index 00000000..b05465fa --- /dev/null +++ b/glm/gtx/simd_vec4.hpp @@ -0,0 +1,130 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-07 +// Updated : 2009-05-07 +// Licence : This source is under MIT License +// File : glm/gtx/simd_vec4.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - intrinsic +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_simd_vec4 +#define glm_gtx_simd_vec4 + +// Dependency: +#include "../glm.hpp" +#include "../core/intrinsic_common.hpp" + +namespace glm +{ + namespace detail + { + GLM_ALIGN(4) struct fvec4SIMD + { + static __m128 one; + + union + { + __m128 Data; + struct{float x, y, z, w;}; + float array[4]; + }; + + ////////////////////////////////////// + // Implicit basic constructors + + fvec4SIMD(); + fvec4SIMD(__m128 const & Data); + fvec4SIMD(fvec4SIMD const & v); + fvec4SIMD(tvec4 const & v); + + ////////////////////////////////////// + // Explicit basic constructors + + fvec4SIMD(float const & s); + fvec4SIMD(float const & x, float const & y, float const & z, float const & w); + fvec4SIMD(float const v[4]); + + //////////////////////////////////////// + //// Swizzle constructors + + //fvec4SIMD(ref4 const & r); + + //////////////////////////////////////// + //// Convertion vector constructors + + fvec4SIMD(vec2 const & v, float const & s1, float const & s2); + fvec4SIMD(float const & s1, vec2 const & v, float const & s2); + fvec4SIMD(float const & s1, float const & s2, vec2 const & v); + fvec4SIMD(vec3 const & v, float const & s); + fvec4SIMD(float const & s, vec3 const & v); + fvec4SIMD(vec2 const & v1, vec2 const & v2); + //fvec4SIMD(ivec4SIMD const & v); + + ////////////////////////////////////// + // Unary arithmetic operators + + fvec4SIMD& operator= (fvec4SIMD const & v); + fvec4SIMD& operator+=(fvec4SIMD const & v); + fvec4SIMD& operator-=(fvec4SIMD const & v); + fvec4SIMD& operator*=(fvec4SIMD const & v); + fvec4SIMD& operator/=(fvec4SIMD const & v); + + fvec4SIMD& operator+=(float const & s); + fvec4SIMD& operator-=(float const & s); + fvec4SIMD& operator*=(float const & s); + fvec4SIMD& operator/=(float const & s); + + fvec4SIMD& operator++(); + fvec4SIMD& operator--(); + + //////////////////////////////////////// + //// Unary bit operators + + //fvec4SIMD& operator%= (float s); + //fvec4SIMD& operator%= (fvec4SIMD const & v); + //fvec4SIMD& operator&= (float s); + //fvec4SIMD& operator&= (fvec4SIMD const & v); + //fvec4SIMD& operator|= (float s); + //fvec4SIMD& operator|= (fvec4SIMD const & v); + //fvec4SIMD& operator^= (float s); + //fvec4SIMD& operator^= (fvec4SIMD const & v); + //fvec4SIMD& operator<<=(float s); + //fvec4SIMD& operator<<=(fvec4SIMD const & v); + //fvec4SIMD& operator>>=(float s); + //fvec4SIMD& operator>>=(fvec4SIMD const & v); + + ////////////////////////////////////// + // Swizzle operators + + //float swizzle(comp X) const; + //vec2 const swizzle(comp X, comp Y) const; + //vec3 const swizzle(comp X, comp Y, comp Z) const; + //fvec4SIMD const swizzle(comp X, comp Y, comp Z, comp W) const; + //fvec4SIMD const swizzle(int X, int Y, int Z, int W) const; + //ref4 swizzle(comp X, comp Y, comp Z, comp W); + }; + + }//namespace detail + + namespace gtx{ + //! GLM_GTX_simd_vec4 extension: SIMD implementation of vec4 type. + namespace simd_vec4 + { + typedef detail::fvec4SIMD vec4SIMD; + + }//namespace simd_vec4 + }//namespace gtx +}//namespace glm + +#define GLM_GTX_simd_vec4 namespace gtx::simd_vec4; +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_simd_vec4;} +#endif//GLM_GTX_GLOBAL + +#include "simd_vec4.inl" + +#endif//glm_gtx_simd_vec4 diff --git a/glm/gtx/simd_vec4.inl b/glm/gtx/simd_vec4.inl new file mode 100644 index 00000000..bf2d3239 --- /dev/null +++ b/glm/gtx/simd_vec4.inl @@ -0,0 +1,263 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-07 +// Updated : 2009-05-07 +// Licence : This source is under MIT License +// File : glm/gtx/simd_vec4.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + namespace detail + { + __m128 fvec4SIMD::one = _mm_set_ps1(1.f); + + ////////////////////////////////////// + // Implicit basic constructors + + inline fvec4SIMD::fvec4SIMD() + {} + + inline fvec4SIMD::fvec4SIMD(__m128 const & Data) : + Data(Data) + {} + + inline fvec4SIMD::fvec4SIMD(fvec4SIMD const & v) : + Data(v.Data) + {} + + inline fvec4SIMD::fvec4SIMD(tvec4 const & v) : + Data(_mm_set_ps(v.w, v.z, v.y, v.x)) + {} + + ////////////////////////////////////// + // Explicit basic constructors + + inline fvec4SIMD::fvec4SIMD(float const & s) : + Data(_mm_set1_ps(s)) + {} + + inline fvec4SIMD::fvec4SIMD(float const & x, float const & y, float const & z, float const & w) : + // Data(_mm_setr_ps(x, y, z, w)) + Data(_mm_set_ps(w, z, y, x)) + {} + + inline fvec4SIMD::fvec4SIMD(float const v[4]) : + Data(_mm_load_ps(v)) + {} + + ////////////////////////////////////// + // Swizzle constructors + + //fvec4SIMD(ref4 const & r); + + ////////////////////////////////////// + // Convertion vector constructors + + inline fvec4SIMD::fvec4SIMD(vec2 const & v, float const & s1, float const & s2) : + Data(_mm_set_ps(s2, s1, v.y, v.x)) + {} + + inline fvec4SIMD::fvec4SIMD(float const & s1, vec2 const & v, float const & s2) : + Data(_mm_set_ps(s2, v.y, v.x, s1)) + {} + + inline fvec4SIMD::fvec4SIMD(float const & s1, float const & s2, vec2 const & v) : + Data(_mm_set_ps(v.y, v.x, s2, s1)) + {} + + inline fvec4SIMD::fvec4SIMD(vec3 const & v, float const & s) : + Data(_mm_set_ps(s, v.z, v.y, v.x)) + {} + + inline fvec4SIMD::fvec4SIMD(float const & s, vec3 const & v) : + Data(_mm_set_ps(v.z, v.y, v.x, s)) + {} + + inline fvec4SIMD::fvec4SIMD(vec2 const & v1, vec2 const & v2) : + Data(_mm_set_ps(v2.y, v2.x, v1.y, v1.x)) + {} + + //inline fvec4SIMD::fvec4SIMD(ivec4SIMD const & v) : + // Data(_mm_cvtepi32_ps(v.Data)) + //{} + + ////////////////////////////////////// + // Unary arithmetic operators + + inline fvec4SIMD& fvec4SIMD::operator=(fvec4SIMD const & v) + { + this->Data = v.Data; + return *this; + } + + inline fvec4SIMD& fvec4SIMD::operator+=(float const & s) + { + this->Data = _mm_add_ps(Data, _mm_set_ps1(s)); + return *this; + } + + inline fvec4SIMD& fvec4SIMD::operator+=(fvec4SIMD const & v) + { + this->Data = _mm_add_ps(this->Data , v.Data); + return *this; + } + + inline fvec4SIMD& fvec4SIMD::operator-=(float const & s) + { + this->Data = _mm_sub_ps(Data, _mm_set_ps1(s)); + return *this; + } + + inline fvec4SIMD& fvec4SIMD::operator-=(fvec4SIMD const & v) + { + this->Data = _mm_sub_ps(this->Data , v.Data); + return *this; + } + + inline fvec4SIMD& fvec4SIMD::operator*=(float const & s) + { + this->Data = _mm_mul_ps(this->Data, _mm_set_ps1(s)); + return *this; + } + + inline fvec4SIMD& fvec4SIMD::operator*=(fvec4SIMD const & v) + { + this->Data = _mm_mul_ps(this->Data , v.Data); + return *this; + } + + inline fvec4SIMD& fvec4SIMD::operator/=(float const & s) + { + this->Data = _mm_div_ps(Data, _mm_set1_ps(s)); + return *this; + } + + inline fvec4SIMD& fvec4SIMD::operator/=(fvec4SIMD const & v) + { + this->Data = _mm_div_ps(this->Data , v.Data); + return *this; + } + + inline fvec4SIMD& fvec4SIMD::operator++() + { + this->Data = _mm_add_ps(this->Data , glm::detail::one); + return *this; + } + + inline fvec4SIMD& fvec4SIMD::operator--() + { + this->Data = _mm_sub_ps(this->Data , glm::detail::one); + return *this; + } + + ////////////////////////////////////// + // Swizzle operators + + //inline fvec4SIMD const fvec4SIMD::swizzle(int d, int c, int b, int a) const + //{ + // int const Mask = ((d << 6) | (c << 4) | (b << 2) | (a << 0)); + + // __m128 Data = _mm_shuffle_ps(this->Data, this->Data, Mask); + // return fvec4SIMD(Data); + //} + + // operator+ + inline fvec4SIMD operator+ (fvec4SIMD const & v, float s) + { + return fvec4SIMD(_mm_add_ps(v.Data, _mm_set1_ps(s))); + } + + inline fvec4SIMD operator+ (float s, fvec4SIMD const & v) + { + return fvec4SIMD(_mm_add_ps(_mm_set1_ps(s), v.Data)); + } + + inline fvec4SIMD operator+ (fvec4SIMD const & v1, fvec4SIMD const & v2) + { + return fvec4SIMD(_mm_add_ps(v1.Data, v2.Data)); + } + + //operator- + inline fvec4SIMD operator- (fvec4SIMD const & v, float s) + { + return fvec4SIMD(_mm_sub_ps(v.Data, _mm_set1_ps(s))); + } + + inline fvec4SIMD operator- (float s, fvec4SIMD const & v) + { + return fvec4SIMD(_mm_sub_ps(_mm_set1_ps(s), v.Data)); + } + + inline fvec4SIMD operator- (fvec4SIMD const & v1, fvec4SIMD const & v2) + { + return fvec4SIMD(_mm_sub_ps(v1.Data, v2.Data)); + } + + //operator* + inline fvec4SIMD operator* (fvec4SIMD const & v, float s) + { + __m128 par0 = v.Data; + __m128 par1 = _mm_set1_ps(s); + return fvec4SIMD(_mm_mul_ps(par0, par1)); + } + + inline fvec4SIMD operator* (float s, fvec4SIMD const & v) + { + __m128 par0 = _mm_set1_ps(s); + __m128 par1 = v.Data; + return fvec4SIMD(_mm_mul_ps(par0, par1)); + } + + inline fvec4SIMD operator* (fvec4SIMD const & v1, fvec4SIMD const & v2) + { + return fvec4SIMD(_mm_mul_ps(v1.Data, v2.Data)); + } + + //operator/ + inline fvec4SIMD operator/ (fvec4SIMD const & v, float s) + { + __m128 par0 = v.Data; + __m128 par1 = _mm_set1_ps(s); + return fvec4SIMD(_mm_div_ps(par0, par1)); + } + + inline fvec4SIMD operator/ (float s, fvec4SIMD const & v) + { + __m128 par0 = _mm_set1_ps(s); + __m128 par1 = v.Data; + return fvec4SIMD(_mm_div_ps(par0, par1)); + } + + inline fvec4SIMD operator/ (fvec4SIMD const & v1, fvec4SIMD const & v2) + { + return fvec4SIMD(_mm_div_ps(v1.Data, v2.Data)); + } + + // Unary constant operators + inline fvec4SIMD operator- (fvec4SIMD const & v) + { + return fvec4SIMD(_mm_sub_ps(_mm_setzero_ps(), v.Data)); + } + + inline fvec4SIMD operator++ (fvec4SIMD const & v, int) + { + return fvec4SIMD(_mm_add_ps(v.Data, glm::detail::one)); + } + + inline fvec4SIMD operator-- (fvec4SIMD const & v, int) + { + return fvec4SIMD(_mm_sub_ps(v.Data, glm::detail::one)); + } + + }//namespace detail + + namespace gtx{ + namespace simd_vec4 + { + + + }//namespace simd_vec4 + }//namespace gtx +}//namespace glm diff --git a/glm/gtx/spline.hpp b/glm/gtx/spline.hpp new file mode 100644 index 00000000..0a596b92 --- /dev/null +++ b/glm/gtx/spline.hpp @@ -0,0 +1,68 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-01-25 +// Updated : 2009-02-19 +// Licence : This source is under MIT License +// File : glm/gtx/spline.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_spline +#define glm_gtx_spline + +// Dependency: +#include "../glm.hpp" +#include "../gtx/optimum_pow.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_spline extension: Spline functions + namespace spline + { + //! Return a point from a catmull rom curve. + //! From GLM_GTX_spline extension. + template + genType catmullRom( + const genType& v1, + const genType& v2, + const genType& v3, + const genType& v4, + const GLMvalType& s); + + //! Return a point from a hermite curve. + //! From GLM_GTX_spline extension. + template + genType hermite( + const genType& v1, + const genType& t1, + const genType& v2, + const genType& t2, + const GLMvalType& s); + + //! Return a point from a cubic curve. + //! From GLM_GTX_spline extension. + template + genType cubic( + const genType& v1, + const genType& v2, + const genType& v3, + const genType& v4, + const GLMvalType& s); + + }//namespace spline + }//namespace gtx +}//namespace glm + +#define GLM_GTX_spline namespace gtx::optimum_pow; using namespace gtx::spline +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_spline;} +#endif//GLM_GTX_GLOBAL + +#include "spline.inl" + +#endif//glm_gtx_spline + diff --git a/glm/gtx/spline.inl b/glm/gtx/spline.inl new file mode 100644 index 00000000..52f4c9d3 --- /dev/null +++ b/glm/gtx/spline.inl @@ -0,0 +1,68 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-01-25 +// Updated : 2009-02-19 +// Licence : This source is under MIT License +// File : glm/gtx/spline.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace spline +{ + template + inline genType catmullRom( + const genType& v1, + const genType& v2, + const genType& v3, + const genType& v4, + const GLMvalType& s) + { + GLMvalType s1 = s; + GLMvalType s2 = optimum_pow::pow2(s); + GLMvalType s3 = optimum_pow::pow3(s); + + GLMvalType f1 = -s3 + GLMvalType(2) * s2 - s; + GLMvalType f2 = GLMvalType(3) * s3 - GLMvalType(5) * s2 + GLMvalType(2); + GLMvalType f3 = GLMvalType(-3) * s3 + GLMvalType(4) * s2 + s; + GLMvalType f4 = s3 - s2; + + return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / GLMvalType(2); + + } + + template + inline genType hermite( + const genType& v1, + const genType& t1, + const genType& v2, + const genType& t2, + const GLMvalType& s) + { + GLMvalType s1 = s; + GLMvalType s2 = optimum_pow::pow2(s); + GLMvalType s3 = optimum_pow::pow3(s); + + GLMvalType f1 = GLMvalType(2) * s3 - GLMvalType(3) * s2 + GLMvalType(1); + GLMvalType f2 = GLMvalType(-2) * s3 + GLMvalType(3) * s2; + GLMvalType f3 = s3 - GLMvalType(2) * s2 + s; + GLMvalType f4 = s3 - s2; + + return f1 * v1 + f2 * v2 + f3 * t1 + f4 * t2; + } + + template + inline genType cubic( + const genType& v1, + const genType& v2, + const genType& v3, + const genType& v4, + const GLMvalType& s) + { + return ((v1 * s + v2) * s + v3) * s + v4; + } + +}//namespace spline +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/statistics_operation.hpp b/glm/gtx/statistics_operation.hpp new file mode 100644 index 00000000..1ffad05f --- /dev/null +++ b/glm/gtx/statistics_operation.hpp @@ -0,0 +1,70 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-11-21 +// Updated : 2007-11-21 +// Licence : This source is under MIT License +// File : glm/gtx/statistics_operation.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_statistics_operation +#define glm_gtx_statistics_operation + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + template T statDistanceGTX(const detail::tvec2& v1, const detail::tvec2& v2); + template T statDistanceGTX(const detail::tvec3& v1, const detail::tvec3& v2); + template T statDistanceGTX(const detail::tvec4& v1, const detail::tvec4& v2); + + template T statDistanceGTX(const detail::tmat2x2& m1, const detail::tmat2x2& m2); + template T statDistanceGTX(const detail::tmat3x3& m1, const detail::tmat3x3& m2); + template T statDistanceGTX(const detail::tmat4x4& m1, const detail::tmat4x4& m2); + + template T expectedValueGTX(const detail::tvec2& v1, const detail::tvec2& v2); + template T expectedValueGTX(const detail::tvec3& v1, const detail::tvec3& v2); + template T expectedValueGTX(const detail::tvec4& v1, const detail::tvec4& v2); + + template T expectedValueGTX(const detail::tmat2x2& m1, const detail::tmat2x2& m2); + template T expectedValueGTX(const detail::tmat3x3& m1, const detail::tmat3x3& m2); + template T expectedValueGTX(const detail::tmat4x4& m1, const detail::tmat4x4& m2); + + template T varianceGTX(const detail::tvec2& v1, const detail::tvec2& v2); + template T varianceGTX(const detail::tvec3& v1, const detail::tvec3& v2); + template T varianceGTX(const detail::tvec4& v1, const detail::tvec4& v2); + + template T varianceGTX(const detail::tmat2x2& m1, const detail::tmat2x2& m2); + template T varianceGTX(const detail::tmat3x3& m1, const detail::tmat3x3& m2); + template T varianceGTX(const detail::tmat4x4& m1, const detail::tmat4x4& m2); + + template T standardDevitionGTX(const detail::tvec2& v1, const detail::tvec2& v2); + template T standardDevitionGTX(const detail::tvec3& v1, const detail::tvec3& v2); + template T standardDevitionGTX(const detail::tvec4& v1, const detail::tvec4& v2); + + template T standardDevitionGTX(const detail::tmat2x2& m1, const detail::tmat2x2& m2); + template T standardDevitionGTX(const detail::tmat3x3& m1, const detail::tmat3x3& m2); + template T standardDevitionGTX(const detail::tmat4x4& m1, const detail::tmat4x4& m2); + + namespace gtx + { + //! GLM_GTX_statistics_operation extension: - Work in progress - Statistics functions + namespace statistics_operation + { + + } + } +} + +#define GLM_GTX_statistics_operation namespace gtx::statistics_operation +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_statistics_operation;} +#endif//GLM_GTX_GLOBAL + +#include "statistics_operation.inl" + +#endif//glm_gtx_statistics_operation diff --git a/glm/gtx/statistics_operation.inl b/glm/gtx/statistics_operation.inl new file mode 100644 index 00000000..2e3e1177 --- /dev/null +++ b/glm/gtx/statistics_operation.inl @@ -0,0 +1,81 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-11-21 +// Updated : 2007-11-21 +// Licence : This source is under MIT License +// File : glm/gtx/statistics_operator.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +namespace glm +{ + //! Compute the sum of square of differences between each matrices paremeters + template + inline T statDistanceGTX(const detail::tmat2x2& m1, const detail::tmat2x2& m2) + { + T result = T(0); + for(int j = 0; j < 2; ++j) + for(int i = 0; i < 2; ++i) + { + T diff = m1[j][i] - m2[j][i]; + result += diff * diff; + } + return result; + } + + template + inline T statDistanceGTX(const detail::tmat3x3& m1, const detail::tmat3x3& m2) + { + T result = T(0); + for(int j = 0; j < 3; ++j) + for(int i = 0; i < 3; ++i) + { + T diff = m1[j][i] - m2[j][i]; + result += diff * diff; + } + return result; + } + + template + inline T statDistanceGTX(const detail::tmat4x4& m1, const detail::tmat4x4& m2) + { + T result = T(0); + for(int j = 0; j < 4; ++j) + for(int i = 0; i < 4; ++i) + { + T diff = m1[j][i] - m2[j][i]; + result += diff * diff; + } + return result; + } + + template + T expectedValueGTX(const detail::tmat4x4& m) + { + T result = T(0); + for(int j = 0; j < 4; ++j) + for(int i = 0; i < 4; ++i) + result += m[j][i]; + result *= T(0,0625); + return result; + } + + template + T varianceGTX(const detail::tmat4x4& m) + { + T ExpectedValue = expectedValueGTX(m); + T ExpectedValueOfSquaredMatrix = expectedValueGTX(matrixCompMult(m)); + return ExpectedValueOfSquaredMatrix - ExpectedValue * ExpectedValue; + } + + template + T standardDevitionGTX(const detail::tmat4x4& m) + { + return sqrt(varianceGTX(m)); + } +} diff --git a/glm/gtx/std_based_type.hpp b/glm/gtx/std_based_type.hpp new file mode 100644 index 00000000..3ca58640 --- /dev/null +++ b/glm/gtx/std_based_type.hpp @@ -0,0 +1,77 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-06-08 +// Updated : 2008-06-08 +// Licence : This source is under MIT License +// File : glm/gtx/std_based_type.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_std_based_type +#define glm_gtx_std_based_type + +// Dependency: +#include "../glm.hpp" +#include + +namespace glm +{ + namespace test{ + void main_gtx_std_based_type(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_std_based_type extension: Add support vector types based on C++ standard type + namespace std_based_type + { + typedef detail::tvec2 size2; + typedef detail::tvec3 size3; + typedef detail::tvec4 size4; + + typedef detail::tvec2 scvec2; + typedef detail::tvec3 scvec3; + typedef detail::tvec4 scvec4; + + typedef detail::tvec2 ucvec2; + typedef detail::tvec3 ucvec3; + typedef detail::tvec4 ucvec4; + + typedef detail::tvec2 ssvec2; + typedef detail::tvec3 ssvec3; + typedef detail::tvec4 ssvec4; + + typedef detail::tvec2 usvec2; + typedef detail::tvec3 usvec3; + typedef detail::tvec4 usvec4; + + typedef detail::tvec2 sivec2; + typedef detail::tvec3 sivec3; + typedef detail::tvec4 sivec4; + + typedef detail::tvec2 uivec2; + typedef detail::tvec3 uivec3; + typedef detail::tvec4 uivec4; + + typedef detail::tvec2 slvec2; + typedef detail::tvec3 slvec3; + typedef detail::tvec4 slvec4; + + typedef detail::tvec2 ulvec2; + typedef detail::tvec3 ulvec3; + typedef detail::tvec4 ulvec4; + + }//namespace std_based_type + }//namespace gtx +}//namespace glm + +#define GLM_GTX_std_based_type namespace gtx::std_based_type +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_std_based_type;} +#endif//GLM_GTX_GLOBAL + +#include "std_based_type.inl" + +#endif//glm_gtx_std_based_type diff --git a/glm/gtx/std_based_type.inl b/glm/gtx/std_based_type.inl new file mode 100644 index 00000000..030765d2 --- /dev/null +++ b/glm/gtx/std_based_type.inl @@ -0,0 +1,13 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-06-08 +// Updated : 2008-06-08 +// Licence : This source is under MIT License +// File : glm/gtx/std_based_type.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm +{ + +} diff --git a/glm/gtx/string_cast.hpp b/glm/gtx/string_cast.hpp new file mode 100644 index 00000000..0168faa3 --- /dev/null +++ b/glm/gtx/string_cast.hpp @@ -0,0 +1,61 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2006 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-04-26 +// Updated : 2008-05-24 +// Licence : This source is under MIT License +// File : glm/gtx/string_cast.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_double +// - GLM_GTX_half +// - GLM_GTX_integer +// - GLM_GTX_quaternion +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_string_cast +#define glm_gtx_string_cast + +// Dependency: +#include "../glm.hpp" +#include "../gtc/double_float.hpp" +#include "../gtc/half_float.hpp" +#include "../gtx/integer.hpp" +#include "../gtx/unsigned_int.hpp" +#include "../gtx/quaternion.hpp" +#include + +namespace glm +{ + namespace test{ + void main_gtx_string_cast(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_string_cast extension: Setup strings for GLM type values + namespace string_cast + { + using namespace gtc::double_float; + using namespace gtc::half_float; + using namespace gtx::integer; + using namespace gtx::unsigned_int; + using namespace gtx::quaternion; + + //! Create a string from a GLM type value. + //! From GLM_GTX_string_cast extension. + template + std::string string(genType const & x); + + }//namespace string_cast + }//namespace gtx +}//namespace glm + +#define GLM_GTX_string_cast namespace gtx::string_cast +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_string_cast;} +#endif//GLM_GTX_GLOBAL + +#include "string_cast.inl" + +#endif//glm_gtx_string_cast diff --git a/glm/gtx/string_cast.inl b/glm/gtx/string_cast.inl new file mode 100644 index 00000000..af2807f6 --- /dev/null +++ b/glm/gtx/string_cast.inl @@ -0,0 +1,597 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2006 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-04-27 +// Updated : 2008-05-24 +// Licence : This source is under MIT License +// File : glm/gtx/string_cast.h +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +namespace glm{ +namespace detail +{ + inline std::string format(const char* msg, ...) + { + const int STRING_BUFFER = 4096; + char text[STRING_BUFFER]; + va_list list; + + if(msg == 0) + return std::string(); + + va_start(list, msg); + vsprintf(text, msg, list); + va_end(list); + + return std::string(text); + } + + static const char* True = "true"; + static const char* False = "false"; +}//namespace detail + +namespace gtx{ +namespace string_cast +{ + //////////////////////////////// + // Scalars + + inline std::string string(detail::thalf const & x) + { + return detail::format("half(%f)", float(x)); + } + + inline std::string string(float x) + { + return detail::format("float(%f)", x); + } + + inline std::string string(double x) + { + return detail::format("double(%f)", x); + } + + inline std::string string(int x) + { + return detail::format("int(%d)", x); + } + + inline std::string string(unsigned int x) + { + return detail::format("uint(%d)", x); + } + + //////////////////////////////// + // Bool vectors + + inline std::string string + ( + detail::tvec2 const & v + ) + { + return detail::format("bvec2(%s, %s)", + v.x ? detail::True : detail::False, + v.y ? detail::True : detail::False); + } + + inline std::string string + ( + detail::tvec3 const & v + ) + { + return detail::format("bvec3(%s, %s, %s)", + v.x ? detail::True : detail::False, + v.y ? detail::True : detail::False, + v.z ? detail::True : detail::False); + } + + inline std::string string + ( + detail::tvec4 const & v + ) + { + return detail::format("bvec4(%s, %s, %s, %s)", + v.x ? detail::True : detail::False, + v.y ? detail::True : detail::False, + v.z ? detail::True : detail::False, + v.w ? detail::True : detail::False); + } + + //////////////////////////////// + // Half vectors + + template <> + inline std::string string + ( + detail::tvec2 const & v + ) + { + return detail::format("hvec2(%f, %f)", float(v.x), float(v.y)); + } + + template <> + inline std::string string + ( + detail::tvec3 const & v + ) + { + return detail::format("hvec3(%f, %f, %f)", float(v.x), float(v.y), float(v.z)); + } + + template <> + inline std::string string + ( + detail::tvec4 const & v + ) + { + return detail::format("hvec4(%f, %f, %f, %f)", float(v.x), float(v.y), float(v.z), float(v.w)); + } + + //////////////////////////////// + // Float vectors + + template <> + inline std::string string + ( + detail::tvec2 const & v + ) + { + return detail::format("fvec2(%f, %f)", v.x, v.y); + } + + template <> + inline std::string string + ( + detail::tvec3 const & v + ) + { + return detail::format("fvec3(%f, %f, %f)", v.x, v.y, v.z); + } + + template <> + inline std::string string + ( + detail::tvec4 const & v + ) + { + return detail::format("fvec4(%f, %f, %f, %f)", v.x, v.y, v.z, v.w); + } + + //////////////////////////////// + // Double vectors + + template <> + inline std::string string + ( + detail::tvec2 const & v + ) + { + return detail::format("dvec2(%f, %f)", v.x, v.y); + } + + template <> + inline std::string string + ( + detail::tvec3 const & v + ) + { + return detail::format("dvec3(%f, %f, %f)", v.x, v.y, v.z); + } + + template <> + inline std::string string + ( + detail::tvec4 const & v + ) + { + return detail::format("dvec4(%f, %f, %f, %f)", v.x, v.y, v.z, v.w); + } + + //////////////////////////////// + // Int vectors + + template <> + inline std::string string + ( + detail::tvec2 const & v + ) + { + return detail::format("ivec2(%d, %d)", v.x, v.y); + } + + template <> + inline std::string string + ( + detail::tvec3 const & v + ) + { + return detail::format("ivec3(%d, %d, %d)", v.x, v.y, v.z); + } + + template <> + inline std::string string + ( + detail::tvec4 const & v + ) + { + return detail::format("ivec4(%d, %d, %d, %d)", v.x, v.y, v.z, v.w); + } + + //////////////////////////////// + // Unsigned int vectors + + template <> + inline std::string string + ( + detail::tvec2 const & v + ) + { + return detail::format("uvec2(%d, %d)", v.x, v.y); + } + + template <> + inline std::string string + ( + detail::tvec3 const & v + ) + { + return detail::format("uvec3(%d, %d, %d)", v.x, v.y, v.z); + } + + template <> + inline std::string string + ( + detail::tvec4 const & v + ) + { + return detail::format("uvec4(%d, %d, %d, %d)", v.x, v.y, v.z, v.w); + } + + //////////////////////////////// + // Half matrices + + template <> + inline std::string string + ( + detail::tmat2x2 const & m + ) + { + detail::tmat2x2 x(m); + return detail::format("hmat2x2((%f, %f), (%f, %f))", + x[0][0], x[0][1], + x[1][0], x[1][1]); + } + + template <> + inline std::string string + ( + detail::tmat2x3 const & m + ) + { + detail::tmat2x3 x(m); + return detail::format("hmat2x3((%f, %f, %f), (%f, %f, %f))", + x[0][0], x[0][1], x[0][2], + x[1][0], x[1][1], x[1][2]); + } + + template <> + inline std::string string + ( + detail::tmat2x4 const & m + ) + { + detail::tmat2x4 x(m); + return detail::format("hmat2x4((%f, %f, %f, %f), (%f, %f, %f, %f))", + x[0][0], x[0][1], x[0][2], x[0][3], + x[1][0], x[1][1], x[1][2], x[1][3]); + } + + template <> + inline std::string string + ( + detail::tmat3x2 const & m + ) + { + detail::tmat3x2 x(m); + return detail::format("hmat3x2((%f, %f), (%f, %f), (%f, %f))", + x[0][0], x[0][1], + x[1][0], x[1][1], + x[2][0], x[2][1]); + } + + template <> + inline std::string string + ( + detail::tmat3x3 const & m + ) + { + detail::tmat3x3 x(m); + return detail::format("hmat3x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", + x[0][0], x[0][1], x[0][2], + x[1][0], x[1][1], x[1][2], + x[2][0], x[2][1], x[2][2]); + } + + template <> + inline std::string string + ( + detail::tmat3x4 const & m + ) + { + detail::tmat3x4 x(m); + return detail::format("hmat3x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", + x[0][0], x[0][1], x[0][2], x[0][3], + x[1][0], x[1][1], x[1][2], x[1][3], + x[2][0], x[2][1], x[2][2], x[2][3]); + } + + template <> + inline std::string string + ( + detail::tmat4x2 const & m + ) + { + detail::tmat4x2 x(m); + return detail::format("hmat4x2((%f, %f), (%f, %f), (%f, %f), (%f, %f))", + x[0][0], x[0][1], + x[1][0], x[1][1], + x[2][0], x[2][1], + x[3][0], x[3][1]); + } + + template <> + inline std::string string + ( + detail::tmat4x3 const & m + ) + { + detail::tmat4x3 x(m); + return detail::format("hmat4x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", + x[0][0], x[0][1], x[0][2], + x[1][0], x[1][1], x[1][2], + x[2][0], x[2][1], x[2][2], + x[3][0], x[3][1], x[3][2]); + } + + template <> + inline std::string string + ( + detail::tmat4x4 const & m + ) + { + detail::tmat4x4 x(m); + return detail::format("hmat4x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", + x[0][0], x[0][1], x[0][2], x[0][3], + x[1][0], x[1][1], x[1][2], x[1][3], + x[2][0], x[2][1], x[2][2], x[2][3], + x[3][0], x[3][1], x[3][2], x[3][3]); + } + + //////////////////////////////// + // Float matrices + + template <> + inline std::string string + ( + detail::tmat2x2 const & x + ) + { + return detail::format("mat2x2((%f, %f), (%f, %f))", + x[0][0], x[0][1], + x[1][0], x[1][1]); + } + + template <> + inline std::string string + ( + detail::tmat2x3 const & x + ) + { + return detail::format("mat2x3((%f, %f, %f), (%f, %f, %f))", + x[0][0], x[0][1], x[0][2], + x[1][0], x[1][1], x[1][2]); + } + + template <> + inline std::string string + ( + detail::tmat2x4 const & x + ) + { + return detail::format("mat2x4((%f, %f, %f, %f), (%f, %f, %f, %f))", + x[0][0], x[0][1], x[0][2], x[0][3], + x[1][0], x[1][1], x[1][2], x[1][3]); + } + + template <> + inline std::string string + ( + detail::tmat3x2 const & x + ) + { + return detail::format("mat3x2((%f, %f), (%f, %f), (%f, %f))", + x[0][0], x[0][1], + x[1][0], x[1][1], + x[2][0], x[2][1]); + } + + template <> + inline std::string string + ( + detail::tmat3x3 const & x + ) + { + return detail::format("mat3x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", + x[0][0], x[0][1], x[0][2], + x[1][0], x[1][1], x[1][2], + x[2][0], x[2][1], x[2][2]); + } + + template <> + inline std::string string + ( + detail::tmat3x4 const & x + ) + { + return detail::format("mat3x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", + x[0][0], x[0][1], x[0][2], x[0][3], + x[1][0], x[1][1], x[1][2], x[1][3], + x[2][0], x[2][1], x[2][2], x[2][3]); + } + + template <> + inline std::string string + ( + detail::tmat4x2 const & x + ) + { + return detail::format("mat4x2((%f, %f), (%f, %f), (%f, %f), (%f, %f))", + x[0][0], x[0][1], + x[1][0], x[1][1], + x[2][0], x[2][1], + x[3][0], x[3][1]); + } + + template <> + inline std::string string + ( + detail::tmat4x3 const & x + ) + { + return detail::format("mat4x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", + x[0][0], x[0][1], x[0][2], + x[1][0], x[1][1], x[1][2], + x[2][0], x[2][1], x[2][2], + x[3][0], x[3][1], x[3][2]); + } + + template <> + inline std::string string + ( + detail::tmat4x4 const & x + ) + { + return detail::format("mat4x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", + x[0][0], x[0][1], x[0][2], x[0][3], + x[1][0], x[1][1], x[1][2], x[1][3], + x[2][0], x[2][1], x[2][2], x[2][3], + x[3][0], x[3][1], x[3][2], x[3][3]); + } + + //////////////////////////////// + // Double matrices + + template <> + inline std::string string + ( + detail::tmat2x2 const & x + ) + { + return detail::format("dmat2x2((%f, %f), (%f, %f))", + x[0][0], x[0][1], + x[1][0], x[1][1]); + } + + template <> + inline std::string string + ( + detail::tmat2x3 const & x + ) + { + return detail::format("dmat2x3((%f, %f, %f), (%f, %f, %f))", + x[0][0], x[0][1], x[0][2], + x[1][0], x[1][1], x[1][2]); + } + + template <> + inline std::string string + ( + detail::tmat2x4 const & x + ) + { + return detail::format("dmat2x4((%f, %f, %f, %f), (%f, %f, %f, %f))", + x[0][0], x[0][1], x[0][2], x[0][3], + x[1][0], x[1][1], x[1][2], x[1][3]); + } + + template <> + inline std::string string + ( + detail::tmat3x2 const & x + ) + { + return detail::format("dmat3x2((%f, %f), (%f, %f), (%f, %f))", + x[0][0], x[0][1], + x[1][0], x[1][1], + x[2][0], x[2][1]); + } + + template <> + inline std::string string + ( + detail::tmat3x3 const & x + ) + { + return detail::format("dmat3x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", + x[0][0], x[0][1], x[0][2], + x[1][0], x[1][1], x[1][2], + x[2][0], x[2][1], x[2][2]); + } + + template <> + inline std::string string + ( + detail::tmat3x4 const & x + ) + { + return detail::format("dmat3x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", + x[0][0], x[0][1], x[0][2], x[0][3], + x[1][0], x[1][1], x[1][2], x[1][3], + x[2][0], x[2][1], x[2][2], x[2][3]); + } + + template <> + inline std::string string + ( + detail::tmat4x2 const & x + ) + { + return detail::format("dmat4x2((%f, %f), (%f, %f), (%f, %f), (%f, %f))", + x[0][0], x[0][1], + x[1][0], x[1][1], + x[2][0], x[2][1], + x[3][0], x[3][1]); + } + + template <> + inline std::string string + ( + detail::tmat4x3 const & x + ) + { + return detail::format("dmat4x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", + x[0][0], x[0][1], x[0][2], + x[1][0], x[1][1], x[1][2], + x[2][0], x[2][1], x[2][2], + x[3][0], x[3][1], x[3][2]); + } + + template <> + inline std::string string + ( + detail::tmat4x4 const & x + ) + { + return detail::format("dmat4x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", + x[0][0], x[0][1], x[0][2], x[0][3], + x[1][0], x[1][1], x[1][2], x[1][3], + x[2][0], x[2][1], x[2][2], x[2][3], + x[3][0], x[3][1], x[3][2], x[3][3]); + } + + }//namespace string_cast + }//namespace gtx +}//namespace glm diff --git a/glm/gtx/transform.hpp b/glm/gtx/transform.hpp new file mode 100644 index 00000000..fe54d840 --- /dev/null +++ b/glm/gtx/transform.hpp @@ -0,0 +1,104 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtx/transform.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTC_matric_transform +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_transform +#define glm_gtx_transform + +// Dependency: +#include "../glm.hpp" +#include "../gtc/matrix_transform.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_transform(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_transform extension: Add transformation matrices + namespace transform + { + using namespace gtc::matrix_transform; + + //! Builds a translation 4 * 4 matrix created from 3 scalars. + //! From GLM_GTX_transform extension. + template + detail::tmat4x4 translate( + T x, T y, T z); + + //! Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. + //! From GLM_GTX_transform extension. + template + detail::tmat4x4 translate( + detail::tmat4x4 const & m, + T x, T y, T z); + + //! Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. + //! From GLM_GTX_transform extension. + template + detail::tmat4x4 translate( + detail::tvec3 const & v); + + //! Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. + //! From GLM_GTX_transform extension. + template + detail::tmat4x4 rotate( + T angle, + T x, T y, T z); + + //! Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. + //! From GLM_GTX_transform extension. + template + detail::tmat4x4 rotate( + T angle, + detail::tvec3 const & v); + + //! Transforms a matrix with a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. + //! From GLM_GTX_transform extension. + template + detail::tmat4x4 rotate( + detail::tmat4x4 const & m, + T angle, + T x, T y, T z); + + //! Builds a scale 4 * 4 matrix created from 3 scalars. + //! From GLM_GTX_transform extension. + template + detail::tmat4x4 scale( + T x, T y, T z); + + //! Transforms a matrix with a scale 4 * 4 matrix created from 3 scalars. + //! From GLM_GTX_transform extension. + template + detail::tmat4x4 scale( + detail::tmat4x4 const & m, + T x, T y, T z); + + //! Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components. + //! From GLM_GTX_transform extension. + template + detail::tmat4x4 scale( + detail::tvec3 const & v); + + }//namespace transform + }//namespace gtx +}//namespace glm + +#define GLM_GTX_transform namespace gtx::transform +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_transform;} +#endif//GLM_GTX_GLOBAL + +#include "transform.inl" + +#endif//glm_gtx_transform diff --git a/glm/gtx/transform.inl b/glm/gtx/transform.inl new file mode 100644 index 00000000..8e3b8985 --- /dev/null +++ b/glm/gtx/transform.inl @@ -0,0 +1,94 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2009-04-29 +// Licence : This source is under MIT License +// File : glm/gtx/transform.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace transform +{ + template + inline detail::tmat4x4 translate( + T x, T y, T z) + { + return gtc::matrix_transform::translate( + detail::tmat4x4(1.0f), + detail::tvec3(x, y , z)); + } + + template + inline detail::tmat4x4 translate( + detail::tmat4x4 const & m, + T x, T y, T z) + { + return gtc::matrix_transform::translate( + m, detail::tvec3(x, y , z)); + } + + template + inline detail::tmat4x4 translate( + detail::tvec3 const & v) + { + return gtc::matrix_transform::translate( + detail::tmat4x4(1.0f), v); + } + + template + inline detail::tmat4x4 rotate( + T angle, + T x, T y, T z) + { + return gtc::matrix_transform::rotate( + detail::tmat4x4(1), angle, detail::tvec3(x, y, z)); + } + + template + inline detail::tmat4x4 rotate( + T angle, + detail::tvec3 const & v) + { + return gtc::matrix_transform::rotate( + detail::tmat4x4(1), angle, v); + } + + template + inline detail::tmat4x4 rotate( + detail::tmat4x4 const & m, + T angle, + T x, T y, T z) + { + return gtc::matrix_transform::rotate( + m, angle, detail::tvec3(x, y, z)); + } + + template + inline detail::tmat4x4 scale(T x, T y, T z) + { + return gtc::matrix_transform::scale( + detail::tmat4x4(1), detail::tvec3(x, y, z)); + } + + template + inline detail::tmat4x4 scale( + detail::tmat4x4 const & m, + T x, T y, T z) + { + return gtc::matrix_transform::scale( + m, detail::tvec3(x, y, z)); + } + + template + inline detail::tmat4x4 scale( + detail::tvec3 const & v) + { + return gtc::matrix_transform::scale( + detail::tmat4x4(1.0f), v); + } + +}//namespace transform +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/transform2.hpp b/glm/gtx/transform2.hpp new file mode 100644 index 00000000..ab3d34c2 --- /dev/null +++ b/glm/gtx/transform2.hpp @@ -0,0 +1,127 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-21 +// Updated : 2006-11-13 +// Licence : This source is under MIT License +// File : glm/gtx/transform2.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_transform +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_transform2 +#define glm_gtx_transform2 + +// Dependency: +#include "../glm.hpp" +#include "../gtx/transform.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_transform2(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_transform2 extension: Add extra transformation matrices + namespace transform2 + { + using namespace gtx::transform; + + //! Transforms a matrix with a shearing on X axis. + //! From GLM_GTX_transform2 extension. + template + detail::tmat3x3 shearX2D( + detail::tmat3x3 const & m, + T y); + + //! Transforms a matrix with a shearing on Y axis. + //! From GLM_GTX_transform2 extension. + template + detail::tmat3x3 shearY2D( + detail::tmat3x3 const & m, + T x); + + //! Transforms a matrix with a shearing on X axis + //! From GLM_GTX_transform2 extension. + template + detail::tmat4x4 shearX3D( + const detail::tmat4x4 & m, + T y, + T z); + + //! Transforms a matrix with a shearing on Y axis. + //! From GLM_GTX_transform2 extension. + template + detail::tmat4x4 shearY3D( + const detail::tmat4x4 & m, + T x, + T z); + + //! Transforms a matrix with a shearing on Z axis. + //! From GLM_GTX_transform2 extension. + template + detail::tmat4x4 shearZ3D( + const detail::tmat4x4 & m, + T x, + T y); + + //template inline detail::tmat4x4 shear(const detail::tmat4x4 & m, shearPlane, planePoint, angle) + // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0 + // - dot(PointOnPlane, normal) * OnPlaneVector 1 + + // Reflect functions seem to don't work + //template detail::tmat3x3 reflect2D(const detail::tmat3x3 & m, const detail::tvec3& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) + //template detail::tmat4x4 reflect3D(const detail::tmat4x4 & m, const detail::tvec3& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) + + //! Build planar projection matrix along normal axis. + //! From GLM_GTX_transform2 extension. + template + detail::tmat3x3 proj2D( + const detail::tmat3x3 & m, + const detail::tvec3& normal); + + //! Build planar projection matrix along normal axis. + //! From GLM_GTX_transform2 extension. + template + detail::tmat4x4 proj3D( + const detail::tmat4x4 & m, + const detail::tvec3& normal); + + //! Build a look at view matrix. + //! From GLM_GTX_transform2 extension. + template + detail::tmat4x4 lookAt( + detail::tvec3 const & eye, + detail::tvec3 const & center, + detail::tvec3 const & up); + + //! Build a scale bias matrix. + //! From GLM_GTX_transform2 extension. + template + detail::tmat4x4 scaleBias( + valType scale, + valType bias); + + //! Build a scale bias matrix. + //! From GLM_GTX_transform2 extension. + template + detail::tmat4x4 scaleBias( + detail::tmat4x4 const & m, + valType scale, + valType bias); + + }//namespace transform2 + }//namespace gtx +}//namespace glm + +#define GLM_GTX_transform2 namespace gtx::transform2 +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_transform2;} +#endif//GLM_GTX_GLOBAL + +#include "transform2.inl" + +#endif//glm_gtx_transform2 diff --git a/glm/gtx/transform2.inl b/glm/gtx/transform2.inl new file mode 100644 index 00000000..d0d10ddc --- /dev/null +++ b/glm/gtx/transform2.inl @@ -0,0 +1,187 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-02-28 +// Updated : 2005-04-23 +// Licence : This source is under MIT License +// File : glm/gtx/transform2.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace transform2 +{ + template + inline detail::tmat3x3 shearX2D( + const detail::tmat3x3& m, + T s) + { + detail::tmat3x3 r(1); + r[0][1] = s; + return m * r; + } + + template + inline detail::tmat3x3 shearY2D( + const detail::tmat3x3& m, + T s) + { + detail::tmat3x3 r(1); + r[1][0] = s; + return m * r; + } + + template + inline detail::tmat4x4 shearX3D( + const detail::tmat4x4& m, + T s, + T t) + { + detail::tmat4x4 r(1); + r[1][0] = s; + r[2][0] = t; + return m * r; + } + + template + inline detail::tmat4x4 shearY3D( + const detail::tmat4x4& m, + T s, + T t) + { + detail::tmat4x4 r(1); + r[0][1] = s; + r[2][1] = t; + return m * r; + } + + template + inline detail::tmat4x4 shearZ3D( + const detail::tmat4x4& m, + T s, + T t) + { + detail::tmat4x4 r(1); + r[0][2] = s; + r[1][2] = t; + return m * r; + } + + template + inline detail::tmat3x3 reflect2D( + const detail::tmat3x3& m, + const detail::tvec3& normal) + { + detail::tmat3x3 r(1); + r[0][0] = 1 - 2 * normal.x * normal.x; + r[0][1] = -2 * normal.x * normal.y; + r[1][0] = -2 * normal.x * normal.y; + r[1][1] = 1 - 2 * normal.y * normal.y; + return m * r; + } + + template + inline detail::tmat4x4 reflect3D( + const detail::tmat4x4& m, + const detail::tvec3& normal) + { + detail::tmat4x4 r(1); + r[0][0] = 1 - 2 * normal.x * normal.x; + r[0][1] = -2 * normal.x * normal.y; + r[0][2] = -2 * normal.x * normal.z; + + r[1][0] = -2 * normal.x * normal.y; + r[1][1] = 1 - 2 * normal.y * normal.y; + r[1][2] = -2 * normal.y * normal.z; + + r[2][0] = -2 * normal.x * normal.z; + r[2][1] = -2 * normal.y * normal.z; + r[2][2] = 1 - 2 * normal.z * normal.z; + return m * r; + } + + template + inline detail::tmat3x3 proj2D( + const detail::tmat3x3& m, + const detail::tvec3& normal) + { + detail::tmat3x3 r(1); + r[0][0] = 1 - normal.x * normal.x; + r[0][1] = - normal.x * normal.y; + r[1][0] = - normal.x * normal.y; + r[1][1] = 1 - normal.y * normal.y; + return m * r; + } + + template + inline detail::tmat4x4 proj3D( + const detail::tmat4x4& m, + const detail::tvec3& normal) + { + detail::tmat4x4 r(1); + r[0][0] = 1 - normal.x * normal.x; + r[0][1] = - normal.x * normal.y; + r[0][2] = - normal.x * normal.z; + r[1][0] = - normal.x * normal.y; + r[1][1] = 1 - normal.y * normal.y; + r[1][2] = - normal.y * normal.z; + r[2][0] = - normal.x * normal.z; + r[2][1] = - normal.y * normal.z; + r[2][2] = 1 - normal.z * normal.z; + return m * r; + } + + template + inline detail::tmat4x4 lookAt( + const detail::tvec3& eye, + const detail::tvec3& center, + const detail::tvec3& up) + { + detail::tvec3 f = normalize(center - eye); + detail::tvec3 u = normalize(up); + detail::tvec3 s = normalize(cross(f, u)); + u = cross(s, f); + + detail::tmat4x4 Result(1); + Result[0][0] = s.x; + Result[1][0] = s.y; + Result[2][0] = s.z; + Result[0][1] = u.x; + Result[1][1] = u.y; + Result[2][1] = u.z; + Result[0][2] =-f.x; + Result[1][2] =-f.y; + Result[2][2] =-f.z; + /* Test this instead of translate3D + Result[3][0] =-dot(s, eye); + Result[3][1] =-dot(y, eye); + Result[3][2] = dot(f, eye); + */ + return gtc::matrix_transform::translate(Result, -eye); + } + + template + inline detail::tmat4x4 scaleBias( + T scale, + T bias) + { + detail::tmat4x4 result; + result[3] = detail::tvec4(detail::tvec3(bias), T(1)); + result[0][0] = scale; + result[1][1] = scale; + result[2][2] = scale; + } + + template + inline detail::tmat4x4 scaleBias( + const detail::tmat4x4& m, + T scale, + T bias) + { + return m * scaleBias(scale, bias); + } + +}//namespace transform2 +}//namespace gtx +}//namespace glm + diff --git a/glm/gtx/type_ptr.hpp b/glm/gtx/type_ptr.hpp new file mode 100644 index 00000000..0d479f3b --- /dev/null +++ b/glm/gtx/type_ptr.hpp @@ -0,0 +1,233 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-06 +// Updated : 2009-05-06 +// Licence : This source is under MIT License +// File : glm/gtx/type_ptr.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_type_ptr +#define glm_gtx_type_ptr + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_type_ptr(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_type_ptr extension: Get access to vectors & matrices value type address. + namespace type_ptr{ + + //! Get the const address of the vector content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tvec2 const & vec) + { + return &(vec.x); + } + + //! Get the address of the vector content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tvec2 & vec) + { + return &(vec.x); + } + + //! Get the const address of the vector content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tvec3 const & vec) + { + return &(vec.x); + } + + //! Get the address of the vector content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tvec3 & vec) + { + return &(vec.x); + } + + //! Get the const address of the vector content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tvec4 const & vec) + { + return &(vec.x); + } + + //! Get the address of the vector content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tvec4 & vec) + { + return &(vec.x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tmat2x2 const & mat) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tmat2x2 & mat) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tmat3x3 const & mat) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tmat3x3 & mat) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tmat4x4 const & mat) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tmat4x4 & mat) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tmat2x3 const & mat) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tmat2x3 & mat) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tmat3x2 const & mat) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tmat3x2 & mat) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tmat2x4 const & mat) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tmat2x4 & mat) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tmat4x2 const & mat) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tmat4x2 & mat) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tmat3x4 const & mat) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tmat3x4 & mat) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType const * value_ptr(detail::tmat4x3 const & mat) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTX_type_ptr extension. + template + inline valType * value_ptr(detail::tmat4x3 & mat) + { + return &(mat[0].x); + } + + }//namespace type_ptr + }//namespace gtx +}//namespace glm + +#define GLM_GTX_type_ptr namespace gtx::type_ptr +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_type_ptr;} +#endif//GLM_GTX_GLOBAL + +#include "type_ptr.inl" + +#endif//glm_gtx_type_ptr + diff --git a/glm/gtx/type_ptr.inl b/glm/gtx/type_ptr.inl new file mode 100644 index 00000000..e69de29b diff --git a/glm/gtx/unsigned_int.hpp b/glm/gtx/unsigned_int.hpp new file mode 100644 index 00000000..9a7569e4 --- /dev/null +++ b/glm/gtx/unsigned_int.hpp @@ -0,0 +1,58 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-24 +// Updated : 2008-10-07 +// Licence : This source is under MIT License +// File : glm/gtx/unsigned_int.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_integer +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_unsigned_int +#define glm_gtx_unsigned_int + +// Dependency: +#include "../glm.hpp" +#include "../gtx/integer.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_unsigned_int(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_unsigned_int extension: Add support for unsigned integer for core functions + namespace unsigned_int + { + //! 32bit signed integer. + //! From GLM_GTX_unsigned_int extension. + typedef signed int sint; + + //! Returns x raised to the y power. + //! From GLM_GTX_unsigned_int extension. + uint pow(uint x, uint y); + + //! Returns the positive square root of x. + //! From GLM_GTX_unsigned_int extension. + uint sqrt(uint x); + + //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. + //! From GLM_GTX_unsigned_int extension. + uint mod(uint x, uint y); + + }//namespace unsigned_int + }//namespace gtx +}//namespace glm + +#define GLM_GTX_unsigned_int namespace gtx::unsigned_int; using namespace gtx::integer +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_unsigned_int;} +#endif//GLM_GTX_GLOBAL + +#include "unsigned_int.inl" + +#endif//glm_gtx_unsigned_int diff --git a/glm/gtx/unsigned_int.inl b/glm/gtx/unsigned_int.inl new file mode 100644 index 00000000..7d138a73 --- /dev/null +++ b/glm/gtx/unsigned_int.inl @@ -0,0 +1,45 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-24 +// Updated : 2008-10-07 +// Licence : This source is under MIT License +// File : glm/gtx/unsigned_int.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace unsigned_int{ + +inline uint pow(uint x, uint y) +{ + uint result = x; + for(uint i = 1; i < y; ++i) + result *= x; + return result; +} + +inline uint sqrt(uint x) +{ + if(x <= 1) return x; + + uint NextTrial = x >> 1; + uint CurrentAnswer; + + do + { + CurrentAnswer = NextTrial; + NextTrial = (NextTrial + x / NextTrial) >> 1; + } while(NextTrial < CurrentAnswer); + + return CurrentAnswer; +} + +inline uint mod(uint x, uint y) +{ + return x - y * (x / y); +} + +}//namespace unsigned_int +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/vector_access.hpp b/glm/gtx/vector_access.hpp new file mode 100644 index 00000000..8ba59457 --- /dev/null +++ b/glm/gtx/vector_access.hpp @@ -0,0 +1,67 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-16 +// Updated : 2008-10-07 +// Licence : This source is under MIT License +// File : glm/gtx/vector_access.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_vector_access +#define glm_gtx_vector_access + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_vector_access(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_vector_access extension: Function to set values to vectors + namespace vector_access + { + //! Set values to a 2 components vector. + //! From GLM_GTX_vector_access extension. + template + void set( + detail::tvec2 & v, + valType const & x, + valType const & y); + + //! Set values to a 3 components vector. + //! From GLM_GTX_vector_access extension. + template + void set( + detail::tvec3 & v, + valType const & x, + valType const & y, + valType const & z); + + //! Set values to a 4 components vector. + //! From GLM_GTX_vector_access extension. + template + void set( + detail::tvec4 & v, + valType const & x, + valType const & y, + valType const & z, + valType const & w); + + }//namespace vector_access + }//namespace gtx +}//namespace glm + +#define GLM_GTX_vector_access namespace gtx::vector_access +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_vector_access;} +#endif//GLM_GTX_GLOBAL + +#include "vector_access.inl" + +#endif//glm_gtx_vector_access diff --git a/glm/gtx/vector_access.inl b/glm/gtx/vector_access.inl new file mode 100644 index 00000000..5131b03e --- /dev/null +++ b/glm/gtx/vector_access.inl @@ -0,0 +1,58 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-01-16 +// Updated : 2008-10-07 +// Licence : This source is under MIT License +// File : glm/gtx/vector_access.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace vector_access{ + +template +inline void set +( + detail::tvec2& v, + valType const & x, + valType const & y +) +{ + v.x = x; + v.y = y; +} + +template +inline void set +( + detail::tvec3& v, + valType const & x, + valType const & y, + valType const & z +) +{ + v.x = x; + v.y = y; + v.z = z; +} + +template +inline void set +( + detail::tvec4& v, + valType const & x, + valType const & y, + valType const & z, + valType const & w +) +{ + v.x = x; + v.y = y; + v.z = z; + v.w = w; +} + +}//namespace vector_access +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/vector_angle.hpp b/glm/gtx/vector_angle.hpp new file mode 100644 index 00000000..16ebf8cf --- /dev/null +++ b/glm/gtx/vector_angle.hpp @@ -0,0 +1,68 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-30 +// Updated : 2006-11-13 +// Licence : This source is under MIT License +// File : glm/gtx/vector_angle.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_quaternion +// - GLM_GTX_epsilon +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_vector_angle +#define glm_gtx_vector_angle + +// Dependency: +#include "../glm.hpp" +#include "../gtx/quaternion.hpp" +#include "../gtx/epsilon.hpp" + +namespace glm +{ + namespace test{ + void main_gtx_vector_angle(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_vector_angle extension: Compute angle between vectors + namespace vector_angle + { + //! Returns the absolute angle between x and y. + //! Parameters need to be normalized. + //! From GLM_GTX_vector_angle extension + template + typename vecType::value_type angle( + vecType const & x, + vecType const & y); + + //! Returns the oriented angle between x and y + //! Parameters need to be normalized. + //! From GLM_GTX_vector_angle extension. + template + typename vecType::value_type orientedAngle( + vecType const & x, + vecType const & y); + + //! Returns the orientation of a two vector base from a normal. + //! Parameters need to be normalized. + //! From GLM_GTX_vector_angle extension. + template + typename vecType::value_type orientedAngleFromRef( + vecType const & x, + vecType const & y, + detail::tvec3 const & ref); + }//namespace vector_angle + }//namespace gtx +}//namespace glm + +#define GLM_GTX_vector_angle namespace gtx::quaternion; using namespace gtx::epsilon; using namespace gtx::vector_angle +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_vector_angle;} +#endif//GLM_GTX_GLOBAL + +#include "vector_angle.inl" + +#endif//glm_gtx_vector_angle diff --git a/glm/gtx/vector_angle.inl b/glm/gtx/vector_angle.inl new file mode 100644 index 00000000..25ab601b --- /dev/null +++ b/glm/gtx/vector_angle.inl @@ -0,0 +1,124 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2005-12-30 +// Updated : 2008-09-29 +// Licence : This source is under MIT License +// File : glm/gtx/vector_angle.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace vector_angle{ + +template +inline typename genType::value_type angle +( + genType const & x, + genType const & y +) +{ + return degrees(acos(dot(x, y))); +} + +//! \todo epsilon is hard coded to 0.01 +template +inline valType orientedAngle +( + detail::tvec2 const & x, + detail::tvec2 const & y +) +{ + valType Angle = acos(dot(x, y)); + valType c = cos(Angle); + valType s = sin(Angle); + detail::tvec2 TransformedVector = detail::tvec2(c * y.x - s * y.y, s * y.x + c * y.y); + if(all(equalEpsilonGTX(x, TransformedVector, valType(0.01)))) + return -degrees(Angle); + else + return degrees(Angle); +} + +//! \todo epsilon is hard coded to 0.01 +template +inline valType orientedAngle +( + detail::tvec3 const & x, + detail::tvec3 const & y +) +{ + valType Angle = degrees(acos(dot(x, y))); + detail::tvec3 TransformedVector = rotate(detail::tquat(), Angle, cross(x, y)) * y; + if(all(equalEpsilon(x, TransformedVector, valType(0.01)))) + return -degrees(Angle); + else + return degrees(Angle); +} + +//! \todo epsilon is hard coded to 0.01 +template +inline valType orientedAngle +( + detail::tvec4 const & x, + detail::tvec4 const & y +) +{ + valType Angle = degrees(acos(dot(x, y))); + detail::tvec4 TransformedVector = rotate(detail::tquat(), Angle, cross(x, y)) * y; + if(all(equalEpsilon(x, TransformedVector, valType(0.01)))) + return -degrees(Angle); + else + return degrees(Angle); +} + +template +inline valType orientedAngleFromRef +( + detail::tvec2 const & x, + detail::tvec2 const & y, + detail::tvec3 const & ref +) +{ + valType Angle = glm::acos(glm::dot(x, y)); + + if(glm::dot(ref, detail::tvec3(glm::cross(x, y), valType(0))) < valType(0)) + return -glm::degrees(Angle); + else + return glm::degrees(Angle); +} + +template +inline valType orientedAngleFromRef +( + detail::tvec3 const & x, + detail::tvec3 const & y, + detail::tvec3 const & ref +) +{ + valType Angle = glm::acos(glm::dot(x, y)); + + if(glm::dot(ref, glm::cross(x, y)) < valType(0)) + return -glm::degrees(Angle); + else + return glm::degrees(Angle); +} + +template +inline valType orientedAngleFromRef +( + detail::tvec4 const & x, + detail::tvec4 const & y, + detail::tvec3 const & ref +) +{ + valType Angle = glm::acos(glm::dot(x, y)); + + if(glm::dot(ref, glm::cross(detail::tvec3(x), detail::tvec3(y))) < valType(0)) + return -glm::degrees(Angle); + else + return glm::degrees(Angle); +} + +}//namespace vector_angle +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/vector_query.hpp b/glm/gtx/vector_query.hpp new file mode 100644 index 00000000..5adbe0d3 --- /dev/null +++ b/glm/gtx/vector_query.hpp @@ -0,0 +1,96 @@ + /////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-03-05 +// Updated : 2007-03-05 +// Licence : This source is under MIT License +// File : glm/gtx/vector_query.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_vector_query +#define glm_gtx_vector_query + +// Dependency: +#include "../glm.hpp" +#include +#include + +namespace glm +{ + namespace test{ + void main_ext_gtx_vector_query(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_vector_query extension: Query informations of vector types + namespace vector_query + { + //! Check if two vectors are collinears. + //! From GLM_GTX_vector_query extensions. + template + bool areCollinear( + const genType & v0, + const genType & v1, + const GLMvalType epsilon = std::numeric_limits::epsilon()); + + //! Check if two vectors are opposites. + //! From GLM_GTX_vector_query extensions. + template + bool areOpposite( + const genType & v0, + const genType & v1, + const GLMvalType epsilon = std::numeric_limits::epsilon()); + + //! Check if two vectors are orthogonals. + //! From GLM_GTX_vector_query extensions. + template + bool areOrthogonal( + const genType & v0, + const genType & v1, + const GLMvalType epsilon = std::numeric_limits::epsilon()); + + //! Check if a vector is normalized. + //! From GLM_GTX_vector_query extensions. + template + bool isNormalized( + const genType & v, + const GLMvalType epsilon = std::numeric_limits::epsilon()); + + //! Check if a vector is null. + //! From GLM_GTX_vector_query extensions. + template + bool isNull( + const genType& v, + const GLMvalType epsilon = std::numeric_limits::epsilon()); + + //! Check if two vectors are orthonormal. + //! From GLM_GTX_vector_query extensions. + template + bool areOrthonormal( + const genType & v0, + const genType & v1, + const GLMvalType epsilon = std::numeric_limits::epsilon()); + + //! Check if two vectors are similar. + //! From GLM_GTX_vector_query extensions. + template + bool areSimilar( + const genType& v0, + const genType& v1, + const GLMvalType epsilon = std::numeric_limits::epsilon()); + + }//namespace vector_query + }//namespace gtx +}//namespace glm + +#define GLM_GTX_vector_query namespace gtx::vector_query +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_vector_query;} +#endif//GLM_GTX_GLOBAL + +#include "vector_query.inl" + +#endif//glm_gtx_vector_query diff --git a/glm/gtx/vector_query.inl b/glm/gtx/vector_query.inl new file mode 100644 index 00000000..81a48e7c --- /dev/null +++ b/glm/gtx/vector_query.inl @@ -0,0 +1,143 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-03-05 +// Updated : 2007-03-05 +// Licence : This source is under MIT License +// File : glm/gtx/vector_query.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +namespace glm{ +namespace gtx{ +namespace vector_query +{ + template + inline bool areCollinear( + const detail::tvec2& v0, + const detail::tvec2& v1, + const T epsilon) + { + return length(cross(detail::tvec3(v0, T(0)), detail::tvec3(v1, T(0)))) < epsilon; + } + + template + inline bool areCollinear( + const detail::tvec3& v0, + const detail::tvec3& v1, + const T epsilon) + { + return length(cross(v0, v1)) < epsilon; + } + + template + inline bool areCollinear( + const detail::tvec4& v0, + const detail::tvec4& v1, + const T epsilon) + { + return length(cross(detail::tvec3(v0), detail::tvec3(v1))) < epsilon; + } + + template + inline bool areOpposite( + const genType& v0, + const genType& v1, + const GLMvalType epsilon) + { + assert(isNormalized(v0) && isNormalized(v1)); + return((genType::value_type(1) + dot(v0, v1)) <= epsilon); + } + + template + inline bool areOrthogonal( + const genType& v0, + const genType& v1, + const GLMvalType epsilon) + { + return abs(dot(v0, v1)) <= max(GLMvalType(1), length(v0)) * max(GLMvalType(1), length(v1)) * epsilon; + } + + template + inline bool isNormalized( + const genType& v, + const GLMvalType epsilon) + { + return abs(length(v) - GLMvalType(1)) <= GLMvalType(2) * epsilon; + } + + template + inline bool isNull(const genType& v, const GLMvalType epsilon) + { + return length(v) <= epsilon; + } + + template + inline bool isCompNull( + const T s, + const T epsilon) + { + return abs(s) < epsilon; + } + + template + inline detail::tvec2 isCompNull( + const detail::tvec2& v, + const T epsilon) + { + return detail::tvec2( + (abs(v.x) < epsilon), + (abs(v.y) < epsilon)); + } + + template + inline detail::tvec3 isCompNull( + const detail::tvec3& v, + const T epsilon) + { + return detail::tvec3( + abs(v.x) < epsilon, + abs(v.y) < epsilon, + abs(v.z) < epsilon); + } + + template + inline detail::tvec4 isCompNull( + const detail::tvec4& v, + const T epsilon) + { + return detail::tvec4( + abs(v.x) < epsilon, + abs(v.y) < epsilon, + abs(v.z) < epsilon, + abs(v.w) < epsilon); + } + + template + inline bool areOrthonormal( + const genType& v0, + const genType& v1, + const GLMvalType epsilon) + { + return isNormalized(v0, epsilon) && isNormalized(v1, epsilon) && (abs(dot(v0, v1)) <= epsilon); + } + + template + inline bool areSimilar( + const genType& v0, + const genType& v1, + const GLMvalType epsilon) + { + bool similar = true; + for(typename genType::size_type i = 0; similar && i < genType::value_size(); i++) + similar = (abs(v0[i] - v1[i]) <= epsilon); + return similar; + } + +}//namespace vector_query +}//namespace gtx +}//namespace glm diff --git a/glm/gtx/vecx.hpp b/glm/gtx/vecx.hpp new file mode 100644 index 00000000..0bc33826 --- /dev/null +++ b/glm/gtx/vecx.hpp @@ -0,0 +1,218 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-02-21 +// Updated : 2007-02-21 +// Licence : This source is under MIT License +// File : glm/gtx/vecx.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_vecx +#define glm_gtx_vecx + +namespace glm{ +namespace detail{ + + template + class _bvecxGTX + { + private: + bool data[N]; + + public: + typedef bool value_type; + typedef int size_type; + static const size_type value_size; + static const size_type col_size; + static const size_type row_size; + + // Common constructors + _bvecxGTX(); + _bvecxGTX(const _bvecxGTX& v); + + // Accesses + bool& operator[](int i); + bool operator[](int i) const; + operator bool*(); + operator const bool*() const; + + // Bool constructors + explicit _bvecxGTX(const bool a); + + // Operators + _bvecxGTX& operator=(const _bvecxGTX& v); + _bvecxGTX operator! () const; + }; + + template + class _xvecxGTX + { + private: + T data[N]; + + public: + typedef T value_type; + typedef int size_type; + static const size_type value_size; + + // Common constructors + _xvecxGTX(); + _xvecxGTX(const _xvecxGTX& v); + + // Accesses + T& operator[](int i); + T operator[](int i) const; + operator T*(); + operator const T*() const; + + // T constructors + explicit _xvecxGTX(const T x); + + // Unary updatable operators + _xvecxGTX& operator= (const _xvecxGTX& v); + _xvecxGTX& operator+=(const T s); + _xvecxGTX& operator+=(const _xvecxGTX& v); + _xvecxGTX& operator-=(const T s); + _xvecxGTX& operator-=(const _xvecxGTX& v); + _xvecxGTX& operator*=(const T s); + _xvecxGTX& operator*=(const _xvecxGTX& v); + _xvecxGTX& operator/=(const T s); + _xvecxGTX& operator/=(const _xvecxGTX& v); + _xvecxGTX& operator++(); + _xvecxGTX& operator--(); + }; + + // Binary operators + template + detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v, const T s); + + template + detail::_xvecxGTX operator+ (const T s, const detail::_xvecxGTX& v); + + template + detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); + + template + detail::_xvecxGTX operator- (const detail::_xvecxGTX& v, const T s); + + template + detail::_xvecxGTX operator- (const T s, const detail::_xvecxGTX& v); + + template + detail::_xvecxGTX operator- (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); + + template + detail::_xvecxGTX operator* (const detail::_xvecxGTX& v, const T s); + + template + detail::_xvecxGTX operator* (const T s, const detail::_xvecxGTX& v); + + template + detail::_xvecxGTX operator* (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); + + template + detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v, const T s); + + template + detail::_xvecxGTX operator/ (const T s, const detail::_xvecxGTX& v); + + template + detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); + + // Unary constant operators + template + const detail::_xvecxGTX operator- (const detail::_xvecxGTX& v); + + template + const detail::_xvecxGTX operator-- (const detail::_xvecxGTX& v, int); + + template + const detail::_xvecxGTX operator++ (const detail::_xvecxGTX& v, int); + +}//namespace detail + + namespace gtx + { + //! GLM_GTX_vecx extension: - Work in progress - Add custom size vectors + namespace vecx + { + template + struct vec + { + typedef detail::_xvecxGTX type; + }; + + // Trigonometric Functions + template detail::_xvecxGTX radiansGTX(const detail::_xvecxGTX& degrees); //< \brief Converts degrees to radians and returns the result. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX degreesGTX(const detail::_xvecxGTX& radians); //< \brief Converts radians to degrees and returns the result. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX sinGTX(const detail::_xvecxGTX& angle); //< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX cosGTX(const detail::_xvecxGTX& angle); //< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX tanGTX(const detail::_xvecxGTX& angle); //< \brief The standard trigonometric tangent function. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX asinGTX(const detail::_xvecxGTX& x); //< \brief Arc sine. Returns an angle whose sine is x. The range of values returned by this function is [-PI/2, PI/2]. Results are undefined if |x| > 1. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX acosGTX(const detail::_xvecxGTX& x); //< \brief Arc cosine. Returns an angle whose sine is x. The range of values returned by this function is [0, PI]. Results are undefined if |x| > 1. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX atanGTX(const detail::_xvecxGTX& y, const detail::_xvecxGTX& x); //< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX atanGTX(const detail::_xvecxGTX& y_over_x); //< \brief Arc tangent. Returns an angle whose tangent is y_over_x. The range of values returned by this function is [-PI/2, PI/2]. (From GLM_GTX_vecx extension) + + // Exponential Functions + template detail::_xvecxGTX powGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns x raised to the y power. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX expGTX(const detail::_xvecxGTX& x); //< \brief Returns the natural exponentiation of x, i.e., e^x. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX logGTX(const detail::_xvecxGTX& x); //< \brief Returns the natural logarithm of x, i.e., returns the value y which satisfies the equation x = e^y. Results are undefined if x <= 0. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX exp2GTX(const detail::_xvecxGTX& x); //< \brief Returns 2 raised to the x power. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX log2GTX(const detail::_xvecxGTX& x); //< \brief Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX sqrtGTX(const detail::_xvecxGTX& x); //< \brief Returns the positive square root of x. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX inversesqrtGTX(const detail::_xvecxGTX& x); //< \brief Returns the reciprocal of the positive square root of x. (From GLM_GTX_vecx extension) + + // Common Functions + template detail::_xvecxGTX absGTX(const detail::_xvecxGTX& x); //< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX floorGTX(const detail::_xvecxGTX& x); //< \brief Returns a value equal to the nearest integer that is less then or equal to x. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX ceilGTX(const detail::_xvecxGTX& x); //< \brief Returns a value equal to the nearest integer that is greater than or equal to x. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX fractGTX(const detail::_xvecxGTX& x); //< \brief Return x - floor(x). (From GLM_GTX_vecx extension) + template detail::_xvecxGTX modGTX(const detail::_xvecxGTX& x, T y); //< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX modGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the corresponding component of y. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX minGTX(const detail::_xvecxGTX& x, T y); //< \brief Returns y if y < x; otherwise, it returns x. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX minGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns minimum of each component of x compared with the floating-point value y. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX maxGTX(const detail::_xvecxGTX& x, T y); //< \brief Returns y if x < y; otherwise, it returns x. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX maxGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns maximum of each component of x compared with the floating-point value y. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX clampGTX(const detail::_xvecxGTX& x, T minVal, T maxVal); //< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX clampGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& minVal, const detail::_xvecxGTX& maxVal); //< \brief Returns the component-wise result of min(max(x, minVal), maxVal). (From GLM_GTX_vecx extension) + template detail::_xvecxGTX stepGTX(T edge, const detail::_xvecxGTX& x); //< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX stepGTX(const detail::_xvecxGTX& edge, const detail::_xvecxGTX& x); //< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX smoothstepGTX(T edge0, T edge1, const detail::_xvecxGTX& x); //< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX smoothstepGTX(const detail::_xvecxGTX& edge0, const detail::_xvecxGTX& edge1, const detail::_xvecxGTX& x);//< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLM_GTX_vecx extension) + + // Geometric Functions + template T lengthGTX(const detail::_xvecxGTX& x); //< \brief Returns the length of x, i.e., sqrt(x * x). (From GLM_GTX_vecx extension) + template T distanceGTX(const detail::_xvecxGTX& p0, const detail::_xvecxGTX& p1); //< \brief Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). (From GLM_GTX_vecx extension) + template T dotGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the dot product of x and y, i.e., result = x[0] * y[0] + x[1] * y[1]. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX normalizeGTX(const detail::_xvecxGTX& x); //< \brief Returns a vector in the same direction as x but with length of 1. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX faceforwardGTX(const detail::_xvecxGTX& Norm, const detail::_xvecxGTX& I, const detail::_xvecxGTX& Nref); //< \brief If dot(Nref, I) < 0.0, return N, otherwise, return -N. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX reflectGTX(const detail::_xvecxGTX& I, const detail::_xvecxGTX& N); //< \brief For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N. (From GLM_GTX_vecx extension) + template detail::_xvecxGTX refractGTX(const detail::_xvecxGTX& I, const detail::_xvecxGTX& N, T eta); //< \brief For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. (From GLM_GTX_vecx extension) + + // Vector Relational Functions + template detail::_bvecxGTX lessThanGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x < y. (From GLM_GTX_vecx extension) + template detail::_bvecxGTX lessThanEqualGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x <= y. (From GLM_GTX_vecx extension) + template detail::_bvecxGTX greaterThanGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x > y. (From GLM_GTX_vecx extension) + template detail::_bvecxGTX greaterThanEqualGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x >= y. (From GLM_GTX_vecx extension) + template detail::_bvecxGTX equalGTX(const detail::_bvecxGTX& x, const detail::_bvecxGTX& y); //< \brief Returns the component-wise compare of x == y. (From GLM_GTX_vecx extension) + template detail::_bvecxGTX equalGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x == y. (From GLM_GTX_vecx extension) + template detail::_bvecxGTX notEqualGTX(const detail::_bvecxGTX& x, const detail::_bvecxGTX& y); //< \brief Returns the component-wise compare of x != y. (From GLM_GTX_vecx extension) + template detail::_bvecxGTX notEqualGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x != y. (From GLM_GTX_vecx extension) + template bool anyGTX(const detail::_bvecxGTX& x); //< \brief Returns true if any component of x is true. (From GLM_GTX_vecx extension) + template bool allGTX(const detail::_bvecxGTX& x); //< \brief Returns true if all component of x is true. (From GLM_GTX_vecx extension) + template detail::_bvecxGTX notGTX(const detail::_bvecxGTX& v); //< \brief Returns the component-wise logical complement of x. (From GLM_GTX_vecx extension) + } + } +} + +#define GLM_GTX_vecx namespace gtx::vecx +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_vecx;} +#endif//GLM_GTX_GLOBAL + +#include "vecx.inl" + +#endif//glm_gtx_vecx diff --git a/glm/gtx/vecx.inl b/glm/gtx/vecx.inl new file mode 100644 index 00000000..601f5d1f --- /dev/null +++ b/glm/gtx/vecx.inl @@ -0,0 +1,863 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-02-21 +// Updated : 2007-02-21 +// Licence : This source is under MIT License +// File : glm/gtx/vecx.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +namespace glm +{ +namespace detail{ + + template const typename _bvecxGTX::size_type _bvecxGTX::value_size = N; + + // Bool constructors + template + inline _bvecxGTX::_bvecxGTX() + { + for(int i = 0; i < N; ++i) + this->data[i] = false; + } + + template + inline _bvecxGTX::_bvecxGTX(const _bvecxGTX& v) + { + for(int i = 0; i < N; ++i) + this->data[i] = v[i]; + } + + template + inline _bvecxGTX::_bvecxGTX(const bool s) + { + for(int i = 0; i < N; ++i) + this->data[i] = s; + } + + // Accesses + template + inline bool& _bvecxGTX::operator[](int i) + { + assert(i >= 0 && i < N); + return this->data[i]; + } + + template + inline bool _bvecxGTX::operator[](int i) const + { + assert(i >= 0 && i < N); + return this->data[i]; + } + + template + inline _bvecxGTX::operator bool*() + { + return data; + } + + template + inline _bvecxGTX::operator const bool*() const + { + return data; + } + + // Operators + template + inline _bvecxGTX& _bvecxGTX::operator=(const _bvecxGTX& v) + { + for(int i = 0; i < N; ++i) + this->data[i] = v[i]; + return *this; + } + + template + inline _bvecxGTX _bvecxGTX::operator! () const + { + _bvecxGTX result; + for(int i = 0; i < N; ++i) + result[i] = !this->data[i]; + return result; + } + + template const typename _xvecxGTX::size_type _xvecxGTX::value_size = N; + + // Common constructors + template + inline _xvecxGTX::_xvecxGTX() + { + for(int i = 0; i < N; ++i) + this->data[i] = T(0); + } + + template + inline _xvecxGTX::_xvecxGTX(const _xvecxGTX& v) + { + for(int i = 0; i < N; ++i) + this->data[i] = v[i]; + } + + // T constructors + template + inline _xvecxGTX::_xvecxGTX(const T s) + { + for(int i = 0; i < N; ++i) + this->data[i] = s; + } + + // Accesses + template + inline T& _xvecxGTX::operator[](int i) + { + assert(i >= 0 && i < N); + return this->data[i]; + } + + template + inline T _xvecxGTX::operator[](int i) const + { + assert(i >= 0 && i < N); + return this->data[i]; + } + + template + inline _xvecxGTX::operator T*() + { + return data; + } + + template + inline _xvecxGTX::operator const T*() const + { + return data; + } + + template + inline _xvecxGTX& _xvecxGTX::operator=(const _xvecxGTX& v) + { + for(int i = 0; i < N; ++i) + this->data[i] = v[i]; + return *this; + } + + template + inline _xvecxGTX& _xvecxGTX::operator+= (const T s) + { + for(int i = 0; i < N; ++i) + this->data[i] += s; + return *this; + } + + template + inline _xvecxGTX& _xvecxGTX::operator+=(const _xvecxGTX& v) + { + for(int i = 0; i < N; ++i) + this->data[i] += v[i]; + return *this; + } + + template + inline _xvecxGTX& _xvecxGTX::operator-= (const T s) + { + for(int i = 0; i < N; ++i) + this->data[i] -= s; + return *this; + } + + template + inline _xvecxGTX& _xvecxGTX::operator-=(const _xvecxGTX& v) + { + for(int i = 0; i < N; ++i) + this->data[i] -= v[i]; + return *this; + } + + template + inline _xvecxGTX& _xvecxGTX::operator*=(const T s) + { + for(int i = 0; i < N; ++i) + this->data[i] *= s; + return *this; + } + + template + inline _xvecxGTX& _xvecxGTX::operator*= (const _xvecxGTX& v) + { + for(int i = 0; i < N; ++i) + this->data[i] *= v[i]; + return *this; + } + + template + inline _xvecxGTX& _xvecxGTX::operator/=(const T s) + { + for(int i = 0; i < N; ++i) + this->data[i] /= s; + return *this; + } + + template + inline _xvecxGTX& _xvecxGTX::operator/= (const _xvecxGTX& v) + { + for(int i = 0; i < N; ++i) + this->data[i] /= v[i]; + return *this; + } + + + // Unary constant operators + template + inline const detail::_xvecxGTX operator- (const detail::_xvecxGTX& v) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = -v[i]; + return result; + } + + template + inline const detail::_xvecxGTX operator++ (const detail::_xvecxGTX& v, int) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = v[i] + T(1); + return result; + } + + template + inline const detail::_xvecxGTX operator-- (const detail::_xvecxGTX& v, int) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = v[i] - T(1); + return result; + } + + // Binary operators + template + inline detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v, const T s) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = v[i] + s; + return result; + } + + template + inline detail::_xvecxGTX operator+ (const T s, const detail::_xvecxGTX& v) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = v[i] + s; + return result; + } + + template + inline detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = v1[i] + v2[i]; + return result; + } + + template + inline detail::_xvecxGTX operator- (const detail::_xvecxGTX& v, const T s) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = v[i] - s; + return result; + } + + template + inline detail::_xvecxGTX operator- (const T s, const detail::_xvecxGTX& v) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = s - v[i]; + return result; + } + + template + inline detail::_xvecxGTX operator- (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = v1[i] - v2[i]; + return result; + } + + template + inline detail::_xvecxGTX operator* (const detail::_xvecxGTX& v, const T s) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = v[i] * s; + return result; + } + + template + inline detail::_xvecxGTX operator* (const T s, const detail::_xvecxGTX& v) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = s * v[i]; + return result; + } + + template + inline detail::_xvecxGTX operator* (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = v1[i] * v2[i]; + return result; + } + + template + inline detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v, const T s) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = v[i] / s; + return result; + } + + template + inline detail::_xvecxGTX operator/ (const T s, const detail::_xvecxGTX& v) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = s / v[i]; + return result; + } + + template + inline detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = v1[i] / v2[i]; + return result; + } + +}//namespace detail + + namespace gtx{ + namespace vecx{ + + // Trigonometric Functions + template + detail::_xvecxGTX radiansGTX(const detail::_xvecxGTX& degrees) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = radians(degrees[i]); + return result; + } + + template + detail::_xvecxGTX degreesGTX(const detail::_xvecxGTX& radians) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = degrees(radians[i]); + return result; + } + + template + detail::_xvecxGTX sinGTX(const detail::_xvecxGTX& angle) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = sin(angle[i]); + return result; + } + + template + detail::_xvecxGTX cosGTX(const detail::_xvecxGTX& angle) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = cos(angle[i]); + return result; + } + + template + detail::_xvecxGTX tanGTX(const detail::_xvecxGTX& angle) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = tan(angle[i]); + return result; + } + + template + detail::_xvecxGTX asinGTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = asin(x[i]); + return result; + } + + template + detail::_xvecxGTX acosGTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = acos(x[i]); + return result; + } + + template + detail::_xvecxGTX atanGTX(const detail::_xvecxGTX& y, const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = atan(y[i], x[i]); + return result; + } + + template + detail::_xvecxGTX atanGTX(const detail::_xvecxGTX& y_over_x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = atan(y_over_x[i]); + return result; + } + + // Exponential Functions + template + detail::_xvecxGTX powGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = pow(x[i], y[i]); + return result; + } + + template + detail::_xvecxGTX expGTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = exp(x[i]); + return result; + } + + template + detail::_xvecxGTX logGTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = log(x[i]); + return result; + } + + template + detail::_xvecxGTX exp2GTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = exp2(x[i]); + return result; + } + + template + detail::_xvecxGTX log2GTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = log2(x[i]); + return result; + } + + template + detail::_xvecxGTX sqrtGTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = sqrt(x[i]); + return result; + } + + template + detail::_xvecxGTX inversesqrtGTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = inversesqrt(x[i]); + return result; + } + + // Common Functions + template + detail::_xvecxGTX absGTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = abs(x[i]); + return result; + } + + template + detail::_xvecxGTX signGTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = sign(x[i]); + return result; + } + + template + detail::_xvecxGTX floorGTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = floor(x[i]); + return result; + } + + template + detail::_xvecxGTX ceilGTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = ceil(x[i]); + return result; + } + + template + detail::_xvecxGTX fractGTX(const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = fract(x[i]); + return result; + } + + template + detail::_xvecxGTX modGTX(const detail::_xvecxGTX& x, T y) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = mod(x[i], y); + return result; + } + + template + detail::_xvecxGTX modGTX( + const detail::_xvecxGTX& x, + const detail::_xvecxGTX& y) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = mod(x[i], y[i]); + return result; + } + + template + detail::_xvecxGTX minGTX( + const detail::_xvecxGTX& x, + T y) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = min(x[i], y); + return result; + } + + template + detail::_xvecxGTX minGTX( + const detail::_xvecxGTX& x, + const detail::_xvecxGTX& y) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = min(x[i], y[i]); + return result; + } + + template + detail::_xvecxGTX maxGTX( + const detail::_xvecxGTX& x, + T y) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = max(x[i], y); + return result; + } + + template + detail::_xvecxGTX maxGTX( + const detail::_xvecxGTX& x, + const detail::_xvecxGTX& y) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = max(x[i], y[i]); + return result; + } + + template + detail::_xvecxGTX clampGTX( + const detail::_xvecxGTX& x, + T minVal, + T maxVal) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = clamp(x[i], minVal, maxVal); + return result; + } + + template + detail::_xvecxGTX clampGTX( + const detail::_xvecxGTX& x, + const detail::_xvecxGTX& minVal, + const detail::_xvecxGTX& maxVal) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = clamp(x[i], minVal[i], maxVal[i]); + return result; + } + + template + detail::_xvecxGTX stepGTX( + T edge, + const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = step(edge, x[i]); + return result; + } + + template + detail::_xvecxGTX stepGTX( + const detail::_xvecxGTX& edge, + const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = step(edge[i], x[i]); + return result; + } + + template + detail::_xvecxGTX smoothstepGTX( + T edge0, + T edge1, + const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = step(edge0, edge1, x[i]); + return result; + } + + template + detail::_xvecxGTX smoothstepGTX( + const detail::_xvecxGTX& edge0, + const detail::_xvecxGTX& edge1, + const detail::_xvecxGTX& x) + { + detail::_xvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = step(edge0[i], edge1[i], x[i]); + return result; + } + + // Geometric Functions + template + T lengthGTX( + const detail::_xvecxGTX& x) + { + T sqr = dot(x, x); + return sqrt(sqr); + } + + template + T distanceGTX( + const detail::_xvecxGTX& p0, + const detail::_xvecxGTX& p1) + { + return lengthGTX(p1 - p0); + } + + template + T dotGTX( + const detail::_xvecxGTX& x, + const detail::_xvecxGTX& y) + { + T result = T(0); + for(int i = 0; i < N; ++i) + result += x[i] * y[i]; + return result; + } + + template + detail::_xvecxGTX normalizeGTX( + const detail::_xvecxGTX& x) + { + T sqr = dot(x, x); + return x * inversesqrt(sqr); + } + + template + detail::_xvecxGTX faceforwardGTX( + const detail::_xvecxGTX& Normal, + const detail::_xvecxGTX& I, + const detail::_xvecxGTX& Nref) + { + return dot(Nref, I) < T(0) ? Normal : -Normal; + } + + template + detail::_xvecxGTX reflectGTX( + const detail::_xvecxGTX& I, + const detail::_xvecxGTX& Normal) + { + return I - Normal * dot(Normal, I) * T(2); + } + + template + detail::_xvecxGTX refractGTX( + const detail::_xvecxGTX& I, + const detail::_xvecxGTX& Normal, + T eta) + { + T dot = dot(Normal, I); + T k = T(1) - eta * eta * (T(1) - dot * dot); + if(k < T(0)) + return detail::_xvecxGTX(T(0)); + else + return eta * I - (eta * dot + sqrt(k)) * Normal; + } + + // Vector Relational Functions + template + detail::_bvecxGTX lessThanGTX( + const detail::_xvecxGTX& x, + const detail::_xvecxGTX& y) + { + detail::_bvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = lessThan(x[i], y[i]); + return result; + } + + template + detail::_bvecxGTX lessThanEqualGTX( + const detail::_xvecxGTX& x, + const detail::_xvecxGTX& y) + { + detail::_bvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = lessThanEqual(x[i], y[i]); + return result; + } + + template + detail::_bvecxGTX greaterThanGTX( + const detail::_xvecxGTX& x, + const detail::_xvecxGTX& y) + { + detail::_bvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = greaterThan(x[i], y[i]); + return result; + } + + template + detail::_bvecxGTX greaterThanEqualGTX( + const detail::_xvecxGTX& x, + const detail::_xvecxGTX& y) + { + detail::_bvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = greaterThanEqual(x[i], y[i]); + return result; + } + + template + detail::_bvecxGTX equalGTX( + const detail::_bvecxGTX& x, + const detail::_bvecxGTX& y) + { + detail::_bvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = equal(x[i], y[i]); + return result; + } + + template + detail::_bvecxGTX equalGTX( + const detail::_xvecxGTX& x, + const detail::_xvecxGTX& y) + { + detail::_bvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = equal(x[i], y[i]); + return result; + } + + template + detail::_bvecxGTX notEqualGTX( + const detail::_bvecxGTX& x, + const detail::_bvecxGTX& y) + { + detail::_bvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = equal(x[i], y[i]); + return result; + } + + template + detail::_bvecxGTX notEqualGTX( + const detail::_xvecxGTX& x, + const detail::_xvecxGTX& y) + { + detail::_bvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = notEqual(x[i], y[i]); + return result; + } + + template + bool anyGTX(const detail::_bvecxGTX& x) + { + for(int i = 0; i< N; ++i) + if(x[i]) return true; + return false; + } + + template + bool allGTX(const detail::_bvecxGTX& x) + { + for(int i = 0; i< N; ++i) + if(!x[i]) return false; + return true; + } + + template + detail::_bvecxGTX notGTX( + const detail::_bvecxGTX& v) + { + detail::_bvecxGTX result; + for(int i = 0; i< N; ++i) + result[i] = !v[i]; + return result; + } + + }//namespace vecx + }//namespace gtx + +} //namespace glm diff --git a/glm/gtx/verbose_operator.hpp b/glm/gtx/verbose_operator.hpp new file mode 100644 index 00000000..bdd51c1d --- /dev/null +++ b/glm/gtx/verbose_operator.hpp @@ -0,0 +1,64 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2007-05-21 +// Updated : 2007-05-21 +// Licence : This source is under MIT License +// File : glm/gtx/verbose_operator.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_verbose_operator +#define glm_gtx_verbose_operator + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_ext_gtx_verbose_operator(); + }//namespace test + + namespace gtx{ + //! GLM_GTX_verbose_operator extension: Use words to replace operators + namespace verbose_operator + { + //! Addition of two values + //! From GLM_GTX_verbose_operator extension. + template + genTypeT add(genTypeT const & a, genTypeU const & b); + + //! Substration of two values + //! From GLM_GTX_verbose_operator extension. + template + genTypeT sub(genTypeT const & a, genTypeU const & b); + + //! Multiplication of two values + //! From GLM_GTX_verbose_operator extension. + template + genTypeT mul(genTypeT const & a, genTypeU const & b); + + //! Division of two values + //! From GLM_GTX_verbose_operator extension. + template + genTypeT div(genTypeT const & a, genTypeU const & b); + + //! Multiplication and addition of three values + //! From GLM_GTX_verbose_operator extension. + template + genTypeT mad(genTypeT const & a, genTypeU const & b, genTypeV const & c); + }//namespace verbose_operator + }//namespace gtx +}//namespace glm + +#include "verbose_operator.inl" + +#define GLM_GTX_verbose_operator namespace gtx::verbose_operator +#ifndef GLM_GTX_GLOBAL +namespace glm {using GLM_GTX_verbose_operator;} +#endif//GLM_GTX_GLOBAL + +#endif//glm_gtx_verbose_operator diff --git a/glm/gtx/verbose_operator.inl b/glm/gtx/verbose_operator.inl new file mode 100644 index 00000000..9e7d3d21 --- /dev/null +++ b/glm/gtx/verbose_operator.inl @@ -0,0 +1,129 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-04-20 +// Updated : 2008-09-29 +// Licence : This source is under MIT License +// File : glm/gtx/verbose_operator.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace verbose_operator{ + +template +inline genType add(genType const & a, genType const & b) +{ + return a + b; +} + +template +inline genType sub(genType const & a, genType const & b) +{ + return a - b; +} + +template +inline detail::tmat2x2 mul +( + detail::tmat2x2 const & a, + detail::tmat2x2 const & b +) +{ + return a * b; +} + +template +inline detail::tmat3x3 mul +( + detail::tmat3x3 const & a, + detail::tmat3x3 const & b +) +{ + return a * b; +} + +template +inline detail::tmat4x4 mul +( + detail::tmat4x4 const & a, + detail::tmat4x4 const & b +) +{ + return a * b; +} + +template +inline detail::tvec2 mul +( + detail::tmat2x2 const & m, + detail::tvec2 const & v +) +{ + return m * v; +} + +template +inline detail::tvec3 mul +( + detail::tmat3x3 const & m, + detail::tvec3 const & v) +{ + return m * v; +} + +template +inline detail::tvec4 mul +( + detail::tmat4x4 const & m, + detail::tvec4 const & v +) +{ + return m * v; +} + +template +inline detail::tvec2 mul +( + detail::tvec2 const & v, + detail::tmat2x2 const & m +) +{ + return v * m; +} + +template +inline detail::tvec3 mul +( + detail::tvec3 const & v, + detail::tmat3x3 const & m +) +{ + return v * m; +} + +template +inline detail::tvec4 mul +( + detail::tvec4 const & v, + detail::tmat4x4 const & m +) +{ + return v * m; +} + +template +inline genType div(genType const & a, genType const & b) +{ + return a / b; +} + +template +inline genTypeT mad(genTypeT const & a, genTypeU const & b, genTypeV const & c) +{ + return a * b + c; +} + +}//namespace verbose_operator +}//namespace gtx +}//namespace glm diff --git a/glm/img.hpp b/glm/img.hpp new file mode 100644 index 00000000..91dadf3f --- /dev/null +++ b/glm/img.hpp @@ -0,0 +1,17 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-11-14 +// Updated : 2009-11-14 +// Licence : This source is under MIT License +// File : glm/img.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_img +#define glm_img + +#define GLM_IMG_GLOBAL 1 + +#include "./img/multiple.hpp" + +#endif//glm_img diff --git a/glm/img/multiple.hpp b/glm/img/multiple.hpp new file mode 100644 index 00000000..c6941f76 --- /dev/null +++ b/glm/img/multiple.hpp @@ -0,0 +1,55 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-10-26 +// Updated : 2009-10-26 +// Licence : This source is under MIT License +// File : glm/img/multiple.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_img_multiple +#define glm_img_multiple + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + bool main_img_multiple(); + }//namespace test + + namespace img + { + //! GLM_IMG_multiple: Find the closest number of a number multiple of other number. + namespace multiple + { + //! Higher Multiple number of Source. + //! From GLM_IMG_multiple extension. + template + genType higherMultiple( + genType const & Source, + genType const & Multiple); + + //! Lower Multiple number of Source. + //! From GLM_IMG_multiple extension. + template + genType lowerMultiple( + genType const & Source, + genType const & Multiple); + + }//namespace multiple + }//namespace img +}//namespace glm + +#define GLM_IMG_multiple namespace img::multiple +#ifndef GLM_IMG_GLOBAL +namespace glm {using GLM_IMG_multiple;} +#endif//GLM_IMG_GLOBAL + +#include "multiple.inl" + +#endif//glm_img_multiple diff --git a/glm/img/multiple.inl b/glm/img/multiple.inl new file mode 100644 index 00000000..178b09df --- /dev/null +++ b/glm/img/multiple.inl @@ -0,0 +1,191 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-10-26 +// Updated : 2009-10-26 +// Licence : This source is under MIT License +// File : glm/img/multiple.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace img{ +namespace multiple +{ + ////////////////////// + // higherMultiple + + template + inline genType higherMultiple + ( + genType const & Source, + genType const & Multiple + ) + { + genType Tmp = Source % Multiple; + return Tmp ? Source + Multiple - Tmp : Source; + } + + template <> + inline detail::thalf higherMultiple + ( + detail::thalf const & Source, + detail::thalf const & Multiple + ) + { + int Tmp = int(float(Source)) % int(float(Multiple)); + return Tmp ? Source + Multiple - detail::thalf(float(Tmp)) : Source; + } + + template <> + inline float higherMultiple + ( + float const & Source, + float const & Multiple + ) + { + int Tmp = int(Source) % int(Multiple); + return Tmp ? Source + Multiple - float(Tmp) : Source; + } + + template <> + inline double higherMultiple + ( + double const & Source, + double const & Multiple + ) + { + long Tmp = long(Source) % long(Multiple); + return Tmp ? Source + Multiple - double(Tmp) : Source; + } + + template + inline detail::tvec2 higherMultiple + ( + detail::tvec2 const & Source, + detail::tvec2 const & Multiple + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = higherMultiple(Source[i], Multiple[i]); + return Result; + } + + template + inline detail::tvec3 higherMultiple + ( + detail::tvec3 const & Source, + detail::tvec3 const & Multiple + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = higherMultiple(Source[i], Multiple[i]); + return Result; + } + + template + inline detail::tvec4 higherMultiple + ( + detail::tvec4 const & Source, + detail::tvec4 const & Multiple + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = higherMultiple(Source[i], Multiple[i]); + return Result; + } + + ////////////////////// + // lowerMultiple + + template + inline genType lowerMultiple + ( + genType const & Source, + genType const & Multiple + ) + { + genType Tmp = Source % Multiple; + return Tmp ? Source - Tmp : Source; + } + + template <> + inline detail::thalf lowerMultiple + ( + detail::thalf const & Source, + detail::thalf const & Multiple + ) + { + int Tmp = int(float(Source)) % int(float(Multiple)); + return Tmp ? Source - detail::thalf(float(Tmp)) : Source; + } + + template <> + inline float lowerMultiple + ( + float const & Source, + float const & Multiple + ) + { + int Tmp = int(Source) % int(Multiple); + return Tmp ? Source - float(Tmp) : Source; + } + + template <> + inline double lowerMultiple + ( + double const & Source, + double const & Multiple + ) + { + long Tmp = long(Source) % long(Multiple); + return Tmp ? Source - double(Tmp) : Source; + } + + template + inline detail::tvec2 lowerMultiple + ( + detail::tvec2 const & Source, + detail::tvec2 const & Multiple + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = lowerMultiple(Source[i], Multiple[i]); + return Result; + } + + template + inline detail::tvec3 lowerMultiple + ( + detail::tvec3 const & Source, + detail::tvec3 const & Multiple + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = lowerMultiple(Source[i], Multiple[i]); + return Result; + } + + template + inline detail::tvec4 lowerMultiple + ( + detail::tvec4 const & Source, + detail::tvec4 const & Multiple + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = lowerMultiple(Source[i], Multiple[i]); + return Result; + } + +}//namespace multiple +}//namespace img +}//namespace glm diff --git a/glm/img/wrap.hpp b/glm/img/wrap.hpp new file mode 100644 index 00000000..9d1ee177 --- /dev/null +++ b/glm/img/wrap.hpp @@ -0,0 +1,56 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-11-25 +// Updated : 2009-11-25 +// Licence : This source is under MIT License +// File : glm/img/wrap.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_img_wrap +#define glm_img_wrap + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + bool main_img_wrap(); + }//namespace test + + namespace img + { + //! GLM_IMG_wrap: Wrapping mode using my texture samping. + namespace wrap + { + //! Simulate GL_CLAMP OpenGL wrap mode + //! From GLM_IMG_wrap extension. + template + genType clamp(genType const & Texcoord); + + //! Simulate GL_REPEAT OpenGL wrap mode + //! From GLM_IMG_wrap extension. + template + genType repeat(genType const & Texcoord); + + //! Simulate GL_MIRROR_REPEAT OpenGL wrap mode + //! From GLM_IMG_wrap extension. + template + genType mirrorRepeat(genType const & Texcoord); + + }//namespace wrap + }//namespace img +}//namespace glm + +#define GLM_IMG_wrap namespace img::wrap +#ifndef GLM_IMG_GLOBAL +namespace glm {using GLM_IMG_wrap;} +#endif//GLM_IMG_GLOBAL + +#include "wrap.inl" + +#endif//glm_img_wrap diff --git a/glm/img/wrap.inl b/glm/img/wrap.inl new file mode 100644 index 00000000..8c3ffcfa --- /dev/null +++ b/glm/img/wrap.inl @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-11-25 +// Updated : 2009-11-25 +// Licence : This source is under MIT License +// File : glm/img/wrap.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace img{ +namespace wrap +{ + //////////////////////// + // clamp + + template + inline valType clamp + ( + valType const & Texcoord + ) + { + return glm::clamp(Texcoord, valType(0), valType(1)); + } + + template + inline detail::tvec2 clamp + ( + detail::tvec2 const & Texcoord + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = clamp(Texcoord[i]); + return Result; + } + + template + inline detail::tvec3 clamp + ( + detail::tvec3 const & Texcoord + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = clamp(Texcoord[i]); + return Result; + } + + template + inline detail::tvec4 clamp + ( + detail::tvec4 const & Texcoord + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = clamp(Texcoord[i]); + return Result; + } + + //////////////////////// + // repeat + + template + inline valType repeat + ( + valType const & Texcoord + ) + { + return glm::fract(Texcoord); + } + + template + inline detail::tvec2 repeat + ( + detail::tvec2 const & Texcoord + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = repeat(Texcoord[i]); + return Result; + } + + template + inline detail::tvec3 repeat + ( + detail::tvec3 const & Texcoord + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = repeat(Texcoord[i]); + return Result; + } + + template + inline detail::tvec4 repeat + ( + detail::tvec4 const & Texcoord + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = repeat(Texcoord[i]); + return Result; + } + + //////////////////////// + // mirrorRepeat + + template + inline genType mirrorRepeat + ( + genType const & Texcoord + ) + { + genType const Clamp = genType(int(glm::floor(Texcoord)) % 2); + genType const Floor = glm::floor(Texcoord); + genType const Rest = Texcoord - Floor; + genType const Mirror = Clamp + Rest; + + genType Out; + if(Mirror >= genType(1)) + Out = genType(1) - Rest; + else + Out = Rest; + return Out; + } + + template + inline detail::tvec2 mirrorRepeat + ( + detail::tvec2 const & Texcoord + ) + { + detail::tvec2 Result; + for(typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i) + Result[i] = mirrorRepeat(Texcoord[i]); + return Result; + } + + template + inline detail::tvec3 mirrorRepeat + ( + detail::tvec3 const & Texcoord + ) + { + detail::tvec3 Result; + for(typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i) + Result[i] = mirrorRepeat(Texcoord[i]); + return Result; + } + + template + inline detail::tvec4 mirrorRepeat + ( + detail::tvec4 const & Texcoord + ) + { + detail::tvec4 Result; + for(typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i) + Result[i] = mirrorRepeat(Texcoord[i]); + return Result; + } + +}//namespace wrap +}//namespace img +}//namespace glm diff --git a/glm/setup.hpp b/glm/setup.hpp new file mode 100644 index 00000000..f73d2b5d --- /dev/null +++ b/glm/setup.hpp @@ -0,0 +1,369 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2006-11-13 +// Updated : 2009-08-24 +// Licence : This source is under MIT License +// File : glm/setup.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_setup +#define glm_setup + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Version + +#define GLM_VERSION 84 +#define GLM_REVISION 1010 + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Common values + +#define GLM_DISABLE 0x00000000 +#define GLM_ENABLE 0x00000001 + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Message + +#define GLM_MESSAGE_QUIET 0x00000000 + +#define GLM_MESSAGE_WARNING 0x00000001 +#define GLM_MESSAGE_NOTIFICATION 0x00000002 +#define GLM_MESSAGE_CORE 0x00000004 +#define GLM_MESSAGE_EXTS 0x00000008 +#define GLM_MESSAGE_SETUP 0x00000010 + +#define GLM_MESSAGE_ALL GLM_MESSAGE_WARNING | GLM_MESSAGE_NOTIFICATION | GLM_MESSAGE_CORE | GLM_MESSAGE_EXTS | GLM_MESSAGE_SETUP + +//! By default: +// #define GLM_MESSAGE GLM_MESSAGE_QUIET + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Precision + +#define GLM_PRECISION_NONE 0x00000000 + +#define GLM_PRECISION_LOWP_FLOAT 0x00000011 +#define GLM_PRECISION_MEDIUMP_FLOAT 0x00000012 +#define GLM_PRECISION_HIGHP_FLOAT 0x00000013 + +#define GLM_PRECISION_LOWP_INT 0x00001100 +#define GLM_PRECISION_MEDIUMP_INT 0x00001200 +#define GLM_PRECISION_HIGHP_INT 0x00001300 + +#define GLM_PRECISION_LOWP_UINT 0x00110000 +#define GLM_PRECISION_MEDIUMP_UINT 0x00120000 +#define GLM_PRECISION_HIGHP_UINT 0x00130000 + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Use options + +// To disable multiple vector component names access. +// GLM_USE_ONLY_XYZW + +// To use anonymous union to provide multiple component names access for class valType. Visual C++ only. +// GLM_USE_ANONYMOUS_UNION + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Compiler + +#define GLM_COMPILER_NONE 0x00000000 + +// Visual C++ defines +#define GLM_COMPILER_VC 0x01000000 +#define GLM_COMPILER_VC60 0x01000040 // unsupported +#define GLM_COMPILER_VC70 0x01000080 // unsupported +#define GLM_COMPILER_VC71 0x01000100 // unsupported +#define GLM_COMPILER_VC80 0x01000200 +#define GLM_COMPILER_VC90 0x01000400 +#define GLM_COMPILER_VC2010 0x01000800 + +// GCC defines +#define GLM_COMPILER_GCC 0x02000000 +#define GLM_COMPILER_GCC28 0x02000020 // unsupported +#define GLM_COMPILER_GCC29 0x02000040 // unsupported +#define GLM_COMPILER_GCC30 0x02000080 // unsupported +#define GLM_COMPILER_GCC31 0x02000100 // unsupported +#define GLM_COMPILER_GCC32 0x02000200 +#define GLM_COMPILER_GCC33 0x02000400 +#define GLM_COMPILER_GCC34 0x02000800 +#define GLM_COMPILER_GCC35 0x02001000 +#define GLM_COMPILER_GCC40 0x02002000 +#define GLM_COMPILER_GCC41 0x02004000 +#define GLM_COMPILER_GCC42 0x02008000 +#define GLM_COMPILER_GCC43 0x02010000 +#define GLM_COMPILER_GCC44 0x02020000 +#define GLM_COMPILER_GCC45 0x02040000 +#define GLM_COMPILER_GCC46 0x02080000 +#define GLM_COMPILER_GCC50 0x0210000 + +#define GLM_MODEL_32 0x00000010 +#define GLM_MODEL_64 0x00000020 + +#ifndef GLM_COMPILER + +///////////////// +// Visual C++ // + +#ifdef _MSC_VER + +#if defined(_WIN64) +#define GLM_MODEL GLM_MODEL_64 +#else +#define GLM_MODEL GLM_MODEL_32 +#endif// + +#if _MSC_VER == 1200 +#define GLM_COMPILER GLM_COMPILER_VC60 +#endif + +#if _MSC_VER == 1300 +#define GLM_COMPILER GLM_COMPILER_VC70 +#endif + +#if _MSC_VER == 1310 +#define GLM_COMPILER GLM_COMPILER_VC71 +#endif + +#if _MSC_VER == 1400 +#define GLM_COMPILER GLM_COMPILER_VC80 +#endif + +#if _MSC_VER == 1500 +#define GLM_COMPILER GLM_COMPILER_VC90 +#endif + +#if _MSC_VER == 1600 +#define GLM_COMPILER GLM_COMPILER_VC2010 +#endif + +#endif//_MSC_VER + +////////////////// +// GCC defines // + +#ifdef __GNUC__ + +#if(defined(__WORDSIZE) && (__WORDSIZE == 64)) || defined(__arch64__) +#define GLM_MODEL GLM_MODEL_64 +#else +#define GLM_MODEL GLM_MODEL_32 +#endif// + +#if (__GNUC__ == 2) && (__GNUC_MINOR__ == 8) +#error "GCC 2.8x isn't supported" +#define GLM_COMPILER GLM_COMPILER_GCC28 +#endif + +#if (__GNUC__ == 2) && (__GNUC_MINOR__ == 9) +#error "GCC 2.9x isn't supported" +#define GLM_COMPILER GLM_COMPILER_GCC29 +#endif + +#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 0) +#error "GCC 3.0 isn't supported" +#define GLM_COMPILER GLM_COMPILER_GCC30 +#endif + +#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 1) +#error "GCC 3.1 isn't supported" +#define GLM_COMPILER GLM_COMPILER_GCC31 +#endif + +#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2) +#define GLM_COMPILER GLM_COMPILER_GCC32 +#endif + +#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 3) +#define GLM_COMPILER GLM_COMPILER_GCC33 +#endif + +#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 4) +#define GLM_COMPILER GLM_COMPILER_GCC34 +#endif + +#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 5) +#define GLM_COMPILER GLM_COMPILER_GCC35 +#endif + +#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 0) +#define GLM_COMPILER GLM_COMPILER_GCC40 +#endif + +#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 1) +#define GLM_COMPILER GLM_COMPILER_GCC41 +#endif + +#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 2) +#define GLM_COMPILER GLM_COMPILER_GCC42 +#endif + +#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) +#define GLM_COMPILER GLM_COMPILER_GCC43 +#endif + +#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 4) +#define GLM_COMPILER GLM_COMPILER_GCC44 +#endif + +#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 5) +#define GLM_COMPILER GLM_COMPILER_GCC45 +#endif + +#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 6) +#define GLM_COMPILER GLM_COMPILER_GCC46 +#endif + +#if (__GNUC__ == 5) && (__GNUC_MINOR__ == 0) +#define GLM_COMPILER GLM_COMPILER_GCC50 +#endif + +#endif//__GNUC__ + +#endif//GLM_COMPILER + +#ifndef GLM_COMPILER +#error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message." +#endif//GLM_COMPILER + +#if(!defined(GLM_MODEL) && GLM_COMPILER != 0) +#error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message." +#endif//GLM_MODEL + +#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION))) +# if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC) +# pragma message("GLM message: Compiled with Visual C++") +# elif(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_GCC) +# pragma message("GLM message: Compiled with GCC") +# else +# pragma message("GLM warning: Compiler not detected") +# endif +#endif//GLM_MESSAGE + +#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION))) +# if(GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM message: 64 bits model") +# elif(GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM message: 32 bits model") +# endif//GLM_MODEL +#endif//GLM_MESSAGE + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Compatibility + +#define GLM_COMPATIBILITY_DEFAULT 0 +#define GLM_COMPATIBILITY_STRICT 1 + +//! By default: +//#define GLM_COMPATIBILITY GLM_COMPATIBILITY_DEFAULT + +#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION))) +# if(!defined(GLM_COMPATIBILITY) || (defined(GLM_COMPATIBILITY) && (GLM_COMPATIBILITY == GLM_COMPATIBILITY_STRICT))) +# +# elif(defined(GLM_COMPATIBILITY) && (GLM_COMPATIBILITY == GLM_COMPATIBILITY_STRICT)) +# pragma message("GLM message: compatibility strict") +# endif//GLM_AUTO_CAST +#endif//GLM_MESSAGE + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// External dependencies + +#define GLM_DEPENDENCE_NONE 0x00000000 +#define GLM_DEPENDENCE_GLEW 0x00000001 +#define GLM_DEPENDENCE_GLEE 0x00000002 +#define GLM_DEPENDENCE_GL 0x00000004 +#define GLM_DEPENDENCE_GL3 0x00000008 +#define GLM_DEPENDENCE_BOOST 0x00000010 +#define GLM_DEPENDENCE_STL 0x00000020 +#define GLM_DEPENDENCE_TR1 0x00000040 +#define GLM_DEPENDENCE_TR2 0x00000080 + +//! By default: +// #define GLM_DEPENDENCE GLM_DEPENDENCE_NONE + +#if(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GLEW)) +#include +#elif(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GLEE)) +#include +#elif(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GL)) +#include +#elif(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GL3)) +#include +#endif//GLM_DEPENDENCE + +#if(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_BOOST)) +#include +#endif//GLM_DEPENDENCE + +#if(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_BOOST)) || defined(BOOST_STATIC_ASSERT) +#define GLM_STATIC_ASSERT(x) BOOST_STATIC_ASSERT(x) +#else +#define GLM_STATIC_ASSERT(x) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] +#endif//GLM_DEPENDENCE + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Cast + +#define GLM_CAST_NONE 0x00000000 +#define GLM_CAST_DIRECTX_9 0x00000001 +#define GLM_CAST_DIRECTX_10 0x00000002 +#define GLM_CAST_NVSG 0x00000004 +#define GLM_CAST_WILD_MAGIC_3 0x00000008 +#define GLM_CAST_WILD_MAGIC_4 0x00000010 +#define GLM_CAST_PHYSX 0x00000020 +#define GLM_CAST_ODE 0x00000040 + +//! By default: +// #define GLM_CAST GLM_CAST_NONE +// #define GLM_CAST_EXT GLM_CAST_NONE + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Automatic cast +// glColor4fv(glm::vec4(1.0)) + +//! By default: +// #define GLM_AUTO_CAST GLM_ENABLE + +// GLM_AUTO_CAST isn't defined by defaut but also enable by default with GLM 0.7.x +// Disable GLM_AUTO_CAST by default on Visual C++ 7.1 +#if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC && GLM_COMPILER <= GLM_COMPILER_VC71) +# if(defined(GLM_AUTO_CAST) || (GLM_AUTO_CAST == GLM_ENABLE)) +# error "GLM_AUTO_CAST isn't supported by Visual C++ 7.1 and below" +# else +# define GLM_AUTO_CAST GLM_DISABLE +# endif//GLM_AUTO_CAST +#endif//GLM_COMPILER + +#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION))) +# if(!defined(GLM_AUTO_CAST) || (defined(GLM_AUTO_CAST) && (GLM_AUTO_CAST == GLM_ENABLE))) +# pragma message("GLM message: Auto cast enabled") +# else +# pragma message("GLM message: Auto cast disabled") +# endif//GLM_AUTO_CAST +#endif//GLM_MESSAGE + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Swizzle operators + +#define GLM_SWIZZLE_NONE 0x00000000 +#define GLM_SWIZZLE_XYZW 0x00000002 +#define GLM_SWIZZLE_RGBA 0x00000004 +#define GLM_SWIZZLE_STQP 0x00000008 +#define GLM_SWIZZLE_FULL (GLM_SWIZZLE_XYZW | GLM_SWIZZLE_RGBA | GLM_SWIZZLE_STQP) + +//! By default: +// #define GLM_SWIZZLE GLM_SWIZZLE_NONE + +#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION))) +# if !defined(GLM_SWIZZLE)|| (defined(GLM_SWIZZLE) && GLM_SWIZZLE == GLM_SWIZZLE_NONE) +# pragma message("GLM message: No swizzling operator used") +# elif(defined(GLM_SWIZZLE) && GLM_SWIZZLE == GLM_SWIZZLE_FULL) +# pragma message("GLM message: Full swizzling operator support enabled") +# elif(defined(GLM_SWIZZLE) && GLM_SWIZZLE & GLM_SWIZZLE_FULL) +# pragma message("GLM message: Partial swizzling operator support enabled") +# endif//GLM_SWIZZLE +#endif//GLM_MESSAGE + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#endif//glm_setup diff --git a/glm/virtrev.hpp b/glm/virtrev.hpp new file mode 100644 index 00000000..a8cf5ef4 --- /dev/null +++ b/glm/virtrev.hpp @@ -0,0 +1,29 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) +// Virtrev SDK copyright matrem (matrem84.free.fr) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-05-29 +// Updated : 2008-10-06 +// Licence : This source is under MIT License +// File : glm/virtrev.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Note: +// Virtrev SDK extensions +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_virtrev +#define glm_virtrev + +#define GLM_VIRTREV_GLOBAL 1 + +#if(defined(GLM_DEPENDENCE) && ( \ + (GLM_DEPENDENCE & GLM_DEPENDENCE_GLEW) || \ + (GLM_DEPENDENCE & GLM_DEPENDENCE_GLEE) || \ + (GLM_DEPENDENCE & GLM_DEPENDENCE_GL))) +#include "./virtrev/gl.hpp" +#endif +#include "./virtrev/address.hpp" +#include "./virtrev/equal_operator.hpp" +#include "./virtrev/xstream.hpp" + +#endif//glm_virtrev diff --git a/glm/virtrev/address.hpp b/glm/virtrev/address.hpp new file mode 100644 index 00000000..dccf9711 --- /dev/null +++ b/glm/virtrev/address.hpp @@ -0,0 +1,192 @@ +#ifndef GLM_EXT_VIRTREV_ADDRESS_HPP +#define GLM_EXT_VIRTREV_ADDRESS_HPP + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +// Virtrev SDK copyright matrem (matrem84.free.fr) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-10-07 +// Updated : +// Licence : This source is under MIT License +// File : glm/ext/virtrev/address.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "../glm.hpp" + + +namespace glm +{ + namespace virtrev_glmext + { + //! GLM_VIRTREV_address extension: Vector & matrix content address (T const * type pointer). + namespace address + { + /** Get the const address of the vector content. */ + template + T const * address(detail::tvec2 const & vec) + { + return &(vec.x); + } + /** Get the address of the vector content. */ + template + T * address(detail::tvec2 & vec) + { + return &(vec.x); + } + + /** Get the const address of the vector content. */ + template + T const * address(detail::tvec3 const & vec) + { + return &(vec.x); + } + /** Get the address of the vector content. */ + template + T * address(detail::tvec3 & vec) + { + return &(vec.x); + } + + /** Get the const address of the vector content. */ + template + T const * address(detail::tvec4 const & vec) + { + return &(vec.x); + } + /** Get the address of the vector content. */ + template + T * address(detail::tvec4 & vec) + { + return &(vec.x); + } + + /** Get the const address of the matrix content. */ + template + T const * address(detail::tmat2x2 const & mat) + { + return &(mat[0].x); + } + /** Get the address of the matrix content. */ + template + T * address(detail::tmat2x2 & mat) + { + return &(mat[0].x); + } + + /** Get the const address of the matrix content. */ + template + T const * address(detail::tmat3x3 const & mat) + { + return &(mat[0].x); + } + /** Get the address of the matrix content. */ + template + T * address(detail::tmat3x3 & mat) + { + return &(mat[0].x); + } + + /** Get the const address of the matrix content. */ + template + T const * address(detail::tmat4x4 const & mat) + { + return &(mat[0].x); + } + /** Get the address of the matrix content. */ + template + T * address(detail::tmat4x4 & mat) + { + return &(mat[0].x); + } + + /** Get the const address of the matrix content. */ + template + T const * address(detail::tmat2x3 const & mat) + { + return &(mat[0].x); + } + /** Get the address of the matrix content. */ + template + T * address(detail::tmat2x3 & mat) + { + return &(mat[0].x); + } + + /** Get the const address of the matrix content. */ + template + T const * address(detail::tmat3x2 const & mat) + { + return &(mat[0].x); + } + /** Get the address of the matrix content. */ + template + T * address(detail::tmat3x2 & mat) + { + return &(mat[0].x); + } + + /** Get the const address of the matrix content. */ + template + T const * address(detail::tmat2x4 const & mat) + { + return &(mat[0].x); + } + /** Get the address of the matrix content. */ + template + T * address(detail::tmat2x4 & mat) + { + return &(mat[0].x); + } + + /** Get the const address of the matrix content. */ + template + T const * address(detail::tmat4x2 const & mat) + { + return &(mat[0].x); + } + /** Get the address of the matrix content. */ + template + T * address(detail::tmat4x2 & mat) + { + return &(mat[0].x); + } + + /** Get the const address of the matrix content. */ + template + T const * address(detail::tmat3x4 const & mat) + { + return &(mat[0].x); + } + /** Get the address of the matrix content. */ + template + T * address(detail::tmat3x4 & mat) + { + return &(mat[0].x); + } + + /** Get the const address of the matrix content. */ + template + T const * address(detail::tmat4x3 const & mat) + { + return &(mat[0].x); + } + /** Get the address of the matrix content. */ + template + T * address(detail::tmat4x3 & mat) + { + return &(mat[0].x); + } + } + } +} + +#define GLM_VIRTREV_address namespace virtrev_glmext::address +#ifndef GLM_VIRTREV_GLOBAL +namespace glm {using GLM_VIRTREV_address;} +#endif//GLM_VIRTREV_GLOBAL + +#endif//GLM_EXT_VIRTREV_ADDRESS_HPP + diff --git a/glm/virtrev/equal_operator.hpp b/glm/virtrev/equal_operator.hpp new file mode 100644 index 00000000..7c71f35b --- /dev/null +++ b/glm/virtrev/equal_operator.hpp @@ -0,0 +1,71 @@ +#ifndef GLM_EXT_VIRTREV_EQUAL_OPERATOR_HPP +#define GLM_EXT_VIRTREV_EQUAL_OPERATOR_HPP + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +// VirtreV SDK copyright matrem (matrem84.free.fr) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-09-23 +// Updated : +// Licence : This source is under MIT License +// File : glm/ext/virtrev/equal_operator.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "../glm.hpp" + +namespace glm +{ + namespace virtrev_glmext + { + //! GLM_VIRTREV_gl extension: Vector & matrix integration with OpenGL. + namespace equal_operator + { + template + inline bool operator == (glm::detail::tvec2 const & v1, glm::detail::tvec2 const & v2) + { + return v1.x==v2.x && v1.y==v2.y; + } + + template + inline bool operator == (glm::detail::tvec3 const & v1, glm::detail::tvec3 const & v2) + { + return v1.x==v2.x && v1.y==v2.y && v1.z==v2.z; + } + + template + inline bool operator == (glm::detail::tvec4 const & v1, glm::detail::tvec4 const & v2) + { + return v1.x==v2.x && v1.y==v2.y && v1.z==v2.z && v1.w==v2.w; + } + + template + inline bool operator != (glm::detail::tvec2 const & v1, glm::detail::tvec2 const & v2) + { + return v1.x!=v2.x || v1.y!=v2.y; + } + + template + inline bool operator != (glm::detail::tvec3 const & v1, glm::detail::tvec3 const & v2) + { + return v1.x!=v2.x || v1.y!=v2.y || v1.z!=v2.z; + } + + template + inline bool operator != (glm::detail::tvec4 const & v1, glm::detail::tvec4 const & v2) + { + return v1.x!=v2.x || v1.y!=v2.y || v1.z!=v2.z || v1.w!=v2.w; + } + } + } +} + +#define GLM_VIRTREV_equal_operator namespace glm::virtrev_glmext::equal_operator +#ifndef GLM_VIRTREV_GLOBAL +namespace glm {using GLM_VIRTREV_equal_operator;} +#endif//GLM_VIRTREV_GLOBAL + +#endif//GLM_EXT_VIRTREV_EQUAL_OPERATOR_HPP + diff --git a/glm/virtrev/gl.hpp b/glm/virtrev/gl.hpp new file mode 100644 index 00000000..eee2ad3a --- /dev/null +++ b/glm/virtrev/gl.hpp @@ -0,0 +1,64 @@ +#ifndef GLM_EXT_VIRTREV_GL_HPP +#define GLM_EXT_VIRTREV_GL_HPP + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +// Virtrev SDK copyright matrem (matrem84.free.fr) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-04-24 +// Updated : 2008-10-07 +// Licence : This source is under MIT License +// File : glm/ext/virtrev/gl.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - glew or glee or gl library header +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "../glm.hpp" + +#if !defined(GLM_DEPENDENCE) || !(GLM_DEPENDENCE & (GLM_DEPENDENCE_GLEW|GLM_DEPENDENCE_GLEE|GLM_DEPENDENCE_GL)) +#error GLM_VIRTREV_gl requires OpenGL to build. GLM_DEPENDENCE doesn't define the dependence. +#endif//GLM_DEPENDENCE + +namespace glm +{ + namespace virtrev_glmext + { + //! GLM_VIRTREV_gl extension: Vector & matrix integration with OpenGL. + namespace gl + { + typedef detail::tvec2 gl_vec2; ///< vec2 for GLfloat OpenGL type + typedef detail::tvec3 gl_vec3; ///< vec3 for GLfloat OpenGL type + typedef detail::tvec4 gl_vec4; ///< vec4 for GLfloat OpenGL type + + typedef detail::tvec2 gl_svec2; ///< vec2 for GLshort OpenGL type + typedef detail::tvec3 gl_svec3; ///< vec3 for GLshort OpenGL type + typedef detail::tvec4 gl_svec4; ///< vec4 for GLshort OpenGL type + + typedef detail::tvec2 gl_ivec2; ///< vec2 for GLint OpenGL type + typedef detail::tvec3 gl_ivec3; ///< vec3 for GLint OpenGL type + typedef detail::tvec4 gl_ivec4; ///< vec4 for GLint OpenGL type + + typedef detail::tmat2x2 gl_mat2; ///< mat2x2 for GLfloat OpenGL type + typedef detail::tmat3x3 gl_mat3; ///< mat3x3 for GLfloat OpenGL type + typedef detail::tmat4x4 gl_mat4; ///< mat4x4 for GLfloat OpenGL type + + typedef detail::tmat2x3 gl_mat2x3; ///< mat2x3 for GLfloat OpenGL type + typedef detail::tmat3x2 gl_mat3x2; ///< mat3x2 for GLfloat OpenGL type + typedef detail::tmat2x4 gl_mat2x4; ///< mat2x4 for GLfloat OpenGL type + typedef detail::tmat4x2 gl_mat4x2; ///< mat4x2 for GLfloat OpenGL type + typedef detail::tmat3x4 gl_mat3x4; ///< mat3x4 for GLfloat OpenGL type + typedef detail::tmat4x3 gl_mat4x3; ///< mat4x3 for GLfloat OpenGL type + + } + } +} + +#define GLM_VIRTREV_gl namespace glm::virtrev_glmext::gl +#ifndef GLM_VIRTREV_GLOBAL +namespace glm {using GLM_VIRTREV_gl;} +#endif//GLM_VIRTREV_GLOBAL + +#endif//GLM_EXT_VIRTREV_GL_HPP + diff --git a/glm/virtrev/xstream.hpp b/glm/virtrev/xstream.hpp new file mode 100644 index 00000000..f5f5a37d --- /dev/null +++ b/glm/virtrev/xstream.hpp @@ -0,0 +1,147 @@ +#ifndef GLM_EXT_VIRTREV_XSTREAM_HPP +#define GLM_EXT_VIRTREV_XSTREAM_HPP + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) +// Virtrev SDK copyright matrem (matrem84.free.fr) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2008-05-24 +// Updated : 2008-05-26 +// Licence : This source is under MIT License +// File : glm/ext/virtrev/xstream.h +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +// - GLM_GTX_matrix_selection +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "../glm.hpp" +#include "../gtx/matrix_selection.hpp" +#include + +namespace glm +{ + namespace virtrev_glmext + { + //! GLM_VIRTREV_xstream extension: Streaming vector and matrix in a xml way + namespace xstream + { + template + std::ostream & operator << (std::ostream & stream, glm::detail::tvec2 const & vec) + { + stream << ""; + + return stream; + } + + template + std::ostream & operator << (std::ostream & stream, glm::detail::tvec3 const & vec) + { + stream << ""; + + return stream; + } + + template + std::ostream & operator << (std::ostream & stream, glm::detail::tvec4 const & vec) + { + stream << ""; + + return stream; + } + + template + std::ostream & operator << (std::ostream & stream, glm::detail::tmat2x2 const & mat) + { + stream << "" << std::endl; + stream << "" << std::endl; + stream << "" << std::endl; + stream << ""; + + return stream; + } + + template + std::ostream & operator << (std::ostream & stream, glm::detail::tmat3x3 const & mat) + { + stream << "" << std::endl; + stream << "" << std::endl; + stream << "" << std::endl; + stream << "" << std::endl; + stream << ""; + + return stream; + } + + template + std::ostream & operator << (std::ostream & stream, glm::detail::tmat4x4 const & mat) + { + stream << "" << std::endl; + stream << "" << std::endl; + stream << "" << std::endl; + stream << "" << std::endl; + stream << "" << std::endl; + stream << ""; + + return stream; + } + } + } +} + +#define GLM_VIRTREV_xstream namespace glm::virtrev_glmext::xstream +#ifndef GLM_VIRTREV_GLOBAL +namespace glm {using GLM_VIRTREV_xstream;} +#endif//GLM_VIRTREV_GLOBAL + +#endif diff --git a/readme b/readme new file mode 100644 index 00000000..0a4220d1 --- /dev/null +++ b/readme @@ -0,0 +1,242 @@ +============================= +GLM 0.8.4.4 final: 2010-01-25 +----------------------------- +- Fixed warnings + +============================= +GLM 0.8.4.3 final: 2009-11-16 +----------------------------- +- Fixed Half float arithmetic +- Fixed setup defines + +============================= +GLM 0.8.4.2 final: 2009-10-19 +----------------------------- +- Fixed Half float adds + +============================= +GLM 0.8.4.1 final: 2009-10-05 +----------------------------- +- Updated documentation +- Fixed MacOS X build + +============================= +GLM 0.8.4.0 final: 2009-09-16 +----------------------------- +- Added GCC 4.4 and VC2010 support +- Added matrix optimizations + +============================= +GLM 0.8.3.5 final: 2009-08-11 +----------------------------- +- Fixed bugs + +============================= +GLM 0.8.3.4 final: 2009-08-10 +----------------------------- +- Updated GLM according GLSL 1.5 spec +- Fixed bugs + +============================= +GLM 0.8.3.3 final: 2009-06-25 +----------------------------- +- Fixed bugs + +============================= +GLM 0.8.3.2 final: 2009-06-04 +----------------------------- +- Added GLM_GTC_quaternion +- Added GLM_GTC_type_precision + +============================= +GLM 0.8.3.1 final: 2009-05-21 +----------------------------- +- Fixed old extension system. + +============================= +GLM 0.8.3.0 final: 2009-05-06 +----------------------------- +- Added stable extensions. +- Added new extension system. + +============================= +GLM 0.8.2.3 final: 2009-04-01 +----------------------------- +- Fixed bugs. + +============================= +GLM 0.8.2.2 final: 2009-02-24 +----------------------------- +- Fixed bugs. + +============================= +GLM 0.8.2.1 final: 2009-02-13 +----------------------------- +- Fixed bugs. + +============================= +GLM 0.8.2 final: 2009-01-21 +----------------------------- +- Fixed bugs. + +============================= +GLM 0.8.1 final: 2008-10-30 +----------------------------- +- Fixed bugs. + +============================= +GLM 0.8.0 final: 2008-10-23 +----------------------------- +- New method to use extension. + +============================= +GLM 0.8.0 beta3: 2008-10-10 +----------------------------- +- Added CMake support for GLM tests. + +============================= +GLM 0.8.0 beta2: 2008-10-04 +----------------------------- +- Improved half scalars and vectors support. + +============================= +GLM 0.8.0 beta1: 2008-09-26 +----------------------------- +- Improved GLSL conformance +- Added GLSL 1.30 support +- Improved API documentation + +============================= +GLM 0.7.6 final: 2008-08-08 +--------------------------- +- Improved C++ standard comformance +- Added Static assert for types checking + +=========================== +GLM 0.7.5 final: 2008-07-05 +--------------------------- +- Added build message system with Visual Studio +- Pedantic build with GCC + +=========================== +GLM 0.7.4 final: 2008-06-01 +--------------------------- +- Added external dependencies system. + +=========================== +GLM 0.7.3 final: 2008-05-24 +--------------------------- +- Fixed bugs +- Added new extension group + +=========================== +GLM 0.7.2 final: 2008-04-27 +--------------------------- +- Updated documentation +- Added preprocessor options + +=========================== +GLM 0.7.1 final: 2008-03-24 +--------------------------- +- Disabled half on GCC +- Fixed extensions + +=========================== +GLM 0.7.0 final: 2008-03-22 +--------------------------- +- Changed to MIT license +- Added new documentation + +=========================== +GLM 0.6.4 : 2007-12-10 +--------------------------- +- Fixed swizzle operators + +=========================== +GLM 0.6.3 : 2007-11-05 +--------------------------- +- Fixed type data accesses +- Fixed 3DSMax sdk conflict + +=========================== +GLM 0.6.2 : 2007-10-08 +--------------------------- +- Fixed extension + +=========================== +GLM 0.6.1 : 2007-10-07 +--------------------------- +- Fixed a namespace error +- Added extensions + +=========================== +GLM 0.6.0 : 2007-09-16 +--------------------------- +- Added new extension namespace mecanium +- Added Automatic compiler detection + +=========================== +GLM 0.5.1 : 2007-02-19 +--------------------------- +- Fixed swizzle operators + +=========================== +GLM 0.5.0 : 2007-01-06 +--------------------------- +- Upgrated to GLSL 1.2 +- Added swizzle operators +- Added setup settings + +=========================== +GLM 0.4.1 : 2006-05-22 +--------------------------- +- Added OpenGL examples + +=========================== +GLM 0.4.0 : 2006-05-17 +--------------------------- +- Added missing operators to vec* and mat* +- Added first GLSL 1.2 features +- Fixed windows.h before glm.h when windows.h required + +=========================== +GLM 0.3.2 : 2006-04-21 +--------------------------- +- Fixed texcoord components access. +- Fixed mat4 and imat4 division operators. + +=========================== +GLM 0.3.1 : 2006-03-28 +--------------------------- +- Added GCC 4.0 support under MacOS X. +- Added GCC 4.0 and 4.1 support under Linux. +- Added code optimisations. + +=========================== +GLM 0.3 : 2006-02-19 +--------------------------- +- Improved GLSL type conversion and construction compliance. +- Added experimental extensions. +- Added Doxygen Documentation. +- Added code optimisations. +- Fixed bugs. + +=========================== +GLM 0.2: 2005-05-05 +--------------------------- +- Improve adaptative from GLSL. +- Add experimental extensions based on OpenGL extension process. +- Fixe bugs. + +=========================== +GLM 0.1: 2005-02-21 +--------------------------- +- Add vec2, vec3, vec4 GLSL types +- Add ivec2, ivec3, ivec4 GLSL types +- Add bvec2, bvec3, bvec4 GLSL types +- Add mat2, mat3, mat4 GLSL types +- Add almost all functions + +=========================== +Christophe [Groove] Riccio, glm|AT|g-truc|DOT|net + diff --git a/util/usertype.dat b/util/usertype.dat new file mode 100644 index 00000000..dbf4a90e --- /dev/null +++ b/util/usertype.dat @@ -0,0 +1,646 @@ +attribute +const +uniform +varying +break +continue +do +for +while +if +else +in +out +inout +float +int +void +bool +true +false +discard +return +mat2 +mat3 +mat4 +mat2x2 +mat3x3 +mat4x4 +mat2x3 +mat3x2 +mat2x4 +mat4x2 +mat3x4 +mat4x3 +vec2 +vec3 +vec4 +ivec2 +ivec3 +ivec4 +uvec2 +uvec3 +uvec4 +bvec2 +bvec3 +bvec4 +sampler1D +sampler2D +sampler3D +samplerCube +sampler1DShadow +sampler2DShadow +struct + +asm +class +union +enum +typedef +template +this +packed +goto +switch +default +inline +noinline +volatile +public +static +extern +external +interface +long +short +double +half +fixed +unsigned +input +output +sampler2DRect +sampler3DRect +sampler2DRectShadow +sizeof +cast +namespace +using + +hvec2 +hvec3 +hvec4 +fvec2 +fvec3 +fvec4 +dvec2 +dvec3 +dvec4 + +__uvec2GTX +__uvec3GTX +__uvec4GTX +__ivec2GTX +__ivec3GTX +__ivec4GTX +__hvec2GTX +__hvec3GTX +__hvec4GTX +__fvec2GTX +__fvec3GTX +__fvec4GTX +__dvec2GTX +__dvec3GTX +__dvec4GTX + +on + +final +abstract +limited +access +self + +uchar +schar +uint +sint + +int8 +int16 +int32 +int64 + +sint8 +sint16 +sint32 +sint64 + +uint8 +uint16 +uint32 +uint64 + +float16 +float32 +float64 + +quat +hquat +fquat +dquat + +__quatGTX +__hquatGTX +__fquatGTX +__dquatGTX + +handle +handle8 +handle16 +handle32 +handle64 + +flag +flag8 +flag16 +flag32 +flag64 + +import +export + +hmat2 +hmat3 +hmat4 + +fmat2 +fmat3 +fmat4 + +dmat2 +dmat3 +dmat4 + +hmat2x3 +hmat3x2 +hmat2x4 +hmat4x2 +hmat3x4 +hmat4x3 + +fmat2x3 +fmat3x2 +fmat2x4 +fmat4x2 +fmat3x4 +fmat4x3 + +dmat2x3 +dmat3x2 +dmat2x4 +dmat4x2 +dmat3x4 +dmat4x3 + +__halfGTX + +__hvec2GTX +__hvec3GTX +__hvec4GTX + +__hmat2GTX +__hmat3GTX +__hmat4GTX + +__fmat2GTX +__fmat3GTX +__fmat4GTX + +__dmat2GTX +__dmat3GTX +__dmat4GTX + +__hmat2x3GTX +__hmat3x2GTX +__hmat2x4GTX +__hmat4x2GTX +__hmat3x4GTX +__hmat4x3GTX + +__fmat2x3GTX +__fmat3x2GTX +__fmat2x4GTX +__fmat4x2GTX +__fmat3x4GTX +__fmat4x3GTX + +__dmat2x3GTX +__dmat3x2GTX +__dmat2x4GTX +__dmat4x2GTX +__dmat3x4GTX +__dmat4x3GTX + +null +pi +epsilon +infinite +self + +byte +word +dword +qword + +new_object +new_array +delete_object +delete_array + +__int8GTX +__int16GTX +__int32GTX +__int64GTX + +__i8GTX +__i16GTX +__i32GTX +__i64GTX + +__i8vec2GTX +__i8vec3GTX +__i8vec4GTX + +__i16vec2GTX +__i16vec3GTX +__i16vec4GTX + +__i32vec2GTX +__i32vec3GTX +__i32vec4GTX + +__i64vec2GTX +__i64vec3GTX +__i64vec4GTX + +__uint8GTX +__uint16GTX +__uint32GTX +__uint64GTX + +__u8GTX +__u16GTX +__u32GTX +__u64GTX + +__u8vec2GTX +__u8vec3GTX +__u8vec4GTX + +__u16vec2GTX +__u16vec3GTX +__u16vec4GTX + +__u32vec2GTX +__u32vec3GTX +__u32vec4GTX + +__u64vec2GTX +__u64vec3GTX +__u64vec4GTX + +__float16GTX +__float32GTX +__float64GTX + +__f16GTX +__f32GTX +__f64GTX + +__f16vec2GTX +__f16vec3GTX +__f16vec4GTX + +__f32vec2GTX +__f32vec3GTX +__f32vec4GTX + +__f64vec2GTX +__f64vec3GTX +__f64vec4GTX + +__f16mat2GTX +__f16mat3GTX +__f16mat4GTX + +__f16mat2x3GTX +__f16mat2x4GTX +__f16mat3x2GTX +__f16mat3x4GTX +__f16mat4x2GTX +__f16mat4x3GTX + +__f32mat2GTX +__f32mat3GTX +__f32mat4GTX + +__f32mat2x3GTX +__f32mat2x4GTX +__f32mat3x2GTX +__f32mat3x4GTX +__f32mat4x2GTX +__f32mat4x3GTX + +__f64mat2GTX +__f64mat3GTX +__f64mat4GTX + +__f64mat2x3GTX +__f64mat2x4GTX +__f64mat3x2GTX +__f64mat3x4GTX +__f64mat4x2GTX +__f64mat4x3GTX + +__f16quatGTX +__f32quatGTX +__f64quatGTX + +int8 +int16 +int32 +int64 + +i8 +i16 +i32 +i64 + +i8vec2 +i8vec3 +i8vec4 + +i16vec2 +i16vec3 +i16vec4 + +i32vec2 +i32vec3 +i32vec4 + +i64vec2 +i64vec3 +i64vec4 + +uint8 +uint16 +uint32 +uint64 + +u8 +u16 +u32 +u64 + +u8vec2 +u8vec3 +u8vec4 + +u16vec2 +u16vec3 +u16vec4 + +u32vec2 +u32vec3 +u32vec4 + +u64vec2 +u64vec3 +u64vec4 + +float16 +float32 +float64 + +f16 +f32 +f64 + +f16vec2 +f16vec3 +f16vec4 + +f32vec2 +f32vec3 +f32vec4 + +f64vec2 +f64vec3 +f64vec4 + +f16mat2 +f16mat3 +f16mat4 + +f16mat2x3 +f16mat2x4 +f16mat3x2 +f16mat3x4 +f16mat4x2 +f16mat4x3 + +f32mat2 +f32mat3 +f32mat4 + +f32mat2x3 +f32mat2x4 +f32mat3x2 +f32mat3x4 +f32mat4x2 +f32mat4x3 + +f64mat2 +f64mat3 +f64mat4 + +f64mat2x3 +f64mat2x4 +f64mat3x2 +f64mat3x4 +f64mat4x2 +f64mat4x3 + +f16quat +f32quat +f64quat + +bool1 +bool2 +bool3 +bool4 + +bool1x1 +bool2x2 +bool3x3 +bool4x4 + +bool2x3 +bool2x4 +bool3x2 +bool3x4 +bool4x2 +bool4x3 + +int1 +int2 +int3 +int4 + +int1x1 +int2x2 +int3x3 +int4x4 + +int2x3 +int2x4 +int3x2 +int3x4 +int4x2 +int4x3 + +half1 +half2 +half3 +half4 + +half2x2 +half3x3 +half4x4 + +half2x3 +half2x4 +half3x2 +half3x4 +half4x2 +half4x3 + +float1 +float2 +float3 +float4 + +float1x1 +float2x2 +float3x3 +float4x4 + +float2x3 +float2x4 +float3x2 +float3x4 +float4x2 +float4x3 + +double1 +double2 +double3 +double4 + +double1x1 +double2x2 +double3x3 +double4x4 + +double2x3 +double2x4 +double3x2 +double3x4 +double4x2 +double4x3 + +bool1GTX +bool2GTX +bool3GTX +bool4GTX + +bool1x1GTX +bool2x2GTX +bool3x3GTX +bool4x4GTX + +bool2x3GTX +bool2x4GTX +bool3x2GTX +bool3x4GTX +bool4x2GTX +bool4x3GTX + +__int1GTX +__int2GTX +__int3GTX +__int4GTX + +__int1x1GTX +__int2x2GTX +__int3x3GTX +__int4x4GTX + +__int2x3GTX +__int2x4GTX +__int3x2GTX +__int3x4GTX +__int4x2GTX +__int4x3GTX + +__half1GTX +__half2GTX +__half3GTX +__half4GTX + +__half1x1GTX +__half2x2GTX +__half3x3GTX +__half4x4GTX + +__half2x3GTX +__half2x4GTX +__half3x2GTX +__half3x4GTX +__half4x2GTX +__half4x3GTX + +__float1GTX +__float2GTX +__float3GTX +__float4GTX + +__float1x1GTX +__float2x2GTX +__float3x3GTX +__float4x4GTX + +__float2x3GTX +__float2x4GTX +__float3x2GTX +__float3x4GTX +__float4x2GTX +__float4x3GTX + +__double1GTX +__double2GTX +__double3GTX +__double4GTX + +__double1x1GTX +__double2x2GTX +__double3x3GTX +__double4x4GTX + +__double2x3GTX +__double2x4GTX +__double3x2GTX +__double3x4GTX +__double4x2GTX +__double4x3GTX