diff --git a/doc/man.doxy b/doc/man.doxy index a0f71f99..cf235dd5 100644 --- a/doc/man.doxy +++ b/doc/man.doxy @@ -44,7 +44,7 @@ PROJECT_BRIEF = # exceed 55 pixels and the maximum width should not exceed 200 pixels. # Doxygen will copy the logo to the output directory. -PROJECT_LOGO = G:/git/ogl-math/doc/image/logo-mini.png +PROJECT_LOGO = ./image/logo-mini.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -80,7 +80,7 @@ OUTPUT_LANGUAGE = English # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. -BRIEF_MEMBER_DESC = YES +BRIEF_MEMBER_DESC = NO # 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. diff --git a/doc/pages.doxy b/doc/pages.doxy index 0e5a9f9f..25f70528 100644 --- a/doc/pages.doxy +++ b/doc/pages.doxy @@ -9,15 +9,15 @@ This library works perfectly with OpenGL but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (Raytracing / Rasterisation), image processing, physic simulations and any context that requires a simple and convenient mathematics library. - \note The Doxygen-generated documentation will often state that a type or function - is defined in a namespace that is a child of the \link glm glm \endlink namespace. - Please ignore this; you can access all publicly available types as direct children - of the glm namespace. - GLM is written as a platform independent library with no dependence and officially supports the following compilers: 1. GCC 3.4 and higher 2. LLVM 2.3 through GCC 4.2 front-end and higher 3. Visual Studio 2005 and higher + + \note The Doxygen-generated documentation will often state that a type or function + is defined in a namespace that is a child of the \link glm glm \endlink namespace. + Please ignore this; All publicly available types and functions can be accessed as a direct children + of the glm namespace. The source code is licenced under the MIT licence. @@ -67,7 +67,7 @@ int foo() The \ref core "GLM" represents only what GLSL's core provides in terms of types and functions (to the best of GLM's ability to replicate them). All that is needed to use the core - is to #include . + is to include . \ref gtc "GTC extensions" are functions and types that add onto the core. These are considered reasonably stable, with their APIs not changing much between @@ -79,7 +79,7 @@ int foo() is why they are marked "experimental". Like GTC extensions, each experimental extension is included with a separate header file. - All the extensions can be included at once by default with #include + All the extensions can be included at once by default by including but this is not recommanded as it will reduce compilation speed for many unused features. All of GLM is defined as direct children of the glm namespace, including extensions. @@ -255,8 +255,8 @@ void foo() GLM's functions are defined in headers, so they are defined with C++'s "inline" delcaration. This does not require the compiler to inline them, however. - If you want to force the compiler to inline the function, using whatever capabilities that the compiler provides to do so, - you can define GLM_FORCE_INLINE before any inclusion of . + To force the compiler to inline the function, using whatever capabilities that the compiler provides to do so, + GLM_FORCE_INLINE can be defined before any inclusion of . \code #define GLM_FORCE_INLINE @@ -281,7 +281,7 @@ void foo() \section advanced_compatibility Compatibility Compilers have some language extensions that GLM will automatically take advantage of them when they are enabled. - The #define GLM_FORCE_CXX98 can switch off these extensions, forcing GLM to operate on pure C++98. + GLM_FORCE_CXX98 can switch off these extensions, forcing GLM to operate on pure C++98. \code #define GLM_FORCE_CXX98 @@ -394,9 +394,10 @@ void foo() \section faq7 Should I use 'using namespace glm;'? - This is unwise. There is every chance that are that if 'using namespace glm;' is called, name collisions will happen. GLSL names for functions are fairly generic, so it is entirely likely that there is another function called, for example, \link glm::sqrt sqrt \endlink. + This is unwise. Chances are that if 'using namespace glm;' is called, name collisions will happen. + GLSL names for functions are fairly generic, so it is entirely likely that there is another function called, for example, \link glm::sqrt sqrt \endlink. - If you need frequent use of particular types, you can bring them into the global + For frequent use of particular types, they can be brough into the global namespace with a 'using' declaration like this: /code @@ -409,9 +410,11 @@ void foo() GLM is mainly designed to be convenient; that's why it is written against GLSL specification. - The 80-20 rule suggests that 80% of a program's performance comes from 20% of its code. Therefore, one must first identify which 20% of the code is impacting the performance. + The 80-20 rule suggests that 80% of a program's performance comes from 20% of its code. + Therefore, one should first identify which 20% of the code is impacting the performance. - In general, if one identifies certain math code to be a performance bottleneck, the only way to solve this is to write specialized code for those particular math needs. So no canned library solution would be suitable. + In general, if one identifies certain math code to be a performance bottleneck, the only way to solve this is to write specialized code for those particular math needs. + So no canned library solution would be suitable. That being said, GLM can provides some descent performances alternatives based on approximations or SIMD instructions. **/ @@ -603,27 +606,30 @@ glm::vec3 lighting( \page pg_reference References OpenGL 4.1 core specification: - http://www.opengl.org/registry/doc/glspec41.core.20100725.pdf + http://www.opengl.org/registry/doc/glspec41.core.20100725.pdf GLSL 4.10 specification: - http://www.opengl.org/registry/doc/GLSLangSpec.4.10.6.clean.pdf + http://www.opengl.org/registry/doc/GLSLangSpec.4.10.6.clean.pdf GLU 1.3 specification: - http://www.opengl.org/documentation/specs/glu/glu1_3.pdf + http://www.opengl.org/documentation/specs/glu/glu1_3.pdf GLM HEAD snapshot: - http://ogl-math.git.sourceforge.net/git/gitweb.cgi?p=ogl-math/ogl-math;a=snapshot;h=HEAD;sf=tgz + http://ogl-math.git.sourceforge.net/git/gitweb.cgi?p=ogl-math/ogl-math;a=snapshot;h=HEAD;sf=tgz - GLM Trac, for bug report and feature request: + GLM bug tracker: https://sourceforge.net/apps/trac/ogl-math GLM website: http://glm.g-truc.net + GLM OpenGL SDK page: + http://www.opengl.org/sdk/libs/GLM/ + G-Truc Creation page: - http://www.g-truc.net/project-0016.html + http://www.g-truc.net/project-0016.html The OpenGL Toolkits forum to ask questions about GLM: - http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=postlist&Board=10&page=1 + http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=postlist&Board=10&page=1 **/ diff --git a/doc/src/data.xml b/doc/src/data.xml index 72d77f6d..b3afe3c6 100644 --- a/doc/src/data.xml +++ b/doc/src/data.xml @@ -141,1449 +141,55 @@ In place operations. - bit rotation. - frexp RGBE. row matrices. - Optimize *mat4 inverse. fixed numbers row and column major matrices - - - Promoted double types - - - Removed global inclusion. - Removed auto cast setup. - Removed compatibility setup. - Clean up and simplify setup.hpp - Fixed website links - - - Added missing inline. - Added common vecType for vector based types. - Updated copyright date. - Refactoring of type precision - GLM types are now more generic - Extract vec1 code - Reduced namespaces count - - - GLM 0.8.4.4 released. - - - Fixed warnings. - - - Added texcoord wrapping through GLM_IMG_wrap extension. - - - Reorganized SVN directory. - - - GLM 0.8.4.3 released. - - - Fixed half arithmetic. - - - Added scalars support for GLM_IMG_multiple. - - - Fixed setup defines. - - - Added GLM_IMG_multiple extensions and unit tests. - - - GLM 0.8.4.2 released. - - - Fixed half. - - - GLM 0.8.4.1 released. - - - Updated documentation. - - - Updated manual. - Added static assert implementation. - Removed unuse GLM_SWIZZLE_FUNC. - - - Some progress on fixing GLM for MacOSX comflics. - - - Fixed GLM_GTX_quaternion extension: cross and intermediate. - - - Fixed quaternion angle. - - - Updated documentation. - GLM 0.8.4.0 released. - - - Added Visual Studio 2010 support. - Fixed build on GCC. - Added GCC 4.4 support. - - - Added no initilization constructor to vec4. - - - Added no initilization constructor to mat4. - Updated GLM_GTC_matrix_transform: faster rotate. - - - Added GLM_GTX_matrix_operation: build diagonal matrix. - Updated GLM_GTC_matrix_transform: faster scaling. - - - Fixed transpose function for mat4x3. - Optimized translate function for mat4 matrix: ~184 cycles instead of ~592 cycles on Q6600. - - - Fixed OpenGL dependence. - Added OpenGL 3 dependence. - - - Fixed parameter definition and definition mismatch. - - - Fixed GLM_GTC_matrix_projection. - Updated GLM_GTX_transform: Added missing entry points. - GLM 0.8.3.5 released. - - - 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. - - - Fixed GLM_GTX_matrix_query extension: Fixed row_size and col_size() calls. - Fixed GLM_GTX_matrix_access extension: Fixed row_size calls. - - - Fixed GLM_GTX_string_cast extension: Build on GCC 4. - Fixed GLM_GTC_quaternion extension: rotate function build. - - - Fixed GLM_GTC_matrix_transform extension: Fixed matrix operation order; like OpenGL instead of like Direct3D. - GLM 0.8.3.3 released. - - - Fixed GLM_GTX_rotate_vector extension: Fixed rotate function. - - - Fixed matrix external operators. - - - Added GLM_GTC_type_precision extension. - GLM 0.8.3.2 released. - - - Fixed GLM_GTC_matrix_transform: Fixed mat4 inverse function. - - - Added GLM_GTC_quaternion extension. - Updated GLM_GTC_quaternion extension. - Fixed GLM_GTC_matrix_transform extension. - - - GLM 0.8.3.1 released. - - - Updated GLM_GTX_bit extension: Added lowestBit functions. - Fixed old extention inclusion method. - - - Updated sse mat4 implementation. - - - Updated GLM_GTX_bit extension: Added bitRevert, bitRotateRight and bitRotateLeft functions. - - - Added intrinsic like functions for mat4 product and inverse. - - - Added intrinsic like functions for mat4 and vec4 products. - - - Fixed GLM_GTX_type_ptr extension. - GLM 0.8.3.0 released. - - - Fixed GLM_GTC_matrix_projection: glm::project build. - - - Added new extensions inclusion system. - - - Fixed GLM_GTX_determinant extension. - Reorganized extensions. - Removed GLM_GTX_vector_comp_mult and GLM_GTX_mat4x3 extensions. - Renamed .h files to .hpp. - - - Added GLM_GTC_half_float. - - - Fixed GLM_GTX_perpendicular extension. - Fixed GLM_GTX_matrix_projection extension. - Fixed GLM_GTX_transform2 extension. - - - Added GLM_GTC_matrix_operation. - Added GLM_GTC_matrix_transform. - Added GLM_GTC_matrix_projection. - Added GLM_GTC_double_float. - - - Fixed bug 2774738. - Fixed bug 2774015. - - - GLM 0.8.2.3 released. - - - Updaded mix function: Makes it more flexible, types wise. - - - Fixed GLM_GTX_perpendicular and GLM_GTX_projection. - Added GLM_GTX_radial_gradient extensions. - - - Fixed GCC 4.3 pedantic build. - GLM 0.8.2.2 released. - - - Removed all deprecated ARB conventions. - - - Fixed highp_int_t and highp_uint_t with Linux 64. - Fixed GCC 4.3 'extra ;' with pedentic build. - - - Fixed build. - GLM 0.8.2.1 released. - - - Fixed build. - Added extensions build test. - - - GLM 0.8.2 released. - - - Fixed GLM_GTX_intersect: intersectRayTriangle. - - - Fixed vectors access operators. - Fixed unresolved with quaternions. - - - Fixed GLM_GTX_norm: Include issue. - - - Fixed left value swizzle operators. - - - Fixed GLM_GTX intersect extension: intersectRayTriangleGTX with GCC. - Typo. - - - Fixed GLM_GTX inverse_transpose extension. - - - Updated quaternion implementation. - - - Added GLM_GTX_raw_data extension. - - - Updated GLM_GTX_bit extension: Added mask function. - - - Updated GLM_GTX_bit extension: Added extractField function. - Fixed STATIC_ASSERT with 64bits integers. - - - GLM 0.8.1 released. - - - Fixed mix function with boolean parameter. - Fixed value_size issue. - - - Fixed GLM_GTX_component_wise extension. - Added GLM_GTX_color_space_YCoCg extension. - - - Added GLM_GTX_comparison extension: Defined comparison operators for vectors. - - - Added GLM_GTX_log_base extension. - - - 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. - - - Updated manuel and documentation. - GLM 0.8.0 final released. - - - 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. - - - Added logos in varius resolutions. - - - Updated website. - Added website builder. - - - Updated GLM_GTX_number_precision: No more warning with type size tests. - Fixed none consistent size_t. - - - Updated website. - - - Fixed build. - Updated manual. - GLM 0.8.0 beta3 released. - - - Added GLM_GTX_reciprocal extension: Define sec, csc, cot, asec, acsc, acot, sech, csch, coth, asech, acsch and acoth functions. - - - Updated GLM_GTX_euler_angles extension: Added functions to build rotation matrices. - - - 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. - - - 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. - - - 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. - - - GLM 0.8.0 beta2 released. - - - value_size and is_vector are now functions. - - - 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. - - - Fixed build with GCC. - Updated manual. - - - Updated GLM_GTX_bit implementation. - Added GLM_USE_ONLY_XYZW to disable multiple component names. - Updated GLM_GTX_euler_angles extension: added yawPitchRoll function. - - - 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. - - - 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. - - - Added build option for build that support anonymous structure. - Fixed missing inline in tvec2 definision. - New implementation of hvec2 thought specialisation of tvec2 template. - - - Updated documentation. - GLM 0.8.0 beta1 released. - - - Fixed static asserts within vector and matrix types. - Updated mix function implementation, support for boolean vectors. - - - Fixed static asserts. - Added some asserts. - Updated matrices operator[]. - - - Added GLM_VIRTREV_equal_operator: Operators that compare vectors. - Fixed build errors from static asserts. - - - Fixed build errors with GCC. - Fixed func_trigonometric.h encoding. - - - Deleted GLM_GTX_INCLUDED. - Fixed build errors. - Fixed GLM_GTX_random: Bad assert definition. - - - Updated manual. - Updated swizzle operators with swizzle function. - Added modf definition. - - - 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. - - - Included all types in type namespace. - - - Added type namespace in glm namespace for documentation purpose. - - - 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. - - - Added trait code (class type) to detect bool, float, int and uint numbers. - Updated static assert to common functions. - - - Updated noise function definitions... Still unsure for staying in GLM 0.8.0. - - - Updated overall documentation, doxygen documentation. - - - 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? - - - 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. - - - Updated documentation and implementation of all geometric functions. - - - Updated documentation and implementation of all exponential functions. - - - 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. - - - Added bool_type implementation detail to vector types. - - - Added API and documentation of all common functions. - - - Updated GLM_GTX_extensions: Define operator* as a cross product. Still in WIP... - - - Updated *vec2 and *vec3 with precision types missed and documentation. - - - Fixed 2085925 bug: rotateGTX didn't use it quaternion parameter. - - - Added test files. - Updated *vec4 with precision types missed and documentation. - - - Renamed implementation files. - Updated type pre-declarations. - - - Fixed GLM_GTX_matrix_projection extension: frustum function gave a wrong result. - - - Updated matrix types functions and extensions according new vectors types. - - - Added new vector types implementation. - - - Added support for new GLSL 1.30 precision model. - - - Added GLSL 1.30.08 unsigned int types support - - - Added detail::vec1 type. - Added detail::desc for types description and higher templatisation. - - - 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. - - - Updated GLM_GTX_fast_square_root implementation: Updated fastInverseSqrt - - - Updated documentation. - GLM 0.7.6 released. - - - 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. - - - Fixed GLM_GTX_component_wise extension. - - - Updated mix functions for optimization purpose. - Fixed mix functions static assert. - Updated test files. - Updated GLM_GTX_statistics_operation. - - - 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. - - - Added GLM_GTX_std_based_type: Types based on C++ conventions. - Added files for extension tests. - - - Fixed GLM_GTX_fast_square_root: Updated fastDistance. - - - Fixed GLM_GTX_fast_square_root: Wrong const and updated fastLenght. - Optimized mix core function - - - Fixed GLM_GTX_epsilon: Wrong function definitions for y, z and w components. - - - Fixed GLM_GTX_flexible: Flexible with scalar only failed. - Fixed GLM_GTX_quaternion: One rotate overloaded function undefined. - - - Some fixes on GLM_GTX_intersect extension. - - - GLM 0.7.5 released. - - - Updated documentation. - - - Updated message system. - - - Added new message system. - - - Fixed GLM_GTX_normal extension. - - - Updated GLM_GTX_unsigned_int extension. (New typedef extensions) - - - Added new precompiler system. - - - Increase C++ conformance. - - - Fixed build errors. - GLM 0.7.4 released. - - - 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. - - - Fixed GLM_GTX_transform2 extension: scaleBias didn't built. - - - Added GLM_VIRTREV_xstream extension: XML output for GLM types. - Added external library system - - - Updated GLM_GTX_string_cast extension: Support of non-square matrices. - GLM 0.7.3 released. - - - Fixed mat2 product. - - - Fixed GLM_GTX_transform2 dependencies. - - - Added GLM_VIRTREV_gl extension: Vector and matrix integration with OpenGL. - - - 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 - - - GLM 0.7.2 released. - - - Added GLM_AUTO_CAST setup option. - Updated documentation - - - Updated GLM_GTX_inverse, added affine inverse functions for fast matrix inverts. - Updated overall documentation - Added trait typedef to all GLM data types - - - Updated GLM_GTX_compatibility documentation. - Fixed GLM_GTX_random, gauss functions didn't build. - - - Added few SSE code. - Fixed matrix projections. - - - Added GLM_SWIZZLE_FUNC swizzle option. - - - Updated GLM_GTX_euler_angles documentation. - - - Updated documentation. - - - Fixed GLM_GTX_associated_min_max build on GCC. - Updated GLM_GTX_matrix_projection. - GLM 0.7.1 released. - - - GLM 0.7.0 released. - - - Updated manual. - - - Updated documentation. - Added GLM_GTX_associated_min_max extension. - - - Fixed not function with GCC. - - - Fixed interger pow function for the case of a null power. - - - Fixed mat4x2 and mat4x3 GCC build. - Updated documentation. - Reseted glmsetup.h to default values. - - - 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. - - - Fixed missing xvec4 ++ and -- operator definition. - - - Move some implementation details into detail namespace. - - - Fixed cast between matrices of different sizes. - - - Fixed matNxM type cast to other matNxM type. - - - Fixed GLM_GTX_matrix_projection extension. - - - GLM 0.6.4 released. - - - Fixed swizzle operators. - - - Fixed GLM_GTX_matrix_selection extension. - - - Updated GLM_GTX_color_space extension. Added luminosity function. - - - GLM 0.6.3 released. - - - Fixed 3DSMax SDK conflict with GLM. - - - Updated GLM_GTX_quaternion. Added sqrt function. - - - Updated GLM_GTX_random extension. - Updated GLM_GTX_half extension. - - - Fixed matrices operator const T*() const. - - - Fixed GLM_GTX_normalize_dot extension. - GLM 0.6.2 released. - - - GLM 0.6.1 released. - - - Added GLM_GTX_normalize_dot extension: Faster way to normalize parameters before a dot product - - - Fixed namespace error on GLM_GTX_matx extension - - - Added GLM_GTX_flexible_mix extension: mix function can take different types parameters - - - Updated documentation. - GLM 0.6.0 released. - - - Added GLM_SINGLE_COMP_NAME to fixed multiple component names on half types with GCC. - - - Added #define GLM_GTX_INCLUDED to automatically include all GTX extensions in the language. - - - Updated extensions documentation. - Updated GLM_GTX_quaternion extension: squad, euler angles conversions - - - Updated GLM_GTX_compatibility extension: Added isfinite isinf, and isnan. - - - Updated GLM_GTX_random extension: Gauss distribution, spherical distribution, linear distribution. - - - Fixed namespace issues with Visual Studio 8.0 SP1. - - - Updated GLM_GTX_gpu_shader4 extension: Add bit operators. - Updated GLM_GTX_integer extension: Delete some code duplications. - Added GLM_GTX_unsigned_int extension. - - - Fixed namespace issues with Visual Studio 8.0 SP1. - Added new namespace management for extensions. - Added automatic compiler ditection, no more compiler setup. - - - Updated GLM_GTX_number_precision extension. - Updated usertype.dat for Visual Studio. - Updated GLM_GTX_random extension. - - - Added GLM_GTX_color_cast extension. - Updated GLM_GTX_quaternion extension. - - - Added GLM_GTX_verbose_operator extension. - - - Added GLM_GTX_component_wise extension. - - - Added GLM_GTX_number_precision extension. - - - Updated GLM_GTX_bit extension. - - - Updated GLM_GTX_bit extension. - - - 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. - - - Added GLM_GTX_mixed_product extension. - Added GLM_GTX_intersect extension. - Updated GLM_GTX_matrix_access extension. - - - Added bits operators in comment for vec2, vec3 and vec4. - Fixed friendly conformance to GLM_GTX_double. - - - Fixed size_type errors. - - - Updated GLM_GTX_quaternion extension. - Added GLM_GTX_bit extension. - Added value_type, size_type and value_size typedefs and value to all types. - - - Updated GLM_GTX_compatibility extension. - Fixed GLM_GTX_color_space extension. - - - Added GLM_GTX_polar_coordinates extension. - - - Added GLM_GTX_vector_query extension. - Added GLM_GTX_matrix_query extension. - - - Fixed square matrices division operators. - - - Added GLM_GTX_mat_mn extension. - - - Updated GLM_GTX_color_space extension. - - - Added GLM_GTX_vecx extension. - Added GLM_GTX_matx extension. - - - GLM 0.5.1 released. - - - Updated Visual Studio projects. - - - Updated GLM_GTX_compatibility extension. - - - Added GLM_GTX_hyperbolic extension. - Added GLM_GTX_spline extension. - Fixed unProject and project functions from GLM_GTX_matrix_projection extension. - - - Added GLM_GTX_compatibility extension. - - - 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 - - - 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 - - - Added user manual. - GLM 0.5.0 released. - - - Updated overloaded functions of matrixCompMult. - Added transpose and outerProduct functions in the GLM core. - - - Fixed GLM_GTX_rotate_vector extension. - - - Fixed GLM_GTX_interger extension conformance. - - - Improved "friendly conformance" support. - Improved quaternion implementation. - - - Updated setup options. - - - Added new setup options for swizzle operators. - - - Updated GLM_GTX_integer extension. - - - Added GLM_GTX_gpu_shader4 extension. - Added extension errors management. - Added compilers management. - Added conformance management. - - - Added GLM_GTX_rotate_vector extension. - - - Updated product operators to non-squared matrices - - - Updated tmat4x3 and tmat3x4 types - Added tmat2x3, tmat3x2, tmat2x4 and tmat4x2 - Clarified ToDo comments for missing operators with non-squared matrices types - - - Added GLSL 1.2 mat4x3 and mat3x4 - Added missing declaration of mat* operators - Added _xmat* with _xvec* division operators - - - Added GLSL 1.2 non-squared matrices files - - - fastCos and fastSin are defined between -2 pi and 2 pi - - - Added swizzle operators for xvec4 - Added swizzle operators for bvec4 - - - Added swizzle operators for bvec2> - Implicit conversion from *ref* to *vec* - Added swizzles operators for xvec3 - Added swizzles operators for bvec3 - - - Separated _*ref* types in different files - Added _bref* types - Updated _xref* types - - - Added operators for tvec2 swizzles operators management - - - GLM 0.4.1 released. - - - Add 4 examples of use with OpenGL under Windows and Linux - - - GLM 0.4.0 released. - - - It's not anymore required to include windows.h before glm.h whether windows.h is required - - - Improved tvec3 conversions - Improved tvec2 conversions - Added left hand side vec2 swizzle operators - Improved bvec4 conversions - Improved bvec3 conversions - Improved bvec2 conversions - - - Added _xref* structures for swizzle operators implementation - Seperated bvec* and xvec* types in different files - Updated core functions code - - - Fixed texture coordinate components access - Added GLM_GTX_mul extension. - Added GLM_GTX_inertia extension. - GLM 0.3.2 released. - - - Added right hand side vec2 swizzle operators - Improved tvec4 conversions - - - Updated GLM_GTX_quaterion, added log and exp functions - Added GLM_GTX_matrix_major_storage extension. - - - Reorganize types code - Complete addition and subtraction vertrices operators - - - Complete addition and subtraction matrices operators - Optimize increment and decrement operators - - - Fixed tmat4x4 division - - - Added GLM_GTX_outer_product extension. - - - GLM 0.3.1 released. - - - Added Linux support under GCC 4.0 and 4.1. - - - Optimisation of increment and decrement operators. - - - Added MacOS X support under GCC 4.0. - - - 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. - - - Optimized GLM_GTX_integer implementation. - - - Deleted explicit conversions from array to type to prevent unespected conversions. - - - 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. - - - Fixed bugs - - - Updated GLM_GTX_integer extension. - - - Added GLM_GTX_fast_exponential extension to wishlist in position 24. - - - Optimized _xvec* copy. - - - Added GLM_GTX_fast_trigonometry extension to wishlist in position 23. - Added factorial function to GLM_GTX_integer extension. - - - 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. - - - 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. - - - Reorganization of extensions. - Fixed vec2 constructeur bug. - - - Updated GLM_GTX_length2 extension. - Renamed GLM_GTX_length2 extension to GLM_GTX_norm. - - - Fixed GLM_GTX_quaterion implémentation bugs. - - - Updated GLM_GTX_projection extension. - - - Added GLM_GTX_transform2 extension to wishlist in position 18. - - - Updated for GCC 4.0. - - - Fixed normalization bug with LookAtGTX. - - - Add array conversion to GLM types. - - - Added GL_GTX_euler_angles extension to wishlist in position 17. - - - Added GLM_GTX_matrix_selection extension to wishlist in position 16. - Added GLM_GTX_matrix_selection extension support. - - - Updated GLM_GTX_projection extension to wishlist in position 15. - - - Added GLM_GTX_projection extension to wishlist in position 15. - - - Fixed bug from rotateGTX with quaternion. - Fixed matrix vector product. - Add vector usage to describe transformations axis. - - - Added GLM_GTX_quaternion extension support - GLM 0.2 released. - - - Add GLM_GTX_transform 2D transform support - - - Add GLM_GTX_transform 3D transform support - - - Updated GLM_GTX_transform extension to wishlist in position 2 - - - Added GLM_GTX_vector_comp_mult extension to whislist in position 14 - Added GLM_GTX_vector_comp_mult extension support - - - Added GLM_GTX_color_space extension to whislist in position 13 - Added GLM_GTX_color_space extension support - Added GLM_GTX_double extension support - - - Overload of GLSL functions used by extentions instead of create new functions - - - Added GLM_GTX_optimum_pow extension to whislist in position 11 - Added GLM_GTX_double extension to wishlist in position 12 - - - 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 - - - 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 - - - Added bug #7 : Vector constructor non conform - Updated issue #13 : Only ARB can allow extensions adding new operators - - - 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 - - - Fixed bug #2 with '#error' - - - Updated issue #4 - - - Updated issue #13 - Updated issue #8 - Updated issue #6 - Updated issue #4 - - - 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 - - - Updated GLM_GTX_transpose extension to wishlist in position 8 - Added GLM_GTX_transpose extension support - Fixed mat* types constructor scalar-parameted - - - Fixed mat* types product by a scalar - - - Updated function 'not' - Defined identificators following compilers - Added GLM_GTX_length2 extension to wishlist in position 6 - Optimized mat3 type divide operator - - - GLM 0.1 released - - - Updated issue #4 - Updated issue #6 - Updated issue #9 - Updated issue #12 - Updated issue #13 - Updated issues ordering - - - 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 - - - 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 - - - Updated issue #13 - Converted text files into XML - Modified files hierarchy - - - 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 - - - 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 - - - Modified *vec* types constructors implementation, chooses initialisation instead of affectation - Added function reflect with its tests - Updated tan function - Fixed mat4 type * operator - - - Added GLM_GTX_refract extension to wishlist in position 5. - - - Added default constructor for mat* types - - - Added mat2 and vec2 type * operator - Added mat3 and vec3 type * operator - Added mat4 and vec4 type * operator - - - 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 - - - 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 - - - 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 - - - Added mat2 type - Added * operator for two mat2 types - Added issue #14 - Added issue #15 - Added mat3 type - Added mat4 type - - - 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 - - - Added function fract with its tests - Added function mod with its tests - Added function clamp with its tests - - - 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 - - - Updated issue #13 - Added temporary namespace called 'glm' - Added function pow with its tests - - - Updated sin function tests - Enhanced trigonometrics functions - Enhanced geometric functions - - - 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 - - - Added function radians with its tests - Added function degrees with its tests - Added issue #9 - - - Separated *vec* types definition from declaration - Added xvec* into xvec2 type conversion - Updated issue #11 - Added issue #12 - - - Using 'union' for multiple access to *vec* types components - Added issue #11 - Deleted __*vec1GT following issue #11 guidance - Closed issue #2 - - - Added function normalize with its tests - Added function faceforward with its tests - - - 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 - - - Renamed intern types _vec* into _xvec* - Separated _xvec* types data, operators and accesses - Added bvec2 type - Added __bvec1GT type beyond GLSL 1.051 specs - - - 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 - - - - + - The stable version, GLM 0.9.0.8, adds the operator * for quaternion products and deprecated the cross function previously used for the same purpose. - Also, it clarifies that GLM is a header only library when a user try to build it. Once more, there is nothing to build. + Finally, GLM 0.9.1 branch is reaching the status of stable with + GLM 0.9.1.0. - The development version, GLM 0.9.1 beta, provides an improved API documentation by - Alfonse Reinheart, - author of a great OpenGL tutorial which uses GLM. - This version also improves the SIMD extensions and it fixes many bugs. + From GLM 0.9.1 beta, mainly bugs has been fixed. GLM has evolved on many sides since GLM 0.9.0: + Improved documentation (manual and doxygen), better test framework, simplified setup/options/configration of GLM and new experimental SIMD API. + + + GLM 0.9.1.0 is not 100% backward compatile with + GLM 0.9.0.8 + but mainly advanced usages should be affected by the differencies. + Have a look at the GLM manual for more information on how to use GLM 0.9.1. - GLM 0.9.1.0 (zip,) + GLM 0.9.1.0 (zip) GLM 0.9.1.0 (7z) GLM 0.9.1 manual Submit a bug report - - - The stable version, GLM 0.9.0.8, adds the operator * for quaternion products and deprecated the cross function previously used for the same purpose. - Also, it clarifies that GLM is a header only library when a user try to build it. Once more, there is nothing to build. - - - The development version, GLM 0.9.1 beta, provides an improved API documentation by - Alfonse Reinheart, - author of a great OpenGL tutorial which uses GLM. - This version also improves the SIMD extensions and it fixes many bugs. - + + + The stable version, GLM 0.9.0.8, adds the operator * for quaternion products and deprecated the cross function previously used for the same purpose. + Also, it clarifies that GLM is a header only library when a user try to build it. Once more, there is nothing to build. + + + The development version, GLM 0.9.1 beta, provides an improved API documentation by + Alfonse Reinheart, + author of a great OpenGL tutorial which uses GLM. + This version also improves the SIMD extensions and it fixes many bugs. + - GLM 0.9.1.B (zip,) - GLM 0.9.1.B (7z) - GLM 0.9.1 manual - GLM 0.9.0.8 (zip,) - GLM 0.9.0.8 (7z) - GLM 0.9.0 manual - Submit a bug report - + GLM 0.9.1.B (zip) + GLM 0.9.1.B (7z) + GLM 0.9.1 manual + GLM 0.9.0.8 (zip) + GLM 0.9.0.8 (7z) + GLM 0.9.0 manual + Submit a bug report + diff --git a/glm/core/intrinsic_matrix.inl b/glm/core/intrinsic_matrix.inl index 4a4cebc9..26011cd1 100644 --- a/glm/core/intrinsic_matrix.inl +++ b/glm/core/intrinsic_matrix.inl @@ -1005,8 +1005,7 @@ inline void sse_inverse_fast_ps(__m128 const in[4], __m128 out[4]) out[3] = _mm_mul_ps(Inv3, Rcp0); } - -void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]) +inline void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]) { float a = glm::radians(Angle); float c = cos(a); @@ -1076,7 +1075,7 @@ void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out sse_mul_ps(in, Result, out); } -void sse_outer_ps(__m128 const & c, __m128 const & r, __m128 out[4]) +inline void sse_outer_ps(__m128 const & c, __m128 const & r, __m128 out[4]) { out[0] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(0, 0, 0, 0))); out[1] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(1, 1, 1, 1))); diff --git a/glm/core/type_int.hpp b/glm/core/type_int.hpp index 6903c2b0..3bad8ce4 100644 --- a/glm/core/type_int.hpp +++ b/glm/core/type_int.hpp @@ -88,7 +88,7 @@ namespace glm #elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT) typedef precision::lowp_int int_t; #else - typedef mediump_int int_t; + typedef precision::mediump_int int_t; # pragma message("GLM message: Precisson undefined for signed integer number."); #endif//GLM_PRECISION diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 803bf685..7257ceb0 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -15,7 +15,6 @@ #include "type_int.hpp" #include "type_size.hpp" #include "_swizzle.hpp" -#include "_detail.hpp" namespace glm { diff --git a/glm/glm.hpp b/glm/glm.hpp index 2c47cabb..394ecf4b 100644 --- a/glm/glm.hpp +++ b/glm/glm.hpp @@ -12,9 +12,6 @@ #ifndef glm_glm #define glm_glm -//! TODO: to delete -#define GLMvalType typename genType::value_type - #include #include #include diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index 1263ce53..93d845e6 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -144,13 +144,15 @@ namespace matrix_transform } template - inline detail::tmat4x4 ortho( + inline detail::tmat4x4 ortho + ( valType const & left, valType const & right, valType const & bottom, valType const & top, valType const & zNear, - valType const & zFar) + valType const & zFar + ) { detail::tmat4x4 Result(1); Result[0][0] = valType(2) / (right - left); @@ -179,13 +181,15 @@ namespace matrix_transform } template - inline detail::tmat4x4 frustum( + inline detail::tmat4x4 frustum + ( valType const & left, valType const & right, valType const & bottom, valType const & top, valType const & nearVal, - valType const & farVal) + valType const & farVal + ) { detail::tmat4x4 Result(0); Result[0][0] = (valType(2) * nearVal) / (right - left); @@ -199,11 +203,13 @@ namespace matrix_transform } template - inline detail::tmat4x4 perspective( + inline detail::tmat4x4 perspective + ( valType const & fovy, valType const & aspect, valType const & zNear, - valType const & zFar) + valType const & zFar + ) { valType range = tan(radians(fovy / valType(2))) * zNear; valType left = -range * aspect; @@ -244,10 +250,12 @@ namespace matrix_transform } template - inline detail::tmat4x4 infinitePerspective( + inline detail::tmat4x4 infinitePerspective + ( T fovy, T aspect, - T zNear) + T zNear + ) { T range = tan(radians(fovy / T(2))) * zNear; T left = -range * aspect; @@ -265,10 +273,12 @@ namespace matrix_transform } template - inline detail::tmat4x4 tweakedInfinitePerspective( + inline detail::tmat4x4 tweakedInfinitePerspective + ( T fovy, T aspect, - T zNear) + T zNear + ) { T range = tan(radians(fovy / T(2))) * zNear; T left = -range * aspect; @@ -286,11 +296,13 @@ namespace matrix_transform } template - inline detail::tvec3 project( + inline detail::tvec3 project + ( detail::tvec3 const & obj, detail::tmat4x4 const & model, detail::tmat4x4 const & proj, - detail::tvec4 const & viewport) + detail::tvec4 const & viewport + ) { detail::tvec4 tmp = detail::tvec4(obj, T(1)); tmp = model * tmp; @@ -305,11 +317,13 @@ namespace matrix_transform } template - inline detail::tvec3 unProject( + inline detail::tvec3 unProject + ( detail::tvec3 const & win, detail::tmat4x4 const & model, detail::tmat4x4 const & proj, - detail::tvec4 const & viewport) + detail::tvec4 const & viewport + ) { detail::tmat4x4 inverse = glm::inverse(proj * model); @@ -338,16 +352,23 @@ namespace matrix_transform if(!(delta.x > T(0) && delta.y > T(0))) return Result; // Error + detail::tvec3 Temp( + (T(viewport[2]) - T(2) * (center.x - T(viewport[0]))) / delta.x, + (T(viewport[3]) - T(2) * (center.y - T(viewport[1]))) / delta.y, + T(0)); + // Translate and scale the picked region to the entire window - Result = translate(Result, (T(viewport[2]) - T(2) * (center.x - T(viewport[0]))) / delta.x, (T(viewport[3]) - T(2) * (center.y - T(viewport[1]))) / delta.y, T(0)); + Result = translate(Result, Temp); return scale(Result, T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1)); } template - inline detail::tmat4x4 lookAt( - const detail::tvec3& eye, - const detail::tvec3& center, - const detail::tvec3& up) + inline detail::tmat4x4 lookAt + ( + detail::tvec3 const & eye, + detail::tvec3 const & center, + detail::tvec3 const & up + ) { detail::tvec3 f = normalize(center - eye); detail::tvec3 u = normalize(up); diff --git a/glm/gtx/spline.hpp b/glm/gtx/spline.hpp index d00bf572..e791d1dc 100644 --- a/glm/gtx/spline.hpp +++ b/glm/gtx/spline.hpp @@ -36,31 +36,31 @@ namespace glm //! From GLM_GTX_spline extension. template genType catmullRom( - const genType& v1, - const genType& v2, - const genType& v3, - const genType& v4, - const GLMvalType& s); + genType const & v1, + genType const & v2, + genType const & v3, + genType const & v4, + typename genType::value_type const & 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); + genType const & v1, + genType const & t1, + genType const & v2, + genType const & t2, + typename genType::value_type const & 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); + genType const & v1, + genType const & v2, + genType const & v3, + genType const & v4, + typename genType::value_type const & s); ///@} diff --git a/glm/gtx/spline.inl b/glm/gtx/spline.inl index 7d94b12b..a0c49b4a 100644 --- a/glm/gtx/spline.inl +++ b/glm/gtx/spline.inl @@ -12,53 +12,59 @@ namespace gtx{ namespace spline { template - inline genType catmullRom( - const genType& v1, - const genType& v2, - const genType& v3, - const genType& v4, - const GLMvalType& s) + inline genType catmullRom + ( + genType const & v1, + genType const & v2, + genType const & v3, + genType const & v4, + typename genType::value_type const & s + ) { - GLMvalType s1 = s; - GLMvalType s2 = optimum_pow::pow2(s); - GLMvalType s3 = optimum_pow::pow3(s); + typename genType::value_type s1 = s; + typename genType::value_type s2 = optimum_pow::pow2(s); + typename genType::value_type 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; + typename genType::value_type f1 = -s3 + typename genType::value_type(2) * s2 - s; + typename genType::value_type f2 = typename genType::value_type(3) * s3 - typename genType::value_type(5) * s2 + typename genType::value_type(2); + typename genType::value_type f3 = typename genType::value_type(-3) * s3 + typename genType::value_type(4) * s2 + s; + typename genType::value_type f4 = s3 - s2; - return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / GLMvalType(2); + return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / typename genType::value_type(2); } template - inline genType hermite( - const genType& v1, - const genType& t1, - const genType& v2, - const genType& t2, - const GLMvalType& s) + inline genType hermite + ( + genType const & v1, + genType const & t1, + genType const & v2, + genType const & t2, + typename genType::value_type const & s + ) { - GLMvalType s1 = s; - GLMvalType s2 = optimum_pow::pow2(s); - GLMvalType s3 = optimum_pow::pow3(s); + typename genType::value_type s1 = s; + typename genType::value_type s2 = optimum_pow::pow2(s); + typename genType::value_type 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; + typename genType::value_type f1 = typename genType::value_type(2) * s3 - typename genType::value_type(3) * s2 + typename genType::value_type(1); + typename genType::value_type f2 = typename genType::value_type(-2) * s3 + typename genType::value_type(3) * s2; + typename genType::value_type f3 = s3 - typename genType::value_type(2) * s2 + s; + typename genType::value_type 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) + inline genType cubic + ( + genType const & v1, + genType const & v2, + genType const & v3, + genType const & v4, + typename genType::value_type const & s + ) { return ((v1 * s + v2) * s + v3) * s + v4; } diff --git a/glm/gtx/vector_query.hpp b/glm/gtx/vector_query.hpp index 776a99ed..47fac281 100644 --- a/glm/gtx/vector_query.hpp +++ b/glm/gtx/vector_query.hpp @@ -39,55 +39,55 @@ namespace glm //! From GLM_GTX_vector_query extensions. template bool areCollinear( - const genType & v0, - const genType & v1, - const GLMvalType epsilon = std::numeric_limits::epsilon()); + genType const & v0, + genType const & v1, + typename genType::value_type const & 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()); + genType const & v0, + genType const & v1, + typename genType::value_type const & 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()); + genType const & v0, + genType const & v1, + typename genType::value_type const & 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()); + genType const & v, + typename genType::value_type const & 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()); + genType const & v, + typename genType::value_type const & 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()); + genType const & v0, + genType const & v1, + typename genType::value_type const & 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()); + genType const & v0, + genType const & v1, + typename genType::value_type const & epsilon = std::numeric_limits::epsilon()); ///@} diff --git a/glm/gtx/vector_query.inl b/glm/gtx/vector_query.inl index b1e76ae2..f9d02199 100644 --- a/glm/gtx/vector_query.inl +++ b/glm/gtx/vector_query.inl @@ -17,77 +17,100 @@ namespace gtx{ namespace vector_query { template - inline bool areCollinear( - const detail::tvec2& v0, - const detail::tvec2& v1, - const T epsilon) + inline bool areCollinear + ( + detail::tvec2 const & v0, + detail::tvec2 const & v1, + T const & 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) + inline bool areCollinear + ( + detail::tvec3 const & v0, + detail::tvec3 const & v1, + T const & epsilon + ) { return length(cross(v0, v1)) < epsilon; } template - inline bool areCollinear( - const detail::tvec4& v0, - const detail::tvec4& v1, - const T epsilon) + inline bool areCollinear + ( + detail::tvec4 const & v0, + detail::tvec4 const & v1, + T const & epsilon + ) { return length(cross(detail::tvec3(v0), detail::tvec3(v1))) < epsilon; } template - inline bool areOpposite( - const genType& v0, - const genType& v1, - const GLMvalType epsilon) + inline bool areOpposite + ( + genType const & v0, + genType const & v1, + typename genType::value_type const & epsilon + ) { assert(isNormalized(v0) && isNormalized(v1)); - return((genType::value_type(1) + dot(v0, v1)) <= epsilon); + return((typename genType::value_type(1) + dot(v0, v1)) <= epsilon); } template - inline bool areOrthogonal( - const genType& v0, - const genType& v1, - const GLMvalType epsilon) + inline bool areOrthogonal + ( + genType const & v0, + genType const & v1, + typename genType::value_type const & epsilon + ) { - return abs(dot(v0, v1)) <= max(GLMvalType(1), length(v0)) * max(GLMvalType(1), length(v1)) * epsilon; + return abs(dot(v0, v1)) <= max( + typename genType::value_type(1), + length(v0)) * max( + typename genType::value_type(1), + length(v1)) * epsilon; } template - inline bool isNormalized( - const genType& v, - const GLMvalType epsilon) + inline bool isNormalized + ( + genType const & v, + typename genType::value_type const & epsilon + ) { return abs(length(v) - GLMvalType(1)) <= GLMvalType(2) * epsilon; } template - inline bool isNull(const genType& v, const GLMvalType epsilon) + inline bool isNull + ( + genType const & v, + typename genType::value_type const & epsilon + ) { return length(v) <= epsilon; } template - inline bool isCompNull( - const T s, - const T epsilon) + inline bool isCompNull + ( + T const & s, + T const & epsilon + ) { return abs(s) < epsilon; } template - inline detail::tvec2 isCompNull( - const detail::tvec2& v, - const T epsilon) + inline detail::tvec2 isCompNull + ( + detail::tvec2 const & v, + T const & epsilon) { return detail::tvec2( (abs(v.x) < epsilon), @@ -95,9 +118,11 @@ namespace vector_query } template - inline detail::tvec3 isCompNull( - const detail::tvec3& v, - const T epsilon) + inline detail::tvec3 isCompNull + ( + detail::tvec3 const & v, + T const & epsilon + ) { return detail::tvec3( abs(v.x) < epsilon, @@ -106,9 +131,11 @@ namespace vector_query } template - inline detail::tvec4 isCompNull( - const detail::tvec4& v, - const T epsilon) + inline detail::tvec4 isCompNull + ( + detail::tvec4 const & v, + T const & epsilon + ) { return detail::tvec4( abs(v.x) < epsilon, @@ -118,19 +145,23 @@ namespace vector_query } template - inline bool areOrthonormal( - const genType& v0, - const genType& v1, - const GLMvalType epsilon) + inline bool areOrthonormal + ( + genType const & v0, + genType const & v1, + typename genType::value_type const & 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) + inline bool areSimilar + ( + genType const & v0, + genType const & v1, + typename genType::value_type const & epsilon + ) { bool similar = true; for(typename genType::size_type i = 0; similar && i < genType::value_size(); i++)