Sync up to branch 0.9.3

This commit is contained in:
athile 2011-09-21 11:25:30 -04:00
commit 24879d4580
287 changed files with 21246 additions and 14361 deletions

View File

@ -16,9 +16,13 @@ if(CMAKE_COMPILER_IS_GNUCXX)
#add_definitions(-mfpmath=387)
#add_definitions(-ffast-math)
#add_definitions(-O3)
#add_definitions(-fprofile-arcs -ftest-coverage) gcov
#ctest_enable_coverage()
endif()
include_directories(".")
include_directories("./test/external")
add_subdirectory(glm)
add_subdirectory(test)

13
CTestConfig.cmake Normal file
View File

@ -0,0 +1,13 @@
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "GLM")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=GLM")
set(CTEST_DROP_SITE_CDASH TRUE)

View File

@ -1,64 +0,0 @@
/*!
\defgroup core GLM Core
\brief The core of GLM, which implements exactly and only the GLSL specification to the degree possible.
The GLM core consists of \ref core_types "C++ types that mirror GLSL types",
\ref core_funcs "C++ functions that mirror the GLSL functions". It also includes
\ref core_precision "a set of precision-based types" that can be used in the appropriate
functions. The C++ types are all based on a basic set of \ref core_template "template types".
The best documentation for GLM Core is the current GLSL specification,
<a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.10.6.clean.pdf">version 4.1
(pdf file)</a>.
There are a few \ref pg_differences "differences" between GLM core and GLSL.
**/
/*!
\defgroup core_types Types
\brief The standard types defined by the specification.
These types are all typedefs of more generalized, template types. To see the definiton
of these template types, go to \ref core_template.
\ingroup core
**/
/*!
\defgroup core_precision Precision types
\brief Non-GLSL types that are used to define precision-based types.
The GLSL language allows the user to define the precision of a particular variable.
In OpenGL's GLSL, these precision qualifiers have no effect; they are there for compatibility
with OpenGL ES's precision qualifiers, where they \em do have an effect.
C++ has no language equivalent to precision qualifiers. So GLM provides the next-best thing:
a number of typedefs of the \ref core_template that use a particular precision.
None of these types make any guarantees about the actual precision used.
\ingroup core
**/
/*!
\defgroup core_template Template types
\brief The generic template types used as the basis for the core types.
These types are all templates used to define the actual \ref core_types.
These templetes are implementation details of GLM types and should not be used explicitly.
\ingroup core
**/
/*!
\defgroup core_funcs Functions
\brief The functions defined by the specification.
\ingroup core
**/

View File

@ -1,108 +0,0 @@
/*!
\defgroup gtc GTC Extensions (Stable)
\brief Functions and types that the GLSL specification doesn't define, but useful to have for a C++ program.
GTC extensions aim to be stable.
Even if it's highly unrecommended, it's possible to include all the extensions at once by
including <glm/ext.hpp>. Otherwise, each extension needs to be included a specific file.
**/
/*!
\defgroup gtc_half_float GLM_GTC_half_float: Half-precision floating-point based types and functions.
\ingroup gtc
Defines the half-precision floating-point type, along with various typedefs for vectors and matrices.
<glm/gtc/half_float.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtc_matrix_access GLM_GTC_matrix_access: Access matrix rows and columns.
\ingroup gtc
Defines functions to access rows or columns of a matrix easily.
<glm/gtc/matrix_access.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtc_matrix_integer GLM_GTC_matrix_integer: Integer matrix types.
\ingroup gtc
Defines a number of matrices with integer types.
<glm/gtc/matrix_integer.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtc_matrix_inverse GLM_GTC_matrix_inverse: Additional matrix inverse function
\ingroup gtc
Defines additional matrix inverting functions.
<glm/gtc/matrix_inverse.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtc_matrix_transform GLM_GTC_matrix_transform: Matrix transform functions.
\ingroup gtc
\brief Defines functions that generate common transformation matrices.
The matrices generated by this extension use standard OpenGL fixed-function
conventions. For example, the lookAt function generates a transform from world
space into the specific eye space that the projective matrix functions (
perspective, ortho, etc) are designed to expect. The OpenGL compatibility
specifications defines the particular layout of this eye space.
<glm/gtc/matrix_transform.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtc_quaternion GLM_GTC_quaternion: Quaternion types and functions
\ingroup gtc
\brief Defines a templated quaternion type and several quaternion operations.
<glm/gtc/quaternion.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtc_type_precision GLM_GTC_type_precision: Vector and matrix types with defined precisions.
\ingroup gtc
\brief Defines specific C++-based precision types.
\ref core_precision defines types based on GLSL's precision qualifiers. This
extension defines types based on explicitly-sized C++ data types.
<glm/gtc/type_precision.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtc_type_ptr GLM_GTC_type_ptr: Memory layout access.
\ingroup gtc
\brief Used to get a pointer to the memory layout of a basic type.
This extension defines an overloaded function, glm::value_ptr, which
takes any of the \ref core_template "core template types". It returns
a pointer to the memory layout of the object. Matrix types store their values
in column-major order.
This is useful for uploading data to matrices or copying data to buffer objects.
Example:
\code
#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
glm::vec3 aVector(3);
glm::mat4 someMatrix(1.0);
glUniform3fv(uniformLoc, 1, glm::value_ptr(aVector));
glUniformMatrix4fv(uniformMatrixLoc, 1, GL_FALSE, glm::value_ptr(someMatrix));
\endcode
<glm/gtc/type_ptr.hpp> need to be included to use these functionalities.
**/

View File

@ -1,498 +0,0 @@
/*!
\defgroup gtx GTX Extensions (Experimental)
\brief Functions and types that the GLSL specification doesn't define, but useful to have for a C++ program.
Experimental extensions are useful functions and types, but the development of
their API and functionality is not necessarily stable. They can change substantially
between versions. Backwards compatibility is not much of an issue for them.
Even if it's highly unrecommended, it's possible to include all the extensions at once by
including <glm/ext.hpp>. Otherwise, each extension needs to be included a specific file.
**/
/*!
\defgroup gtx_associated_min_max GLM_GTX_associated_min_max: Associated Min/Max
\ingroup gtx
\brief Min and max functions that return associated values not the compared onces.
<glm/gtx/associated_min_max.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_bit GLM_GTX_bit: Extended bitwise operations
\ingroup gtx
\brief Allow to perform bit operations on integer values
<glm/gtx/bit.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_closest_point GLM_GTX_closest_point: Find closest point
\ingroup gtx
\brief Find the point on a straight line which is the closet of a point.
<glm/gtx/closest_point.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_color_cast GLM_GTX_color_cast: Color conversion
\ingroup gtx
\brief Conversion between two color types.
<glm/gtx/color_cast.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_color_space GLM_GTX_color_space: RGB to HSV conversion
\ingroup gtx
\brief Related to RGB to HSV conversions and operations.
<glm/gtx/color_space.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_color_space_YCoCg GLM_GTX_color_space_YCoCg: RGB to YCoCg conversion
\ingroup gtx
\brief RGB to YCoCg conversions and operations
<glm/gtx/color_space_YCoCg.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_compatibility GLM_GTX_compatibility: Cg and HLSL compatibility
\ingroup gtx
\brief Provide functions to increase the compatibility with Cg and HLSL languages
<glm/gtx/compatibility.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_component_wise GLM_GTX_component_wise: Component wise
\ingroup gtx
\brief Operations between components of a type
<glm/gtx/component_wise.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_epsilon GLM_GTX_epsilon: Epsilon comparison
\ingroup gtx
\brief Comparison functions for a user defined epsilon values.
<glm/gtx/epsilon.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_euler_angles GLM_GTX_euler_angles: Matrix from euler angles
\ingroup gtx
\brief Build matrices from Euler angles.
<glm/gtx/euler_angles.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_extend GLM_GTX_extend: Position extending
\ingroup gtx
\brief Extend a position from a source to a position at a defined length.
<glm/gtx/extend.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_extented_min_max GLM_GTX_extented_min_max: Extended min max
\ingroup gtx
\brief Min and max functions for 3 to 4 parameters.
<glm/gtx/extented_min_max.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_fast_exponential GLM_GTX_fast_exponential: Fast exponentiation functions
\ingroup gtx
\brief Fast but less accurate implementations of exponential based functions.
<glm/gtx/fast_exponential.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_fast_square_root GLM_GTX_fast_square_root: Fast square root functions
\ingroup gtx
\brief Fast but less accurate implementations of square root based functions.
<glm/gtx/fast_square_root.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_fast_trigonometry GLM_GTX_fast_trigonometry: Fast trigonometric functions
\ingroup gtx
\brief Fast but less accurate implementations of trigonometric functions.
<glm/gtx/fast_trigonometry.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_handed_coordinate_space GLM_GTX_handed_coordinate_space: Space Handedness
\ingroup gtx
\brief To know if a set of three basis vectors defines a right or left-handed coordinate system.
<glm/gtx/handed_coordinate_system.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_inertia GLM_GTX_inertia: Intertial matrix
\ingroup gtx
\brief Create inertia matrices
<glm/gtx/inertia.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_int_10_10_10_2 GLM_GTX_int_10_10_10_2: Packed integer
\ingroup gtx
\brief Pack vector to 1010102 integers. Storage only.
<glm/gtx/int_10_10_10_2.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_integer GLM_GTX_integer: Extended integer functions
\ingroup gtx
\brief Add support for integer for core functions
<glm/gtx/integer.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_intersect GLM_GTX_intersect: Intersection tests
\ingroup gtx
\brief Add intersection functions
<glm/gtx/intersect.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_log_base GLM_GTX_log_base: Log with base
\ingroup gtx
\brief Logarithm for any base. base can be a vector or a scalar.
<glm/gtx/log_base.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_matrix_cross_product GLM_GTX_matrix_cross_product: Cross product matrix form
\ingroup gtx
\brief Build cross product matrices
<glm/gtx/matrix_cross_product.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_matrix_major_storage GLM_GTX_matrix_major_storage: Build matrix
\ingroup gtx
\brief Build matrices with specific matrix order, row or column
<glm/gtx/matrix_major_storage.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_matrix_operation GLM_GTX_matrix_operation: Extended matrix operations
\ingroup gtx
\brief Build diagonal matrices from vectors.
<glm/gtx/matrix_operation.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_matrix_query GLM_GTX_matrix_query: Query matrix properties
\ingroup gtx
\brief Query to evaluate matrix properties
<glm/gtx/matrix_query.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_mixed_product GLM_GTX_mixed_producte: Mixed product
\ingroup gtx
\brief Mixed product of 3 vectors.
<glm/gtx/mixed_product.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_multiple GLM_GTX_multiple: Multiples
\ingroup gtx
\brief Find the closest number of a number multiple of other number.
<glm/gtx/multiple.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_norm GLM_GTX_norm: Vector norm calculations
\ingroup gtx
\brief Various way to compute vector norms.
<glm/gtx/norm.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_normal GLM_GTX_normal: Compute normals
\ingroup gtx
\brief Compute the normal of a triangle.
<glm/gtx/normal.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_normalize_dot GLM_GTX_normalize_dot: Normalize dot product
\ingroup gtx
\brief Dot product of vectors that need to be normalize with a single square root.
<glm/gtx/normalized_dot.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_number_precision GLM_GTX_number_precision: Number precision
\ingroup gtx
\brief Defined size types.
<glm/gtx/number_precision.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_ocl_type GLM_GTX_ocl_type: OpenCL types
\ingroup gtx
\brief OpenCL types.
<glm/gtx/ocl_type.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_optimum_pow GLM_GTX_optimum_pow: Optimum pow
\ingroup gtx
\brief Integer exponentiation of power functions.
<glm/gtx/optimum_pow.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_orthonormalize GLM_GTX_orthonormalize: Orthonormalize
\ingroup gtx
\brief Orthonormalize matrices.
<glm/gtx/orthonormalize.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_perpendicular GLM_GTX_perpendicular: Perpendicular
\ingroup gtx
\brief Perpendicular of a vector from other one
<glm/gtx/perpendicular.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_polar_coordinates GLM_GTX_polar_coordinates: Polar coordinates
\ingroup gtx
\brief Conversion from Euclidean space to polar space and revert.
<glm/gtx/polar_coordinates.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_projection GLM_GTX_projection: Projection
\ingroup gtx
\brief Projection of a vector to other one
<glm/gtx/projection.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_quaternion GLM_GTX_quaternion: Extented quaternion types and functions
\ingroup gtx
\brief Extented quaternion types and functions
<glm/gtx/quaternion.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_random GLM_GTX_random: Random
\ingroup gtx
\brief Generate random number from various distribution methods
<glm/gtx/random.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_raw_data GLM_GTX_raw_data: Raw data
\ingroup gtx
\brief Projection of a vector to other one
<glm/gtx/raw_data.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_reciprocal GLM_GTX_reciprocal: Reciprocal
\ingroup gtx
\brief Define secant, cosecant and cotangent functions.
<glm/gtx/reciprocal.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_rotate_vector GLM_GTX_rotate_vector: Rotate vector
\ingroup gtx
\brief Function to directly rotate a vector
<glm/gtx/rotate_vector.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_simd_mat4 GLM_GTX_simd_mat4: SIMD mat4 type and functions
\ingroup gtx
\brief SIMD implementation of mat4 type.
<glm/gtx/simd_mat4.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_simd_vec4 GLM_GTX_simd_vec4: SIMD vec4 type and functions
\ingroup gtx
\brief SIMD implementation of vec4 type.
<glm/gtx/simd_vec4.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_spline GLM_GTX_spline: Spline
\ingroup gtx
\brief Spline functions
<glm/gtx/spline.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_string_cast GLM_GTX_string_cast: String cast
\ingroup gtx
\brief Setup strings for GLM type values
<glm/gtx/string_cast.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_transform GLM_GTX_transform: Extented transformation matrices
\ingroup gtx
\brief Add transformation matrices
<glm/gtx/transform.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_transform2 GLM_GTX_transform2: Extra transformation matrices
\ingroup gtx
\brief Add extra transformation matrices
<glm/gtx/transform2.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_unsigned_int GLM_GTX_unsigned_int: Unsigned int
\ingroup gtx
\brief Add support for unsigned integer for core functions
<glm/gtx/unsigned_int.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_vector_access GLM_GTX_vector_access: Vector access
\ingroup gtx
\brief Function to set values to vectors
<glm/gtx/vector_access.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_vector_angle GLM_GTX_vector_angle: Vector angle
\ingroup gtx
\brief Compute angle between vectors
<glm/gtx/vector_angle.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_vector_query GLM_GTX_vector_query: Vector query
\ingroup gtx
\brief Query informations of vector types
<glm/gtx/vector_query.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_verbose_operator GLM_GTX_verbose_operator: Verbose operator
\ingroup gtx
\brief Use words to replace operators
<glm/gtx/verbose_operator.hpp> need to be included to use these functionalities.
**/
/*!
\defgroup gtx_wrap GLM_GTX_wrap: Texture coordinate wrap modes
\ingroup gtx
\brief Wrapping mode of texture coordinates.
<glm/gtx/wrap.hpp> need to be included to use these functionalities.
**/

View File

@ -31,7 +31,7 @@ PROJECT_NAME =
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 0.9.2
PROJECT_NUMBER = 0.9.3
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer

View File

@ -311,38 +311,38 @@ void foo()
<dl>
<dt>glRotate[fd]</dt>
<dd>\link glm::gtc::matrix_transform::rotate glm::rotate \endlink</dd>
<dd>\ref rotate()</dd>
<dt>glScale[fd]</dt>
<dd>\link glm::gtc::matrix_transform::scale glm::scale \endlink</dd>
<dd>\ref scale()</dd>
<dt>glTranslate[fd]</dt>
<dd>\link glm::gtc::matrix_transform::translate glm::translate \endlink</dd>
<dd>\ref translate()</dd>
<dt>glLoadIdentity</dt>
<dd>The default constructor of all matrix types creates an identity matrix.</dd>
<dt>glMultMatrix[fd]</dt>
<dd>Per the GLSL specification, the multiplication operator is overloaded for all matrix types. Multiplying two matrices together will perform matrix multiplication.</dd>
<dt>glLoadTransposeMatrix[fd]</dt>
<dd>\link glm::core::function::matrix::transpose glm::transpose \endlink</dd>
<dd>\ref transpose()</dd>
<dt>glMultTransposeMatrix</dt>
<dd>Combine the last two.</dd>
<dt>glFrustum</dt>
<dd>\link glm::gtc::matrix_transform::frustum glm::frustum \endlink</dd>
<dd>\ref frustum()</dd>
<dt>glOrtho</dt>
<dd>\link glm::gtc::matrix_transform::ortho glm::ortho \endlink</dd>
<dd>\ref ortho()</dd>
<dt>gluLookAt</dt>
<dd>\link glm::gtc::matrix_transform::lookAt glm::lookAt \endlink</dd>
<dd>\ref lookAt()</dd>
</dl>
\section deprecated_glu GLU function replacements
<dl>
<dt>gluOrtho2D</dt>
<dd>\link glm::gtc::matrix_transform::ortho glm::ortho \endlink</dd>
<dd>\ref ortho()</dd>
<dt>gluPerspective</dt>
<dd>\link glm::gtc::matrix_transform::perspective glm::perspective \endlink</dd>
<dd>\ref perspective()</dd>
<dt>gluProject</dt>
<dd>\link glm::gtc::matrix_transform::project glm::project \endlink</dd>
<dd>\ref project()</dd>
<dt>gluUnProject</dt>
<dd>\link glm::gtc::matrix_transform::unProject glm::unProject \endlink</dd>
<dd>\ref unProject()</dd>
</dl>
**/
@ -407,7 +407,7 @@ void foo()
\section faq7 Should I use 'using namespace glm;'?
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.
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.
For frequent use of particular types, they can be brough into the global
namespace with a 'using' declaration like this:

View File

@ -1,14 +0,0 @@
/*!
\defgroup virtrev VIRTREV Extensions
\brief Extensions develop and maintain by Mathieu [matrem] Roumillac (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showprofile&User=22660).
**/
/*!
\defgroup virtrev_xstream GLM_VIRTREV_xstream: xml like output
\ingroup virtrev
\brief Streaming vector and matrix in a xml way.
Include <glm/virtrev/xstream.hpp> for this functionality.
**/

View File

@ -1,17 +1,39 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/_detail.hpp
/// @date 2008-07-24 / 2011-06-14
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_detail
#define glm_core_detail
#include "setup.hpp"
#include <cassert>
#if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
#include <cstdint>
#endif
namespace glm{
namespace detail
@ -305,25 +327,26 @@ namespace detail
is_bool = is_bool<T>::_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
#if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005))

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2011-02-21
// Updated : 2011-02-21
// Licence : This source is under MIT License
// File : glm/core/_fixes.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/_fixes.hpp
/// @date 2011-02-21 / 2011-02-16
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
//! Workaround for compatibility with other libraries
#ifdef max

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,33 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2011-01-19
// Updated : 2011-01-19
// Licence : This source is under MIT License
// File : glm/setup.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// GLM is a header only library. There is nothing to compile.
// dummy.cpp exist only a wordaround for CMake file.
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/dummy.cpp
/// @date 2011-01-19 / 2011-06-15
/// @author Christophe Riccio
///
/// GLM is a header only library. There is nothing to compile.
/// dummy.cpp exist only a wordaround for CMake file.
///////////////////////////////////////////////////////////////////////////////////
#include "../glm.hpp"
#include "../ext.hpp"

View File

@ -1,52 +1,74 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-03-08
// Updated : 2010-01-26
// Licence : This source is under MIT License
// File : glm/core/func_common.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_common.hpp
/// @date 2008-03-08 / 2010-01-26
/// @author Christophe Riccio
///
/// @see - <a href="http://www.opengl.org/GLSLangSpec.4.10.6.pdf">GLSL 4.10.6 specification, section 8.2</a>
///
/// @defgroup core_func_common Common functions
/// @ingroup core
///
/// These all operate component-wise. The description is per component.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_common
#define glm_core_func_common
#ifndef GLM_CORE_func_common
#define GLM_CORE_func_common GLM_VERSION
#include "_fixes.hpp"
namespace glm
{
namespace core{
namespace function{
namespace common{ //!< Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace.
/// \addtogroup core_funcs
/// @addtogroup core_func_common
/// @{
//! Returns x if x >= 0; otherwise, it returns -x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
template <typename genFIType>
/// Returns x if x >= 0; otherwise, it returns -x.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genFIType>
genFIType abs(genFIType const & x);
//! Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genFIType>
genFIType sign(genFIType const & x);
//! Returns a value equal to the nearest integer that is less then or equal to x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
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.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType trunc(genType const & x);
@ -56,8 +78,8 @@ namespace glm
//! This includes the possibility that round(x) returns the
//! same value as roundEven(x) for all values of x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType round(genType const & x);
@ -65,31 +87,31 @@ namespace glm
//! 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.)
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType roundEven(genType const & x);
//! Returns a value equal to the nearest integer
//! that is greater than or equal to x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType ceil(genType const & x);
//! Return x - floor(x).
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType fract(genType const & x);
//! Modulus. Returns x - y * floor(x / y)
//! for each component in x using the floating point value y.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType mod(
genType const & x,
@ -98,8 +120,8 @@ namespace glm
//! Modulus. Returns x - y * floor(x / y)
//! for each component in x using the floating point value y.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType mod(
genType const & x,
@ -110,17 +132,17 @@ namespace glm
//! return value and the output parameter will have the same
//! sign as x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType modf(
genType const & x,
genType & i);
//! Returns y if y < x; otherwise, it returns x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// Returns y if y < x; otherwise, it returns x.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType min(
genType const & x,
@ -131,10 +153,10 @@ namespace glm
genType const & x,
typename genType::value_type const & y);
//! Returns y if x < y; otherwise, it returns x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// Returns y if x < y; otherwise, it returns x.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType max(
genType const & x,
@ -148,8 +170,8 @@ namespace glm
//! Returns min(max(x, minVal), maxVal) for each component in x
//! using the floating-point values minVal and maxVal.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType clamp(
genType const & x,
@ -162,12 +184,12 @@ namespace glm
typename genType::value_type const & minVal,
typename genType::value_type const & maxVal);
//! \return If genTypeU is a floating scalar or vector:
//! @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:
//!
//! @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
@ -178,22 +200,39 @@ namespace glm
//! provides different functionality than
//! genType mix(genType x, genType y, genType(a))
//! where a is a Boolean vector.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mix.xml">GLSL mix man page</a>
//! \li 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.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mix.xml">GLSL mix man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
///
/// @param[in] x Value to interpolate.
/// @param[in] y Value to interpolate.
/// @param[in] a Interpolant.
///
/// @tparam genTypeT Floating point scalar or vector.
/// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT.
///
/// @code
/// #include <glm/glm.hpp>
/// ...
/// float a;
/// bool b;
/// glm::dvec3 e;
/// glm::dvec3 f;
/// glm::vec4 g;
/// glm::vec4 h;
/// ...
/// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors.
/// glm::vec4 s = glm::mix(g, h, b); // Teturns g or h;
/// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second.
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
/// @endcode
template <typename genTypeT, typename genTypeU>
genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a);
//! Returns 0.0 if x < edge, otherwise it returns 1.0.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType step(
genType const & edge,
@ -214,8 +253,8 @@ namespace glm
//! return t * t * (3 2 * t);
//! Results are undefined if edge0 >= edge1.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType smoothstep(
genType const & edge0,
@ -234,8 +273,8 @@ namespace glm
//! including for implementations with no NaN
//! representations.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
typename genType::bool_type isnan(genType const & x);
@ -245,8 +284,8 @@ namespace glm
//! otherwise, including for implementations with no infinity
//! representations.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a>
//! \li GLSL 1.30.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
typename genType::bool_type isinf(genType const & x);
@ -254,8 +293,8 @@ namespace glm
//! the encoding of a floating-point value. The floatingpoint
//! value's bit-level representation is preserved.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
//! \li GLSL 4.00.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType, typename genIType>
genIType floatBitsToInt(genType const & value);
@ -263,8 +302,8 @@ namespace glm
//! the encoding of a floating-point value. The floatingpoint
//! value's bit-level representation is preserved.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
//! \li GLSL 4.00.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType, typename genUType>
genUType floatBitsToUint(genType const & value);
@ -274,8 +313,8 @@ namespace glm
//! resulting floating point value is unspecified. Otherwise,
//! the bit-level representation is preserved.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
//! \li GLSL 4.00.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType, typename genIType>
genType intBitsToFloat(genIType const & value);
@ -285,15 +324,15 @@ namespace glm
//! resulting floating point value is unspecified. Otherwise,
//! the bit-level representation is preserved.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
//! \li GLSL 4.00.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType, typename genUType>
genType uintBitsToFloat(genUType const & value);
//! Computes and returns a * b + c.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a>
//! \li GLSL 4.00.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType>
genType fma(genType const & a, genType const & b, genType const & c);
@ -307,8 +346,8 @@ namespace glm
//! are both zero. For a floating-point value that is an
//! infinity or is not a number, the results are undefined.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a>
//! \li GLSL 4.00.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType, typename genIType>
genType frexp(genType const & x, genIType & exp);
@ -319,19 +358,14 @@ namespace glm
//! If this product is too large to be represented in the
//! floating-point type, the result is undefined.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>;
//! \li GLSL 4.00.08 specification, section 8.3
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>;
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType, typename genIType>
genType ldexp(genType const & x, genIType const & exp);
///@}
}//namespace common
}//namespace function
}//namespace core
using namespace core::function::common;
/// @}
}//namespace glm
#include "func_common.inl"
#endif//glm_core_func_common
#endif//GLM_CORE_func_common

View File

@ -1,49 +1,61 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-03
// Updated : 2010-01-26
// Licence : This source is under MIT License
// File : glm/core/func_common.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_common.inl
/// @date 2008-08-03 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
namespace glm{
namespace detail
{
namespace detail
{
template <typename genFIType, bool /*signed*/>
struct Abs_
{
};
template <typename genFIType, bool /*signed*/>
struct Abs_
{};
template <typename genFIType>
struct Abs_<genFIType, true>
{
static genFIType get(genFIType const & x)
{
GLM_STATIC_ASSERT(
detail::type<genFIType>::is_float ||
detail::type<genFIType>::is_int, "'abs' only accept floating-point and integer inputs");
return x >= genFIType(0) ? x : -x;
}
};
template <typename genFIType>
struct Abs_<genFIType, true>
{
static genFIType get(genFIType const & x)
{
GLM_STATIC_ASSERT(
detail::type<genFIType>::is_float ||
detail::type<genFIType>::is_int, "'abs' only accept floating-point and integer inputs");
return x >= genFIType(0) ? x : -x;
}
};
template <typename genFIType>
struct Abs_<genFIType, false>
{
static genFIType get(genFIType const & x)
{
GLM_STATIC_ASSERT(
template <typename genFIType>
struct Abs_<genFIType, false>
{
static genFIType get(genFIType const & x)
{
GLM_STATIC_ASSERT(
detail::type<genFIType>::is_uint, "'abs' only accept floating-point and integer inputs");
return x;
}
};
}//namespace detail
namespace core{
namespace function{
namespace common{
return x;
}
};
}//namespace detail
// abs
template <typename genFIType>
@ -146,7 +158,7 @@ namespace glm
template <>
GLM_FUNC_QUALIFIER detail::thalf floor<detail::thalf>(detail::thalf const& x)
{
return detail::thalf(::std::floor(float(x)));
return detail::thalf(::std::floor(x.toFloat()));
}
template <typename genType>
@ -256,7 +268,7 @@ namespace glm
round(x.z),
round(x.w));
}
/*
// roundEven
template <typename genType>
GLM_FUNC_QUALIFIER genType roundEven(genType const& x)
@ -265,7 +277,22 @@ namespace glm
return genType(int(x + genType(int(x) % 2)));
}
*/
// roundEven
template <typename genType>
GLM_FUNC_QUALIFIER genType roundEven(genType const& x)
{
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'roundEven' only accept floating-point inputs");
genType RoundValue(0.5);
if(fract(x) == genType(0.5) && int(x) % 2)
RoundValue = genType(-0.5);
if(x < genType(0.0))
return genType(int(x - RoundValue));
return genType(int(x + RoundValue));
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<valType> roundEven(detail::tvec2<valType> const& x)
{
@ -735,7 +762,7 @@ namespace glm
//if(x >= maxVal) return maxVal;
//if(x <= minVal) return minVal;
//return x;
return glm::max(glm::min(x, maxVal), minVal);
return max(min(x, maxVal), minVal);
}
template <typename T>
@ -1335,7 +1362,7 @@ namespace glm
floatBitsToInt(value.z));
}
GLM_FUNC_QUALIFIER detail::tvec4<int> floatBitsToInt
GLM_FUNC_QUALIFIER detail::tvec4<int> floatBitsToInt
(
detail::tvec4<float> const & value
)
@ -1404,7 +1431,8 @@ namespace glm
return fi.f;
}
GLM_FUNC_QUALIFIER detail::tvec2<float> intBitsToFloat
GLM_FUNC_QUALIFIER detail::tvec2<float> intBitsToFloat
(
detail::tvec2<int> const & value
)
@ -1414,7 +1442,7 @@ namespace glm
intBitsToFloat(value.y));
}
GLM_FUNC_QUALIFIER detail::tvec3<float> intBitsToFloat
GLM_FUNC_QUALIFIER detail::tvec3<float> intBitsToFloat
(
detail::tvec3<int> const & value
)
@ -1573,7 +1601,4 @@ namespace glm
return std::frexp(x, exp);
}
}//namespace common
}//namespace function
}//namespace core
}//namespace glm

View File

@ -1,84 +1,99 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-08
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/core/func_exponential.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_exponential.hpp
/// @date 2008-08-08 / 2011-06-14
/// @author Christophe Riccio
///
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
///
/// @defgroup core_func_exponential Exponential functions
/// @ingroup core
///
/// These all operate component-wise. The description is per component.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_exponential
#define glm_core_func_exponential
#define glm_core_func_exponential GLM_VERSION
namespace glm
{
namespace core{
namespace function{
//! Define all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace.
namespace exponential{
/// @addtogroup core_func_exponential
/// @{
/// \addtogroup core_funcs
///@{
//! Returns x raised to the y power.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
//! \li GLSL 1.30.08 specification, section 8.2
/// Returns x raised to the y power.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
template <typename genType>
genType pow(genType const & x, genType const & y);
//! Returns the natural exponentiation of x, i.e., e^x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
//! \li GLSL 1.30.08 specification, section 8.2
/// Returns the natural exponentiation of x, i.e., e^x.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
template <typename genType>
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.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
//! \li GLSL 1.30.08 specification, section 8.2
/// 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.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
template <typename genType>
genType log(genType const & x);
//! Returns 2 raised to the x power.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
//! \li GLSL 1.30.08 specification, section 8.2
/// Returns 2 raised to the x power.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
template <typename genType>
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.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
//! \li GLSL 1.30.08 specification, section 8.2
/// Returns the base 2 log of x, i.e., returns the value y,
/// which satisfies the equation x = 2 ^ y.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
template <typename genType>
genType log2(genType const & x);
//! Returns the positive square root of x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
//! \li GLSL 1.30.08 specification, section 8.2
/// Returns the positive square root of x.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
template <typename genType>
genType sqrt(genType const & x);
//! Returns the reciprocal of the positive square root of x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
//! \li GLSL 1.30.08 specification, section 8.2
/// Returns the reciprocal of the positive square root of x.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
template <typename genType>
genType inversesqrt(genType const & x);
///@}
}//namespace exponential
}//namespace function
}//namespace core
using namespace core::function::exponential;
/// @}
}//namespace glm
#include "func_exponential.inl"

View File

@ -1,18 +1,33 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-03
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/core/func_exponential.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_exponential.inl
/// @date 2008-08-03 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
namespace core{
namespace function{
namespace exponential{
// pow
template <typename genType>
GLM_FUNC_QUALIFIER genType pow
@ -276,8 +291,8 @@ namespace glm
)
{
return detail::tvec2<T>(
sqrt(x.x),
sqrt(x.y));
glm::sqrt(x.x),
glm::sqrt(x.y));
}
template <typename T>
@ -287,9 +302,9 @@ namespace glm
)
{
return detail::tvec3<T>(
sqrt(x.x),
sqrt(x.y),
sqrt(x.z));
glm::sqrt(x.x),
glm::sqrt(x.y),
glm::sqrt(x.z));
}
template <typename T>
@ -299,10 +314,10 @@ namespace glm
)
{
return detail::tvec4<T>(
sqrt(x.x),
sqrt(x.y),
sqrt(x.z),
sqrt(x.w));
glm::sqrt(x.x),
glm::sqrt(x.y),
glm::sqrt(x.z),
glm::sqrt(x.w));
}
template <typename genType>
@ -352,7 +367,4 @@ namespace glm
inversesqrt(x.w));
}
}//namespace exponential
}//namespace function
}//namespace core
}//namespace glm

View File

@ -1,106 +1,122 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-03
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/core/func_geometric.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_geometric.hpp
/// @date 2008-08-03 / 2011-06-14
/// @author Christophe Riccio
///
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
///
/// @defgroup core_func_geometric Geometric functions
/// @ingroup core
///
/// These operate on vectors as vectors, not component-wise.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_geometric
#define glm_core_func_geometric
#define glm_core_func_geometric GLM_VERSION
namespace glm
{
namespace core{
namespace function{
namespace geometric{ //!< Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace.
/// @addtogroup core_func_geometric
/// @{
/// \addtogroup core_funcs
///@{
//! Returns the length of x, i.e., sqrt(x * x).
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a>
//! \li GLSL 1.30.08 specification, section 8.4
/// Returns the length of x, i.e., sqrt(x * x).
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType>
typename genType::value_type length(
typename genType::value_type length(
genType const & x);
//! Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a>
//! \li GLSL 1.30.08 specification, section 8.4
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType>
typename genType::value_type distance(
genType const & p0,
genType const & p1);
//! Returns the dot product of x and y, i.e., result = x * y.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
//! \li GLSL 1.30.08 specification, section 8.4
/// Returns the dot product of x and y, i.e., result = x * y.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType>
typename genType::value_type dot(
genType const & x,
genType const & y);
//! Returns the cross product of x and y.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a>
//! \li GLSL 1.30.08 specification, section 8.4
/// Returns the cross product of x and y.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename T>
detail::tvec3<T> cross(
detail::tvec3<T> const & x,
detail::tvec3<T> const & y);
//! Returns a vector in the same direction as x but with length of 1.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/normalize.xml">GLSL normalize man page</a>
//! \li GLSL 1.30.08 specification, section 8.4
/// Returns a vector in the same direction as x but with length of 1.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/normalize.xml">GLSL normalize man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType>
genType normalize(
genType const & x);
//! If dot(Nref, I) < 0.0, return N, otherwise, return -N.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a>
//! \li GLSL 1.30.08 specification, section 8.4
/// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType>
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.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a>
//! \li GLSL 1.30.08 specification, section 8.4
/// For the incident vector I and surface orientation N,
/// returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType>
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.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a>
//! \li GLSL 1.30.08 specification, section 8.4
/// For the incident vector I and surface normal N,
/// and the ratio of indices of refraction eta,
/// return the refraction vector.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType>
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"

View File

@ -1,18 +1,33 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-03
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/core/func_geometric.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_geometric.inl
/// @date 2008-08-03 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
namespace core{
namespace function{
namespace geometric{
// length
template <typename genType>
GLM_FUNC_QUALIFIER genType length
@ -284,7 +299,4 @@ namespace glm
return eta * I - (eta * dotValue + sqrt(k)) * N;
}
}//namespace geometric
}//namespace function
}//namespace core
}//namespace glm

View File

@ -1,155 +1,172 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2010-03-17
// Updated : 2010-03-31
// Licence : This source is under MIT License
// File : glm/core/func_integer.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_integer.hpp
/// @date 2010-03-17 / 2011-06-18
/// @author Christophe Riccio
///
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
///
/// @defgroup core_func_integer Integer functions
/// @ingroup core
///
/// These all operate component-wise. The description is per component.
/// The notation [a, b] means the set of bits from bit-number a through bit-number
/// b, inclusive. The lowest-order bit is bit 0.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_integer
#define glm_core_func_integer
#define glm_core_func_integer GLM_VERSION
namespace glm
{
namespace core{
namespace function{
//! Define integer functions from Section 8.8 of GLSL 4.00.8 specification.
namespace integer{
/// @addtogroup core_func_integer
/// @{
/// \addtogroup core_funcs
///@{
//! Adds 32-bit unsigned integer x and y, returning the sum
//! modulo pow(2, 32). The value carry is set to 0 if the sum was
//! less than pow(2, 32), or to 1 otherwise.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genUType>
genUType uaddCarry(
genUType const & x,
genUType const & y,
genUType & carry);
//! Adds 32-bit unsigned integer x and y, returning the sum
//! modulo pow(2, 32). The value carry is set to 0 if the sum was
//! less than pow(2, 32), or to 1 otherwise.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a>
//! \li GLSL 4.00.08 specification, section 8.8
template <typename genUType>
genUType uaddCarry(
genUType const & x,
genUType const & y,
genUType & carry);
//! Subtracts the 32-bit unsigned integer y from x, returning
//! the difference if non-negative, or pow(2, 32) plus the difference
//! otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a>
//! \li GLSL 4.00.08 specification, section 8.8
template <typename genUType>
genUType usubBorrow(
genUType const & x,
genUType const & y,
genUType & borrow);
//! Subtracts the 32-bit unsigned integer y from x, returning
//! the difference if non-negative, or pow(2, 32) plus the difference
//! otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genUType>
genUType usubBorrow(
genUType const & x,
genUType const & y,
genUType & borrow);
//! Multiplies 32-bit integers x and y, producing a 64-bit
//! result. The 32 least-significant bits are returned in lsb.
//! The 32 most-significant bits are returned in msb.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a>
//! \li GLSL 4.00.08 specification, section 8.8
template <typename genUType>
void umulExtended(
genUType const & x,
genUType const & y,
genUType & msb,
genUType & lsb);
//! Multiplies 32-bit integers x and y, producing a 64-bit
//! result. The 32 least-significant bits are returned in lsb.
//! The 32 most-significant bits are returned in msb.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genUType>
void umulExtended(
genUType const & x,
genUType const & y,
genUType & msb,
genUType & lsb);
//! Multiplies 32-bit integers x and y, producing a 64-bit
//! result. The 32 least-significant bits are returned in lsb.
//! The 32 most-significant bits are returned in msb.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a>
//! \li GLSL 4.00.08 specification, section 8.8
template <typename genIType>
void imulExtended(
genIType const & x,
genIType const & y,
genIType & msb,
genIType & lsb);
//! Multiplies 32-bit integers x and y, producing a 64-bit
//! result. The 32 least-significant bits are returned in lsb.
//! The 32 most-significant bits are returned in msb.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIType>
void imulExtended(
genIType const & x,
genIType const & y,
genIType & msb,
genIType & lsb);
//! Extracts bits [offset, offset + bits - 1] from value,
//! returning them in the least significant bits of the result.
//! For unsigned data types, the most significant bits of the
//! result will be set to zero. For signed data types, the
//! most significant bits will be set to the value of bit offset + base 1.
//!
//! If bits is zero, the result will be zero. The result will be
//! undefined if offset or bits is negative, or if the sum of
//! offset and bits is greater than the number of bits used
//! to store the operand.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a>
//! \li GLSL 4.00.08 specification, section 8.8
template <typename genIUType>
genIUType bitfieldExtract(
genIUType const & Value,
int const & Offset,
int const & Bits);
//! Extracts bits [offset, offset + bits - 1] from value,
//! returning them in the least significant bits of the result.
//! For unsigned data types, the most significant bits of the
//! result will be set to zero. For signed data types, the
//! most significant bits will be set to the value of bit offset + base 1.
//!
//! If bits is zero, the result will be zero. The result will be
//! undefined if offset or bits is negative, or if the sum of
//! offset and bits is greater than the number of bits used
//! to store the operand.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIUType>
genIUType bitfieldExtract(
genIUType const & Value,
int const & Offset,
int const & Bits);
//! Returns the insertion the bits least-significant bits of insert into base.
//!
//! The result will have bits [offset, offset + bits - 1] taken
//! from bits [0, bits 1] of insert, and all other bits taken
//! directly from the corresponding bits of base. If bits is
//! zero, the result will simply be base. The result will be
//! undefined if offset or bits is negative, or if the sum of
//! offset and bits is greater than the number of bits used to
//! store the operand.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a>
//! \li GLSL 4.00.08 specification, section 8.8
template <typename genIUType>
genIUType bitfieldInsert(
genIUType const & Base,
genIUType const & Insert,
int const & Offset,
int const & Bits);
//! Returns the insertion the bits least-significant bits of insert into base.
//!
//! The result will have bits [offset, offset + bits - 1] taken
//! from bits [0, bits 1] of insert, and all other bits taken
//! directly from the corresponding bits of base. If bits is
//! zero, the result will simply be base. The result will be
//! undefined if offset or bits is negative, or if the sum of
//! offset and bits is greater than the number of bits used to
//! store the operand.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIUType>
genIUType bitfieldInsert(
genIUType const & Base,
genIUType const & Insert,
int const & Offset,
int const & Bits);
//! Returns the reversal of the bits of value.
//! The bit numbered n of the result will be taken from bit (bits - 1) - n of value,
//! where bits is the total number of bits used to represent value.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a>
//! \li GLSL 4.00.08 specification, section 8.8
template <typename genIUType>
genIUType bitfieldReverse(genIUType const & value);
//! Returns the reversal of the bits of value.
//! The bit numbered n of the result will be taken from bit (bits - 1) - n of value,
//! where bits is the total number of bits used to represent value.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIUType>
genIUType bitfieldReverse(genIUType const & value);
//! Returns the number of bits set to 1 in the binary representation of value.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
//! \li GLSL 4.00.08 specification, section 8.8
template <typename T, template <typename> class C>
typename C<T>::signed_type bitCount(C<T> const & Value);
//! Returns the number of bits set to 1 in the binary representation of value.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename T, template <typename> class C>
typename C<T>::signed_type bitCount(C<T> const & Value);
//! Returns the bit number of the least significant bit set to
//! 1 in the binary representation of value.
//! If value is zero, -1 will be returned.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
//! \li GLSL 4.00.08 specification, section 8.8
template <typename T, template <typename> class C>
typename C<T>::signed_type findLSB(C<T> const & Value);
//! Returns the bit number of the least significant bit set to
//! 1 in the binary representation of value.
//! If value is zero, -1 will be returned.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename T, template <typename> class C>
typename C<T>::signed_type findLSB(C<T> const & Value);
//! Returns the bit number of the most significant bit in the binary representation of value.
//! For positive integers, the result will be the bit number of the most significant bit set to 1.
//! For negative integers, the result will be the bit number of the most significant
//! bit set to 0. For a value of zero or negative one, -1 will be returned.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
//! \li GLSL 4.00.08 specification, section 8.8
template <typename T, template <typename> class C>
typename C<T>::signed_type findMSB(C<T> const & Value);
//! Returns the bit number of the most significant bit in the binary representation of value.
//! For positive integers, the result will be the bit number of the most significant bit set to 1.
//! For negative integers, the result will be the bit number of the most significant
//! bit set to 0. For a value of zero or negative one, -1 will be returned.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename T, template <typename> class C>
typename C<T>::signed_type findMSB(C<T> const & Value);
///@}
}//namespace integer
}//namespace function
}//namespace core
using namespace core::function::integer;
/// @}
}//namespace glm
#include "func_integer.inl"

File diff suppressed because it is too large Load Diff

View File

@ -1,111 +1,130 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-03
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/core/func_matrix.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_matrix.hpp
/// @date 2008-08-03 / 2011-06-15
/// @author Christophe Riccio
///
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
///
/// @defgroup core_func_matrix Matrix functions
/// @ingroup core
///
/// For each of the following built-in matrix functions, there is both a
/// single-precision floating point version, where all arguments and return values
/// are single precision, and a double-precision floating version, where all
/// arguments and return values are double precision. Only the single-precision
/// floating point version is shown.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_matrix
#define glm_core_func_matrix
#ifndef GLM_CORE_func_matrix
#define GLM_CORE_func_matrix GLM_VERSION
namespace glm
{
namespace core{
namespace function{
//! Define all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace.
namespace matrix{
/// @addtogroup core_func_matrix
/// @{
/// \addtogroup core_funcs
///@{
//! 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].
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a>
//! \li GLSL 1.30.08 specification, section 8.5
/// 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].
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename matType>
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.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a>
//! \li GLSL 1.30.08 specification, section 8.5
/// 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.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename vecType, typename matType>
matType outerProduct(
vecType const & c,
vecType const & r);
//! Returns the transposed matrix of x
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
//! \li GLSL 1.30.08 specification, section 8.5
/// Returns the transposed matrix of x
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename matType>
typename matType::transpose_type transpose(
matType const & x);
//! Return the determinant of a mat2 matrix.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
//! \li GLSL 1.30.08 specification, section 8.5
/// Return the determinant of a mat2 matrix.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T>
typename detail::tmat2x2<T>::value_type determinant(
detail::tmat2x2<T> const & m);
//! Return the determinant of a mat3 matrix.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
//! \li GLSL 1.30.08 specification, section 8.5
/// Return the determinant of a mat3 matrix.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T>
typename detail::tmat3x3<T>::value_type determinant(
detail::tmat3x3<T> const & m);
//! Return the determinant of a mat4 matrix.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
//! \li GLSL 1.30.08 specification, section 8.5
/// Return the determinant of a mat4 matrix.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T>
typename detail::tmat4x4<T>::value_type determinant(
detail::tmat4x4<T> const & m);
//! Return the inverse of a mat2 matrix.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
//! \li GLSL 1.40.07 specification, section 8.5
/// Return the inverse of a mat2 matrix.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T>
detail::tmat2x2<T> inverse(
detail::tmat2x2<T> const & m);
//! Return the inverse of a mat3 matrix.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
//! \li GLSL 1.40.07 specification, section 8.5
/// Return the inverse of a mat3 matrix.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T>
detail::tmat3x3<T> inverse(
detail::tmat3x3<T> const & m);
//! Return the inverse of a mat4 matrix.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
//! \li GLSL 1.40.07 specification, section 8.5
/// Return the inverse of a mat4 matrix.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T>
detail::tmat4x4<T> inverse(
detail::tmat4x4<T> const & m);
///@}
}//namespace matrix
}//namespace function
}//namespace core
using namespace core::function::matrix;
/// @}
}//namespace glm
#include "func_matrix.inl"
#endif//glm_core_func_matrix
#endif//GLM_CORE_func_matrix

View File

@ -1,42 +1,57 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-03-08
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/core/func_matrix.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_matrix.inl
/// @date 2008-03-08 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
namespace core{
namespace function{
namespace matrix{
// matrixCompMult
template <typename matType>
GLM_FUNC_QUALIFIER matType matrixCompMult
// matrixCompMult
template <typename matType>
GLM_FUNC_QUALIFIER matType matrixCompMult
(
matType const & x,
matType const & y
)
{
{
GLM_STATIC_ASSERT(detail::type<typename matType::value_type>::is_float, "'matrixCompMult' only accept floating-point inputs");
matType result(matType::null);
matType result(matType::null);
for(typename matType::size_type i = 0; i < matType::col_size(); ++i)
result[i] = x[i] * y[i];
return result;
}
return result;
}
// outerProduct
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x2<T> outerProduct
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x2<T> outerProduct
(
detail::tvec2<T> const & c,
detail::tvec2<T> const & r
)
{
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'outerProduct' only accept floating-point inputs");
detail::tmat2x2<T> m(detail::tmat2x2<T>::null);
@ -44,40 +59,40 @@ namespace glm
m[0][1] = c[1] * r[0];
m[1][0] = c[0] * r[1];
m[1][1] = c[1] * r[1];
return m;
}
return m;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<T> outerProduct
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<T> outerProduct
(
detail::tvec3<T> const & c,
detail::tvec3<T> const & r
)
{
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'outerProduct' only accept floating-point inputs");
detail::tmat3x3<T> m(detail::tmat3x3<T>::null);
for(typename detail::tmat3x3<T>::size_type i = 0; i < detail::tmat3x3<T>::col_size(); ++i)
m[i] = c * r[i];
return m;
}
return m;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> outerProduct
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> outerProduct
(
detail::tvec4<T> const & c,
detail::tvec4<T> const & r
)
{
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'outerProduct' only accept floating-point inputs");
detail::tmat4x4<T> m(detail::tmat4x4<T>::null);
for(typename detail::tmat4x4<T>::size_type i = 0; i < detail::tmat4x4<T>::col_size(); ++i)
m[i] = c * r[i];
return m;
}
return m;
}
template <typename T>
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x3<T> outerProduct
(
detail::tvec3<T> const & c,
@ -96,7 +111,7 @@ namespace glm
return m;
}
template <typename T>
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x2<T> outerProduct
(
detail::tvec2<T> const & c,
@ -207,113 +222,113 @@ namespace glm
return m;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x2<T> transpose
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x2<T> transpose
(
detail::tmat2x2<T> const & m
)
{
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'transpose' only accept floating-point inputs");
detail::tmat2x2<T> result(detail::tmat2x2<T>::null);
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;
}
detail::tmat2x2<T> result(detail::tmat2x2<T>::null);
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 <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<T> transpose
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<T> transpose
(
detail::tmat3x3<T> const & m
)
{
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'transpose' only accept floating-point inputs");
detail::tmat3x3<T> result(detail::tmat3x3<T>::null);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
result[0][2] = m[2][0];
detail::tmat3x3<T> result(detail::tmat3x3<T>::null);
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[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;
}
result[2][0] = m[0][2];
result[2][1] = m[1][2];
result[2][2] = m[2][2];
return result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> transpose
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> transpose
(
detail::tmat4x4<T> const & m
)
{
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'transpose' only accept floating-point inputs");
detail::tmat4x4<T> result(detail::tmat4x4<T>::null);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
result[0][2] = m[2][0];
result[0][3] = m[3][0];
detail::tmat4x4<T> result(detail::tmat4x4<T>::null);
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[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[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;
}
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 <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x3<T> transpose
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x3<T> transpose
(
detail::tmat3x2<T> const & m
)
{
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'transpose' only accept floating-point inputs");
detail::tmat2x3<T> result(detail::tmat2x3<T>::null);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
detail::tmat2x3<T> result(detail::tmat2x3<T>::null);
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][0] = m[0][1];
result[1][1] = m[1][1];
result[1][2] = m[2][1];
return result;
}
return result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x2<T> transpose
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x2<T> transpose
(
detail::tmat2x3<T> const & m
)
{
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'transpose' only accept floating-point inputs");
detail::tmat3x2<T> result(detail::tmat3x2<T>::null);
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;
}
detail::tmat3x2<T> result(detail::tmat3x2<T>::null);
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 <typename T>
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x4<T> transpose
(
detail::tmat4x2<T> const & m
@ -322,18 +337,18 @@ namespace glm
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'transpose' only accept floating-point inputs");
detail::tmat2x4<T> result(detail::tmat2x4<T>::null);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
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][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 <typename T>
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x2<T> transpose
(
detail::tmat2x4<T> const & m
@ -341,19 +356,19 @@ namespace glm
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'transpose' only accept floating-point inputs");
detail::tmat4x2<T> result(detail::tmat4x2<T>::null);
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;
detail::tmat4x2<T> result(detail::tmat4x2<T>::null);
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 <typename T>
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x4<T> transpose
(
detail::tmat4x3<T> const & m
@ -362,22 +377,22 @@ namespace glm
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'transpose' only accept floating-point inputs");
detail::tmat3x4<T> result(detail::tmat3x4<T>::null);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
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][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][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 <typename T>
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x3<T> transpose
(
detail::tmat3x4<T> const & m
@ -385,20 +400,20 @@ namespace glm
{
GLM_STATIC_ASSERT(detail::type<T>::is_float, "'transpose' only accept floating-point inputs");
detail::tmat4x3<T> result(detail::tmat4x3<T>::null);
result[0][0] = m[0][0];
result[0][1] = m[1][0];
detail::tmat4x3<T> result(detail::tmat4x3<T>::null);
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][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][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][0] = m[0][3];
result[3][1] = m[1][3];
result[3][2] = m[2][3];
return result;
return result;
}
template <typename T>
@ -448,9 +463,9 @@ namespace glm
- (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];
+ m[0][1] * DetCof[1]
+ m[0][2] * DetCof[2]
+ m[0][3] * DetCof[3];
}
template <typename T>
@ -564,8 +579,4 @@ namespace glm
return Inverse;
}
}//namespace matrix
}//namespace function
}//namespace core
}//namespace glm

View File

@ -1,60 +1,77 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_noise.hpp
/// @date 2008-08-01 / 2011-06-18
/// @author Christophe Riccio
///
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a>
///
/// @defgroup core_func_noise Noise functions
/// @ingroup core
///
/// Noise functions are stochastic functions that can be used to increase visual
/// complexity. Values returned by the following noise functions give the
/// appearance of randomness, but are not truly random.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_noise
#define glm_core_func_noise
#define glm_core_func_noise GLM_VERSION
namespace glm
{
namespace core{
namespace function{
// Define all noise functions from Section 8.9 of GLSL 1.30.8 specification. Included in glm namespace.
namespace noise{
/// @addtogroup core_func_noise
/// @{
/// \addtogroup core_funcs
///@{
//! Returns a 1D noise value based on the input value x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a>
//! \li GLSL 1.30.08 specification, section 8.9
/// Returns a 1D noise value based on the input value x.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a>
template <typename genType>
typename genType::value_type noise1(genType const & x);
//! Returns a 2D noise value based on the input value x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a>
//! \li GLSL 1.30.08 specification, section 8.9
/// Returns a 2D noise value based on the input value x.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a>
template <typename genType>
detail::tvec2<typename genType::value_type> noise2(genType const & x);
//! Returns a 3D noise value based on the input value x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a>
//! \li GLSL 1.30.08 specification, section 8.9
/// Returns a 3D noise value based on the input value x.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a>
template <typename genType>
detail::tvec3<typename genType::value_type> noise3(genType const & x);
//! Returns a 4D noise value based on the input value x.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a>
//! \li GLSL 1.30.08 specification, section 8.9
/// Returns a 4D noise value based on the input value x.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a>
template <typename genType>
detail::tvec4<typename genType::value_type> noise4(genType const & x);
///@}
}//namespace noise
}//namespace function
}//namespace core
using namespace core::function::noise;
/// @}
}//namespace glm
#include "func_noise.inl"

View File

@ -1,21 +1,32 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-01
// Updated : 2011-04-14
// Licence : This source is under MIT License
// File : glm/core/func_noise.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_noise.inl
/// @date 2008-08-01 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
namespace core{
namespace function{
namespace noise{
}//namespace noise
}//namespace function
}//namespace core
}//namespace glm

View File

@ -1,132 +1,194 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2010-03-17
// Updated : 2010-03-17
// Licence : This source is under MIT License
// File : glm/core/func_packing.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_packing.hpp
/// @date 2010-03-17 / 2011-06-15
/// @author Christophe Riccio
///
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
///
/// @defgroup core_func_packing Floating-Point Pack and Unpack Functions
/// @ingroup core
///
/// These functions do not operate component-wise, rather as described in each case.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_packing
#define glm_core_func_packing
#ifndef GLM_CORE_func_packing
#define GLM_CORE_func_packing GLM_VERSION
namespace glm
{
namespace core{
namespace function{
//! Define packing functions from section 8.4 floating-point pack and unpack functions of GLSL 4.00.8 specification
namespace packing
{
/// \addtogroup core_funcs
///@{
{
/// @addtogroup core_func_packing
/// @{
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer.
//!
//! The conversion for component c of v to fixed point is done as follows:
//! packUnorm2x16: round(clamp(c, 0, +1) * 65535.0)
//!
//! The first component of the vector will be written to the least significant bits of the output;
//! the last component will be written to the most significant bits.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a>
//! \li GLSL 4.00.08 specification, section 8.4
detail::uint32 packUnorm2x16(detail::tvec2<detail::float32> const & v);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer.
//!
//! The conversion for component c of v to fixed point is done as follows:
//! packUnorm2x16: round(clamp(c, 0, +1) * 65535.0)
//!
//! The first component of the vector will be written to the least significant bits of the output;
//! the last component will be written to the most significant bits.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
detail::uint32 packUnorm2x16(detail::tvec2<detail::float32> const & v);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer.
//!
//! The conversion for component c of v to fixed point is done as follows:
//! packSnorm2x16: round(clamp(v, -1, +1) * 32767.0)
//!
//! The first component of the vector will be written to the least significant bits of the output;
//! the last component will be written to the most significant bits.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm2x16.xml">GLSL packSnorm2x16 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
detail::uint32 packSnorm2x16(detail::tvec2<detail::float32> const & v);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer.
//!
//! The conversion for component c of v to fixed point is done as follows:
//! packUnorm4x8: round(clamp(c, 0, +1) * 255.0)
//!
//! The first component of the vector will be written to the least significant bits of the output;
//! the last component will be written to the most significant bits.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
detail::uint32 packUnorm4x8(detail::tvec4<detail::float32> const & v);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer.
//!
//! The conversion for component c of v to fixed point is done as follows:
//! packUnorm4x8: round(clamp(c, 0, +1) * 255.0)
//!
//! The first component of the vector will be written to the least significant bits of the output;
//! the last component will be written to the most significant bits.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
//! \li GLSL 4.00.08 specification, section 8.4
detail::uint32 packUnorm4x8(detail::tvec4<detail::float32> const & v);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer.
//!
//! The conversion for component c of v to fixed point is done as follows:
//! packSnorm4x8: round(clamp(c, -1, +1) * 127.0)
//!
//! The first component of the vector will be written to the least significant bits of the output;
//! the last component will be written to the most significant bits.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
detail::uint32 packSnorm4x8(detail::tvec4<detail::float32> const & v);
//! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
//! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
//!
//! The conversion for unpacked fixed-point value f to floating point is done as follows:
//! unpackUnorm2x16: f / 65535.0
//!
//! The first component of the returned vector will be extracted from the least significant bits of the input;
//! the last component will be extracted from the most significant bits.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
detail::tvec2<detail::float32> unpackUnorm2x16(detail::uint32 const & p);
//! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
//! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
//!
//! The conversion for unpacked fixed-point value f to floating point is done as follows:
//! unpackSnorm2x16: clamp(f / 32767.0, -1, +1)
//!
//! The first component of the returned vector will be extracted from the least significant bits of the input;
//! the last component will be extracted from the most significant bits.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm2x16 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
detail::tvec2<detail::float32> unpackSnorm2x16(detail::uint32 const & p);
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackUnorm4x8: f / 255.0
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
detail::tvec4<detail::float32> unpackUnorm4x8(detail::uint32 const & p);
//! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
//! Then, the results are packed into the returned 32-bit unsigned integer.
//!
//! The conversion for component c of v to fixed point is done as follows:
//! packSnorm4x8: round(clamp(c, -1, +1) * 127.0)
//!
//! The first component of the vector will be written to the least significant bits of the output;
//! the last component will be written to the most significant bits.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
//! \li GLSL 4.00.08 specification, section 8.4
detail::uint32 packSnorm4x8(detail::tvec4<detail::float32> const & v);
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackSnorm4x8: clamp(f / 127.0, -1, +1)
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
detail::tvec4<detail::float32> unpackSnorm4x8(detail::uint32 const & p);
//! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
//! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
//!
//! The conversion for unpacked fixed-point value f to floating point is done as follows:
//! unpackUnorm2x16: f / 65535.0
//!
//! The first component of the returned vector will be extracted from the least significant bits of the input;
//! the last component will be extracted from the most significant bits.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a>
//! \li GLSL 4.00.08 specification, section 8.4
detail::tvec2<detail::float32> unpackUnorm2x16(detail::uint32 const & p);
//! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
//! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
//!
//! The conversion for unpacked fixed-point value f to floating point is done as follows:
//! unpackUnorm4x8: f / 255.0
//!
//! The first component of the returned vector will be extracted from the least significant bits of the input;
//! the last component will be extracted from the most significant bits.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a>
//! \li GLSL 4.00.08 specification, section 8.4
detail::tvec4<detail::float32> unpackUnorm4x8(detail::uint32 const & p);
/// Returns a double-precision value obtained by packing the components of v into a 64-bit value.
/// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified.
/// Otherwise, the bit- level representation of v is preserved.
/// The first vector component specifies the 32 least significant bits;
/// the second component specifies the 32 most significant bits.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
double packDouble2x32(detail::tvec2<detail::uint32> const & v);
//! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
//! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
//!
//! The conversion for unpacked fixed-point value f to floating point is done as follows:
//! unpackSnorm4x8: clamp(f / 127.0, -1, +1)
//!
//! The first component of the returned vector will be extracted from the least significant bits of the input;
//! the last component will be extracted from the most significant bits.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a>
//! \li GLSL 4.00.08 specification, section 8.4
detail::tvec4<detail::float32> unpackSnorm4x8(detail::uint32 const & p);
/// Returns a two-component unsigned integer vector representation of v.
/// The bit-level representation of v is preserved.
/// The first component of the vector contains the 32 least significant bits of the double;
/// the second component consists the 32 most significant bits.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
detail::tvec2<detail::uint32> unpackDouble2x32(double const & v);
//! Returns a double-precision value obtained by packing the components of v into a 64-bit value.
//! If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified.
//! Otherwise, the bit- level representation of v is preserved.
//! The first vector component specifies the 32 least significant bits;
//! the second component specifies the 32 most significant bits.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a>
//! \li GLSL 4.00.08 specification, section 8.4
double packDouble2x32(detail::tvec2<detail::uint32> const & v);
//! Returns a two-component unsigned integer vector representation of v.
//! The bit-level representation of v is preserved.
//! The first component of the vector contains the 32 least significant bits of the double;
//! the second component consists the 32 most significant bits.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a>
//! \li GLSL 4.00.08 specification, section 8.4
detail::tvec2<detail::uint32> unpackDouble2x32(double const & v);
///@}
}//namespace packing
}//namespace function
}//namespace core
using namespace core::function::packing;
/// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector
/// to the 16-bit floating-point representation found in the OpenGL Specification,
/// and then packing these two 16- bit integers into a 32-bit unsigned integer.
/// The first vector component specifies the 16 least-significant bits of the result;
/// the second component specifies the 16 most-significant bits.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
uint packHalf2x16(vec2 const & v);
/// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values,
/// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification,
/// and converting them to 32-bit floating-point values.
/// The first component of the vector is obtained from the 16 least-significant bits of v;
/// the second component is obtained from the 16 most-significant bits of v.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4</a>
vec2 unpackHalf2x16(uint const & v);
/// @}
}//namespace glm
#include "func_packing.inl"
#endif//glm_core_func_packing
#endif//GLM_CORE_func_packing

View File

@ -1,16 +1,32 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2010-03-17
// Updated : 2010-03-17
// Licence : This source is under MIT License
// File : glm/core/func_packing.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_packing.inl
/// @date 2010-03-17 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace core{
namespace function{
namespace packing{
GLM_FUNC_QUALIFIER detail::uint32 packUnorm2x16(detail::tvec2<detail::float32> const & v)
{
@ -140,7 +156,4 @@ GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint const & v)
return vec2(detail::toFloat32(Unpack.x), detail::toFloat32(Unpack.y));
}
}//namespace packing
}//namespace function
}//namespace core
}//namespace glm

View File

@ -1,61 +1,84 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_trigonometric.hpp
/// @date 2008-08-01 / 2011-06-15
/// @author Christophe Riccio
///
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
///
/// @defgroup core_func_trigonometric Angle and Trigonometry Functions
/// @ingroup core
///
/// Function parameters specified as angle are assumed to be in units of radians.
/// In no case will any of these functions result in a divide by zero error. If
/// the divisor of a ratio is 0, then results will be undefined.
///
/// These all operate component-wise. The description is per component.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_trigonometric
#define glm_core_func_trigonometric
#ifndef GLM_CORE_func_trigonometric
#define GLM_CORE_func_trigonometric GLM_VERSION
namespace glm
{
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{
/// \addtogroup core_funcs
///@{
/// @addtogroup core_func_trigonometric
/// @{
//! Converts degrees to radians and returns the result.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType radians(genType const & degrees);
//! Converts radians to degrees and returns the result.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType degrees(genType const & radians);
//! The standard trigonometric sine function.
//! The values returned by this function will range from [-1, 1].
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sin.xml">GLSL sin man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sin.xml">GLSL sin man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType sin(genType const & angle);
//! The standard trigonometric cosine function.
//! The values returned by this function will range from [-1, 1].
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cos.xml">GLSL cos man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cos.xml">GLSL cos man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType cos(genType const & angle);
//! The standard trigonometric tangent function.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tan.xml">GLSL tan man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tan.xml">GLSL tan man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType tan(genType const & angle);
@ -63,8 +86,8 @@ namespace glm
//! The range of values returned by this function is [-PI/2, PI/2].
//! Results are undefined if |x| > 1.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asin.xml">GLSL asin man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asin.xml">GLSL asin man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType asin(genType const & x);
@ -72,8 +95,8 @@ namespace glm
//! The range of values returned by this function is [0, PI].
//! Results are undefined if |x| > 1.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acos.xml">GLSL acos man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acos.xml">GLSL acos man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType acos(genType const & x);
@ -83,74 +106,68 @@ namespace glm
//! by this function is [-PI, PI]. Results are undefined
//! if x and y are both 0.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
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].
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType atan(genType const & y_over_x);
//! Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sinh.xml">GLSL sinh man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sinh.xml">GLSL sinh man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType sinh(genType const & angle);
//! Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cosh.xml">GLSL cosh man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cosh.xml">GLSL cosh man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType cosh(genType const & angle);
//! Returns the hyperbolic tangent function, sinh(angle) / cosh(angle)
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tanh.xml">GLSL tanh man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tanh.xml">GLSL tanh man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType tanh(genType const & angle);
//! Arc hyperbolic sine; returns the inverse of sinh.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asinh.xml">GLSL asinh man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asinh.xml">GLSL asinh man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType asinh(genType const & x);
//! Arc hyperbolic cosine; returns the non-negative inverse
//! of cosh. Results are undefined if x < 1.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acosh.xml">GLSL acosh man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acosh.xml">GLSL acosh man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
genType acosh(genType const & x);
//! Arc hyperbolic tangent; returns the inverse of tanh.
//! Results are undefined if abs(x) >= 1.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atanh.xml">GLSL atanh man page</a>
//! \li GLSL 1.30.08 specification, section 8.1
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atanh.xml">GLSL atanh man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType>
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
#endif//GLM_CORE_func_trigonometric

File diff suppressed because it is too large Load Diff

View File

@ -1,215 +1,120 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_vector_relational.hpp
/// @date 2008-08-03 / 2011-06-15
/// @author Christophe Riccio
///
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.10.6.pdf">GLSL 4.10.6 specification, section 8.7</a>
///
/// @defgroup core_func_vector_relational Vector Relational Functions
/// @ingroup core
///
/// Relational and equality operators (<, <=, >, >=, ==, !=) are defined to
/// operate on scalars and produce scalar Boolean results. For vector results,
/// use the following built-in functions.
///
/// In all cases, the sizes of all the input and return vectors for any particular
/// call must match.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_func_vector_relational
#define glm_core_func_vector_relational
#ifndef GLM_CORE_func_vector_relational
#define GLM_CORE_func_vector_relational GLM_VERSION
#include "_detail.hpp"
namespace glm
{
namespace core{
namespace function{
//! Define vector relational functions from Section 8.6 of GLSL 1.30.8 specification.
//! Included in glm namespace.
namespace vector_relational
{
/// \addtogroup core_funcs
///@{
/// @addtogroup core_func_vector_relational
/// @{
//! Returns the component-wise comparison result of x < y.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a>
//! \li GLSL 1.30.08 specification, section 8.6
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type lessThan
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'lessThan', GLM vector types required");
GLM_STATIC_ASSERT(detail::is_bool<T>::_NO,
"Invalid template instantiation of 'lessThan', GLM vector types required floating-point or integer value types vectors");
//! Returns the component-wise comparison result of x < y.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
//template <typename T, template <typename> class vecType>
//GLM_FUNC_QUALIFIER typename vecType<T>::bool_type lessThan(vecType<T> const & x, vecType<T> const & y);
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] < y[i];
//! Returns the component-wise comparison of result x <= y.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type lessThanEqual(vecType<T> const & x, vecType<T> const & y);
return Result;
}
//! Returns the component-wise comparison of result x > y.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type greaterThan(vecType<T> const & x, vecType<T> const & y);
//! Returns the component-wise comparison of result x <= y.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a>
//! \li GLSL 1.30.08 specification, section 8.6
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type lessThanEqual
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'lessThanEqual', GLM vector types required");
GLM_STATIC_ASSERT(detail::is_bool<T>::_NO,
"Invalid template instantiation of 'lessThanEqual', GLM vector types required floating-point or integer value types vectors");
//! Returns the component-wise comparison of result x >= y.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <typename T, template <typename> class vecType>
typename vecType<T>::bool_type greaterThanEqual(vecType<T> const & x, vecType<T> const & y);
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] <= y[i];
return Result;
}
//! Returns the component-wise comparison of result x == y.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
//template <typename T, template <typename> class vecType>
//GLM_FUNC_QUALIFIER typename vecType<T>::bool_type equal(vecType<T> const & x, vecType<T> const & y);
//! Returns the component-wise comparison of result x > y.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a>
//! \li GLSL 1.30.08 specification, section 8.6
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type greaterThan
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'greaterThan', GLM vector types required");
GLM_STATIC_ASSERT(detail::is_bool<T>::_NO,
"Invalid template instantiation of 'greaterThan', GLM vector types required floating-point or integer value types vectors");
//! Returns the component-wise comparison of result x != y.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <typename T, template <typename> class vecType>
typename vecType<T>::bool_type notEqual(vecType<T> const & x, vecType<T> const & y);
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] > y[i];
return Result;
}
//! Returns true if any component of x is true.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <template <typename> class vecType>
bool any(vecType<bool> const & v);
//! Returns the component-wise comparison of result x >= y.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a>
//! \li GLSL 1.30.08 specification, section 8.6
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type greaterThanEqual
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'greaterThanEqual', GLM vector types required");
GLM_STATIC_ASSERT(detail::is_bool<T>::_NO,
"Invalid template instantiation of 'greaterThanEqual', GLM vector types required floating-point or integer value types vectors");
//! Returns true if all components of x are true.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <template <typename> class vecType>
bool all(vecType<bool> const & v);
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] >= y[i];
return Result;
}
//! Returns the component-wise logical complement of x.
//! /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead.
//!
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <template <typename> class vecType>
vecType<bool> not_(vecType<bool> const & v);
//! Returns the component-wise comparison of result x == y.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a>
//! \li GLSL 1.30.08 specification, section 8.6
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type equal
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'equal', GLM vector types required");
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] == y[i];
return Result;
}
//! Returns the component-wise comparison of result x != y.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a>
//! \li GLSL 1.30.08 specification, section 8.6
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type notEqual
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'notEqual', GLM vector types required");
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] != y[i];
return Result;
}
//! Returns true if any component of x is true.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a>
//! \li GLSL 1.30.08 specification, section 8.6
template <template <typename> class vecType>
GLM_FUNC_QUALIFIER bool any(vecType<bool> const & v)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<bool> >::_YES,
"Invalid template instantiation of 'any', GLM boolean vector types required");
bool Result = false;
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result = Result || v[i];
return Result;
}
//! Returns true if all components of x are true.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a>
//! \li GLSL 1.30.08 specification, section 8.6
template <template <typename> class vecType>
GLM_FUNC_QUALIFIER bool all(vecType<bool> const & v)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<bool> >::_YES,
"Invalid template instantiation of 'all', GLM boolean vector types required");
bool Result = true;
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result = Result && v[i];
return Result;
}
//! Returns the component-wise logical complement of x.
//! /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead.
//!
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a>
//! \li GLSL 1.30.08 specification, section 8.6
template <template <typename> class vecType>
GLM_FUNC_QUALIFIER vecType<bool> not_(vecType<bool> const & v)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<bool> >::_YES,
"Invalid template instantiation of 'not_', GLM vector types required");
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = !v[i];
return Result;
}
///@}
}//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
#endif//GLM_CORE_func_vector_relational

View File

@ -1,20 +1,172 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/func_vector_relational.inl
/// @date 2008-08-03 / 2011-09-09
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
namespace core{
namespace function{
namespace vector_relational{
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type lessThan
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'lessThan', GLM vector types required");
GLM_STATIC_ASSERT(detail::is_bool<T>::_NO,
"Invalid template instantiation of 'lessThan', GLM vector types required floating-point or integer value types vectors");
}//namespace vector_relational
}//namespace function
}//namespace core
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] < y[i];
return Result;
}
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type lessThanEqual
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'lessThanEqual', GLM vector types required");
GLM_STATIC_ASSERT(detail::is_bool<T>::_NO,
"Invalid template instantiation of 'lessThanEqual', GLM vector types required floating-point or integer value types vectors");
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] <= y[i];
return Result;
}
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type greaterThan
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'greaterThan', GLM vector types required");
GLM_STATIC_ASSERT(detail::is_bool<T>::_NO,
"Invalid template instantiation of 'greaterThan', GLM vector types required floating-point or integer value types vectors");
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] > y[i];
return Result;
}
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type greaterThanEqual
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'greaterThanEqual', GLM vector types required");
GLM_STATIC_ASSERT(detail::is_bool<T>::_NO,
"Invalid template instantiation of 'greaterThanEqual', GLM vector types required floating-point or integer value types vectors");
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] >= y[i];
return Result;
}
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type equal
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'equal', GLM vector types required");
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] == y[i];
return Result;
}
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type notEqual
(
vecType<T> const & x,
vecType<T> const & y
)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'notEqual', GLM vector types required");
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] != y[i];
return Result;
}
template <template <typename> class vecType>
GLM_FUNC_QUALIFIER bool any(vecType<bool> const & v)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<bool> >::_YES,
"Invalid template instantiation of 'any', GLM boolean vector types required");
bool Result = false;
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result = Result || v[i];
return Result;
}
template <template <typename> class vecType>
GLM_FUNC_QUALIFIER bool all(vecType<bool> const & v)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<bool> >::_YES,
"Invalid template instantiation of 'all', GLM boolean vector types required");
bool Result = true;
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result = Result && v[i];
return Result;
}
template <template <typename> class vecType>
GLM_FUNC_QUALIFIER vecType<bool> not_(vecType<bool> const & v)
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<bool> >::_YES,
"Invalid template instantiation of 'not_', GLM vector types required");
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = !v[i];
return Result;
}
}//namespace glm

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/hint.hpp
/// @date 2008-08-14 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type
#define glm_core_type
@ -16,6 +35,6 @@ namespace glm
class dont_care {};
class nicest {};
class fastest {};
};
}//namespace glm
#endif//glm_core_type

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_common.hpp
/// @date 2009-05-11 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_detail_intrinsic_common
#define glm_detail_intrinsic_common

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_common.inl
/// @date 2009-05-08 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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_exponential.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_exponential.hpp
/// @date 2009-05-11 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_detail_intrinsic_exponential
#define glm_detail_intrinsic_exponential

View File

@ -0,0 +1,27 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_exponential.inl
/// @date 2011-06-15 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_geometric.hpp
/// @date 2009-05-08 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_intrinsic_geometric
#define glm_core_intrinsic_geometric

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_geometric.inl
/// @date 2009-05-08 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_common.hpp
/// @date 2009-06-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_detail_intrinsic_matrix
#define glm_detail_intrinsic_matrix

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_common.inl
/// @date 2009-06-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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_trigonometric.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_trigonometric.hpp
/// @date 2009-06-09 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_detail_intrinsic_trigonometric
#define glm_detail_intrinsic_trigonometric

View File

@ -0,0 +1,27 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_trigonometric.inl
/// @date 2011-06-15 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_vector_relational.hpp
/// @date 2009-06-09 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_detail_intrinsic_vector_relational
#define glm_detail_intrinsic_vector_relational

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_vector_relational.inl
/// @date 2009-06-09 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
//
//// lessThan
//template <typename valType>

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-11-13
// Updated : 2011-01-26
// Licence : This source is under MIT License
// File : glm/setup.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/setup.hpp
/// @date 2006-11-13 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_setup
#define glm_setup
@ -13,11 +32,11 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// Version
#define GLM_VERSION 92
#define GLM_VERSION 93
#define GLM_VERSION_MAJOR 0
#define GLM_VERSION_MINOR 9
#define GLM_VERSION_PATCH 2
#define GLM_VERSION_REVISION 3
#define GLM_VERSION_PATCH 3
#define GLM_VERSION_REVISION 0
///////////////////////////////////////////////////////////////////////////////////////////////////
// Compiler
@ -104,6 +123,21 @@
// CUDA
#elif defined(__CUDACC__)
# define GLM_COMPILER GLM_COMPILER_CUDA
/*
# if CUDA_VERSION < 3000
# error "GLM requires CUDA 3.0 or higher"
# elif CUDA_VERSION == 3000
# define GLM_COMPILER GLM_COMPILER_CUDA30
# elif CUDA_VERSION == 3010
# define GLM_COMPILER GLM_COMPILER_CUDA31
# elif CUDA_VERSION == 3020
# define GLM_COMPILER GLM_COMPILER_CUDA32
# elif CUDA_VERSION == 4000
# define GLM_COMPILER GLM_COMPILER_CUDA40
# else
# define GLM_COMPILER GLM_COMPILER_CUDA
# endif
*/
// Visual C++
#elif defined(_MSC_VER)
@ -132,7 +166,7 @@
# endif//_MSC_VER
// G++
#elif defined(__GNUC__) || defined(__llvm__) || defined(__clang__)
#elif defined(__GNUC__)// || defined(__llvm__) || defined(__clang__)
# if defined (__llvm__)
# define GLM_COMPILER_GCC_EXTRA GLM_COMPILER_GCC_LLVM
# elif defined (__clang__)
@ -247,7 +281,13 @@
#else
# define GLM_MODEL GLM_MODEL_32
#endif//
/*
#if(sizeof(void*) == 8)
# define GLM_MODEL GLM_MODEL_64
#else
# define GLM_MODEL GLM_MODEL_32
#endif//_M_X64
*/
#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

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type.hpp
/// @date 2008-01-08 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type
#define glm_core_type
@ -31,112 +50,110 @@
#include "type_mat4x3.hpp"
#include "type_mat4x4.hpp"
namespace glm{
namespace core{
namespace type
namespace glm
{
//////////////////////////
// Float definition
#if(defined(GLM_PRECISION_HIGHP_FLOAT))
typedef precision::highp_vec2 vec2;
typedef precision::highp_vec3 vec3;
typedef precision::highp_vec4 vec4;
typedef precision::highp_mat2x2 mat2x2;
typedef precision::highp_mat2x3 mat2x3;
typedef precision::highp_mat2x4 mat2x4;
typedef precision::highp_mat3x2 mat3x2;
typedef precision::highp_mat3x3 mat3x3;
typedef precision::highp_mat3x4 mat3x4;
typedef precision::highp_mat4x2 mat4x2;
typedef precision::highp_mat4x3 mat4x3;
typedef precision::highp_mat4x4 mat4x4;
typedef highp_vec2 vec2;
typedef highp_vec3 vec3;
typedef highp_vec4 vec4;
typedef highp_mat2x2 mat2x2;
typedef highp_mat2x3 mat2x3;
typedef highp_mat2x4 mat2x4;
typedef highp_mat3x2 mat3x2;
typedef highp_mat3x3 mat3x3;
typedef highp_mat3x4 mat3x4;
typedef highp_mat4x2 mat4x2;
typedef highp_mat4x3 mat4x3;
typedef highp_mat4x4 mat4x4;
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
typedef precision::mediump_vec2 vec2;
typedef precision::mediump_vec3 vec3;
typedef precision::mediump_vec4 vec4;
typedef precision::mediump_mat2x2 mat2x2;
typedef precision::mediump_mat2x3 mat2x3;
typedef precision::mediump_mat2x4 mat2x4;
typedef precision::mediump_mat3x2 mat3x2;
typedef precision::mediump_mat3x3 mat3x3;
typedef precision::mediump_mat3x4 mat3x4;
typedef precision::mediump_mat4x2 mat4x2;
typedef precision::mediump_mat4x3 mat4x3;
typedef precision::mediump_mat4x4 mat4x4;
typedef mediump_vec2 vec2;
typedef mediump_vec3 vec3;
typedef mediump_vec4 vec4;
typedef mediump_mat2x2 mat2x2;
typedef mediump_mat2x3 mat2x3;
typedef mediump_mat2x4 mat2x4;
typedef mediump_mat3x2 mat3x2;
typedef mediump_mat3x3 mat3x3;
typedef mediump_mat3x4 mat3x4;
typedef mediump_mat4x2 mat4x2;
typedef mediump_mat4x3 mat4x3;
typedef mediump_mat4x4 mat4x4;
#elif(defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::lowp_vec2 vec2;
typedef precision::lowp_vec3 vec3;
typedef precision::lowp_vec4 vec4;
typedef precision::lowp_mat2x2 mat2x2;
typedef precision::lowp_mat2x3 mat2x3;
typedef precision::lowp_mat2x4 mat2x4;
typedef precision::lowp_mat3x2 mat3x2;
typedef precision::lowp_mat3x3 mat3x3;
typedef precision::lowp_mat3x4 mat3x4;
typedef precision::lowp_mat4x2 mat4x2;
typedef precision::lowp_mat4x3 mat4x3;
typedef precision::lowp_mat4x4 mat4x4;
typedef lowp_vec2 vec2;
typedef lowp_vec3 vec3;
typedef lowp_vec4 vec4;
typedef lowp_mat2x2 mat2x2;
typedef lowp_mat2x3 mat2x3;
typedef lowp_mat2x4 mat2x4;
typedef lowp_mat3x2 mat3x2;
typedef lowp_mat3x3 mat3x3;
typedef lowp_mat3x4 mat3x4;
typedef lowp_mat4x2 mat4x2;
typedef lowp_mat4x3 mat4x3;
typedef lowp_mat4x4 mat4x4;
#else
//! 2 components vector of floating-point numbers.
//! From GLSL 1.30.8 specification, section 4.1.5 Vectors.
//! \ingroup core_types
typedef precision::mediump_vec2 vec2;
typedef mediump_vec2 vec2;
//! 3 components vector of floating-point numbers.
//! From GLSL 1.30.8 specification, section 4.1.5 Vectors.
//! \ingroup core_types
typedef precision::mediump_vec3 vec3;
typedef mediump_vec3 vec3;
//! 4 components vector of floating-point numbers.
//! From GLSL 1.30.8 specification, section 4.1.5 Vectors.
//! \ingroup core_types
typedef precision::mediump_vec4 vec4;
typedef mediump_vec4 vec4;
//! 2 columns of 2 components matrix of floating-point numbers.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)
//! \ingroup core_types
typedef precision::mediump_mat2x2 mat2x2;
typedef mediump_mat2x2 mat2x2;
//! 2 columns of 3 components matrix of floating-point numbers.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)
//! \ingroup core_types
typedef precision::mediump_mat2x3 mat2x3;
typedef mediump_mat2x3 mat2x3;
//! 2 columns of 4 components matrix of floating-point numbers.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)
//! \ingroup core_types
typedef precision::mediump_mat2x4 mat2x4;
typedef mediump_mat2x4 mat2x4;
//! 3 columns of 2 components matrix of floating-point numbers.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)
//! \ingroup core_types
typedef precision::mediump_mat3x2 mat3x2;
typedef mediump_mat3x2 mat3x2;
//! 3 columns of 3 components matrix of floating-point numbers.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)
//! \ingroup core_types
typedef precision::mediump_mat3x3 mat3x3;
typedef mediump_mat3x3 mat3x3;
//! 3 columns of 4 components matrix of floating-point numbers.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)
//! \ingroup core_types
typedef precision::mediump_mat3x4 mat3x4;
typedef mediump_mat3x4 mat3x4;
//! 4 columns of 2 components matrix of floating-point numbers.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)
//! \ingroup core_types
typedef precision::mediump_mat4x2 mat4x2;
typedef mediump_mat4x2 mat4x2;
//! 4 columns of 3 components matrix of floating-point numbers.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)
//! \ingroup core_types
typedef precision::mediump_mat4x3 mat4x3;
typedef mediump_mat4x3 mat4x3;
//! 4 columns of 4 components matrix of floating-point numbers.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)
//! \ingroup core_types
typedef precision::mediump_mat4x4 mat4x4;
typedef mediump_mat4x4 mat4x4;
#endif//GLM_PRECISION
@ -159,64 +176,64 @@ namespace type
// Signed integer definition
#if(defined(GLM_PRECISION_HIGHP_INT))
typedef precision::highp_ivec2 ivec2;
typedef precision::highp_ivec3 ivec3;
typedef precision::highp_ivec4 ivec4;
typedef highp_ivec2 ivec2;
typedef highp_ivec3 ivec3;
typedef highp_ivec4 ivec4;
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef precision::mediump_ivec2 ivec2;
typedef precision::mediump_ivec3 ivec3;
typedef precision::mediump_ivec4 ivec4;
typedef mediump_ivec2 ivec2;
typedef mediump_ivec3 ivec3;
typedef mediump_ivec4 ivec4;
#elif(defined(GLM_PRECISION_LOWP_INT))
typedef precision::lowp_ivec2 ivec2;
typedef precision::lowp_ivec3 ivec3;
typedef precision::lowp_ivec4 ivec4;
typedef lowp_ivec2 ivec2;
typedef lowp_ivec3 ivec3;
typedef lowp_ivec4 ivec4;
#else
//! 2 components vector of signed integer numbers.
//! From GLSL 1.30.8 specification, section 4.1.5 Vectors.
//! \ingroup core_types
typedef precision::mediump_ivec2 ivec2;
typedef mediump_ivec2 ivec2;
//! 3 components vector of signed integer numbers.
//! From GLSL 1.30.8 specification, section 4.1.5 Vectors.
//! \ingroup core_types
typedef precision::mediump_ivec3 ivec3;
typedef mediump_ivec3 ivec3;
//! 4 components vector of signed integer numbers.
//! From GLSL 1.30.8 specification, section 4.1.5 Vectors.
//! \ingroup core_types
typedef precision::mediump_ivec4 ivec4;
typedef mediump_ivec4 ivec4;
#endif//GLM_PRECISION
//////////////////////////
// Unsigned integer definition
#if(defined(GLM_PRECISION_HIGHP_UINT))
typedef precision::highp_uvec2 uvec2;
typedef precision::highp_uvec3 uvec3;
typedef precision::highp_uvec4 uvec4;
typedef highp_uvec2 uvec2;
typedef highp_uvec3 uvec3;
typedef highp_uvec4 uvec4;
#elif(defined(GLM_PRECISION_MEDIUMP_UINT))
typedef precision::mediump_uvec2 uvec2;
typedef precision::mediump_uvec3 uvec3;
typedef precision::mediump_uvec4 uvec4;
typedef mediump_uvec2 uvec2;
typedef mediump_uvec3 uvec3;
typedef mediump_uvec4 uvec4;
#elif(defined(GLM_PRECISION_LOWP_UINT))
typedef precision::lowp_uvec2 uvec2;
typedef precision::lowp_uvec3 uvec3;
typedef precision::lowp_uvec4 uvec4;
typedef lowp_uvec2 uvec2;
typedef lowp_uvec3 uvec3;
typedef lowp_uvec4 uvec4;
#else
//! 2 components vector of unsigned integer numbers.
//! From GLSL 1.30.8 specification, section 4.1.5 Vectors.
//! \ingroup core_types
typedef precision::mediump_uvec2 uvec2;
typedef mediump_uvec2 uvec2;
//! 3 components vector of unsigned integer numbers.
//! From GLSL 1.30.8 specification, section 4.1.5 Vectors.
//! \ingroup core_types
typedef precision::mediump_uvec3 uvec3;
typedef mediump_uvec3 uvec3;
//! 4 components vector of unsigned integer numbers.
//! From GLSL 1.30.8 specification, section 4.1.5 Vectors.
//! \ingroup core_types
typedef precision::mediump_uvec4 uvec4;
typedef mediump_uvec4 uvec4;
#endif//GLM_PRECISION
//////////////////////////
@ -315,8 +332,6 @@ namespace type
//! \ingroup core_types
typedef detail::tmat4x4<double> dmat4x4;
}//namespace type
}//namespace core
}//namespace glm
#endif//glm_core_type

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-22
// Updated : 2010-02-08
// Licence : This source is under MIT License
// File : glm/core/type_float.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_float.hpp
/// @date 2008-08-22 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_float
#define glm_core_type_float
@ -24,51 +43,44 @@ namespace glm
}
//namespace detail
namespace core{
namespace type{
namespace precision
{
#ifdef GLM_USE_HALF_SCALAR
typedef detail::thalf lowp_float_t;
typedef detail::thalf lowp_float_t;
#else//GLM_USE_HALF_SCALAR
typedef float lowp_float_t;
typedef float lowp_float_t;
#endif//GLM_USE_HALF_SCALAR
typedef float mediump_float_t;
typedef double highp_float_t;
typedef float mediump_float_t;
typedef double highp_float_t;
//! Low precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification
//! \ingroup core_precision
typedef lowp_float_t lowp_float;
//! Medium precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification
//! \ingroup core_precision
typedef mediump_float_t mediump_float;
//! High precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification
//! \ingroup core_precision
typedef highp_float_t highp_float;
}
//namespace precision
//! Low precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification
//! \ingroup core_precision
typedef lowp_float_t lowp_float;
//! Medium precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification
//! \ingroup core_precision
typedef mediump_float_t mediump_float;
//! High precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification
//! \ingroup core_precision
typedef highp_float_t highp_float;
#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::mediump_float float_t;
typedef mediump_float float_t;
#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::highp_float float_t;
typedef highp_float float_t;
#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::mediump_float float_t;
typedef mediump_float float_t;
#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::lowp_float float_t;
typedef lowp_float float_t;
#else
# error "GLM error: multiple default precision requested for floating-point types"
#endif
}//namespace type
}//namespace core
}//namespace glm
#endif//glm_core_type_float

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-10-05
// Updated : 2010-01-26
// Licence : This source is under MIT License
// File : glm/core/type_gentype.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_gentype.hpp
/// @date 2008-10-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_gentype
#define glm_core_type_gentype

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_gentype.inl
/// @date 2008-10-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-17
// Updated : 2010-02-17
// Licence : This source is under MIT License
// File : glm/core/type_half.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_half.hpp
/// @date 2008-08-17 / 2011-09-20
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_half
#define glm_core_type_half
@ -20,8 +39,8 @@ namespace detail
float toFloat32(hdata value);
hdata toFloat16(float const & value);
///16-bit floating point type.
/// \ingroup gtc_half_float
/// 16-bit floating point type.
/// @ingroup gtc_half_float
class thalf
{
public:
@ -33,10 +52,8 @@ namespace detail
GLM_FUNC_DECL explicit thalf(U const & s);
// Cast
//operator float();
GLM_FUNC_DECL operator float() const;
//operator double();
//operator double() const;
template <typename U>
GLM_FUNC_DECL operator U() const;
// Unary updatable operators
GLM_FUNC_DECL thalf& operator= (thalf const & s);
@ -70,6 +87,30 @@ namespace detail
thalf operator++ (thalf const & s, int);
bool operator==(
detail::thalf const & x,
detail::thalf const & y);
bool operator!=(
detail::thalf const & x,
detail::thalf const & y);
bool operator<(
detail::thalf const & x,
detail::thalf const & y);
bool operator<=(
detail::thalf const & x,
detail::thalf const & y);
bool operator>(
detail::thalf const & x,
detail::thalf const & y);
bool operator>=(
detail::thalf const & x,
detail::thalf const & y);
}//namespace detail
}//namespace glm

View File

@ -1,15 +1,34 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_half.inl
/// @date 2008-08-17 / 2011-06-15
/// @author Christophe Riccio
///
/// 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"
@ -231,7 +250,9 @@ namespace detail
// Assemble the half from s, e and m.
//
return hdata(s | (e << 10) | (m >> 13));
hdata Hdata(s | (e << 10) | (m >> 13));
return Hdata;
}
}
@ -248,27 +269,12 @@ namespace detail
data(toFloat16(float(s)))
{}
// Cast
//GLM_FUNC_QUALIFIER half::operator float()
//{
// return toFloat();
//}
GLM_FUNC_QUALIFIER thalf::operator float() const
template <typename U>
GLM_FUNC_QUALIFIER thalf::operator U() const
{
return toFloat32(this->data);
return static_cast<U>(this->toFloat());
}
//GLM_FUNC_QUALIFIER half::operator double()
//{
// return double(toFloat());
//}
//GLM_FUNC_QUALIFIER half::operator double() const
//{
// return double(toFloat());
//}
// Unary updatable operators
GLM_FUNC_QUALIFIER thalf& thalf::operator= (thalf const & s)
{
@ -303,14 +309,14 @@ namespace detail
GLM_FUNC_QUALIFIER thalf& thalf::operator++()
{
float Casted = toFloat32(data);
data = toFloat16(++Casted);
this->data = toFloat16(++Casted);
return *this;
}
GLM_FUNC_QUALIFIER thalf& thalf::operator--()
{
float Casted = toFloat32(data);
data = toFloat16(--Casted);
this->data = toFloat16(--Casted);
return *this;
}
@ -319,38 +325,92 @@ namespace detail
GLM_FUNC_QUALIFIER detail::thalf operator+ (detail::thalf const & s1, detail::thalf const & s2)
{
return detail::thalf(float(s1) + float(s2));
return detail::thalf(s1.toFloat() + s2.toFloat());
}
GLM_FUNC_QUALIFIER detail::thalf operator- (detail::thalf const & s1, detail::thalf const & s2)
{
return detail::thalf(float(s1) - float(s2));
return detail::thalf(s1.toFloat() - s2.toFloat());
}
GLM_FUNC_QUALIFIER detail::thalf operator* (detail::thalf const & s1, detail::thalf const & s2)
{
return detail::thalf(float(s1) * float(s2));
return detail::thalf(s1.toFloat() * s2.toFloat());
}
GLM_FUNC_QUALIFIER detail::thalf operator/ (detail::thalf const & s1, detail::thalf const & s2)
{
return detail::thalf(float(s1) / float(s2));
return detail::thalf(s1.toFloat() / s2.toFloat());
}
// Unary constant operators
GLM_FUNC_QUALIFIER detail::thalf operator- (detail::thalf const & s)
{
return detail::thalf(-float(s));
return detail::thalf(-s.toFloat());
}
GLM_FUNC_QUALIFIER detail::thalf operator-- (detail::thalf const & s, int)
{
return detail::thalf(float(s) - 1.0f);
return detail::thalf(s.toFloat() - 1.0f);
}
GLM_FUNC_QUALIFIER detail::thalf operator++ (detail::thalf const & s, int)
{
return detail::thalf(float(s) + 1.0f);
return detail::thalf(s.toFloat() + 1.0f);
}
GLM_FUNC_QUALIFIER bool operator==
(
detail::thalf const & x,
detail::thalf const & y
)
{
return x._data() == y._data();
}
GLM_FUNC_QUALIFIER bool operator!=
(
detail::thalf const & x,
detail::thalf const & y
)
{
return x._data() != y._data();
}
GLM_FUNC_QUALIFIER bool operator<
(
detail::thalf const & x,
detail::thalf const & y
)
{
return x.toFloat() < y.toFloat();
}
GLM_FUNC_QUALIFIER bool operator<=
(
detail::thalf const & x,
detail::thalf const & y
)
{
return x.toFloat() <= y.toFloat();
}
GLM_FUNC_QUALIFIER bool operator>
(
detail::thalf const & x,
detail::thalf const & y
)
{
return x.toFloat() > y.toFloat();
}
GLM_FUNC_QUALIFIER bool operator>=
(
detail::thalf const & x,
detail::thalf const & y
)
{
return x.toFloat() >= y.toFloat();
}
}//namespace detail

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_int.hpp
/// @date 2008-08-22 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_int
#define glm_core_type_int
@ -37,20 +56,18 @@ namespace detail
GLM_DETAIL_IS_UINT(highp_uint_t);
}//namespace detail
namespace core{
namespace type{
namespace precision //!< Namespace for precision stuff.
{
//! Low precision signed integer.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification.
//! \ingroup core_precision
typedef detail::lowp_int_t lowp_int;
//! Medium precision signed integer.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification.
//! \ingroup core_precision
typedef detail::mediump_int_t mediump_int;
typedef detail::mediump_int_t mediump_int;
//! High precision signed integer.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification.
@ -62,38 +79,39 @@ namespace precision //!< Namespace for precision stuff.
//! From GLSL 1.30.8 specification.
//! \ingroup core_precision
typedef detail::lowp_uint_t lowp_uint;
//! Medium precision unsigned integer.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification.
//! \ingroup core_precision
typedef detail::mediump_uint_t mediump_uint;
//! High precision unsigned integer.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification.
//! \ingroup core_precision
typedef detail::highp_uint_t highp_uint;
}//namespace precision
#if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef precision::mediump_int int_t;
typedef mediump_int int_t;
#elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef precision::highp_int int_t;
typedef highp_int int_t;
#elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef precision::mediump_int int_t;
typedef mediump_int int_t;
#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
typedef precision::lowp_int int_t;
typedef lowp_int int_t;
#else
# error "GLM error: multiple default precision requested for signed interger types"
#endif
#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef precision::mediump_uint uint_t;
typedef mediump_uint uint_t;
#elif(defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef precision::highp_uint uint_t;
typedef highp_uint uint_t;
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef precision::mediump_uint uint_t;
typedef mediump_uint uint_t;
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
typedef precision::lowp_uint uint_t;
typedef lowp_uint uint_t;
#else
# error "GLM error: multiple default precision requested for unsigned interger types"
#endif
@ -102,8 +120,6 @@ namespace precision //!< Namespace for precision stuff.
//! From GLSL 1.30.8 specification section 4.1.3 Integers.
typedef uint_t uint;
}//namespace type
}//namespace core
}//namespace glm
#endif//glm_core_type_int

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2010-01-26
// Updated : 2010-01-26
// Licence : This source is under MIT License
// File : glm/core/type_mat.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat.hpp
/// @date 2010-01-26 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_mat
#define glm_core_type_mat

View File

@ -0,0 +1,27 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat.inl
/// @date 2011-06-15 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-01-27
// Updated : 2010-02-11
// Licence : This source is under MIT License
// File : glm/core/type_mat2x2.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat2x2.hpp
/// @date 2005-01-27 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_mat2x2
#define glm_core_type_mat2x2
@ -39,6 +58,7 @@ namespace detail
typedef std::size_t size_type;
typedef tvec2<T> col_type;
typedef tvec2<T> row_type;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type col_size();
static GLM_FUNC_DECL size_type row_size();
@ -77,7 +97,7 @@ namespace detail
template <typename U>
GLM_FUNC_DECL explicit tmat2x2(
U const & x);
template <typename U, typename V, typename M, typename N>
GLM_FUNC_DECL explicit tmat2x2(
U const & x1, V const & y1,
@ -229,10 +249,6 @@ namespace detail
int);
} //namespace detail
namespace core{
namespace type{
namespace precision
{
//! 2 columns of 2 components matrix of low precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers
@ -269,9 +285,6 @@ namespace precision
//! \ingroup core_precision
typedef detail::tmat2x2<highp_float> highp_mat2x2;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,15 +1,40 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-01-16
// Updated : 2010-02-11
// Licence : This source is under MIT License
// File : glm/core/type_mat2x2.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat2x2.inl
/// @date 2005-01-16 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T>
GLM_FUNC_QUALIFIER typename tmat2x2<T>::size_type tmat2x2<T>::length() const
{
return 2;
}
template <typename T>
GLM_FUNC_QUALIFIER typename tmat2x2<T>::size_type tmat2x2<T>::col_size()
{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-10-01
// Updated : 2010-02-03
// Licence : This source is under MIT License
// File : glm/core/type_mat2x3.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat2x3.hpp
/// @date 2006-10-01 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_mat2x3
#define glm_core_type_mat2x3
@ -39,6 +58,7 @@ namespace detail
typedef std::size_t size_type;
typedef tvec3<T> col_type;
typedef tvec2<T> row_type;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type col_size();
static GLM_FUNC_DECL size_type row_size();
@ -64,7 +84,6 @@ namespace detail
GLM_FUNC_DECL explicit tmat2x3(
col_type const & v0,
col_type const & v1);
//////////////////////////////////////
// Conversions
@ -196,28 +215,24 @@ namespace detail
} //namespace detail
namespace core{
namespace type{
namespace precision
{
//! 2 columns of 3 components matrix of low precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)
//! \ingroup core_precision
typedef detail::tmat2x3<lowp_float> lowp_mat2x3;
//! 2 columns of 3 components matrix of medium precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)
//! \ingroup core_precision
typedef detail::tmat2x3<mediump_float> mediump_mat2x3;
//! 2 columns of 3 components matrix of high precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)
//! \ingroup core_precision
typedef detail::tmat2x3<highp_float> highp_mat2x3;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,15 +1,40 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-08-05
// Updated : 2010-02-03
// Licence : This source is under MIT License
// File : glm/core/type_mat2x3.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat2x3.inl
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T>
GLM_FUNC_QUALIFIER typename tmat2x3<T>::size_type tmat2x3<T>::length() const
{
return 2;
}
template <typename T>
GLM_FUNC_QUALIFIER typename tmat2x3<T>::size_type tmat2x3<T>::col_size()
{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-08-05
// Updated : 2010-02-11
// Licence : This source is under MIT License
// File : glm/core/type_mat2x4.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat2x4.hpp
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_mat2x4
#define glm_core_type_mat2x4
@ -39,6 +58,7 @@ namespace detail
typedef std::size_t size_type;
typedef tvec4<T> col_type;
typedef tvec2<T> row_type;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type col_size();
static GLM_FUNC_DECL size_type row_size();
@ -197,10 +217,6 @@ namespace detail
} //namespace detail
namespace core{
namespace type{
namespace precision
{
//! 2 columns of 4 components matrix of low precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)
@ -213,9 +229,7 @@ namespace precision
//! There is no guarantee 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_float> highp_mat2x4;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,15 +1,40 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-08-05
// Updated : 2010-02-03
// Licence : This source is under MIT License
// File : glm/core/type_mat2x4.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat2x4.inl
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T>
GLM_FUNC_QUALIFIER typename tmat2x4<T>::size_type tmat2x4<T>::length() const
{
return 2;
}
template <typename T>
GLM_FUNC_QUALIFIER typename tmat2x4<T>::size_type tmat2x4<T>::col_size()
{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-08-05
// Updated : 2010-02-05
// Licence : This source is under MIT License
// File : glm/core/type_mat3x2.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat3x2.hpp
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_mat3x2
#define glm_core_type_mat3x2
@ -39,6 +58,7 @@ namespace detail
typedef std::size_t size_type;
typedef tvec2<T> col_type;
typedef tvec3<T> row_type;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type col_size();
static GLM_FUNC_DECL size_type row_size();
@ -203,25 +223,21 @@ namespace detail
} //namespace detail
namespace core{
namespace type{
namespace precision
{
//! 3 columns of 2 components matrix of low precision floating-point numbers.
//! There is no guarantee 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_float> lowp_mat3x2;
//! 3 columns of 2 components matrix of medium precision floating-point numbers.
//! There is no guarantee 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_float> mediump_mat3x2;
//! 3 columns of 2 components matrix of high precision floating-point numbers.
//! There is no guarantee 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_float> highp_mat3x2;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,15 +1,40 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-08-05
// Updated : 2010-01-05
// Licence : This source is under MIT License
// File : glm/core/type_mat3x2.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat3x2.inl
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T>
GLM_FUNC_QUALIFIER typename tmat3x2<T>::size_type tmat3x2<T>::length() const
{
return 3;
}
template <typename T>
GLM_FUNC_QUALIFIER typename tmat3x2<T>::size_type tmat3x2<T>::col_size()
{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-01-27
// Updated : 2010-02-03
// Licence : This source is under MIT License
// File : glm/core/type_mat3x3.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat3x3.hpp
/// @date 2005-01-27 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_mat3x3
#define glm_core_type_mat3x3
@ -39,6 +58,7 @@ namespace detail
typedef std::size_t size_type;
typedef tvec3<T> col_type;
typedef tvec3<T> row_type;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type col_size();
static GLM_FUNC_DECL size_type row_size();
@ -233,10 +253,6 @@ namespace detail
} //namespace detail
namespace core{
namespace type{
namespace precision
{
//! 3 columns of 3 components matrix of low precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers
@ -271,9 +287,6 @@ namespace precision
//! \ingroup core_precision
typedef detail::tmat3x3<highp_float> highp_mat3x3;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,15 +1,40 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-01-27
// Updated : 2010-02-03
// Licence : This source is under MIT License
// File : glm/core/type_mat3x3.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat3x3.inl
/// @date 2005-01-27 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T>
GLM_FUNC_QUALIFIER typename tmat3x3<T>::size_type tmat3x3<T>::length() const
{
return 3;
}
template <typename T>
GLM_FUNC_QUALIFIER typename tmat3x3<T>::size_type tmat3x3<T>::col_size()
{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-08-05
// Updated : 2010-02-05
// Licence : This source is under MIT License
// File : glm/core/type_mat3x4.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat3x4.hpp
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_mat3x4
#define glm_core_type_mat3x4
@ -39,6 +58,7 @@ namespace detail
typedef std::size_t size_type;
typedef tvec4<T> col_type;
typedef tvec3<T> row_type;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type col_size();
static GLM_FUNC_DECL size_type row_size();
@ -203,10 +223,6 @@ namespace detail
}//namespace detail
namespace core{
namespace type{
namespace precision
{
//! 3 columns of 4 components matrix of low precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)
@ -220,9 +236,6 @@ namespace precision
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)
typedef detail::tmat3x4<highp_float> highp_mat3x4;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,15 +1,40 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-08-05
// Updated : 2010-02-05
// Licence : This source is under MIT License
// File : glm/core/type_mat3x4.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat3x4.inl
/// @date 2006-08-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T>
GLM_FUNC_QUALIFIER typename tmat3x4<T>::size_type tmat3x4<T>::length() const
{
return 3;
}
template <typename T>
GLM_FUNC_QUALIFIER typename tmat3x4<T>::size_type tmat3x4<T>::col_size()
{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-10-01
// Updated : 2010-02-11
// Licence : This source is under MIT License
// File : glm/core/type_mat4x2.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat4x2.hpp
/// @date 2006-10-01 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_mat4x2
#define glm_core_type_mat4x2
@ -39,6 +58,7 @@ namespace detail
typedef std::size_t size_type;
typedef tvec2<T> col_type;
typedef tvec4<T> row_type;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type col_size();
static GLM_FUNC_DECL size_type row_size();
@ -208,10 +228,6 @@ namespace detail
} //namespace detail
namespace core{
namespace type{
namespace precision
{
//! 4 columns of 2 components matrix of low precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)
@ -230,9 +246,6 @@ namespace precision
//! \ingroup core_precision
typedef detail::tmat4x2<highp_float> highp_mat4x2;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,15 +1,40 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-10-01
// Updated : 2010-02-03
// Licence : This source is under MIT License
// File : glm/core/type_mat4x2.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat4x2.inl
/// @date 2006-10-01 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T>
GLM_FUNC_QUALIFIER typename tmat4x2<T>::size_type tmat4x2<T>::length() const
{
return 4;
}
template <typename T>
GLM_FUNC_QUALIFIER typename tmat4x2<T>::size_type tmat4x2<T>::col_size()
{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-08-04
// Updated : 2010-02-11
// Licence : This source is under MIT License
// File : glm/core/type_mat4x3.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat4x3.hpp
/// @date 2006-08-04 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_mat4x3
#define glm_core_type_mat4x3
@ -39,6 +58,7 @@ namespace detail
typedef std::size_t size_type;
typedef tvec3<T> col_type;
typedef tvec4<T> row_type;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type col_size();
static GLM_FUNC_DECL size_type row_size();
@ -206,10 +226,6 @@ namespace detail
}//namespace detail
namespace core{
namespace type{
namespace precision
{
//! 4 columns of 3 components matrix of low precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)
@ -228,9 +244,6 @@ namespace precision
//! \ingroup core_precision
typedef detail::tmat4x3<highp_float> highp_mat4x3;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,15 +1,40 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2006-04-17
// Updated : 2010-02-02
// Licence : This source is under MIT License
// File : glm/core/type_mat4x3.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat4x3.inl
/// @date 2006-04-17 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T>
GLM_FUNC_QUALIFIER typename tmat4x3<T>::size_type tmat4x3<T>::length() const
{
return 4;
}
template <typename T>
GLM_FUNC_QUALIFIER typename tmat4x3<T>::size_type tmat4x3<T>::col_size()
{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-01-27
// Updated : 2011-06-02
// Licence : This source is under MIT License
// File : glm/core/type_mat4x4.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat4x4.hpp
/// @date 2005-01-27 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_mat4x4
#define glm_core_type_mat4x4
@ -39,6 +58,7 @@ namespace detail
typedef std::size_t size_type;
typedef tvec4<T> col_type;
typedef tvec4<T> row_type;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type col_size();
static GLM_FUNC_DECL size_type row_size();
@ -234,10 +254,6 @@ namespace detail
} //namespace detail
namespace core{
namespace type{
namespace precision
{
//! 4 columns of 4 components matrix of low precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers
@ -274,9 +290,6 @@ namespace precision
//! \ingroup core_precision
typedef detail::tmat4x4<highp_float> highp_mat4x4;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,15 +1,40 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-01-27
// Updated : 2010-02-05
// Licence : This source is under MIT License
// File : glm/core/type_mat4x4.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_mat4x4.inl
/// @date 2005-01-27 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T>
GLM_FUNC_QUALIFIER typename tmat4x4<T>::size_type tmat4x4<T>::length() const
{
return 4;
}
template <typename T>
GLM_FUNC_QUALIFIER typename tmat4x4<T>::size_type tmat4x4<T>::col_size()
{

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_size.hpp
/// @date 2008-10-05 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_size
#define glm_core_type_size

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2010-01-26
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/core/type_vec.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_vec.hpp
/// @date 2010-01-26 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_vec
#define glm_core_type_vec

View File

@ -0,0 +1,27 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_vec.inl
/// @date 2011-06-15 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-25
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/core/type_vec1.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_vec1.hpp
/// @date 2008-08-25 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_gentype1
#define glm_core_type_gentype1
@ -152,15 +171,15 @@ namespace detail
GLM_DETAIL_IS_VECTOR(tvec1);
typedef detail::tvec1<core::type::precision::highp_float> highp_vec1_t;
typedef detail::tvec1<core::type::precision::mediump_float> mediump_vec1_t;
typedef detail::tvec1<core::type::precision::lowp_float> lowp_vec1_t;
typedef detail::tvec1<core::type::precision::highp_int> highp_ivec1_t;
typedef detail::tvec1<core::type::precision::mediump_int> mediump_ivec1_t;
typedef detail::tvec1<core::type::precision::lowp_int> lowp_ivec1_t;
typedef detail::tvec1<core::type::precision::highp_uint> highp_uvec1_t;
typedef detail::tvec1<core::type::precision::mediump_uint> mediump_uvec1_t;
typedef detail::tvec1<core::type::precision::lowp_uint> lowp_uvec1_t;
typedef detail::tvec1<highp_float> highp_vec1_t;
typedef detail::tvec1<mediump_float> mediump_vec1_t;
typedef detail::tvec1<lowp_float> lowp_vec1_t;
typedef detail::tvec1<highp_int> highp_ivec1_t;
typedef detail::tvec1<mediump_int> mediump_ivec1_t;
typedef detail::tvec1<lowp_int> lowp_ivec1_t;
typedef detail::tvec1<highp_uint> highp_uvec1_t;
typedef detail::tvec1<mediump_uint> mediump_uvec1_t;
typedef detail::tvec1<lowp_uint> lowp_uvec1_t;
}//namespace detail
}//namespace glm

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-25
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/core/type_vec1.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_vec1.inl
/// @date 2008-08-25 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-18
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/core/type_tvec2.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_vec2.hpp
/// @date 2008-08-18 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_gentype2
#define glm_core_type_gentype2
@ -203,10 +222,6 @@ namespace detail
} //namespace detail
namespace core{
namespace type{
namespace precision
{
//! 2 components vector of high precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.
@ -261,9 +276,6 @@ namespace precision
//! \ingroup core_precision
typedef detail::tvec2<lowp_uint> lowp_uvec2;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-18
// Updated : 2010-10-26
// Licence : This source is under MIT License
// File : glm/core/type_tvec2.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_tvec2.inl
/// @date 2008-08-18 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
@ -123,11 +142,11 @@ namespace detail
template <typename U, typename V>
GLM_FUNC_QUALIFIER tvec2<T>::tvec2
(
U const & x,
V const & y
U const & a,
V const & b
) :
x(value_type(x)),
y(value_type(y))
x(value_type(a)),
y(value_type(b))
{}
//////////////////////////////////////

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-22
// Updated : 2010-02-03
// Licence : This source is under MIT License
// File : glm/core/type_tvec3.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_vec3.hpp
/// @date 2008-08-22 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_gentype3
#define glm_core_type_gentype3
@ -61,7 +80,7 @@ namespace detail
struct{value_type r, g, b;};
struct{value_type s, t, p;};
struct{value_type x, y, z;};
};
};
# else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES)
union {value_type x, r, s;};
union {value_type y, g, t;};
@ -209,10 +228,6 @@ namespace detail
GLM_DETAIL_IS_VECTOR(tvec3);
} //namespace detail
namespace core{
namespace type{
namespace precision
{
//! 3 components vector of high precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.
@ -267,9 +282,6 @@ namespace precision
//! \ingroup core_precision
typedef detail::tvec3<lowp_uint> lowp_uvec3;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-22
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/core/type_tvec3.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_tvec3.inl
/// @date 2008-08-22 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-22
// Updated : 2010-02-03
// Licence : This source is under MIT License
// File : glm/core/type_tvec4.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_vec4.hpp
/// @date 2008-08-22 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_type_gentype4
#define glm_core_type_gentype4
@ -25,8 +44,8 @@ namespace detail
template <typename T> struct tvec2;
template <typename T> struct tvec3;
///Basic 4D vector type.
//! \ingroup core_template
/// Basic 4D vector type.
/// @ingroup core_template
template <typename T>
struct tvec4
{
@ -222,10 +241,6 @@ namespace detail
GLM_DETAIL_IS_VECTOR(tvec4);
}//namespace detail
namespace core{
namespace type{
namespace precision
{
//! 4 components vector of high precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.
@ -280,9 +295,6 @@ namespace precision
//! \ingroup core_precision
typedef detail::tvec4<lowp_uint> lowp_uvec4;
}//namespace precision
}//namespace type
}//namespace core
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-23
// Updated : 2010-02-05
// Licence : This source is under MIT License
// File : glm/core/type_tvec4.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/core/type_tvec4.inl
/// @date 2008-08-23 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail

View File

@ -1,11 +1,59 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2009-05-01
// Updated : 2010-12-13
// Licence : This source is under MIT License
// File : glm/ext.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @file glm/glm.hpp
/// @date 2009-05-01 / 2011-05-16
/// @author Christophe Riccio
///
/// @ref core (Dependence)
///
/// @defgroup gtc GTC Extensions (Stable)
///
/// @brief Functions and types that the GLSL specification doesn't define, but useful to have for a C++ program.
///
/// GTC extensions aim to be stable.
///
/// Even if it's highly unrecommended, it's possible to include all the extensions at once by
/// including <glm/ext.hpp>. Otherwise, each extension needs to be included a specific file.
///
/// @defgroup gtx GTX Extensions (Experimental)
///
/// @brief Functions and types that the GLSL specification doesn't define, but
/// useful to have for a C++ program.
///
/// Experimental extensions are useful functions and types, but the development of
/// their API and functionality is not necessarily stable. They can change
/// substantially between versions. Backwards compatibility is not much of an issue
/// for them.
///
/// Even if it's highly unrecommended, it's possible to include all the extensions
/// at once by including <glm/ext.hpp>. Otherwise, each extension needs to be
/// included a specific file.
///
/// @defgroup virtrev VIRTREV Extensions
///
/// @brief Extensions develop and maintain by Mathieu [matrem] Roumillac
/// (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showprofile&User=22660).
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_ext
#define glm_ext

View File

@ -1,11 +1,79 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-01-14
// Updated : 2011-01-19
// Licence : This source is under MIT License
// File : glm/glm.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref core
/// @file glm/glm.hpp
/// @date 2005-01-14 / 2011-05-16
/// @author Christophe Riccio
///
/// @defgroup core GLM Core
///
/// @brief The core of GLM, which implements exactly and only the GLSL specification to the degree possible.
///
/// The GLM core consists of @ref core_types "C++ types that mirror GLSL types",
/// @ref core_funcs "C++ functions that mirror the GLSL functions". It also includes
/// @ref core_precision "a set of precision-based types" that can be used in the appropriate
/// functions. The C++ types are all based on a basic set of @ref core_template "template types".
///
/// The best documentation for GLM Core is the current GLSL specification,
/// <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.10.6.clean.pdf">version 4.1
/// (pdf file)</a>.
/// There are a few @ref pg_differences "differences" between GLM core and GLSL.
///
/// GLM core functionnalities requires <glm/glm.hpp> to be included to be used.
///
/// @defgroup core_types Types
///
/// @brief The standard types defined by the specification.
///
/// These types are all typedefs of more generalized, template types. To see the definiton
/// of these template types, go to @ref core_template.
///
/// @ingroup core
///
/// @defgroup core_precision Precision types
///
/// @brief Non-GLSL types that are used to define precision-based types.
///
/// The GLSL language allows the user to define the precision of a particular variable.
/// In OpenGL's GLSL, these precision qualifiers have no effect; they are there for compatibility
/// with OpenGL ES's precision qualifiers, where they @em do have an effect.
///
/// C++ has no language equivalent to precision qualifiers. So GLM provides the next-best thing:
/// a number of typedefs of the @ref core_template that use a particular precision.
///
/// None of these types make any guarantees about the actual precision used.
///
/// @ingroup core
///
/// @defgroup core_template Template types
///
/// @brief The generic template types used as the basis for the core types.
///
/// These types are all templates used to define the actual @ref core_types.
/// These templetes are implementation details of GLM types and should not be used explicitly.
///
/// @ingroup core
///////////////////////////////////////////////////////////////////////////////////
#include "core/_fixes.hpp"
@ -23,41 +91,6 @@
# pragma message("GLM: Core library included")
#endif//GLM_MESSAGE
//! GLM namespace, it contains all GLSL based features.
namespace glm
{
//! GLM core. Namespace that includes all the feature define by GLSL 4.10.6 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
{
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
//! G-Truc Creation stable extensions.
namespace gtc{}
//! G-Truc Creation experimental extensions.
//! The interface could change between releases.
namespace gtx{}
//! VIRTREV extensions.
namespace virtrev{}
using namespace core::type;
using namespace core::type::precision;
using namespace core::function;
}//namespace glm
#include "./core/_detail.hpp"
#include "./core/type.hpp"

View File

@ -1,14 +1,41 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2009-04-29
// Updated : 2010-02-07
// Licence : This source is under MIT License
// File : glm/gtc/half_float.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_half_float
/// @file glm/gtc/half_float.hpp
/// @date 2009-04-29 / 2011-06-05
/// @author Christophe Riccio
///
/// @see core (dependence)
///
/// @defgroup gtc_half_float GLM_GTC_half_float: Half-precision floating-point based types and functions
/// @ingroup gtc
///
/// Defines the half-precision floating-point type, along with various typedefs for vectors and matrices.
/// <glm/gtc/half_float.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_gtc_half_float
#define glm_gtc_half_float
#ifndef GLM_GTC_half_float
#define GLM_GTC_half_float GLM_VERSION
// Dependency:
#include "../glm.hpp"
@ -27,8 +54,9 @@ namespace detail
enum ctor{null};
typedef thalf value_type;
typedef std::size_t size_type;
static size_type value_size();
GLM_FUNC_DECL size_type length() const;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type value_size();
typedef tvec2<thalf> type;
typedef tvec2<bool> bool_type;
@ -120,8 +148,8 @@ namespace detail
enum ctor{null};
typedef thalf value_type;
typedef std::size_t size_type;
static size_type value_size();
GLM_FUNC_DECL size_type length() const;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type value_size();
typedef tvec3<thalf> type;
typedef tvec3<bool> bool_type;
@ -217,8 +245,8 @@ namespace detail
enum ctor{null};
typedef thalf value_type;
typedef std::size_t size_type;
static size_type value_size();
GLM_FUNC_DECL size_type length() const;
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type value_size();
typedef tvec4<thalf> type;
typedef tvec4<bool> bool_type;
@ -321,11 +349,8 @@ namespace detail
}
//namespace detail
namespace gtc{
namespace half_float ///< GLM_GTC_half_float extension: Add support for half precision floating-point types
{
/// \addtogroup gtc_half_float
///@{
/// @addtogroup gtc_half_float
/// @{
/// Type for half-precision floating-point numbers.
/// From GLM_GTC_half_float extension.
@ -392,13 +417,8 @@ namespace half_float ///< GLM_GTC_half_float extension: Add support for half pre
typedef detail::tmat4x4<detail::thalf> hmat4x4;
/// @}
}// namespace half_float
}// namespace gtc
}// namespace glm
#include "half_float.inl"
namespace glm{using namespace gtc::half_float;}
#endif//glm_gtc_half_float
#endif//GLM_GTC_half_float

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-12-21
// Updated : 2010-02-07
// Licence : This source is under MIT licence
// File : glm/gtc/half_float.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_half_float
/// @file glm/gtc/half_float.inl
/// @date 2009-04-29 / 2011-06-05
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail{
@ -15,12 +34,12 @@ namespace detail{
//////////////////////////////////////
// hvec2
GLM_FUNC_QUALIFIER tvec2<thalf>::size_type tvec2<thalf>::value_size()
GLM_FUNC_QUALIFIER tvec2<thalf>::size_type tvec2<thalf>::length() const
{
return 2;
return 2;
}
GLM_FUNC_QUALIFIER typename tvec2<thalf>::size_type tvec2<thalf>::length() const
GLM_FUNC_QUALIFIER tvec2<thalf>::size_type tvec2<thalf>::value_size()
{
return 2;
}
@ -288,12 +307,12 @@ GLM_FUNC_QUALIFIER tref2<thalf> tvec2<thalf>::swizzle(comp x, comp y)
//////////////////////////////////////
// hvec3
GLM_FUNC_QUALIFIER tvec3<thalf>::size_type tvec3<thalf>::value_size()
GLM_FUNC_QUALIFIER tvec3<thalf>::size_type tvec3<thalf>::length() const
{
return 3;
return 3;
}
GLM_FUNC_QUALIFIER typename tvec3<thalf>::size_type tvec3<thalf>::length() const
GLM_FUNC_QUALIFIER tvec3<thalf>::size_type tvec3<thalf>::value_size()
{
return 3;
}
@ -605,13 +624,12 @@ GLM_FUNC_QUALIFIER tref3<thalf> tvec3<thalf>::swizzle(comp x, comp y, comp z)
//////////////////////////////////////
// hvec4
GLM_FUNC_QUALIFIER tvec4<thalf>::size_type tvec4<thalf>::value_size()
GLM_FUNC_QUALIFIER tvec4<thalf>::size_type tvec4<thalf>::length() const
{
return 4;
return 4;
}
GLM_FUNC_QUALIFIER typename tvec4<thalf>::size_type tvec4<thalf>::length() const
GLM_FUNC_QUALIFIER tvec4<thalf>::size_type tvec4<thalf>::value_size()
{
return 4;
}

View File

@ -1,17 +1,41 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-12-27
// Updated : 2010-11-12
// Licence : This source is under MIT License
// File : glm/gtc/matrix_access.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_matrix_access
/// @file glm/gtc/matrix_access.hpp
/// @date 2005-12-27 / 2011-05-16
/// @author Christophe Riccio
///
/// @see core (dependence)
///
/// @defgroup gtc_matrix_access GLM_GTC_matrix_access: Access matrix rows and columns
/// @ingroup gtc
///
/// Defines functions to access rows or columns of a matrix easily.
/// <glm/gtc/matrix_access.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_gtc_matrix_access
#define glm_gtc_matrix_access
#ifndef GLM_GTC_matrix_access
#define GLM_GTC_matrix_access GLM_VERSION
// Dependency:
#include "../glm.hpp"
@ -20,51 +44,44 @@
# pragma message("GLM: GLM_GTC_matrix_access extension included")
#endif
namespace glm{
namespace gtc{
namespace matrix_access ///< GLM_GTC_matrix_access extension: Set a column or a row of a matrix
namespace glm
{
/// \addtogroup gtc_matrix_access
///@{
/// @addtogroup gtc_matrix_access
/// @{
//! Get a specific row of a matrix.
//! From GLM_GTC_matrix_access extension.
/// Get a specific row of a matrix.
/// @see - gtc_matrix_access
template <typename genType>
typename genType::row_type row(
genType const & m,
int index);
//! Set a specific row to a matrix.
//! From GLM_GTC_matrix_access extension.
/// Set a specific row to a matrix.
/// @see - gtc_matrix_access
template <typename genType>
genType row(
genType const & m,
int index,
typename genType::row_type const & x);
//! Get a specific column of a matrix.
//! From GLM_GTC_matrix_access extension.
/// Get a specific column of a matrix.
/// @see - gtc_matrix_access
template <typename genType>
typename genType::col_type column(
genType const & m,
int index);
//! Set a specific column to a matrix.
//! From GLM_GTC_matrix_access extension.
/// Set a specific column to a matrix.
/// @see - gtc_matrix_access
template <typename genType>
genType column(
genType const & m,
int index,
typename genType::col_type const & x);
///@}
}//namespace matrix_access
}//namespace gtc
/// @}
}//namespace glm
#include "matrix_access.inl"
namespace glm{using namespace gtc::matrix_access;}
#endif//glm_gtc_matrix_access
#endif//GLM_GTC_matrix_access

View File

@ -1,59 +1,74 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-12-27
// Updated : 2010-11-12
// Licence : This source is under MIT License
// File : glm/gtc/matrix_access.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_matrix_access
/// @file glm/gtc/matrix_access.inl
/// @date 2005-12-27 / 2011-06-05
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace gtc{
namespace matrix_access
template <typename genType>
GLM_FUNC_QUALIFIER genType row(
genType const & m,
int index,
typename genType::row_type const & x)
{
template <typename genType>
GLM_FUNC_QUALIFIER 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;
}
genType Result = m;
for(typename genType::size_type i = 0; i < genType::row_size(); ++i)
Result[i][index] = x[i];
return Result;
}
template <typename genType>
GLM_FUNC_QUALIFIER typename genType::row_type row(
genType const & m,
int index)
{
typename genType::row_type Result;
for(typename genType::size_type i = 0; i < genType::row_size(); ++i)
Result[i] = m[i][index];
return Result;
}
template <typename genType>
GLM_FUNC_QUALIFIER typename genType::row_type row(
genType const & m,
int index)
{
typename genType::row_type Result;
for(typename genType::size_type i = 0; i < genType::row_size(); ++i)
Result[i] = m[i][index];
return Result;
}
template <typename genType>
GLM_FUNC_QUALIFIER genType column(
genType const & m,
int index,
typename genType::col_type const & x)
{
genType Result = m;
Result[index] = x;
return Result;
}
template <typename genType>
GLM_FUNC_QUALIFIER genType column(
genType const & m,
int index,
typename genType::col_type const & x)
{
genType Result = m;
Result[index] = x;
return Result;
}
template <typename genType>
GLM_FUNC_QUALIFIER typename genType::col_type column(
genType const & m,
int index)
{
return m[index];
}
template <typename genType>
GLM_FUNC_QUALIFIER typename genType::col_type column(
genType const & m,
int index)
{
return m[index];
}
}//namespace matrix_access
}//namespace gtc
}//namespace glm

View File

@ -1,17 +1,41 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2011-01-20
// Updated : 2011-01-20
// Licence : This source is under MIT License
// File : glm/gtc/matrix_integer.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_matrix_integer
/// @file glm/gtc/matrix_integer.hpp
/// @date 2011-01-20 / 2011-06-05
/// @author Christophe Riccio
///
/// @see core (dependence)
///
/// @defgroup gtc_matrix_integer GLM_GTC_matrix_integer: Integer matrix types
/// @ingroup gtc
///
/// Defines a number of matrices with integer types.
/// <glm/gtc/matrix_integer.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_gtc_matrix_integer
#define glm_gtc_matrix_integer
#ifndef GLM_GTC_matrix_integer
#define GLM_GTC_matrix_integer GLM_VERSION
// Dependency:
#include "../glm.hpp"
@ -20,12 +44,10 @@
# pragma message("GLM: GLM_GTC_matrix_integer extension included")
#endif
namespace glm{
namespace gtc{
namespace matrix_integer ///< GLM_GTC_matrix_integer extension: Add integer matrices
namespace glm
{
/// \addtogroup gtc_matrix_integer
///@{
/// @addtogroup gtc_matrix_integer
/// @{
typedef detail::tmat2x2<highp_int> highp_imat2; //!< \brief High-precision signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
typedef detail::tmat3x3<highp_int> highp_imat3; //!< \brief High-precision signed integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
@ -193,12 +215,7 @@ namespace matrix_integer ///< GLM_GTC_matrix_integer extension: Add integer matr
typedef mediump_umat4x4 umat4x4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
#endif//GLM_PRECISION
///@}
}//namespace matrix_integer
}//namespace gtc
/// @}
}//namespace glm
namespace glm{using namespace gtc::matrix_integer;}
#endif//glm_gtc_matrix_integer
#endif//GLM_GTC_matrix_integer

View File

@ -1,17 +1,41 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-12-21
// Updated : 2010-12-13
// Licence : This source is under MIT License
// File : glm/gtc/matrix_inverse.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_matrix_inverse
/// @file glm/gtc/matrix_inverse.hpp
/// @date 2005-12-21 / 2011-06-05
/// @author Christophe Riccio
///
/// @see core (dependence)
///
/// @defgroup gtc_matrix_inverse GLM_GTC_matrix_inverse: Additional matrix inverse function
/// @ingroup gtc
///
/// Defines additional matrix inverting functions.
/// <glm/gtc/matrix_inverse.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_gtc_matrix_inverse
#define glm_gtc_matrix_inverse
#ifndef GLM_GTC_matrix_inverse
#define GLM_GTC_matrix_inverse GLM_VERSION
// Dependency:
#include "../glm.hpp"
@ -20,32 +44,31 @@
# pragma message("GLM: GLM_GTC_matrix_inverse extension included")
#endif
namespace glm{
namespace gtc{
namespace matrix_inverse ///< GLM_GTC_matrix_inverse extension: Inverse matrix functions
namespace glm
{
/// \addtogroup gtc_matrix_inverse
///@{
/// @addtogroup gtc_matrix_inverse
/// @{
//! Fast matrix inverse for affine matrix.
//! From GLM_GTC_matrix_inverse extension.
/// Fast matrix inverse for affine matrix.
///
/// @param m Input matrix to invert.
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate.
/// @see gtc_matrix_inverse
template <typename genType>
genType affineInverse(genType const & m);
//! Compute the inverse transpose of a matrix.
//! From GLM_GTC_matrix_inverse extension.
/// Compute the inverse transpose of a matrix.
///
/// @param m Input matrix to invert transpose.
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate.
/// @see gtc_matrix_inverse
template <typename genType>
GLM_FUNC_QUALIFIER typename genType::value_type inverseTranspose(
genType const & m);
///@}
}//namespace matrix_inverse
}//namespace gtc
/// @}
}//namespace glm
#include "matrix_inverse.inl"
namespace glm{using namespace gtc::matrix_inverse;}
#endif//glm_gtc_matrix_inverse
#endif//GLM_GTC_matrix_inverse

View File

@ -1,139 +1,154 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-12-21
// Updated : 2010-12-13
// Licence : This source is under MIT License
// File : glm/gtc/matrix_inverse.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_matrix_inverse
/// @file glm/gtc/matrix_inverse.inl
/// @date 2005-12-21 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace gtc{
namespace matrix_inverse
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<T> affineInverse
(
detail::tmat3x3<T> const & m
)
{
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<T> affineInverse
(
detail::tmat3x3<T> const & m
)
{
detail::tmat3x3<T> Result(m);
Result[2] = detail::tvec3<T>(0, 0, 1);
Result = transpose(Result);
detail::tvec3<T> Translation = Result * detail::tvec3<T>(-detail::tvec2<T>(m[2]), m[2][2]);
Result[2] = Translation;
return Result;
}
detail::tmat3x3<T> Result(m);
Result[2] = detail::tvec3<T>(0, 0, 1);
Result = transpose(Result);
detail::tvec3<T> Translation = Result * detail::tvec3<T>(-detail::tvec2<T>(m[2]), m[2][2]);
Result[2] = Translation;
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> affineInverse
(
detail::tmat4x4<T> const & m
)
{
detail::tmat4x4<T> Result(m);
Result[3] = detail::tvec4<T>(0, 0, 0, 1);
Result = transpose(Result);
detail::tvec4<T> Translation = Result * detail::tvec4<T>(-detail::tvec3<T>(m[3]), m[3][3]);
Result[3] = Translation;
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> affineInverse
(
detail::tmat4x4<T> const & m
)
{
detail::tmat4x4<T> Result(m);
Result[3] = detail::tvec4<T>(0, 0, 0, 1);
Result = transpose(Result);
detail::tvec4<T> Translation = Result * detail::tvec4<T>(-detail::tvec3<T>(m[3]), m[3][3]);
Result[3] = Translation;
return Result;
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat2x2<valType> inverseTranspose(
detail::tmat2x2<valType> const & m)
{
valType Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat2x2<valType> inverseTranspose(
detail::tmat2x2<valType> const & m)
{
valType Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];
detail::tmat2x2<valType> Inverse(
+ m[1][1] / Determinant,
- m[0][1] / Determinant,
- m[1][0] / Determinant,
+ m[0][0] / Determinant);
detail::tmat2x2<valType> Inverse(
+ m[1][1] / Determinant,
- m[0][1] / Determinant,
- m[1][0] / Determinant,
+ m[0][0] / Determinant);
return Inverse;
}
return Inverse;
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat3x3<valType> inverseTranspose(
detail::tmat3x3<valType> 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]);
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat3x3<valType> inverseTranspose(
detail::tmat3x3<valType> 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<valType> 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;
detail::tmat3x3<valType> 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;
}
return Inverse;
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> inverseTranspose(
detail::tmat4x4<valType> 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];
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> inverseTranspose(
detail::tmat4x4<valType> 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<valType> 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);
detail::tmat4x4<valType> 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[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[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);
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];
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;
Inverse /= Determinant;
return Inverse;
}
return Inverse;
}
}//namespace matrix_inverse
}//namespace gtc
}//namespace glm

View File

@ -1,18 +1,50 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_matrix_transform
/// @file glm/gtc/matrix_transform.hpp
/// @date 2009-04-29 / 2011-05-16
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtx_transform
/// @see gtx_transform2
///
/// @defgroup gtc_matrix_transform GLM_GTC_matrix_transform: Matrix transform functions
/// @ingroup gtc
///
/// @brief Defines functions that generate common transformation matrices.
///
/// The matrices generated by this extension use standard OpenGL fixed-function
/// conventions. For example, the lookAt function generates a transform from world
/// space into the specific eye space that the projective matrix functions
/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility
/// specifications defines the particular layout of this eye space.
///
/// <glm/gtc/matrix_transform.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_gtc_matrix_transform
#define glm_gtc_matrix_transform
#ifndef GLM_GTC_matrix_transform
#define GLM_GTC_matrix_transform GLM_VERSION
// Dependency:
#include "../glm.hpp"
@ -21,37 +53,79 @@
# pragma message("GLM: GLM_GTC_matrix_transform extension included")
#endif
namespace glm{
namespace gtc{
namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transformation matrices
namespace glm
{
/// \addtogroup gtc_matrix_transform
///@{
/// @addtogroup gtc_matrix_transform
/// @{
//! Builds a translation 4 * 4 matrix created from a vector of 3 components.
//! From GLM_GTC_matrix_transform extension.
/// Builds a translation 4 * 4 matrix created from a vector of 3 components.
///
/// @param m Input matrix multiplied by this translation matrix.
/// @param v Coordinates of a translation vector.
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @code
/// #include <glm/glm.hpp>
/// #include <glm/gtc/matrix_transform.hpp>
/// ...
/// glm::mat4 m = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f));
/// // m[0][0] == 1.0f, m[0][1] == 0.0f, m[0][2] == 0.0f, m[0][3] == 0.0f
/// // m[1][0] == 0.0f, m[1][1] == 1.0f, m[1][2] == 0.0f, m[1][3] == 0.0f
/// // m[2][0] == 0.0f, m[2][1] == 0.0f, m[2][2] == 1.0f, m[2][3] == 0.0f
/// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f
/// @endcode
/// @see gtc_matrix_transform
/// @see gtx_transform
/// @see - translate(T x, T y, T z)
/// @see - translate(detail::tmat4x4<T> const & m, T x, T y, T z)
/// @see - translate(detail::tvec3<T> const & v)
template <typename T>
detail::tmat4x4<T> translate(
detail::tmat4x4<T> const & m,
detail::tvec3<T> 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.
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees.
///
/// @param m Input matrix multiplied by this rotation matrix.
/// @param angle Rotation angle expressed in degrees.
/// @param axis Rotation axis, recommanded to be normalized.
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see gtx_transform
/// @see - rotate(T angle, T x, T y, T z)
/// @see - rotate(detail::tmat4x4<T> const & m, T angle, T x, T y, T z)
/// @see - rotate(T angle, detail::tvec3<T> const & v)
template <typename T>
detail::tmat4x4<T> rotate(
detail::tmat4x4<T> const & m,
T const & angle,
detail::tvec3<T> const & v);
detail::tvec3<T> const & axis);
//! Builds a scale 4 * 4 matrix created from 3 scalars.
//! From GLM_GTC_matrix_transform extension.
/// Builds a scale 4 * 4 matrix created from 3 scalars.
///
/// @param m Input matrix multiplied by this scale matrix.
/// @param v Ratio of scaling for each axis.
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see gtx_transform
/// @see - scale(T x, T y, T z) scale(T const & x, T const & y, T const & z)
/// @see - scale(detail::tmat4x4<T> const & m, T x, T y, T z)
/// @see - scale(detail::tvec3<T> const & v)
template <typename T>
detail::tmat4x4<T> scale(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v);
//! Creates a matrix for an orthographic parallel viewing volume.
//! From GLM_GTC_matrix_transform extension.
/// Creates a matrix for an orthographic parallel viewing volume.
///
/// @param left
/// @param right
/// @param bottom
/// @param top
/// @param zNear
/// @param zFar
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
template <typename T>
detail::tmat4x4<T> ortho(
T const & left,
@ -61,59 +135,104 @@ namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transfor
T const & zNear,
T const & zFar);
//! Creates a matrix for projecting two-dimensional coordinates onto the screen.
//! From GLM_GTC_matrix_transform extension.
template <typename T>
/// Creates a matrix for projecting two-dimensional coordinates onto the screen.
///
/// @param left
/// @param right
/// @param bottom
/// @param top
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar)
template <typename T>
detail::tmat4x4<T> ortho(
T const & left,
T const & right,
T const & bottom,
T const & top);
//! Creates a frustum matrix.
//! From GLM_GTC_matrix_transform extension.
/// Creates a frustum matrix.
///
/// @param left
/// @param right
/// @param bottom
/// @param top
/// @param near
/// @param far
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
detail::tmat4x4<T> frustum(
T const & left,
T const & right,
T const & bottom,
T const & top,
T const & nearVal,
T const & farVal);
T const & near,
T const & far);
//! Creates a matrix for a symetric perspective-view frustum.
//! From GLM_GTC_matrix_transform extension.
/// Creates a matrix for a symetric perspective-view frustum.
///
/// @param fovy
/// @param aspect
/// @param near
/// @param far
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
detail::tmat4x4<T> perspective(
T const & fovy,
T const & aspect,
T const & zNear,
T const & zFar);
T const & near,
T const & far);
//! Builds a perspective projection matrix based on a field of view
//! From GLM_GTC_matrix_transform extension.
/// Builds a perspective projection matrix based on a field of view.
///
/// @param fov
/// @param width
/// @param height
/// @param near
/// @param far
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename valType>
detail::tmat4x4<valType> perspectiveFov(
valType const & fov,
valType const & width,
valType const & height,
valType const & zNear,
valType const & zFar);
valType const & near,
valType const & far);
//! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite .
//! From GLM_GTC_matrix_transform extension.
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite.
///
/// @param fovy
/// @param aspect
/// @param near
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
detail::tmat4x4<T> infinitePerspective(
T fovy, T aspect, T zNear);
T fovy, T aspect, T near);
//! 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_GTC_matrix_transform extension.
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
///
/// @param fovy
/// @param aspect
/// @param near
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
detail::tmat4x4<T> tweakedInfinitePerspective(
T fovy, T aspect, T zNear);
T fovy, T aspect, T near);
//! Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.
//! From GLM_GTC_matrix_transform extension.
/// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.
///
/// @param obj
/// @param model
/// @param proj
/// @param viewport
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
template <typename T, typename U>
detail::tvec3<T> project(
detail::tvec3<T> const & obj,
@ -121,8 +240,15 @@ namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transfor
detail::tmat4x4<T> const & proj,
detail::tvec4<U> const & viewport);
//! Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
//! From GLM_GTC_matrix_transform extension.
/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
///
/// @param win
/// @param model
/// @param proj
/// @param viewport
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
template <typename T, typename U>
detail::tvec3<T> unProject(
detail::tvec3<T> const & win,
@ -130,29 +256,36 @@ namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transfor
detail::tmat4x4<T> const & proj,
detail::tvec4<U> const & viewport);
//! Define a picking region
//! From GLM_GTC_matrix_transform extension.
/// Define a picking region
///
/// @param center
/// @param delta
/// @param viewport
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
template <typename T, typename U>
detail::tmat4x4<T> pickMatrix(
detail::tvec2<T> const & center,
detail::tvec2<T> const & delta,
detail::tvec4<U> const & viewport);
//! Build a look at view matrix.
//! From GLM_GTC_matrix_transform extension.
/// Build a look at view matrix.
///
/// @param eye Position of the camera
/// @param center Position where the camera is looking at
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
/// @see gtc_matrix_transform
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T>
detail::tmat4x4<T> lookAt(
detail::tvec3<T> const & eye,
detail::tvec3<T> const & center,
detail::tvec3<T> const & up);
///@}
}//namespace matrix_transform
}//namespace gtc
/// @}
}//namespace glm
#include "matrix_transform.inl"
namespace glm{using namespace gtc::matrix_transform;}
#endif//glm_gtc_matrix_transform
#endif//GLM_GTC_matrix_transform

View File

@ -1,397 +1,413 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_matrix_transform
/// @file glm/gtc/matrix_transform.inl
/// @date 2009-04-29 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace gtc{
namespace matrix_transform
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
)
{
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
)
{
detail::tmat4x4<T> Result(m);
Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];
return Result;
}
detail::tmat4x4<T> Result(m);
Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> rotate
(
detail::tmat4x4<T> const & m,
T const & angle,
detail::tvec3<T> const & v
)
{
T a = radians(angle);
T c = cos(a);
T s = sin(a);
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> rotate
(
detail::tmat4x4<T> const & m,
T const & angle,
detail::tvec3<T> const & v
)
{
T a = radians(angle);
T c = cos(a);
T s = sin(a);
detail::tvec3<T> axis = normalize(v);
detail::tvec3<T> axis = normalize(v);
detail::tvec3<T> temp = (T(1) - c) * axis;
detail::tvec3<T> temp = (T(1) - c) * axis;
detail::tmat4x4<T> Rotate(detail::tmat4x4<T>::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];
detail::tmat4x4<T> Rotate(detail::tmat4x4<T>::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[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];
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<T> Result(detail::tmat4x4<T>::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;
}
detail::tmat4x4<T> Result(detail::tmat4x4<T>::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 <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
)
{
detail::tmat4x4<T> Result(detail::tmat4x4<T>::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 <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
)
{
detail::tmat4x4<T> Result(detail::tmat4x4<T>::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 <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate_slow
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
)
{
detail::tmat4x4<T> Result(T(1));
Result[3] = detail::tvec4<T>(v, T(1));
return m * Result;
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate_slow
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
)
{
detail::tmat4x4<T> Result(T(1));
Result[3] = detail::tvec4<T>(v, T(1));
return m * Result;
//detail::tmat4x4<valType> 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;
}
//detail::tmat4x4<valType> 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 <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> rotate_slow
(
detail::tmat4x4<T> const & m,
T const & angle,
detail::tvec3<T> const & v
)
{
T a = radians(angle);
T c = cos(a);
T s = sin(a);
detail::tmat4x4<T> Result;
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> rotate_slow
(
detail::tmat4x4<T> const & m,
T const & angle,
detail::tvec3<T> const & v
)
{
T a = radians(angle);
T c = cos(a);
T s = sin(a);
detail::tmat4x4<T> Result;
detail::tvec3<T> axis = normalize(v);
detail::tvec3<T> 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[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[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[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<T>(0, 0, 0, 1);
return m * Result;
}
Result[3] = detail::tvec4<T>(0, 0, 0, 1);
return m * Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale_slow
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
)
{
detail::tmat4x4<T> Result(T(1));
Result[0][0] = v.x;
Result[1][1] = v.y;
Result[2][2] = v.z;
return m * Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale_slow
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
)
{
detail::tmat4x4<T> Result(T(1));
Result[0][0] = v.x;
Result[1][1] = v.y;
Result[2][2] = v.z;
return m * Result;
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> ortho
(
valType const & left,
valType const & right,
valType const & bottom,
valType const & top,
valType const & zNear,
valType const & zFar
)
{
detail::tmat4x4<valType> 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 <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> ortho
(
valType const & left,
valType const & right,
valType const & bottom,
valType const & top,
valType const & zNear,
valType const & zFar
)
{
detail::tmat4x4<valType> 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 <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> ortho(
valType const & left,
valType const & right,
valType const & bottom,
valType const & top)
{
detail::tmat4x4<valType> 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 <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> ortho(
valType const & left,
valType const & right,
valType const & bottom,
valType const & top)
{
detail::tmat4x4<valType> 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 <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> frustum
(
valType const & left,
valType const & right,
valType const & bottom,
valType const & top,
valType const & nearVal,
valType const & farVal
)
{
detail::tmat4x4<valType> 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 <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> frustum
(
valType const & left,
valType const & right,
valType const & bottom,
valType const & top,
valType const & nearVal,
valType const & farVal
)
{
detail::tmat4x4<valType> 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 <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> 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;
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> 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<valType> 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;
}
detail::tmat4x4<valType> 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 <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> 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;
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> 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<valType> 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;
}
detail::tmat4x4<valType> 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 <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> 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;
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> 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<T> 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;
}
detail::tmat4x4<T> 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 <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> 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;
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> 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<T> 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;
}
detail::tmat4x4<T> 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;
}
template <typename T, typename U>
GLM_FUNC_QUALIFIER detail::tvec3<T> project
(
detail::tvec3<T> const & obj,
detail::tmat4x4<T> const & model,
detail::tmat4x4<T> const & proj,
detail::tvec4<U> const & viewport
)
{
detail::tvec4<T> tmp = detail::tvec4<T>(obj, T(1));
tmp = model * tmp;
tmp = proj * tmp;
template <typename T, typename U>
GLM_FUNC_QUALIFIER detail::tvec3<T> project
(
detail::tvec3<T> const & obj,
detail::tmat4x4<T> const & model,
detail::tmat4x4<T> const & proj,
detail::tvec4<U> const & viewport
)
{
detail::tvec4<T> tmp = detail::tvec4<T>(obj, T(1));
tmp = model * tmp;
tmp = proj * tmp;
tmp /= tmp.w;
tmp = tmp * T(0.5) + T(0.5);
tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]);
tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]);
tmp /= tmp.w;
tmp = tmp * T(0.5) + T(0.5);
tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]);
tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]);
return detail::tvec3<T>(tmp);
}
return detail::tvec3<T>(tmp);
}
template <typename T, typename U>
GLM_FUNC_QUALIFIER detail::tvec3<T> unProject
(
detail::tvec3<T> const & win,
detail::tmat4x4<T> const & model,
detail::tmat4x4<T> const & proj,
detail::tvec4<U> const & viewport
)
{
detail::tmat4x4<T> inverse = glm::inverse(proj * model);
template <typename T, typename U>
GLM_FUNC_QUALIFIER detail::tvec3<T> unProject
(
detail::tvec3<T> const & win,
detail::tmat4x4<T> const & model,
detail::tmat4x4<T> const & proj,
detail::tvec4<U> const & viewport
)
{
detail::tmat4x4<T> inverse = glm::inverse(proj * model);
detail::tvec4<T> tmp = detail::tvec4<T>(win, T(1));
tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]);
tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]);
tmp = tmp * T(2) - T(1);
detail::tvec4<T> tmp = detail::tvec4<T>(win, T(1));
tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]);
tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]);
tmp = tmp * T(2) - T(1);
detail::tvec4<T> obj = inverse * tmp;
obj /= obj.w;
detail::tvec4<T> obj = inverse * tmp;
obj /= obj.w;
return detail::tvec3<T>(obj);
}
return detail::tvec3<T>(obj);
}
template <typename T, typename U>
detail::tmat4x4<T> pickMatrix
(
detail::tvec2<T> const & center,
detail::tvec2<T> const & delta,
detail::tvec4<U> const & viewport
)
{
assert(delta.x > T(0) && delta.y > T(0));
detail::tmat4x4<T> Result(1.0f);
template <typename T, typename U>
detail::tmat4x4<T> pickMatrix
(
detail::tvec2<T> const & center,
detail::tvec2<T> const & delta,
detail::tvec4<U> const & viewport
)
{
assert(delta.x > T(0) && delta.y > T(0));
detail::tmat4x4<T> Result(1.0f);
if(!(delta.x > T(0) && delta.y > T(0)))
return Result; // Error
if(!(delta.x > T(0) && delta.y > T(0)))
return Result; // Error
detail::tvec3<T> 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));
detail::tvec3<T> 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, Temp);
return scale(Result, detail::tvec3<T>(T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1)));
}
// Translate and scale the picked region to the entire window
Result = translate(Result, Temp);
return scale(Result, detail::tvec3<T>(T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1)));
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> lookAt
(
detail::tvec3<T> const & eye,
detail::tvec3<T> const & center,
detail::tvec3<T> const & up
)
{
detail::tvec3<T> f = normalize(center - eye);
detail::tvec3<T> u = normalize(up);
detail::tvec3<T> s = normalize(cross(f, u));
u = cross(s, f);
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> lookAt
(
detail::tvec3<T> const & eye,
detail::tvec3<T> const & center,
detail::tvec3<T> const & up
)
{
detail::tvec3<T> f = normalize(center - eye);
detail::tvec3<T> u = normalize(up);
detail::tvec3<T> s = normalize(cross(f, u));
u = cross(s, f);
detail::tmat4x4<T> 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 translate(Result, -eye);
}
detail::tmat4x4<T> 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);
}
}//namespace matrix_transform
}//namespace gtc
}//namespace glm

View File

@ -1,22 +1,43 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2009-05-21
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/gtc/quaternion.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
// - GLM_GTC_half_float
///////////////////////////////////////////////////////////////////////////////////////////////////
// ToDo:
// - Study constructors with angles and axis
// - Study constructors with vec3 that are the imaginary component of quaternion
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_quaternion
/// @file glm/gtc/quaternion.hpp
/// @date 2009-05-21 / 2011-06-05
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtc_half_float (dependence)
///
/// @defgroup gtc_quaternion GLM_GTC_quaternion: Quaternion types and functions
/// @ingroup gtc
///
/// @brief Defines a templated quaternion type and several quaternion operations.
///
/// <glm/gtc/quaternion.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_gtc_quaternion
#define glm_gtc_quaternion
#ifndef GLM_GTC_quaternion
#define GLM_GTC_quaternion GLM_VERSION
// Dependency:
#include "../glm.hpp"
@ -29,22 +50,27 @@
namespace glm{
namespace detail
{
//! \brief Template for quaternion.
//! From GLM_GTC_quaternion extension.
/// \ingroup gtc_quaternion
/// @brief Template for quaternion.
/// From GLM_GTC_quaternion extension.
/// @ingroup gtc_quaternion
template <typename T>
struct tquat// : public genType<T, tquat>
{
typedef T value_type;
enum ctor{null};
typedef T value_type;
typedef std::size_t size_type;
public:
value_type x, y, z, w;
GLM_FUNC_DECL size_type length() const;
// Constructors
tquat();
explicit tquat(
value_type const & s,
tvec3<T> const & v);
glm::detail::tvec3<T> const & v);
explicit tquat(
value_type const & w,
value_type const & x,
@ -121,40 +147,34 @@ namespace detail
} //namespace detail
namespace gtc{
namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and functions
{
/// @addtogroup gtc_quaternion
/// @{
//! Returns the length of the quaternion.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
template <typename T>
typename detail::tquat<T>::value_type length(
T length(
detail::tquat<T> const & q);
//! Returns the normalized quaternion.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
template <typename T>
detail::tquat<T> normalize(
detail::tquat<T> const & q);
//! Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
template <typename T>
typename detail::tquat<T>::value_type dot(
T dot(
detail::tquat<T> const & q1,
detail::tquat<T> const & q2);
//! Returns the cross product of q1 and q2.
//! From GLM_GTC_quaternion extension.
template <typename T>
GLM_DEPRECATED detail::tquat<T> cross(
detail::tquat<T> const & q1,
detail::tquat<T> const & q2);
//! Returns a SLERP interpolated quaternion of x and y according a.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
template <typename T>
detail::tquat<T> mix(
detail::tquat<T> const & x,
@ -162,19 +182,22 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun
T const & a);
//! Returns the q conjugate.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
template <typename T>
detail::tquat<T> conjugate(
detail::tquat<T> const & q);
//! Returns the q inverse.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
template <typename T>
detail::tquat<T> inverse(
detail::tquat<T> const & q);
//! Rotates a quaternion from an vector of 3 components axis and an angle expressed in degrees.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
template <typename T>
detail::tquat<T> rotate(
detail::tquat<T> const & q,
@ -182,64 +205,71 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun
detail::tvec3<T> const & v);
//! Converts a quaternion to a 3 * 3 matrix.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
template <typename T>
detail::tmat3x3<T> mat3_cast(
detail::tquat<T> const & x);
//! Converts a quaternion to a 4 * 4 matrix.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
template <typename T>
detail::tmat4x4<T> mat4_cast(
detail::tquat<T> const & x);
//! Converts a 3 * 3 matrix to a quaternion.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
template <typename T>
detail::tquat<T> quat_cast(
detail::tmat3x3<T> const & x);
//! Converts a 4 * 4 matrix to a quaternion.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
template <typename T>
detail::tquat<T> quat_cast(
detail::tmat4x4<T> const & x);
//! Quaternion of floating-point numbers.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
typedef detail::tquat<float> quat;
//! Quaternion of half-precision floating-point numbers.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
typedef detail::tquat<detail::thalf> hquat;
//! Quaternion of single-precision floating-point numbers.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
typedef detail::tquat<float> fquat;
//! Quaternion of double-precision floating-point numbers.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
typedef detail::tquat<double> dquat;
//! Quaternion of low precision floating-point numbers.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
typedef detail::tquat<lowp_float> lowp_quat;
//! Quaternion of medium precision floating-point numbers.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
typedef detail::tquat<mediump_float> mediump_quat;
//! Quaternion of high precision floating-point numbers.
//! From GLM_GTC_quaternion extension.
///
/// @see - gtc_quaternion
typedef detail::tquat<highp_float> highp_quat;
/// @}
} //namespace quaternion
} //namespace gtc
/// @}
} //namespace glm
#include "quaternion.inl"
namespace glm{using namespace gtc::quaternion;}
#endif//glm_gtc_quaternion
#endif//GLM_GTC_quaternion

View File

@ -1,11 +1,30 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2009-05-21
// Updated : 2010-02-04
// Licence : This source is under MIT License
// File : glm/gtc/quaternion.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_quaternion
/// @file glm/gtc/quaternion.inl
/// @date 2009-05-21 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#include <limits>
@ -88,7 +107,7 @@ namespace detail{
tmat3x3<T> const & m
)
{
*this = gtc::quaternion::quat_cast(m);
*this = quat_cast(m);
}
template <typename T>
@ -97,7 +116,7 @@ namespace detail{
tmat4x4<T> const & m
)
{
*this = gtc::quaternion::quat_cast(m);
*this = quat_cast(m);
}
//////////////////////////////////////////////////////////////
@ -211,7 +230,7 @@ namespace detail{
detail::tquat<T> const & q
)
{
return gtc::quaternion::inverse(q) * v;
return inverse(q) * v;
}
template <typename T>
@ -231,7 +250,7 @@ namespace detail{
detail::tquat<T> const & q
)
{
return gtc::quaternion::inverse(q) * v;
return inverse(q) * v;
}
template <typename T>
@ -291,12 +310,9 @@ namespace detail{
}//namespace detail
namespace gtc{
namespace quaternion{
////////////////////////////////////////////////////////
template <typename T>
GLM_FUNC_QUALIFIER typename detail::tquat<T>::value_type length
GLM_FUNC_QUALIFIER T length
(
detail::tquat<T> const & q
)
@ -318,7 +334,7 @@ namespace quaternion{
}
template <typename T>
GLM_FUNC_QUALIFIER typename detail::tquat<T>::value_type dot
GLM_FUNC_QUALIFIER T dot
(
detail::tquat<T> const & q1,
detail::tquat<T> const & q2
@ -448,7 +464,7 @@ namespace quaternion{
detail::tquat<T> const & q
)
{
return gtc::quaternion::conjugate(q) / gtc::quaternion::dot(q, q);
return conjugate(q) / dot(q, q);
}
template <typename T>
@ -462,8 +478,8 @@ namespace quaternion{
detail::tvec3<T> Tmp = v;
// Axis of rotation must be normalised
typename detail::tquat<T>::value_type len = glm::core::function::geometric::length(Tmp);
if(abs(len - typename detail::tquat<T>::value_type(1)) > typename detail::tquat<T>::value_type(0.001))
typename detail::tquat<T>::value_type len = glm::length(Tmp);
if(abs(len - T(1)) > T(0.001))
{
T oneOverLen = T(1) / len;
Tmp.x *= oneOverLen;
@ -484,7 +500,7 @@ namespace quaternion{
detail::tquat<T> const & q
)
{
detail::tmat3x3<T> Result(typename detail::tquat<T>::value_type(1));
detail::tmat3x3<T> Result(T(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;
@ -537,8 +553,8 @@ namespace quaternion{
biggestIndex = 3;
}
typename detail::tquat<T>::value_type biggestVal = sqrt(fourBiggestSquaredMinus1 + typename detail::tquat<T>::value_type(1)) * typename detail::tquat<T>::value_type(0.5);
typename detail::tquat<T>::value_type mult = typename detail::tquat<T>::value_type(0.25) / biggestVal;
typename detail::tquat<T>::value_type biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5);
typename detail::tquat<T>::value_type mult = T(0.25) / biggestVal;
detail::tquat<T> Result;
switch(biggestIndex)
@ -580,6 +596,4 @@ namespace quaternion{
return quat_cast(detail::tmat3x3<T>(m4));
}
}//namespace quaternion
}//namespace gtc
}//namespace glm

65
glm/gtc/random.hpp Normal file
View File

@ -0,0 +1,65 @@
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_random
/// @file glm/gtc/random.hpp
/// @date 2011-09-18 / 2011-09-18
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtc_half_float (dependence)
/// @see gtx_random (extended)
///
/// @defgroup gtc_random GLM_GTC_random: Random number generation
/// @ingroup gtc
///
/// @brief Generate random number from various distribution methods
///
/// <glm/gtc/random.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_GTC_random
#define GLM_GTC_random GLM_VERSION
// Dependency:
#include "../glm.hpp"
#include "../gtc/half_float.hpp"
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
# pragma message("GLM: GLM_GTC_random extension included")
#endif
namespace glm
{
/// @addtogroup gtc_random
/// @{
/// Generate a random number in the interval [-1, 1], according a linear distribution.
/// From GLM_GTC_random extension.
template <typename T> T signedRand1();
/// @}
}//namespace glm
#include "random.inl"
#endif//GLM_GTC_random

16
glm/gtc/random.inl Normal file
View File

@ -0,0 +1,16 @@
//////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
//////////////////////////////////////////////////////////////////////////////////
// Created : 2011-09-19
// Updated : 2011-09-19
// Licence : This source is under MIT License
// File : glm/gtc/random.inl
//////////////////////////////////////////////////////////////////////////////////
#include <ctime>
#include <cassert>
namespace glm{
}//namespace glm

View File

@ -1,17 +1,42 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2010-02-20
// Updated : 2010-02-20
// Licence : This source is under MIT License
// File : glm/gtc/swizzle.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_swizzle
/// @file glm/gtc/swizzle.hpp
/// @date 2010-02-20 / 2011-06-05
/// @author Christophe Riccio
///
/// @see core (dependence)
///
/// @defgroup gtc_swizzle GLM_GTC_swizzle: Swizzle 'operator' implementation
/// @ingroup gtc
///
/// @brief Provide functions to emulate GLSL swizzle operator fonctionalities.
///
/// <glm/gtc/swizzle.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_gtc_swizzle
#define glm_gtc_swizzle
#ifndef GLM_GTC_swizzle
#define GLM_GTC_swizzle GLM_VERSION
// Dependency:
#include "../glm.hpp"
@ -21,12 +46,11 @@
# pragma message("GLM: GLM_GTC_swizzle extension included")
#endif
namespace glm{
namespace gtc{
namespace swizzle ///< GLM_GTC_swizzle extension
namespace glm
{
using namespace gtc::half_float;
/// @addtogroup gtc_swizzle
/// @{
template <typename T, template <typename> class vecType>
T const & swizzle(
vecType<T> const & v,
@ -343,12 +367,9 @@ namespace swizzle ///< GLM_GTC_swizzle extension
static_swizzle4_ref(glm::u32, 4)
static_swizzle4_ref(glm::u64, 4)
}//namespace swizzle
}//namespace gtc
/// @}
}//namespace glm
#include "swizzle.inl"
namespace glm{using namespace gtc::swizzle;}
#endif//glm_gtc_swizzle
#endif//GLM_GTC_swizzle

View File

@ -1,18 +1,32 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2011-01-15
// Updated : 2011-01-15
// Licence : This source is under MIT License
// File : glm/gtc/swizzle.inl
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_swizzle
/// @file glm/gtc/swizzle.inl
/// @date 2011-01-15 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace gtc{
namespace swizzle{
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER T swizzle
@ -172,6 +186,5 @@ GLM_FUNC_QUALIFIER detail::tref4<int> swizzle
return detail::tref4<int>(v[x], v[y], v[z], v[w]);
}
*/
}//namespace swizzle
}//namespace gtc
}//namespace glm

View File

@ -1,19 +1,47 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 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_quaternion
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// 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.
///
/// @ref gtc_type_precision
/// @file glm/gtc/type_precision.hpp
/// @date 2009-06-04 / 2011-06-05
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtc_half_float (dependence)
/// @see gtc_quaternion (dependence)
///
/// @defgroup gtc_type_precision GLM_GTC_type_precision: Vector and matrix types with defined precisions
/// @ingroup gtc
///
/// @brief Defines specific C++-based precision types.
///
/// @ref core_precision defines types based on GLSL's precision qualifiers. This
/// extension defines types based on explicitly-sized C++ data types.
///
/// <glm/gtc/type_precision.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_gtc_type_precision
#define glm_gtc_type_precision
#ifndef GLM_GTC_type_precision
#define GLM_GTC_type_precision GLM_VERSION
// Dependency:
#include "../glm.hpp"
@ -24,21 +52,13 @@
# pragma message("GLM: GLM_GTC_type_precision extension included")
#endif
namespace glm{
namespace gtc{
namespace type_precision ///< GLM_GTC_type_precision extension: Defined types with specific size.
namespace glm
{
///////////////////////////
// Dependences
using namespace gtc::half_float;
using namespace gtc::quaternion;
///////////////////////////
// Signed int vector types
/// \addtogroup gtc_type_precision
///@{
/// @addtogroup gtc_type_precision
/// @{
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)
@ -207,14 +227,9 @@ namespace type_precision ///< GLM_GTC_type_precision extension: Defined types wi
typedef detail::tquat<f32> f32quat; //!< \brief Single-precision floating-point quaternion. (from GLM_GTC_type_precision extension)
typedef detail::tquat<f64> f64quat; //!< \brief Double-precision floating-point quaternion. (from GLM_GTC_type_precision extension)
///@}
}//namespace type_precision
}//namespace gtc
/// @}
}//namespace glm
#include "type_precision.inl"
namespace glm{using namespace gtc::type_precision;}
#endif//glm_gtc_type_precision
#endif//GLM_GTC_type_precision

Some files were not shown because too many files have changed in this diff Show More