From 872f23c5a97ee62821960c42f49823cc0eb9ff7a Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Apr 2010 09:45:44 +0100 Subject: [PATCH 01/10] Deleted deprecated files --- glm/gtx/flexible_mix.inl | 60 ----- glm/gtx/mat4x3.inl | 405 ------------------------------- glm/gtx/statistics_operation.hpp | 67 ----- glm/gtx/statistics_operation.inl | 81 ------- glm/virtrev/gl.hpp | 64 ----- 5 files changed, 677 deletions(-) delete mode 100644 glm/gtx/flexible_mix.inl delete mode 100644 glm/gtx/mat4x3.inl delete mode 100644 glm/gtx/statistics_operation.hpp delete mode 100644 glm/gtx/statistics_operation.inl delete mode 100644 glm/virtrev/gl.hpp diff --git a/glm/gtx/flexible_mix.inl b/glm/gtx/flexible_mix.inl deleted file mode 100644 index 48424097..00000000 --- a/glm/gtx/flexible_mix.inl +++ /dev/null @@ -1,60 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-09-21 -// Updated : 2007-09-21 -// Licence : This source is under MIT licence -// File : glm/gtx/flexible_mix.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // mix - template - inline T mixGTX(T x, T y, U a) - { - //GLM_STATIC_ASSERT(detail::traits::is_float); - //return T(x * (U(1) - a) + y * a); - return T(x + a * (y - x)); - } - - template - inline detail::tvec2 mixGTX(const detail::tvec2& x, const detail::tvec2& y, U a) - { - return detail::tvec2(detail::tvec2(x) * (U(1) - a) + detail::tvec2(y) * a); - //return x * (U(1) - a) + y * a; - } - - template - inline detail::tvec3 mixGTX(const detail::tvec3& x, const detail::tvec3& y, U a) - { - return detail::tvec3(detail::tvec3(x) * (U(1) - a) + detail::tvec3(y) * a); - //return x * (U(1) - a) + y * a; - //return mix(x, y, tvec3(a)); - } - - template - inline detail::tvec4 mixGTX(const detail::tvec4& x, const detail::tvec4& y, U a) - { - return detail::tvec4(detail::tvec4(x) * (U(1) - a) + detail::tvec4(y) * a); - //return x * (U(1) - a) + y * a; - } - - template - inline detail::tvec2 mixGTX(const detail::tvec2& x, const detail::tvec2& y, const detail::tvec2& a) - { - return detail::tvec2(detail::tvec2(x) * (U(1) - a) + detail::tvec2(y) * a); - } - - template - inline detail::tvec3 mixGTX(const detail::tvec3& x, const detail::tvec3& y, const detail::tvec3& a) - { - return detail::tvec3(detail::tvec3(x) * (U(1) - a) + detail::tvec3(y) * a); - } - - template - inline detail::tvec4 mixGTX(const detail::tvec4& x, const detail::tvec4& y, const detail::tvec4& a) - { - return detail::tvec4(detail::tvec4(x) * (U(1) - a) + detail::tvec4(y) * a); - } -} diff --git a/glm/gtx/mat4x3.inl b/glm/gtx/mat4x3.inl deleted file mode 100644 index d6f56ab8..00000000 --- a/glm/gtx/mat4x3.inl +++ /dev/null @@ -1,405 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-17 -// Updated : 2006-04-17 -// Licence : This source is under MIT licence -// File : glm/gtx/mat4x3.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////////////////////////////////////////////// - // Constructors - - template - inline _xmat4x3GTX::_xmat4x3GTX() - { - this->value[0] = tvec3(1, 0, 0); - this->value[1] = tvec3(0, 1, 0); - this->value[2] = tvec3(0, 0, 1); - this->value[3] = tvec3(0, 0, 0); - } - - template - inline _xmat4x3GTX::_xmat4x3GTX(const T f) - { - this->value[0] = tvec3(f, 0, 0); - this->value[1] = tvec3(0, f, 0); - this->value[2] = tvec3(0, 0, f); - this->value[3] = tvec3(0, 0, 0); - } - - template - inline _xmat4x3GTX::_xmat4x3GTX - ( - const T x0, const T y0, const T z0, - const T x1, const T y1, const T z1, - const T x2, const T y2, const T z2, - const T x3, const T y3, const T z3 - ) - { - this->value[0] = tvec3(x0, y0, z0); - this->value[1] = tvec3(x1, y1, z1); - this->value[2] = tvec3(x2, y2, z2); - this->value[3] = tvec3(x3, y3, z3); - } - - template - inline _xmat4x3GTX::_xmat4x3GTX - ( - const tvec3 & v0, - const tvec3 & v1, - const tvec3 & v2, - const tvec3 & v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator= (const _xmat4x3GTX& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator+= (const T s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator+= (const _xmat4x3GTX& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator-= (const T s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator-= (const _xmat4x3GTX& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator*= (const T s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator*= (const _xmat4x3GTX& m) - { - return (*this = *this * m); - } - - template - inline _xmat4x3GTX & _xmat4x3GTX::operator/= (const T s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } -/* - template - inline _xmat4x3GTX& _xmat4x3GTX::operator/= (const _xmat4x3GTX& m) - { - return (*this = *this / m); - } -*/ - template - inline _xmat4x3GTX& _xmat4x3GTX::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - ////////////////////////////////////////////////////////////// - // Unary constant operators - template - inline const _xmat4x3GTX _xmat4x3GTX::operator- () const - { - return _xmat4x3GTX( - -this->value[0], - -this->value[1], - -this->value[2], - -this->value[3]); - } - - template - inline const _xmat4x3GTX _xmat4x3GTX::operator-- (int n) const - { - _xmat4x3GTX m = *this; - --m.value[0]; - --m.value[1]; - --m.value[2]; - --m.value[3]; - return m; - } - - template - inline const _xmat4x3GTX _xmat4x3GTX::operator++ (int n) const - { - detail::tmat4x4 m = *this; - ++m.value[0]; - ++m.value[1]; - ++m.value[2]; - ++m.value[3]; - return m; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template - inline _xmat4x3GTX operator+ (const _xmat4x3GTX& m, const T s) - { - return _xmat4x3GTX( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template - inline _xmat4x3GTX operator+ (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) - { - return _xmat4x3GTX( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template - inline _xmat4x3GTX operator- (const _xmat4x3GTX& m, const T s) - { - return _xmat4x3GTX( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } - - template - inline _xmat4x3GTX operator- (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) - { - return _xmat4x3GTX( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template - inline _xmat4x3GTX operator* (const _xmat4x3GTX& m, const T s) - { - return _xmat4x3GTX( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - inline _xmat4x3GTX operator* (const T s, const _xmat4x3GTX & m) - { - return _xmat4x3GTX( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - inline tvec3 operator* (const _xmat4x3GTX& m, const tvec4& v) - { - return tvec3( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); - } - - template - inline tvec3 operator* (const tvec4& v, const _xmat4x3GTX& m) - { - return tvec3( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); - } - - template - inline _xmat4x3GTX operator* (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - const T SrcA22 = m1[2][2]; - const T SrcA30 = m1[3][0]; - const T SrcA31 = m1[3][1]; - const T SrcA32 = m1[3][2]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - const T SrcB22 = m2[2][2]; - const T SrcB30 = m2[3][0]; - const T SrcB31 = m2[3][1]; - const T SrcB32 = m2[3][2]; - - _xmat4x3GTX Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32 + SrcA30; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32 + SrcA31; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32 + SrcA32; - return Result; - } - - template - inline _xmat4x3GTX operator/ (const _xmat4x3GTX& m, const T s) - { - return _xmat4x3GTX( - m.value[0] / s, - m.value[1] / s, - m.value[2] / s, - m.value[3] / s); - } -/* - template - inline _xmat4x3GTX operator/ (const T s, const _xmat4x3GTX& m) - { - return _xmat4x3GTX( - s / m.value[0], - s / m.value[1], - s / m.value[2], - s / m.value[3]); - } - - template - tvec3 operator/ (const _xmat4x3GTX& m, const tvec4& v) - { - - } - - template - tvec3 operator/ (const tvec4& v, const _xmat4x3GTX& m) - { - - } -*/ - - template - inline _xmat4x3GTX operator/ (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) - { - T SubFactor01 = m2[2][1] * m2[3][2] - m2[3][1] * m2[2][2]; - T SubFactor02 = m2[2][0] * m2[3][2] - m2[3][0] * m2[2][2]; - T SubFactor03 = m2[2][0] * m2[3][1] - m2[3][0] * m2[2][1]; - T SubFactor04 = m2[1][1] * m2[3][2] - m2[3][1] * m2[1][2]; - T SubFactor05 = m2[1][0] * m2[3][2] - m2[3][0] * m2[1][2]; - T SubFactor06 = m2[1][0] * m2[3][1] - m2[3][0] * m2[1][1]; - T SubFactor07 = m2[1][1] * m2[2][2] - m2[2][1] * m2[1][2]; - T SubFactor08 = m2[1][0] * m2[2][2] - m2[2][0] * m2[1][2]; - T SubFactor09 = m2[1][0] * m2[2][1] - m2[2][0] * m2[1][1]; - - _xmat4x3GTX Inverse( - + m2[1][3] * SubFactor01, - - m2[1][3] * SubFactor02, - + m2[1][3] * SubFactor03, - -(m2[1][0] * SubFactor01 - m2[1][1] * SubFactor02 + m2[1][2] * SubFactor03), - - - m2[0][3] * SubFactor01, - + m2[0][3] * SubFactor02, - - m2[0][3] * SubFactor03, - +(m2[0][0] * SubFactor02 - m2[0][1] * SubFactor02 + m2[0][2] * SubFactor03), - - + m2[0][3] * SubFactor04, - - m2[0][3] * SubFactor05, - + m2[0][3] * SubFactor06, - -(m2[0][0] * SubFactor04 - m2[0][1] * SubFactor05 + m2[0][2] * SubFactor06), - - - m2[0][3] * SubFactor07, - + m2[0][3] * SubFactor08, - - m2[0][3] * SubFactor09, - +(m2[0][0] * SubFactor07 - m2[0][1] * SubFactor08 + m2[0][2] * SubFactor09)); - - T Determinant = m2[0][0] * Inverse[0][0] - + m2[0][1] * Inverse[1][0] - + m2[0][2] * Inverse[2][0] - + m2[0][3] * Inverse[3][0]; - - Inverse /= Determinant; - - return m1 * Inverse; - } - -} //namespace glm diff --git a/glm/gtx/statistics_operation.hpp b/glm/gtx/statistics_operation.hpp deleted file mode 100644 index 15519d24..00000000 --- a/glm/gtx/statistics_operation.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-11-21 -// Updated : 2007-11-21 -// Licence : This source is under MIT License -// File : glm/gtx/statistics_operation.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_statistics_operation -#define glm_gtx_statistics_operation - -// Dependency: -#include "../glm.hpp" - -namespace glm -{ - template T statDistanceGTX(const detail::tvec2& v1, const detail::tvec2& v2); - template T statDistanceGTX(const detail::tvec3& v1, const detail::tvec3& v2); - template T statDistanceGTX(const detail::tvec4& v1, const detail::tvec4& v2); - - template T statDistanceGTX(const detail::tmat2x2& m1, const detail::tmat2x2& m2); - template T statDistanceGTX(const detail::tmat3x3& m1, const detail::tmat3x3& m2); - template T statDistanceGTX(const detail::tmat4x4& m1, const detail::tmat4x4& m2); - - template T expectedValueGTX(const detail::tvec2& v1, const detail::tvec2& v2); - template T expectedValueGTX(const detail::tvec3& v1, const detail::tvec3& v2); - template T expectedValueGTX(const detail::tvec4& v1, const detail::tvec4& v2); - - template T expectedValueGTX(const detail::tmat2x2& m1, const detail::tmat2x2& m2); - template T expectedValueGTX(const detail::tmat3x3& m1, const detail::tmat3x3& m2); - template T expectedValueGTX(const detail::tmat4x4& m1, const detail::tmat4x4& m2); - - template T varianceGTX(const detail::tvec2& v1, const detail::tvec2& v2); - template T varianceGTX(const detail::tvec3& v1, const detail::tvec3& v2); - template T varianceGTX(const detail::tvec4& v1, const detail::tvec4& v2); - - template T varianceGTX(const detail::tmat2x2& m1, const detail::tmat2x2& m2); - template T varianceGTX(const detail::tmat3x3& m1, const detail::tmat3x3& m2); - template T varianceGTX(const detail::tmat4x4& m1, const detail::tmat4x4& m2); - - template T standardDevitionGTX(const detail::tvec2& v1, const detail::tvec2& v2); - template T standardDevitionGTX(const detail::tvec3& v1, const detail::tvec3& v2); - template T standardDevitionGTX(const detail::tvec4& v1, const detail::tvec4& v2); - - template T standardDevitionGTX(const detail::tmat2x2& m1, const detail::tmat2x2& m2); - template T standardDevitionGTX(const detail::tmat3x3& m1, const detail::tmat3x3& m2); - template T standardDevitionGTX(const detail::tmat4x4& m1, const detail::tmat4x4& m2); - - namespace gtx - { - //! GLM_GTX_statistics_operation extension: - Work in progress - Statistics functions - namespace statistics_operation - { - - } - } -} - -#include "statistics_operation.inl" - -namespace glm{using namespace gtx::statistics_operation;} - -#endif//glm_gtx_statistics_operation diff --git a/glm/gtx/statistics_operation.inl b/glm/gtx/statistics_operation.inl deleted file mode 100644 index dc67bc25..00000000 --- a/glm/gtx/statistics_operation.inl +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-11-21 -// Updated : 2007-11-21 -// Licence : This source is under MIT License -// File : glm/gtx/statistics_operator.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include - -namespace glm -{ - //! Compute the sum of square of differences between each matrices paremeters - template - inline T statDistanceGTX(const detail::tmat2x2& m1, const detail::tmat2x2& m2) - { - T result = T(0); - for(int j = 0; j < 2; ++j) - for(int i = 0; i < 2; ++i) - { - T diff = m1[j][i] - m2[j][i]; - result += diff * diff; - } - return result; - } - - template - inline T statDistanceGTX(const detail::tmat3x3& m1, const detail::tmat3x3& m2) - { - T result = T(0); - for(int j = 0; j < 3; ++j) - for(int i = 0; i < 3; ++i) - { - T diff = m1[j][i] - m2[j][i]; - result += diff * diff; - } - return result; - } - - template - inline T statDistanceGTX(const detail::tmat4x4& m1, const detail::tmat4x4& m2) - { - T result = T(0); - for(int j = 0; j < 4; ++j) - for(int i = 0; i < 4; ++i) - { - T diff = m1[j][i] - m2[j][i]; - result += diff * diff; - } - return result; - } - - template - T expectedValueGTX(const detail::tmat4x4& m) - { - T result = T(0); - for(int j = 0; j < 4; ++j) - for(int i = 0; i < 4; ++i) - result += m[j][i]; - result *= T(0,0625); - return result; - } - - template - T varianceGTX(const detail::tmat4x4& m) - { - T ExpectedValue = expectedValueGTX(m); - T ExpectedValueOfSquaredMatrix = expectedValueGTX(matrixCompMult(m)); - return ExpectedValueOfSquaredMatrix - ExpectedValue * ExpectedValue; - } - - template - T standardDevitionGTX(const detail::tmat4x4& m) - { - return sqrt(varianceGTX(m)); - } -} diff --git a/glm/virtrev/gl.hpp b/glm/virtrev/gl.hpp deleted file mode 100644 index eee2ad3a..00000000 --- a/glm/virtrev/gl.hpp +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef GLM_EXT_VIRTREV_GL_HPP -#define GLM_EXT_VIRTREV_GL_HPP - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) -// Virtrev SDK copyright matrem (matrem84.free.fr) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-04-24 -// Updated : 2008-10-07 -// Licence : This source is under MIT License -// File : glm/ext/virtrev/gl.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - glew or glee or gl library header -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../glm.hpp" - -#if !defined(GLM_DEPENDENCE) || !(GLM_DEPENDENCE & (GLM_DEPENDENCE_GLEW|GLM_DEPENDENCE_GLEE|GLM_DEPENDENCE_GL)) -#error GLM_VIRTREV_gl requires OpenGL to build. GLM_DEPENDENCE doesn't define the dependence. -#endif//GLM_DEPENDENCE - -namespace glm -{ - namespace virtrev_glmext - { - //! GLM_VIRTREV_gl extension: Vector & matrix integration with OpenGL. - namespace gl - { - typedef detail::tvec2 gl_vec2; ///< vec2 for GLfloat OpenGL type - typedef detail::tvec3 gl_vec3; ///< vec3 for GLfloat OpenGL type - typedef detail::tvec4 gl_vec4; ///< vec4 for GLfloat OpenGL type - - typedef detail::tvec2 gl_svec2; ///< vec2 for GLshort OpenGL type - typedef detail::tvec3 gl_svec3; ///< vec3 for GLshort OpenGL type - typedef detail::tvec4 gl_svec4; ///< vec4 for GLshort OpenGL type - - typedef detail::tvec2 gl_ivec2; ///< vec2 for GLint OpenGL type - typedef detail::tvec3 gl_ivec3; ///< vec3 for GLint OpenGL type - typedef detail::tvec4 gl_ivec4; ///< vec4 for GLint OpenGL type - - typedef detail::tmat2x2 gl_mat2; ///< mat2x2 for GLfloat OpenGL type - typedef detail::tmat3x3 gl_mat3; ///< mat3x3 for GLfloat OpenGL type - typedef detail::tmat4x4 gl_mat4; ///< mat4x4 for GLfloat OpenGL type - - typedef detail::tmat2x3 gl_mat2x3; ///< mat2x3 for GLfloat OpenGL type - typedef detail::tmat3x2 gl_mat3x2; ///< mat3x2 for GLfloat OpenGL type - typedef detail::tmat2x4 gl_mat2x4; ///< mat2x4 for GLfloat OpenGL type - typedef detail::tmat4x2 gl_mat4x2; ///< mat4x2 for GLfloat OpenGL type - typedef detail::tmat3x4 gl_mat3x4; ///< mat3x4 for GLfloat OpenGL type - typedef detail::tmat4x3 gl_mat4x3; ///< mat4x3 for GLfloat OpenGL type - - } - } -} - -#define GLM_VIRTREV_gl namespace glm::virtrev_glmext::gl -#ifndef GLM_VIRTREV_GLOBAL -namespace glm {using GLM_VIRTREV_gl;} -#endif//GLM_VIRTREV_GLOBAL - -#endif//GLM_EXT_VIRTREV_GL_HPP - From d5c4dc0aeb57dee6e9456b8c69c24548ed3e21b6 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Apr 2010 09:52:38 +0100 Subject: [PATCH 02/10] Added GLM_GTC_swizzle --- glm/gtc/swizzle.hpp | 4 ++-- glm/gtc/swizzle.inl | 40 +++++++++++++++------------------------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/glm/gtc/swizzle.hpp b/glm/gtc/swizzle.hpp index b3cd75bd..eb354080 100644 --- a/glm/gtc/swizzle.hpp +++ b/glm/gtc/swizzle.hpp @@ -24,11 +24,11 @@ namespace glm namespace gtc{ //! GLM_GTC_swizzle extension - namespace glm_gtc_swizzle{ + namespace swizzle{ - }//namespace closest_point + }//namespace swizzle }//namespace gtc }//namespace glm diff --git a/glm/gtc/swizzle.inl b/glm/gtc/swizzle.inl index be2e265f..b072df20 100644 --- a/glm/gtc/swizzle.inl +++ b/glm/gtc/swizzle.inl @@ -3,58 +3,48 @@ namespace gtc{ namespace glm_gtc_swizzle { template - inline typename tvec4::value_type swizzle + inline T swizzle ( detail::tvec4 const & v, comp x - ) const + ) { return v[x]; } template - inline tvec2 tvec4::swizzle + inline detail::tvec2 swizzle ( detail::tvec4 const & v, comp x, comp y - ) const + ) { - return tvec2( - (*this)[x], - (*this)[y]); + return detail::tvec2( + v[x], + v[y]); } template - inline tvec3 tvec4::swizzle + inline detail::tvec3 swizzle ( detail::tvec4 const & v, comp x, comp y, comp z - ) const - { - return tvec3( - (*this)[x], - (*this)[y], - (*this)[z]); - } - - template - inline tvec4 tvec4::swizzle - ( - detail::tvec4 const & v, - comp x, comp y, comp z, comp w - ) const + ) { - return tvec4(v[x], v[y], v[z], v[w]); + return detail::tvec3( + v[x], + v[y], + v[z]); } template - inline tref4 swizzle + inline detail::tref4 swizzle ( detail::tvec4 const & v, comp x, comp y, comp z, comp w ) { - return tref4(v[x], v[y], v[z], v[w]); + return detail::tref4(v[x], v[y], v[z], v[w]); } }//namespace glm_gtc_swizzle From 990ec8df2f30a381cb5b18d4c46e089dd2de4d83 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Apr 2010 09:59:43 +0100 Subject: [PATCH 03/10] Fixed build, fixed extensions list --- glm/core/dummy.cpp | 3 +++ glm/ext.hpp | 10 ++++------ glm/virtrev/address.hpp | 5 +---- glm/virtrev/equal_operator.hpp | 2 +- glm/virtrev/xstream.hpp | 7 ++----- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/glm/core/dummy.cpp b/glm/core/dummy.cpp index 0395e23b..9fbb93ec 100644 --- a/glm/core/dummy.cpp +++ b/glm/core/dummy.cpp @@ -1,3 +1,6 @@ +#include "../glm.hpp" +#include "../ext.hpp" + int main() { diff --git a/glm/ext.hpp b/glm/ext.hpp index 20bd110e..f59d7bec 100644 --- a/glm/ext.hpp +++ b/glm/ext.hpp @@ -18,17 +18,17 @@ #include "gtc/matrix_transform.hpp" #include "gtc/quaternion.hpp" #include "gtc/swizzle.hpp" +#include "gtc/type_precision.hpp" -//#include "./gtx/array_range.hpp" #include "./gtx/associated_min_max.hpp" #include "./gtx/bit.hpp" #include "./gtx/closest_point.hpp" #include "./gtx/color_cast.hpp" #include "./gtx/color_space.hpp" #include "./gtx/color_space_YCoCg.hpp" +#include "./gtx/comparison.hpp" #include "./gtx/compatibility.hpp" #include "./gtx/component_wise.hpp" -//#include "./gtx/complex.hpp" #include "./gtx/determinant.hpp" #include "./gtx/double_float.hpp" #include "./gtx/epsilon.hpp" @@ -38,8 +38,6 @@ #include "./gtx/fast_exponential.hpp" #include "./gtx/fast_square_root.hpp" #include "./gtx/fast_trigonometry.hpp" -//#include "./gtx/flexible_mix.hpp" -//#include "./gtx/gpu_shader4.hpp" #include "./gtx/gradient_paint.hpp" #include "./gtx/half_float.hpp" #include "./gtx/handed_coordinate_space.hpp" @@ -48,11 +46,11 @@ #include "./gtx/intersect.hpp" #include "./gtx/inverse.hpp" #include "./gtx/inverse_transpose.hpp" -//#include "./gtx/mat_mn.hpp" #include "./gtx/log_base.hpp" #include "./gtx/matrix_access.hpp" #include "./gtx/matrix_cross_product.hpp" #include "./gtx/matrix_major_storage.hpp" +#include "./gtx/matrix_operation.hpp" #include "./gtx/matrix_projection.hpp" #include "./gtx/matrix_query.hpp" #include "./gtx/matrix_selection.hpp" @@ -62,6 +60,7 @@ #include "./gtx/normal.hpp" #include "./gtx/normalize_dot.hpp" #include "./gtx/number_precision.hpp" +#include "./gtx/ocl_type.hpp" #include "./gtx/optimum_pow.hpp" #include "./gtx/orthonormalize.hpp" #include "./gtx/perpendicular.hpp" @@ -90,7 +89,6 @@ #include "./virtrev/address.hpp" #include "./virtrev/equal_operator.hpp" -#include "./virtrev/xstream.hpp" //const float goldenRatio = 1.618033988749894848f; //const float pi = 3.141592653589793238f; diff --git a/glm/virtrev/address.hpp b/glm/virtrev/address.hpp index 8977088b..c64071a5 100644 --- a/glm/virtrev/address.hpp +++ b/glm/virtrev/address.hpp @@ -183,10 +183,7 @@ namespace glm } } -#define GLM_VIRTREV_address namespace virtrev_glmext::address -#ifndef GLM_VIRTREV_GLOBAL -namespace glm {using GLM_VIRTREV_address;} -#endif//GLM_VIRTREV_GLOBAL +namespace glm{using namespace virtrev_glmext::address;} #endif//GLM_EXT_VIRTREV_ADDRESS_HPP diff --git a/glm/virtrev/equal_operator.hpp b/glm/virtrev/equal_operator.hpp index ae106664..a6aaef3f 100644 --- a/glm/virtrev/equal_operator.hpp +++ b/glm/virtrev/equal_operator.hpp @@ -62,7 +62,7 @@ namespace glm } } -namespace glm {namespace virtrev_glmext::equal_operator;} +namespace glm {using namespace virtrev_glmext::equal_operator;} #endif//glm_virtrev_equal_operator diff --git a/glm/virtrev/xstream.hpp b/glm/virtrev/xstream.hpp index 8141f36f..de5e37b0 100644 --- a/glm/virtrev/xstream.hpp +++ b/glm/virtrev/xstream.hpp @@ -139,9 +139,6 @@ namespace glm } } -#define GLM_VIRTREV_xstream namespace glm::virtrev_glmext::xstream -#ifndef GLM_VIRTREV_GLOBAL -namespace glm {using GLM_VIRTREV_xstream;} -#endif//GLM_VIRTREV_GLOBAL +namespace glm{using namespace glm::virtrev_glmext::xstream;} -#endif +#endif//GLM_EXT_VIRTREV_XSTREAM_HPP From d631c53d6d66351bf72a0e2efafb7abdaa38524e Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Apr 2010 10:35:21 +0100 Subject: [PATCH 04/10] Updated manual --- doc/glm-manual.doc | Bin 72704 -> 74752 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/doc/glm-manual.doc b/doc/glm-manual.doc index 40f6a54fcfbd89b22f7d349a3ac991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vk}y*QG^^@ZaL zqfH_|T$Xi5p`(cCdil9hEVX|rhz{6F=c%*KDchhrX8B`>F!={>{_pCn1?rPk2DRixn+Jjo&K#2j`0XWG$9J+#cBux#$0-#hND`h;ZY;{CV0e0V_KHFKyO5)|~ug v9h?dBKkBeD@|Cn$=FpH%*_pnq$!u0XdTgt@ByX_28CK9XWdrqCr&<34K8aCV From 1fbda8371fba2236594297be0bfa5f5bdb471e20 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Apr 2010 10:37:08 +0100 Subject: [PATCH 05/10] Added GLM_GTC_type_ptr extension --- glm/gtc/type_ptr.hpp | 299 +++++++++++++++++++++++++++++++++++++++++++ glm/gtc/type_ptr.inl | 0 2 files changed, 299 insertions(+) create mode 100644 glm/gtc/type_ptr.hpp create mode 100644 glm/gtc/type_ptr.inl diff --git a/glm/gtc/type_ptr.hpp b/glm/gtc/type_ptr.hpp new file mode 100644 index 00000000..1286261d --- /dev/null +++ b/glm/gtc/type_ptr.hpp @@ -0,0 +1,299 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2009-05-06 +// Updated : 2010-04-30 +// Licence : This source is under MIT License +// File : glm/gtc/type_ptr.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtc_type_ptr +#define glm_gtc_type_ptr + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace test{ + void main_gtc_type_ptr(); + }//namespace test + + namespace gtc{ + //! GLM_GTC_type_ptr extension: Get access to vectors & matrices value type address. + namespace type_ptr{ + + //! Get the const address of the vector content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tvec2 const & vec + ) + { + return &(vec.x); + } + + //! Get the address of the vector content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr + ( + detail::tvec2 & vec + ) + { + return &(vec.x); + } + + //! Get the const address of the vector content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tvec3 const & vec + ) + { + return &(vec.x); + } + + //! Get the address of the vector content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr + ( + detail::tvec3 & vec + ) + { + return &(vec.x); + } + + //! Get the const address of the vector content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tvec4 const & vec + ) + { + return &(vec.x); + } + + //! Get the address of the vector content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr + ( + detail::tvec4 & vec + ) + { + return &(vec.x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tmat2x2 const & mat + ) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr + ( + detail::tmat2x2 & mat + ) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tmat3x3 const & mat + ) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr + ( + detail::tmat3x3 & mat + ) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tmat4x4 const & mat + ) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr + ( + detail::tmat4x4 & mat + ) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tmat2x3 const & mat + ) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr + ( + detail::tmat2x3 & mat + ) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tmat3x2 const & mat + ) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr + ( + detail::tmat3x2 & mat + ) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tmat2x4 const & mat + ) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr + ( + detail::tmat2x4 & mat + ) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tmat4x2 const & mat + ) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr + ( + detail::tmat4x2 & mat + ) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tmat3x4 const & mat + ) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr + ( + detail::tmat3x4 & mat + ) + { + return &(mat[0].x); + } + + //! Get the const address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T const * value_ptr + ( + detail::tmat4x3 const & mat + ) + { + return &(mat[0].x); + } + + //! Get the address of the matrix content. + //! From GLM_GTC_type_ptr extension. + template + inline T * value_ptr(detail::tmat4x3 & mat) + { + return &(mat[0].x); + } + + }//namespace type_ptr + }//namespace gtc +}//namespace glm + +#include "type_ptr.inl" + +namespace glm{using namespace gtc::type_ptr;} + +#endif//glm_gtx_type_ptr + diff --git a/glm/gtc/type_ptr.inl b/glm/gtc/type_ptr.inl new file mode 100644 index 00000000..e69de29b From d462852ff9c3065a997b02571597f1373100d3d3 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Apr 2010 10:37:22 +0100 Subject: [PATCH 06/10] Added GLM_GTC_type_ptr extension --- glm/ext.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/glm/ext.hpp b/glm/ext.hpp index f59d7bec..c66ab45f 100644 --- a/glm/ext.hpp +++ b/glm/ext.hpp @@ -19,6 +19,7 @@ #include "gtc/quaternion.hpp" #include "gtc/swizzle.hpp" #include "gtc/type_precision.hpp" +#include "gtc/type_ptr.hpp" #include "./gtx/associated_min_max.hpp" #include "./gtx/bit.hpp" From 679e46ae9885f6ac8f6baeeae48764d6a87a1443 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Apr 2010 10:52:36 +0100 Subject: [PATCH 07/10] Removed extension for intrinsic branche --- glm/gtx/simd_common.hpp | 0 glm/gtx/simd_common.inl | 0 glm/gtx/simd_geometric.hpp | 0 glm/gtx/simd_geometric.inl | 0 glm/gtx/simd_mat4.hpp | 141 -------------------- glm/gtx/simd_mat4.inl | 221 ------------------------------- glm/gtx/simd_vec4.hpp | 127 ------------------ glm/gtx/simd_vec4.inl | 263 ------------------------------------- 8 files changed, 752 deletions(-) delete mode 100644 glm/gtx/simd_common.hpp delete mode 100644 glm/gtx/simd_common.inl delete mode 100644 glm/gtx/simd_geometric.hpp delete mode 100644 glm/gtx/simd_geometric.inl delete mode 100644 glm/gtx/simd_mat4.hpp delete mode 100644 glm/gtx/simd_mat4.inl delete mode 100644 glm/gtx/simd_vec4.hpp delete mode 100644 glm/gtx/simd_vec4.inl diff --git a/glm/gtx/simd_common.hpp b/glm/gtx/simd_common.hpp deleted file mode 100644 index e69de29b..00000000 diff --git a/glm/gtx/simd_common.inl b/glm/gtx/simd_common.inl deleted file mode 100644 index e69de29b..00000000 diff --git a/glm/gtx/simd_geometric.hpp b/glm/gtx/simd_geometric.hpp deleted file mode 100644 index e69de29b..00000000 diff --git a/glm/gtx/simd_geometric.inl b/glm/gtx/simd_geometric.inl deleted file mode 100644 index e69de29b..00000000 diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp deleted file mode 100644 index 8e99647d..00000000 --- a/glm/gtx/simd_mat4.hpp +++ /dev/null @@ -1,141 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-05-07 -// Updated : 2009-05-07 -// Licence : This source is under MIT License -// File : glm/gtx/simd_vec4.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - intrinsic -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_simd_mat4 -#define glm_gtx_simd_mat4 - -// Dependency: -#include "../glm.hpp" -#include -#include - -namespace glm -{ - namespace detail - { - GLM_ALIGN(16) struct fmat4x4SIMD - { - static __m128 one; - - enum no_init - { - NO_INIT - }; - - typedef float value_type; - typedef fvec4SIMD col_type; - typedef fvec4SIMD row_type; - typedef glm::sizeType size_type; - static size_type value_size(); - static size_type col_size(); - static size_type row_size(); - static bool is_matrix(); - - fvec4SIMD Data[4]; - - ////////////////////////////////////// - // Constructors - - fmat4x4SIMD(); - explicit fmat4x4SIMD(float const & s); - explicit fmat4x4SIMD( - float const & x0, float const & y0, float const & z0, float const & w0, - float const & x1, float const & y1, float const & z1, float const & w1, - float const & x2, float const & y2, float const & z2, float const & w2, - float const & x3, float const & y3, float const & z3, float const & w3); - explicit fmat4x4SIMD( - fvec4SIMD const & v0, - fvec4SIMD const & v1, - fvec4SIMD const & v2, - fvec4SIMD const & v3); - explicit fmat4x4SIMD( - tmat4x4 const & m); - - // Conversions - //template - //explicit tmat4x4(tmat4x4 const & m); - - //explicit tmat4x4(tmat2x2 const & x); - //explicit tmat4x4(tmat3x3 const & x); - //explicit tmat4x4(tmat2x3 const & x); - //explicit tmat4x4(tmat3x2 const & x); - //explicit tmat4x4(tmat2x4 const & x); - //explicit tmat4x4(tmat4x2 const & x); - //explicit tmat4x4(tmat3x4 const & x); - //explicit tmat4x4(tmat4x3 const & x); - - // Accesses - fvec4SIMD & operator[](size_type i); - fvec4SIMD const & operator[](size_type i) const; - - // Unary updatable operators - fmat4x4SIMD & operator= (fmat4x4SIMD const & m); - fmat4x4SIMD & operator+= (float const & s); - fmat4x4SIMD & operator+= (fmat4x4SIMD const & m); - fmat4x4SIMD & operator-= (float const & s); - fmat4x4SIMD & operator-= (fmat4x4SIMD const & m); - fmat4x4SIMD & operator*= (float const & s); - fmat4x4SIMD & operator*= (fmat4x4SIMD const & m); - fmat4x4SIMD & operator/= (float const & s); - fmat4x4SIMD & operator/= (fmat4x4SIMD const & m); - fmat4x4SIMD & operator++ (); - fmat4x4SIMD & operator-- (); - }; - - // Binary operators - fmat4x4SIMD operator+ (fmat4x4SIMD const & m, float const & s); - fmat4x4SIMD operator+ (float const & s, fmat4x4SIMD const & m); - fmat4x4SIMD operator+ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); - - fmat4x4SIMD operator- (fmat4x4SIMD const & m, float const & s); - fmat4x4SIMD operator- (float const & s, fmat4x4SIMD const & m); - fmat4x4SIMD operator- (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); - - fmat4x4SIMD operator* (fmat4x4SIMD const & m, float const & s); - fmat4x4SIMD operator* (float const & s, fmat4x4SIMD const & m); - - fvec4SIMD operator* (fmat4x4SIMD const & m, fvec4SIMD const & v); - fvec4SIMD operator* (fvec4SIMD const & v, fmat4x4SIMD const & m); - - fmat4x4SIMD operator* (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); - - fmat4x4SIMD operator/ (fmat4x4SIMD const & m, float const & s); - fmat4x4SIMD operator/ (float const & s, fmat4x4SIMD const & m); - - fvec4SIMD operator/ (fmat4x4SIMD const & m, fvec4SIMD const & v); - fvec4SIMD operator/ (fvec4SIMD const & v, fmat4x4SIMD const & m); - - fmat4x4SIMD operator/ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2); - - // Unary constant operators - fmat4x4SIMD const operator- (fmat4x4SIMD const & m); - fmat4x4SIMD const operator-- (fmat4x4SIMD const & m, int); - fmat4x4SIMD const operator++ (fmat4x4SIMD const & m, int); - - }//namespace detail - - namespace gtx{ - //! GLM_GTX_simd_mat4 extension: SIMD implementation of vec4 type. - namespace simd_mat4 - { - typedef detail::fmat4SIMD mat4SIMD; - - }//namespace simd_mat4 - }//namespace gtx -}//namespace glm - -#include "simd_mat4.inl" - -namespace glm{using namespace gtx::simd_mat4;} - -#endif//glm_gtx_simd_mat4 diff --git a/glm/gtx/simd_mat4.inl b/glm/gtx/simd_mat4.inl deleted file mode 100644 index 2b1eaa0c..00000000 --- a/glm/gtx/simd_mat4.inl +++ /dev/null @@ -1,221 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-05-19 -// Updated : 2009-05-19 -// Licence : This source is under MIT License -// File : glm/gtx/simd_mat4.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail -{ - inline fmat4x4SIMD::fmat4x4SIMD() - {} - - inline fmat4x4SIMD::fmat4x4SIMD(float const & s) - { - this->value[0] = fvec4SIMD(s, 0, 0, 0); - this->value[1] = fvec4SIMD(0, s, 0, 0); - this->value[2] = fvec4SIMD(0, 0, s, 0); - this->value[3] = fvec4SIMD(0, 0, 0, s); - } - - inline fmat4x4SIMD::fmat4x4SIMD - ( - float const & x0, float const & y0, float const & z0, float const & w0, - float const & x1, float const & y1, float const & z1, float const & w1, - float const & x2, float const & y2, float const & z2, float const & w2, - float const & x3, float const & y3, float const & z3, float const & w3 - ) - { - this->value[0] = fvec4SIMD(x0, y0, z0, w0); - this->value[1] = fvec4SIMD(x1, y1, z1, w1); - this->value[2] = fvec4SIMD(x2, y2, z2, w2); - this->value[3] = fvec4SIMD(x3, y3, z3, w3); - } - - inline fmat4x4SIMD::fmat4x4SIMD - ( - fvec4SIMD const & v0, - fvec4SIMD const & v1, - fvec4SIMD const & v2, - fvec4SIMD const & v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } - - inline fmat4x4SIMD::fmat4x4SIMD - ( - tmat4x4 const & m - ) - { - this->value[0] = fvec4SIMD(m[0]); - this->value[1] = fvec4SIMD(m[1]); - this->value[2] = fvec4SIMD(m[2]); - this->value[3] = fvec4SIMD(m[3]); - } - - ////////////////////////////////////// - // Accesses - - inline fvec4SIMD & fmat4x4SIMD::operator[] - ( - typename fmat4x4SIMD::size_type i - ) - { - assert( - i >= typename tmat4x4::size_type(0) && - i < tmat4x4::col_size()); - - return value[i]; - } - - inline fvec4SIMD const & fmat4x4SIMD::operator[] - ( - typename fmat4x4SIMD::size_type i - ) const - { - assert( - i >= typename fmat4x4SIMD::size_type(0) && - i < fmat4x4SIMD::col_size()); - - return value[i]; - } - - ////////////////////////////////////////////////////////////// - // mat4 operators - - inline fmat4x4SIMD& fmat4x4SIMD::operator= - ( - fmat4x4SIMD const & m - ) - { - this->value[0].Data = m[0].Data; - this->value[1].Data = m[1].Data; - this->value[2].Data = m[2].Data; - this->value[3].Data = m[3].Data; - return *this; - } - - inline fmat4x4SIMD & fmat4x4SIMD::operator+= - ( - fmat4x4SIMD const & m - ) - { - this->value[0].Data = _mm_add_ps(this->value[0].Data, m[0].Data); - this->value[1].Data = _mm_add_ps(this->value[1].Data, m[1].Data); - this->value[2].Data = _mm_add_ps(this->value[2].Data, m[2].Data); - this->value[3].Data = _mm_add_ps(this->value[3].Data, m[3].Data); - return *this; - } - - inline fmat4x4SIMD & fmat4x4SIMD::operator-= - ( - fmat4x4SIMD const & m - ) - { - this->value[0].Data = _mm_sub_ps(this->value[0].Data, m[0].Data); - this->value[1].Data = _mm_sub_ps(this->value[1].Data, m[1].Data); - this->value[2].Data = _mm_sub_ps(this->value[2].Data, m[2].Data); - this->value[3].Data = _mm_sub_ps(this->value[3].Data, m[3].Data); - - return *this; - } - - inline fmat4x4SIMD & fmat4x4SIMD::operator*= - ( - fmat4x4SIMD const & m - ) - { - _mm_mul_ps(this->Data, m.Data, this->Data); - return *this; - } - - inline fmat4x4SIMD & fmat4x4SIMD::operator/= - ( - fmat4x4SIMD const & m - ) - { - __m128 Inv[4]; - _mm_inverse_ps(m.Data, Inv); - _mm_mul_ps(this->Data, Inv, this->Data); - return *this; - } - - inline fmat4x4SIMD & fmat4x4SIMD::operator+= - ( - float const & s - ) - { - __m128 Operand = _mm_set_ps1(s); - this->value[0].Data = _mm_add_ps(this->value[0].Data, Operand); - this->value[1].Data = _mm_add_ps(this->value[1].Data, Operand); - this->value[2].Data = _mm_add_ps(this->value[2].Data, Operand); - this->value[3].Data = _mm_add_ps(this->value[3].Data, Operand); - return *this; - } - - inline fmat4x4SIMD & fmat4x4SIMD::operator-= - ( - float const & s - ) - { - __m128 Operand = _mm_set_ps1(s); - this->value[0].Data = _mm_sub_ps(this->value[0].Data, Operand); - this->value[1].Data = _mm_sub_ps(this->value[1].Data, Operand); - this->value[2].Data = _mm_sub_ps(this->value[2].Data, Operand); - this->value[3].Data = _mm_sub_ps(this->value[3].Data, Operand); - return *this; - } - - inline fmat4x4SIMD & fmat4x4SIMD::operator*= - ( - float const & s - ) - { - __m128 Operand = _mm_set_ps1(s); - this->value[0].Data = _mm_mul_ps(this->value[0].Data, Operand); - this->value[1].Data = _mm_mul_ps(this->value[1].Data, Operand); - this->value[2].Data = _mm_mul_ps(this->value[2].Data, Operand); - this->value[3].Data = _mm_mul_ps(this->value[3].Data, Operand); - return *this; - } - - inline fmat4x4SIMD & fmat4x4SIMD::operator/= - ( - float const & s - ) - { - __m128 Operand = _mm_div_ps(one, s)); - this->value[0].Data = _mm_mul_ps(this->value[0].Data, Operand); - this->value[1].Data = _mm_mul_ps(this->value[1].Data, Operand); - this->value[2].Data = _mm_mul_ps(this->value[2].Data, Operand); - this->value[3].Data = _mm_mul_ps(this->value[3].Data, Operand); - return *this; - } - - inline fmat4x4SIMD & fmat4x4SIMD::operator++ () - { - this->value[0].Data = _mm_add_ps(this->value[0].Data, one); - this->value[1].Data = _mm_add_ps(this->value[1].Data, one); - this->value[2].Data = _mm_add_ps(this->value[2].Data, one); - this->value[3].Data = _mm_add_ps(this->value[3].Data, one); - return *this; - } - - inline fmat4x4SIMD & fmat4x4SIMD::operator-- () - { - this->value[0].Data = _mm_sub_ps(this->value[0].Data, one); - this->value[1].Data = _mm_sub_ps(this->value[1].Data, one); - this->value[2].Data = _mm_sub_ps(this->value[2].Data, one); - this->value[3].Data = _mm_sub_ps(this->value[3].Data, one); - return *this; - } - -}//namespace detail -}//namespace glm diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp deleted file mode 100644 index a67a1b0d..00000000 --- a/glm/gtx/simd_vec4.hpp +++ /dev/null @@ -1,127 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-05-07 -// Updated : 2009-05-07 -// Licence : This source is under MIT License -// File : glm/gtx/simd_vec4.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - intrinsic -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_simd_vec4 -#define glm_gtx_simd_vec4 - -// Dependency: -#include "../glm.hpp" -#include "../core/intrinsic_common.hpp" - -namespace glm -{ - namespace detail - { - GLM_ALIGN(4) struct fvec4SIMD - { - static __m128 one; - - union - { - __m128 Data; - struct{float x, y, z, w;}; - float array[4]; - }; - - ////////////////////////////////////// - // Implicit basic constructors - - fvec4SIMD(); - fvec4SIMD(__m128 const & Data); - fvec4SIMD(fvec4SIMD const & v); - fvec4SIMD(tvec4 const & v); - - ////////////////////////////////////// - // Explicit basic constructors - - fvec4SIMD(float const & s); - fvec4SIMD(float const & x, float const & y, float const & z, float const & w); - fvec4SIMD(float const v[4]); - - //////////////////////////////////////// - //// Swizzle constructors - - //fvec4SIMD(ref4 const & r); - - //////////////////////////////////////// - //// Convertion vector constructors - - fvec4SIMD(vec2 const & v, float const & s1, float const & s2); - fvec4SIMD(float const & s1, vec2 const & v, float const & s2); - fvec4SIMD(float const & s1, float const & s2, vec2 const & v); - fvec4SIMD(vec3 const & v, float const & s); - fvec4SIMD(float const & s, vec3 const & v); - fvec4SIMD(vec2 const & v1, vec2 const & v2); - //fvec4SIMD(ivec4SIMD const & v); - - ////////////////////////////////////// - // Unary arithmetic operators - - fvec4SIMD& operator= (fvec4SIMD const & v); - fvec4SIMD& operator+=(fvec4SIMD const & v); - fvec4SIMD& operator-=(fvec4SIMD const & v); - fvec4SIMD& operator*=(fvec4SIMD const & v); - fvec4SIMD& operator/=(fvec4SIMD const & v); - - fvec4SIMD& operator+=(float const & s); - fvec4SIMD& operator-=(float const & s); - fvec4SIMD& operator*=(float const & s); - fvec4SIMD& operator/=(float const & s); - - fvec4SIMD& operator++(); - fvec4SIMD& operator--(); - - //////////////////////////////////////// - //// Unary bit operators - - //fvec4SIMD& operator%= (float s); - //fvec4SIMD& operator%= (fvec4SIMD const & v); - //fvec4SIMD& operator&= (float s); - //fvec4SIMD& operator&= (fvec4SIMD const & v); - //fvec4SIMD& operator|= (float s); - //fvec4SIMD& operator|= (fvec4SIMD const & v); - //fvec4SIMD& operator^= (float s); - //fvec4SIMD& operator^= (fvec4SIMD const & v); - //fvec4SIMD& operator<<=(float s); - //fvec4SIMD& operator<<=(fvec4SIMD const & v); - //fvec4SIMD& operator>>=(float s); - //fvec4SIMD& operator>>=(fvec4SIMD const & v); - - ////////////////////////////////////// - // Swizzle operators - - //float swizzle(comp X) const; - //vec2 const swizzle(comp X, comp Y) const; - //vec3 const swizzle(comp X, comp Y, comp Z) const; - //fvec4SIMD const swizzle(comp X, comp Y, comp Z, comp W) const; - //fvec4SIMD const swizzle(int X, int Y, int Z, int W) const; - //ref4 swizzle(comp X, comp Y, comp Z, comp W); - }; - - }//namespace detail - - namespace gtx{ - //! GLM_GTX_simd_vec4 extension: SIMD implementation of vec4 type. - namespace simd_vec4 - { - typedef detail::fvec4SIMD vec4SIMD; - - }//namespace simd_vec4 - }//namespace gtx -}//namespace glm - -#include "simd_vec4.inl" - -namespace glm{using namespace gtx::simd_vec4;} - -#endif//glm_gtx_simd_vec4 diff --git a/glm/gtx/simd_vec4.inl b/glm/gtx/simd_vec4.inl deleted file mode 100644 index ab572e4a..00000000 --- a/glm/gtx/simd_vec4.inl +++ /dev/null @@ -1,263 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-05-07 -// Updated : 2009-05-07 -// Licence : This source is under MIT License -// File : glm/gtx/simd_vec4.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - namespace detail - { - __m128 fvec4SIMD::one = _mm_set_ps1(1.f); - - ////////////////////////////////////// - // Implicit basic constructors - - inline fvec4SIMD::fvec4SIMD() - {} - - inline fvec4SIMD::fvec4SIMD(__m128 const & Data) : - Data(Data) - {} - - inline fvec4SIMD::fvec4SIMD(fvec4SIMD const & v) : - Data(v.Data) - {} - - inline fvec4SIMD::fvec4SIMD(tvec4 const & v) : - Data(_mm_set_ps(v.w, v.z, v.y, v.x)) - {} - - ////////////////////////////////////// - // Explicit basic constructors - - inline fvec4SIMD::fvec4SIMD(float const & s) : - Data(_mm_set1_ps(s)) - {} - - inline fvec4SIMD::fvec4SIMD(float const & x, float const & y, float const & z, float const & w) : - // Data(_mm_setr_ps(x, y, z, w)) - Data(_mm_set_ps(w, z, y, x)) - {} - - inline fvec4SIMD::fvec4SIMD(float const v[4]) : - Data(_mm_load_ps(v)) - {} - - ////////////////////////////////////// - // Swizzle constructors - - //fvec4SIMD(ref4 const & r); - - ////////////////////////////////////// - // Convertion vector constructors - - inline fvec4SIMD::fvec4SIMD(vec2 const & v, float const & s1, float const & s2) : - Data(_mm_set_ps(s2, s1, v.y, v.x)) - {} - - inline fvec4SIMD::fvec4SIMD(float const & s1, vec2 const & v, float const & s2) : - Data(_mm_set_ps(s2, v.y, v.x, s1)) - {} - - inline fvec4SIMD::fvec4SIMD(float const & s1, float const & s2, vec2 const & v) : - Data(_mm_set_ps(v.y, v.x, s2, s1)) - {} - - inline fvec4SIMD::fvec4SIMD(vec3 const & v, float const & s) : - Data(_mm_set_ps(s, v.z, v.y, v.x)) - {} - - inline fvec4SIMD::fvec4SIMD(float const & s, vec3 const & v) : - Data(_mm_set_ps(v.z, v.y, v.x, s)) - {} - - inline fvec4SIMD::fvec4SIMD(vec2 const & v1, vec2 const & v2) : - Data(_mm_set_ps(v2.y, v2.x, v1.y, v1.x)) - {} - - //inline fvec4SIMD::fvec4SIMD(ivec4SIMD const & v) : - // Data(_mm_cvtepi32_ps(v.Data)) - //{} - - ////////////////////////////////////// - // Unary arithmetic operators - - inline fvec4SIMD& fvec4SIMD::operator=(fvec4SIMD const & v) - { - this->Data = v.Data; - return *this; - } - - inline fvec4SIMD& fvec4SIMD::operator+=(float const & s) - { - this->Data = _mm_add_ps(Data, _mm_set_ps1(s)); - return *this; - } - - inline fvec4SIMD& fvec4SIMD::operator+=(fvec4SIMD const & v) - { - this->Data = _mm_add_ps(this->Data , v.Data); - return *this; - } - - inline fvec4SIMD& fvec4SIMD::operator-=(float const & s) - { - this->Data = _mm_sub_ps(Data, _mm_set_ps1(s)); - return *this; - } - - inline fvec4SIMD& fvec4SIMD::operator-=(fvec4SIMD const & v) - { - this->Data = _mm_sub_ps(this->Data , v.Data); - return *this; - } - - inline fvec4SIMD& fvec4SIMD::operator*=(float const & s) - { - this->Data = _mm_mul_ps(this->Data, _mm_set_ps1(s)); - return *this; - } - - inline fvec4SIMD& fvec4SIMD::operator*=(fvec4SIMD const & v) - { - this->Data = _mm_mul_ps(this->Data , v.Data); - return *this; - } - - inline fvec4SIMD& fvec4SIMD::operator/=(float const & s) - { - this->Data = _mm_div_ps(Data, _mm_set1_ps(s)); - return *this; - } - - inline fvec4SIMD& fvec4SIMD::operator/=(fvec4SIMD const & v) - { - this->Data = _mm_div_ps(this->Data , v.Data); - return *this; - } - - inline fvec4SIMD& fvec4SIMD::operator++() - { - this->Data = _mm_add_ps(this->Data , glm::detail::one); - return *this; - } - - inline fvec4SIMD& fvec4SIMD::operator--() - { - this->Data = _mm_sub_ps(this->Data , glm::detail::one); - return *this; - } - - ////////////////////////////////////// - // Swizzle operators - - //inline fvec4SIMD const fvec4SIMD::swizzle(int d, int c, int b, int a) const - //{ - // int const Mask = ((d << 6) | (c << 4) | (b << 2) | (a << 0)); - - // __m128 Data = _mm_shuffle_ps(this->Data, this->Data, Mask); - // return fvec4SIMD(Data); - //} - - // operator+ - inline fvec4SIMD operator+ (fvec4SIMD const & v, float s) - { - return fvec4SIMD(_mm_add_ps(v.Data, _mm_set1_ps(s))); - } - - inline fvec4SIMD operator+ (float s, fvec4SIMD const & v) - { - return fvec4SIMD(_mm_add_ps(_mm_set1_ps(s), v.Data)); - } - - inline fvec4SIMD operator+ (fvec4SIMD const & v1, fvec4SIMD const & v2) - { - return fvec4SIMD(_mm_add_ps(v1.Data, v2.Data)); - } - - //operator- - inline fvec4SIMD operator- (fvec4SIMD const & v, float s) - { - return fvec4SIMD(_mm_sub_ps(v.Data, _mm_set1_ps(s))); - } - - inline fvec4SIMD operator- (float s, fvec4SIMD const & v) - { - return fvec4SIMD(_mm_sub_ps(_mm_set1_ps(s), v.Data)); - } - - inline fvec4SIMD operator- (fvec4SIMD const & v1, fvec4SIMD const & v2) - { - return fvec4SIMD(_mm_sub_ps(v1.Data, v2.Data)); - } - - //operator* - inline fvec4SIMD operator* (fvec4SIMD const & v, float s) - { - __m128 par0 = v.Data; - __m128 par1 = _mm_set1_ps(s); - return fvec4SIMD(_mm_mul_ps(par0, par1)); - } - - inline fvec4SIMD operator* (float s, fvec4SIMD const & v) - { - __m128 par0 = _mm_set1_ps(s); - __m128 par1 = v.Data; - return fvec4SIMD(_mm_mul_ps(par0, par1)); - } - - inline fvec4SIMD operator* (fvec4SIMD const & v1, fvec4SIMD const & v2) - { - return fvec4SIMD(_mm_mul_ps(v1.Data, v2.Data)); - } - - //operator/ - inline fvec4SIMD operator/ (fvec4SIMD const & v, float s) - { - __m128 par0 = v.Data; - __m128 par1 = _mm_set1_ps(s); - return fvec4SIMD(_mm_div_ps(par0, par1)); - } - - inline fvec4SIMD operator/ (float s, fvec4SIMD const & v) - { - __m128 par0 = _mm_set1_ps(s); - __m128 par1 = v.Data; - return fvec4SIMD(_mm_div_ps(par0, par1)); - } - - inline fvec4SIMD operator/ (fvec4SIMD const & v1, fvec4SIMD const & v2) - { - return fvec4SIMD(_mm_div_ps(v1.Data, v2.Data)); - } - - // Unary constant operators - inline fvec4SIMD operator- (fvec4SIMD const & v) - { - return fvec4SIMD(_mm_sub_ps(_mm_setzero_ps(), v.Data)); - } - - inline fvec4SIMD operator++ (fvec4SIMD const & v, int) - { - return fvec4SIMD(_mm_add_ps(v.Data, glm::detail::one)); - } - - inline fvec4SIMD operator-- (fvec4SIMD const & v, int) - { - return fvec4SIMD(_mm_sub_ps(v.Data, glm::detail::one)); - } - - }//namespace detail - - namespace gtx{ - namespace simd_vec4 - { - - - }//namespace simd_vec4 - }//namespace gtx -}//namespace glm From ee7b52c8eebb836c05f99a82de12c8531cae07cf Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Apr 2010 10:53:48 +0100 Subject: [PATCH 08/10] Promoted extension to GTC --- glm/gtx/type_ptr.hpp | 230 ------------------------------------------- glm/gtx/type_ptr.inl | 0 2 files changed, 230 deletions(-) delete mode 100644 glm/gtx/type_ptr.hpp delete mode 100644 glm/gtx/type_ptr.inl diff --git a/glm/gtx/type_ptr.hpp b/glm/gtx/type_ptr.hpp deleted file mode 100644 index 95dc08e9..00000000 --- a/glm/gtx/type_ptr.hpp +++ /dev/null @@ -1,230 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-05-06 -// Updated : 2009-05-06 -// Licence : This source is under MIT License -// File : glm/gtx/type_ptr.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_type_ptr -#define glm_gtx_type_ptr - -// Dependency: -#include "../glm.hpp" - -namespace glm -{ - namespace test{ - void main_gtx_type_ptr(); - }//namespace test - - namespace gtx{ - //! GLM_GTX_type_ptr extension: Get access to vectors & matrices value type address. - namespace type_ptr{ - - //! Get the const address of the vector content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tvec2 const & vec) - { - return &(vec.x); - } - - //! Get the address of the vector content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tvec2 & vec) - { - return &(vec.x); - } - - //! Get the const address of the vector content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tvec3 const & vec) - { - return &(vec.x); - } - - //! Get the address of the vector content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tvec3 & vec) - { - return &(vec.x); - } - - //! Get the const address of the vector content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tvec4 const & vec) - { - return &(vec.x); - } - - //! Get the address of the vector content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tvec4 & vec) - { - return &(vec.x); - } - - //! Get the const address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tmat2x2 const & mat) - { - return &(mat[0].x); - } - - //! Get the address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tmat2x2 & mat) - { - return &(mat[0].x); - } - - //! Get the const address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tmat3x3 const & mat) - { - return &(mat[0].x); - } - - //! Get the address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tmat3x3 & mat) - { - return &(mat[0].x); - } - - //! Get the const address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tmat4x4 const & mat) - { - return &(mat[0].x); - } - - //! Get the address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tmat4x4 & mat) - { - return &(mat[0].x); - } - - //! Get the const address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tmat2x3 const & mat) - { - return &(mat[0].x); - } - - //! Get the address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tmat2x3 & mat) - { - return &(mat[0].x); - } - - //! Get the const address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tmat3x2 const & mat) - { - return &(mat[0].x); - } - - //! Get the address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tmat3x2 & mat) - { - return &(mat[0].x); - } - - //! Get the const address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tmat2x4 const & mat) - { - return &(mat[0].x); - } - - //! Get the address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tmat2x4 & mat) - { - return &(mat[0].x); - } - - //! Get the const address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tmat4x2 const & mat) - { - return &(mat[0].x); - } - - //! Get the address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tmat4x2 & mat) - { - return &(mat[0].x); - } - - //! Get the const address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tmat3x4 const & mat) - { - return &(mat[0].x); - } - - //! Get the address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tmat3x4 & mat) - { - return &(mat[0].x); - } - - //! Get the const address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType const * value_ptr(detail::tmat4x3 const & mat) - { - return &(mat[0].x); - } - - //! Get the address of the matrix content. - //! From GLM_GTX_type_ptr extension. - template - inline valType * value_ptr(detail::tmat4x3 & mat) - { - return &(mat[0].x); - } - - }//namespace type_ptr - }//namespace gtx -}//namespace glm - -#include "type_ptr.inl" - -namespace glm{using namespace gtx::type_ptr;} - -#endif//glm_gtx_type_ptr - diff --git a/glm/gtx/type_ptr.inl b/glm/gtx/type_ptr.inl deleted file mode 100644 index e69de29b..00000000 From bcd6716592ba9c90425ad95cdf373321d4bd561c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Apr 2010 11:00:54 +0100 Subject: [PATCH 09/10] Move vecx and matx --- glm/gtx/matx.hpp | 179 ---------- glm/gtx/matx.inl | 479 -------------------------- glm/gtx/vecx.hpp | 215 ------------ glm/gtx/vecx.inl | 863 ----------------------------------------------- 4 files changed, 1736 deletions(-) delete mode 100644 glm/gtx/matx.hpp delete mode 100644 glm/gtx/matx.inl delete mode 100644 glm/gtx/vecx.hpp delete mode 100644 glm/gtx/vecx.inl diff --git a/glm/gtx/matx.hpp b/glm/gtx/matx.hpp deleted file mode 100644 index 3d613d71..00000000 --- a/glm/gtx/matx.hpp +++ /dev/null @@ -1,179 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-02-21 -// Updated : 2007-03-01 -// Licence : This source is under MIT License -// File : glm/gtx/matx.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_vecx -// - GLM_GTX_matrix_selection -// - GLM_GTX_matrix_access -// - GLM_GTX_inverse_transpose -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_matx -#define glm_gtx_matx - -// Dependency: -#include "../glm.hpp" -#include "../gtx/vecx.hpp" - -namespace glm{ -namespace detail{ - - template - class _xmatxGTX - { - private: - // Data - _xvecxGTX value[N]; - - public: - _xmatxGTX _inverse() const; - - public: - typedef T value_type; - typedef int size_type; - static const size_type value_size; - - // Constructors - _xmatxGTX(); - explicit _xmatxGTX(const T x); - - // Accesses - _xvecxGTX& operator[](int i) {return value[i];} - const _xvecxGTX & operator[](int i) const {return value[i];} - operator T*() {return &value[0][0];} - operator const T*() const {return &value[0][0];} - - // Unary updatable operators - _xmatxGTX& operator= (const _xmatxGTX& m); - _xmatxGTX& operator+= (const T s); - _xmatxGTX& operator+= (const _xmatxGTX& m); - _xmatxGTX& operator-= (const T s); - _xmatxGTX& operator-= (const _xmatxGTX& m); - _xmatxGTX& operator*= (const T s); - _xmatxGTX& operator*= (const _xmatxGTX& m); - _xmatxGTX& operator/= (const T s); - _xmatxGTX& operator/= (const _xmatxGTX& m); - _xmatxGTX& operator++ (); - _xmatxGTX& operator-- (); - }; - - // Binary operators - template - _xmatxGTX operator+ (const _xmatxGTX& m, const T s); - - template - _xmatxGTX operator+ (const T s, const _xmatxGTX& m); - - template - _xvecxGTX operator+ (const _xmatxGTX& m, const _xvecxGTX& v); - - template - _xvecxGTX operator+ (const _xvecxGTX& v, const _xmatxGTX& m); - - template - _xmatxGTX operator+ (const _xmatxGTX& m1, const _xmatxGTX& m2); - - template - _xmatxGTX operator- (const _xmatxGTX& m, const T s); - - template - _xmatxGTX operator- (const T s, const _xmatxGTX& m); - - template - _xvecxGTX operator- (const _xmatxGTX& m, const _xvecxGTX& v); - - template - _xvecxGTX operator- (const _xvecxGTX& v, const _xmatxGTX& m); - - template - _xmatxGTX operator- (const _xmatxGTX& m1, const _xmatxGTX& m2); - - template - _xmatxGTX operator* (const _xmatxGTX& m, const T s); - - template - _xmatxGTX operator* (const T s, const _xmatxGTX& m); - - template - _xvecxGTX operator* (const _xmatxGTX& m, const _xvecxGTX& v); - - template - _xvecxGTX operator* (const _xvecxGTX& v, const _xmatxGTX& m); - - template - _xmatxGTX operator* (const _xmatxGTX& m1, const _xmatxGTX& m2); - - template - _xmatxGTX operator/ (const _xmatxGTX& m, const T s); - - template - _xmatxGTX operator/ (const T s, const _xmatxGTX& m); - - template - _xvecxGTX operator/ (const _xmatxGTX& m, const _xvecxGTX& v); - - template - _xvecxGTX operator/ (const _xvecxGTX& v, const _xmatxGTX& m); - - template - _xmatxGTX operator/ (const _xmatxGTX& m1, const _xmatxGTX& m2); - - // Unary constant operators - template - const _xmatxGTX operator- (const _xmatxGTX& m); - - template - const _xmatxGTX operator-- (const _xmatxGTX& m, int); - - template - const _xmatxGTX operator++ (const _xmatxGTX& m, int); - -}//namespace detail - - // Extension functions - template detail::_xmatxGTX matrixCompMultGTX(const detail::_xmatxGTX& x, const detail::_xmatxGTX& y); - template detail::_xmatxGTX outerProductGTX(const detail::_xvecxGTX& c, const detail::_xvecxGTX& r); - template detail::_xmatxGTX transposeGTX(const detail::_xmatxGTX& x); - - template T determinantGTX(const detail::_xmatxGTX& m); - template detail::_xmatxGTX inverseTransposeGTX(const detail::_xmatxGTX & m); - - template void columnGTX(detail::_xmatxGTX& m, int ColIndex, const detail::_xvecxGTX& v); - template void rowGTX(detail::_xmatxGTX& m, int RowIndex, const detail::_xvecxGTX& v); - - template detail::_xvecxGTX columnGTX(const detail::_xmatxGTX& m, int ColIndex); - template detail::_xvecxGTX rowGTX(const detail::_xmatxGTX& m, int RowIndex); - - namespace gtx - { - //! GLM_GTX_matx extension: - Work in progress - NxN matrix types. - namespace matx - { - // Matrix Functions - template inline detail::_xmatxGTX matrixCompMult(const detail::_xmatxGTX& x, const detail::_xmatxGTX& y){return matrixCompMult(x, y);} - template inline detail::_xmatxGTX outerProduct(const detail::_xvecxGTX& c, const detail::_xvecxGTX& r){return outerProductGTX(c, r);} - template inline detail::_xmatxGTX transpose(const detail::_xmatxGTX& x){return transposeGTX(x);} - - template inline T determinant(const detail::_xmatxGTX& m){return determinantGTX(m);} - template inline detail::_xmatxGTX inverseTranspose(const detail::_xmatxGTX& m){return inverseTransposeGTX(m);} - - template inline void column(detail::_xmatxGTX& m, int ColIndex, const detail::_xvecxGTX& v){setColumnGTX(m, v);} - template inline void row(detail::_xmatxGTX& m, int RowIndex, const detail::_xvecxGTX& v){setRowGTX(m, v);} - - template inline detail::_xvecxGTX column(const detail::_xmatxGTX& m, int ColIndex){return column(m, ColIndex);} - template inline detail::_xvecxGTX row(const detail::_xmatxGTX& m, int RowIndex){return row(m, RowIndex);} - } - } -} - -#include "matx.inl" - -namespace glm{using namespace gtx::matx;} - -#endif//glm_gtx_matx diff --git a/glm/gtx/matx.inl b/glm/gtx/matx.inl deleted file mode 100644 index 93d5eefa..00000000 --- a/glm/gtx/matx.inl +++ /dev/null @@ -1,479 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-02-21 -// Updated : 2007-02-21 -// Licence : This source is under MIT License -// File : glm/gtx/matx.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include -#include - -namespace glm{ -namespace detail{ - - template const typename _xmatxGTX::size_type _xmatxGTX::value_size = N; - - ////////////////////////////////////////////////////////////// - // _xmatxGTX constructors - - template - inline _xmatxGTX::_xmatxGTX() - { - for(int i = 0; i < N; ++i) - this->value[i][i] = T(0); - } - - template - inline _xmatxGTX::_xmatxGTX(const T f) - { - for(int i = 0; i < N; ++i) - this->value[i][i] = f; - } - - ////////////////////////////////////////////////////////////// - // _xmatxGTX operators - - // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared - template - inline _xmatxGTX& _xmatxGTX::operator= (const _xmatxGTX& m) - { - //memcpy could be faster - //memcpy(&this->value, &m.value, 16 * sizeof(T)); - for(int i = 0; i < N; ++i) - this->value[i] = m[i]; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator+= (const T s) - { - for(int i = 0; i < N; ++i) - this->value[i] += s; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator+= (const _xmatxGTX& m) - { - for(int i = 0; i < N; ++i) - this->value[i] += m[i]; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator-= (const T s) - { - for(int i = 0; i < N; ++i) - this->value[i] -= s; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator-= (const _xmatxGTX& m) - { - for(int i = 0; i < N; ++i) - this->value[i] -= m[i]; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator*= (const T s) - { - for(int i = 0; i < N; ++i) - this->value[i] *= s; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator*= (const _xmatxGTX& m) - { - return (*this = *this * m); - } - - template - inline _xmatxGTX& _xmatxGTX::operator/= (const T s) - { - for(int i = 0; i < N; ++i) - this->value[i] /= s; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator/= (const _xmatxGTX& m) - { - return (*this = *this / m); - } - - template - inline _xmatxGTX& _xmatxGTX::operator-- () - { - for(int i = 0; i < N; ++i) - --this->value[i]; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator++ () - { - for(int i = 0; i < N; ++i) - ++this->value[i]; - return *this; - } - - // Private functions - template - inline _xmatxGTX _xmatxGTX::_inverse() const - { - _xmatxGTX Result = *this; - - int ColIndex[N]; - int RowIndex[N]; - bool Pivoted[N]; - memset(ColIndex, 0, N * sizeof(int)); - memset(RowIndex, 0, N * sizeof(int)); - memset(Pivoted, 0, N * sizeof(bool)); - - int iRow = 0, iCol = 0; - - // elimination by full pivoting - for(int i0 = 0; i0 < N; i0++) - { - // search matrix (excluding pivoted rows) for maximum absolute entry - T fMax = T(0); - for(int i1 = 0; i1 < N; i1++) - { - if(Pivoted[i1]) - continue; - - for(int i2 = 0; i2 < N; i2++) - { - if(Pivoted[i2]) - continue; - - T Abs = abs(Result[i1][i2]); - if(Abs > fMax) - { - fMax = Abs; - iRow = i1; - iCol = i2; - } - } - } - - if(fMax == T(0)) - { - return _xmatxGTX(1.0f); // Error - } - - Pivoted[iCol] = true; - - // swap rows so that A[iCol][iCol] contains the pivot entry - if(iRow != iCol) - { - _xvecxGTX Row = rowGTX(Result, iRow); - _xvecxGTX Col = rowGTX(Result, iCol); - rowGTX(Result, iRow, Col); - rowGTX(Result, iCol, Row); - } - - // keep track of the permutations of the rows - RowIndex[i0] = iRow; - ColIndex[i0] = iCol; - - // scale the row so that the pivot entry is 1 - T fInv = T(1) / Result[iCol][iCol]; - Result[iCol][iCol] = T(1); - for(int i2 = 0; i2 < N; i2++) - Result[iCol][i2] *= fInv; - - // zero out the pivot column locations in the other rows - for(int i1 = 0; i1 < N; ++i1) - { - if(i1 == iCol) - continue; - - T Tmp = Result[i1][iCol]; - Result[i1][iCol] = T(0); - for(int i2 = 0; i2 < N; i2++) - Result[i1][i2] -= Result[iCol][i2] * Tmp; - } - } - - // reorder rows so that A[][] stores the inverse of the original matrix - for(int i1 = N-1; i1 >= 0; --i1) - { - if(RowIndex[i1] == ColIndex[i1]) - continue; - for(int i2 = 0; i2 < N; ++i2) - std::swap(Result[i2][RowIndex[i1]], Result[i2][ColIndex[i1]]); - } - - return Result; - } - - // Binary operators - template - inline _xmatxGTX operator+ (const _xmatxGTX& m, const T s) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] + s; - return result; - } - - template - inline _xmatxGTX operator+ (const T s, const _xmatxGTX& m) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = s + m[i]; - return result; - } -/* - template - inline tvec4 operator+ (const _xmatxGTX& m, const tvec4& v) - { - - } - - template - inline tvec4 operator+ (const tvec4& v, const _xmatxGTX& m) - { - - } -*/ - template - inline _xmatxGTX operator+ (const _xmatxGTX& m1, const _xmatxGTX& m2) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m1[i] + m2[i]; - return result; - } - - template - inline _xmatxGTX operator- (const _xmatxGTX& m, const T s) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] - s; - return result; - } - - template - inline _xmatxGTX operator- (const T s, const _xmatxGTX& m) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = s - m[i]; - return result; - } -/* - template - inline tvec4 operator- (const _xmatxGTX& m, const tvec4& v) - { - - } - - template - inline tvec4 operator- (const tvec4& v, const _xmatxGTX& m) - { - - } -*/ - template - inline _xmatxGTX operator- (const _xmatxGTX& m1, const _xmatxGTX& m2) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m1[i] - m2[i]; - return result; - } - - template - inline _xmatxGTX operator* (const _xmatxGTX& m, const T s) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] * s; - return result; - } - - template - inline _xmatxGTX operator* (const T s, const _xmatxGTX& m) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = s * m[i]; - return result; - } - - template - inline _xvecxGTX operator* (const _xmatxGTX& m, const _xvecxGTX& v) - { - _xvecxGTX result(T(0)); - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - result[j] += m[i][j] * v[i]; - return result; - } - - template - inline _xvecxGTX operator* (const _xvecxGTX& v, const _xmatxGTX& m) - { - _xvecxGTX result(T(0)); - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - result[j] += m[j][i] * v[i]; - return result; - } - - template - inline _xmatxGTX operator* (const _xmatxGTX& m1, const _xmatxGTX& m2) - { - _xmatxGTX Result(T(0)); - for(int k = 0; k < N; ++k) - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - Result[k][j] += m1[i][j] * m2[k][i]; - return Result; - } - - template - inline _xmatxGTX operator/ (const _xmatxGTX& m, const T s) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] / s; - return result; - } - - template - inline _xmatxGTX operator/ (const T s, const _xmatxGTX& m) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = s / m[i]; - return result; - } - - template - inline _xvecxGTX operator/ (const _xmatxGTX& m, const _xvecxGTX& v) - { - return m._inverse() * v; - } - - template - inline _xvecxGTX operator/ (const _xvecxGTX& v, const _xmatxGTX& m) - { - return v * m._inverse(); - } - - template - inline _xmatxGTX operator/ (const _xmatxGTX& m1, const _xmatxGTX& m2) - { - return m1 * m2._inverse(); - } - - // Unary constant operators - template - inline const _xmatxGTX operator- (const _xmatxGTX& m) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = -m[i]; - return result; - } - - template - inline const _xmatxGTX operator++ (const _xmatxGTX& m, int) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] + T(1); - return result; - } - - template - inline const _xmatxGTX operator-- (const _xmatxGTX& m, int) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] - T(1); - return result; - } -}//namespace detail - - // Matrix Functions - template - inline detail::_xmatxGTX matrixCompMultGTX(const detail::_xmatxGTX& x, const detail::_xmatxGTX& y) - { - detail::_xmatxGTX result; - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - result[j][i] = x[j][i] * y[j][i]; - return result; - } - - template - inline detail::_xmatxGTX outerProductGTX(const detail::_xvecxGTX& c, const detail::_xvecxGTX& r) - { - detail::_xmatxGTX result; - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - result[j][i] = c[i] * r[j]; - return result; - } - - template - inline detail::_xmatxGTX transposeGTX(const detail::_xmatxGTX& m) - { - detail::_xmatxGTX result; - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - result[j][i] = m[i][j]; - return result; - } - - template - inline T determinantGTX(const detail::_xmatxGTX& m) - { - - } - - template - inline detail::_xmatxGTX inverseTransposeGTX(const detail::_xmatxGTX& m) - { - - } - - template - inline void columnGTX(detail::_xmatxGTX& m, int ColIndex, const detail::_xvecxGTX& v) - { - m[ColIndex] = v; - } - - template - inline void rowGTX(detail::_xmatxGTX& m, int RowIndex, const detail::_xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - m[i][RowIndex] = v[i]; - } - - template - inline detail::_xvecxGTX columnGTX(const detail::_xmatxGTX& m, int ColIndex) - { - return m[ColIndex]; - } - - template - inline detail::_xvecxGTX rowGTX(const detail::_xmatxGTX& m, int RowIndex) - { - detail::_xvecxGTX v; - for(int i = 0; i < N; ++i) - v[i] = m[i][RowIndex]; - return v; - } -} //namespace glm diff --git a/glm/gtx/vecx.hpp b/glm/gtx/vecx.hpp deleted file mode 100644 index b14a2b50..00000000 --- a/glm/gtx/vecx.hpp +++ /dev/null @@ -1,215 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-02-21 -// Updated : 2007-02-21 -// Licence : This source is under MIT License -// File : glm/gtx/vecx.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_vecx -#define glm_gtx_vecx - -namespace glm{ -namespace detail{ - - template - class _bvecxGTX - { - private: - bool data[N]; - - public: - typedef bool value_type; - typedef int size_type; - static const size_type value_size; - static const size_type col_size; - static const size_type row_size; - - // Common constructors - _bvecxGTX(); - _bvecxGTX(const _bvecxGTX& v); - - // Accesses - bool& operator[](int i); - bool operator[](int i) const; - operator bool*(); - operator const bool*() const; - - // Bool constructors - explicit _bvecxGTX(const bool a); - - // Operators - _bvecxGTX& operator=(const _bvecxGTX& v); - _bvecxGTX operator! () const; - }; - - template - class _xvecxGTX - { - private: - T data[N]; - - public: - typedef T value_type; - typedef int size_type; - static const size_type value_size; - - // Common constructors - _xvecxGTX(); - _xvecxGTX(const _xvecxGTX& v); - - // Accesses - T& operator[](int i); - T operator[](int i) const; - operator T*(); - operator const T*() const; - - // T constructors - explicit _xvecxGTX(const T x); - - // Unary updatable operators - _xvecxGTX& operator= (const _xvecxGTX& v); - _xvecxGTX& operator+=(const T s); - _xvecxGTX& operator+=(const _xvecxGTX& v); - _xvecxGTX& operator-=(const T s); - _xvecxGTX& operator-=(const _xvecxGTX& v); - _xvecxGTX& operator*=(const T s); - _xvecxGTX& operator*=(const _xvecxGTX& v); - _xvecxGTX& operator/=(const T s); - _xvecxGTX& operator/=(const _xvecxGTX& v); - _xvecxGTX& operator++(); - _xvecxGTX& operator--(); - }; - - // Binary operators - template - detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v, const T s); - - template - detail::_xvecxGTX operator+ (const T s, const detail::_xvecxGTX& v); - - template - detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); - - template - detail::_xvecxGTX operator- (const detail::_xvecxGTX& v, const T s); - - template - detail::_xvecxGTX operator- (const T s, const detail::_xvecxGTX& v); - - template - detail::_xvecxGTX operator- (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); - - template - detail::_xvecxGTX operator* (const detail::_xvecxGTX& v, const T s); - - template - detail::_xvecxGTX operator* (const T s, const detail::_xvecxGTX& v); - - template - detail::_xvecxGTX operator* (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); - - template - detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v, const T s); - - template - detail::_xvecxGTX operator/ (const T s, const detail::_xvecxGTX& v); - - template - detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); - - // Unary constant operators - template - const detail::_xvecxGTX operator- (const detail::_xvecxGTX& v); - - template - const detail::_xvecxGTX operator-- (const detail::_xvecxGTX& v, int); - - template - const detail::_xvecxGTX operator++ (const detail::_xvecxGTX& v, int); - -}//namespace detail - - namespace gtx - { - //! GLM_GTX_vecx extension: - Work in progress - Add custom size vectors - namespace vecx - { - template - struct vec - { - typedef detail::_xvecxGTX type; - }; - - // Trigonometric Functions - template detail::_xvecxGTX radiansGTX(const detail::_xvecxGTX& degrees); //< \brief Converts degrees to radians and returns the result. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX degreesGTX(const detail::_xvecxGTX& radians); //< \brief Converts radians to degrees and returns the result. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX sinGTX(const detail::_xvecxGTX& angle); //< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX cosGTX(const detail::_xvecxGTX& angle); //< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX tanGTX(const detail::_xvecxGTX& angle); //< \brief The standard trigonometric tangent function. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX asinGTX(const detail::_xvecxGTX& x); //< \brief Arc sine. Returns an angle whose sine is x. The range of values returned by this function is [-PI/2, PI/2]. Results are undefined if |x| > 1. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX acosGTX(const detail::_xvecxGTX& x); //< \brief Arc cosine. Returns an angle whose sine is x. The range of values returned by this function is [0, PI]. Results are undefined if |x| > 1. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX atanGTX(const detail::_xvecxGTX& y, const detail::_xvecxGTX& x); //< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX atanGTX(const detail::_xvecxGTX& y_over_x); //< \brief Arc tangent. Returns an angle whose tangent is y_over_x. The range of values returned by this function is [-PI/2, PI/2]. (From GLM_GTX_vecx extension) - - // Exponential Functions - template detail::_xvecxGTX powGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns x raised to the y power. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX expGTX(const detail::_xvecxGTX& x); //< \brief Returns the natural exponentiation of x, i.e., e^x. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX logGTX(const detail::_xvecxGTX& x); //< \brief Returns the natural logarithm of x, i.e., returns the value y which satisfies the equation x = e^y. Results are undefined if x <= 0. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX exp2GTX(const detail::_xvecxGTX& x); //< \brief Returns 2 raised to the x power. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX log2GTX(const detail::_xvecxGTX& x); //< \brief Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX sqrtGTX(const detail::_xvecxGTX& x); //< \brief Returns the positive square root of x. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX inversesqrtGTX(const detail::_xvecxGTX& x); //< \brief Returns the reciprocal of the positive square root of x. (From GLM_GTX_vecx extension) - - // Common Functions - template detail::_xvecxGTX absGTX(const detail::_xvecxGTX& x); //< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX floorGTX(const detail::_xvecxGTX& x); //< \brief Returns a value equal to the nearest integer that is less then or equal to x. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX ceilGTX(const detail::_xvecxGTX& x); //< \brief Returns a value equal to the nearest integer that is greater than or equal to x. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX fractGTX(const detail::_xvecxGTX& x); //< \brief Return x - floor(x). (From GLM_GTX_vecx extension) - template detail::_xvecxGTX modGTX(const detail::_xvecxGTX& x, T y); //< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX modGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the corresponding component of y. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX minGTX(const detail::_xvecxGTX& x, T y); //< \brief Returns y if y < x; otherwise, it returns x. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX minGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns minimum of each component of x compared with the floating-point value y. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX maxGTX(const detail::_xvecxGTX& x, T y); //< \brief Returns y if x < y; otherwise, it returns x. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX maxGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns maximum of each component of x compared with the floating-point value y. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX clampGTX(const detail::_xvecxGTX& x, T minVal, T maxVal); //< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX clampGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& minVal, const detail::_xvecxGTX& maxVal); //< \brief Returns the component-wise result of min(max(x, minVal), maxVal). (From GLM_GTX_vecx extension) - template detail::_xvecxGTX stepGTX(T edge, const detail::_xvecxGTX& x); //< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX stepGTX(const detail::_xvecxGTX& edge, const detail::_xvecxGTX& x); //< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX smoothstepGTX(T edge0, T edge1, const detail::_xvecxGTX& x); //< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX smoothstepGTX(const detail::_xvecxGTX& edge0, const detail::_xvecxGTX& edge1, const detail::_xvecxGTX& x);//< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLM_GTX_vecx extension) - - // Geometric Functions - template T lengthGTX(const detail::_xvecxGTX& x); //< \brief Returns the length of x, i.e., sqrt(x * x). (From GLM_GTX_vecx extension) - template T distanceGTX(const detail::_xvecxGTX& p0, const detail::_xvecxGTX& p1); //< \brief Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). (From GLM_GTX_vecx extension) - template T dotGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the dot product of x and y, i.e., result = x[0] * y[0] + x[1] * y[1]. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX normalizeGTX(const detail::_xvecxGTX& x); //< \brief Returns a vector in the same direction as x but with length of 1. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX faceforwardGTX(const detail::_xvecxGTX& Norm, const detail::_xvecxGTX& I, const detail::_xvecxGTX& Nref); //< \brief If dot(Nref, I) < 0.0, return N, otherwise, return -N. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX reflectGTX(const detail::_xvecxGTX& I, const detail::_xvecxGTX& N); //< \brief For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N. (From GLM_GTX_vecx extension) - template detail::_xvecxGTX refractGTX(const detail::_xvecxGTX& I, const detail::_xvecxGTX& N, T eta); //< \brief For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. (From GLM_GTX_vecx extension) - - // Vector Relational Functions - template detail::_bvecxGTX lessThanGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x < y. (From GLM_GTX_vecx extension) - template detail::_bvecxGTX lessThanEqualGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x <= y. (From GLM_GTX_vecx extension) - template detail::_bvecxGTX greaterThanGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x > y. (From GLM_GTX_vecx extension) - template detail::_bvecxGTX greaterThanEqualGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x >= y. (From GLM_GTX_vecx extension) - template detail::_bvecxGTX equalGTX(const detail::_bvecxGTX& x, const detail::_bvecxGTX& y); //< \brief Returns the component-wise compare of x == y. (From GLM_GTX_vecx extension) - template detail::_bvecxGTX equalGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x == y. (From GLM_GTX_vecx extension) - template detail::_bvecxGTX notEqualGTX(const detail::_bvecxGTX& x, const detail::_bvecxGTX& y); //< \brief Returns the component-wise compare of x != y. (From GLM_GTX_vecx extension) - template detail::_bvecxGTX notEqualGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //< \brief Returns the component-wise compare of x != y. (From GLM_GTX_vecx extension) - template bool anyGTX(const detail::_bvecxGTX& x); //< \brief Returns true if any component of x is true. (From GLM_GTX_vecx extension) - template bool allGTX(const detail::_bvecxGTX& x); //< \brief Returns true if all component of x is true. (From GLM_GTX_vecx extension) - template detail::_bvecxGTX notGTX(const detail::_bvecxGTX& v); //< \brief Returns the component-wise logical complement of x. (From GLM_GTX_vecx extension) - } - } -} - -#include "vecx.inl" - -namespace glm{using namespace gtx::vecx;} - -#endif//glm_gtx_vecx diff --git a/glm/gtx/vecx.inl b/glm/gtx/vecx.inl deleted file mode 100644 index 2af0db4e..00000000 --- a/glm/gtx/vecx.inl +++ /dev/null @@ -1,863 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-02-21 -// Updated : 2007-02-21 -// Licence : This source is under MIT License -// File : glm/gtx/vecx.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include - -namespace glm -{ -namespace detail{ - - template const typename _bvecxGTX::size_type _bvecxGTX::value_size = N; - - // Bool constructors - template - inline _bvecxGTX::_bvecxGTX() - { - for(int i = 0; i < N; ++i) - this->data[i] = false; - } - - template - inline _bvecxGTX::_bvecxGTX(const _bvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] = v[i]; - } - - template - inline _bvecxGTX::_bvecxGTX(const bool s) - { - for(int i = 0; i < N; ++i) - this->data[i] = s; - } - - // Accesses - template - inline bool& _bvecxGTX::operator[](int i) - { - assert(i >= 0 && i < N); - return this->data[i]; - } - - template - inline bool _bvecxGTX::operator[](int i) const - { - assert(i >= 0 && i < N); - return this->data[i]; - } - - template - inline _bvecxGTX::operator bool*() - { - return data; - } - - template - inline _bvecxGTX::operator const bool*() const - { - return data; - } - - // Operators - template - inline _bvecxGTX& _bvecxGTX::operator=(const _bvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] = v[i]; - return *this; - } - - template - inline _bvecxGTX _bvecxGTX::operator! () const - { - _bvecxGTX result; - for(int i = 0; i < N; ++i) - result[i] = !this->data[i]; - return result; - } - - template const typename _xvecxGTX::size_type _xvecxGTX::value_size = N; - - // Common constructors - template - inline _xvecxGTX::_xvecxGTX() - { - for(int i = 0; i < N; ++i) - this->data[i] = T(0); - } - - template - inline _xvecxGTX::_xvecxGTX(const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] = v[i]; - } - - // T constructors - template - inline _xvecxGTX::_xvecxGTX(const T s) - { - for(int i = 0; i < N; ++i) - this->data[i] = s; - } - - // Accesses - template - inline T& _xvecxGTX::operator[](int i) - { - assert(i >= 0 && i < N); - return this->data[i]; - } - - template - inline T _xvecxGTX::operator[](int i) const - { - assert(i >= 0 && i < N); - return this->data[i]; - } - - template - inline _xvecxGTX::operator T*() - { - return data; - } - - template - inline _xvecxGTX::operator const T*() const - { - return data; - } - - template - inline _xvecxGTX& _xvecxGTX::operator=(const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] = v[i]; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator+= (const T s) - { - for(int i = 0; i < N; ++i) - this->data[i] += s; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator+=(const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] += v[i]; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator-= (const T s) - { - for(int i = 0; i < N; ++i) - this->data[i] -= s; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator-=(const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] -= v[i]; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator*=(const T s) - { - for(int i = 0; i < N; ++i) - this->data[i] *= s; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator*= (const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] *= v[i]; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator/=(const T s) - { - for(int i = 0; i < N; ++i) - this->data[i] /= s; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator/= (const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] /= v[i]; - return *this; - } - - - // Unary constant operators - template - inline const detail::_xvecxGTX operator- (const detail::_xvecxGTX& v) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = -v[i]; - return result; - } - - template - inline const detail::_xvecxGTX operator++ (const detail::_xvecxGTX& v, int) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] + T(1); - return result; - } - - template - inline const detail::_xvecxGTX operator-- (const detail::_xvecxGTX& v, int) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] - T(1); - return result; - } - - // Binary operators - template - inline detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v, const T s) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] + s; - return result; - } - - template - inline detail::_xvecxGTX operator+ (const T s, const detail::_xvecxGTX& v) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] + s; - return result; - } - - template - inline detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v1[i] + v2[i]; - return result; - } - - template - inline detail::_xvecxGTX operator- (const detail::_xvecxGTX& v, const T s) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] - s; - return result; - } - - template - inline detail::_xvecxGTX operator- (const T s, const detail::_xvecxGTX& v) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = s - v[i]; - return result; - } - - template - inline detail::_xvecxGTX operator- (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v1[i] - v2[i]; - return result; - } - - template - inline detail::_xvecxGTX operator* (const detail::_xvecxGTX& v, const T s) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] * s; - return result; - } - - template - inline detail::_xvecxGTX operator* (const T s, const detail::_xvecxGTX& v) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = s * v[i]; - return result; - } - - template - inline detail::_xvecxGTX operator* (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v1[i] * v2[i]; - return result; - } - - template - inline detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v, const T s) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] / s; - return result; - } - - template - inline detail::_xvecxGTX operator/ (const T s, const detail::_xvecxGTX& v) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = s / v[i]; - return result; - } - - template - inline detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v1[i] / v2[i]; - return result; - } - -}//namespace detail - - namespace gtx{ - namespace vecx{ - - // Trigonometric Functions - template - detail::_xvecxGTX radiansGTX(const detail::_xvecxGTX& degrees) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = radians(degrees[i]); - return result; - } - - template - detail::_xvecxGTX degreesGTX(const detail::_xvecxGTX& radians) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = degrees(radians[i]); - return result; - } - - template - detail::_xvecxGTX sinGTX(const detail::_xvecxGTX& angle) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = sin(angle[i]); - return result; - } - - template - detail::_xvecxGTX cosGTX(const detail::_xvecxGTX& angle) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = cos(angle[i]); - return result; - } - - template - detail::_xvecxGTX tanGTX(const detail::_xvecxGTX& angle) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = tan(angle[i]); - return result; - } - - template - detail::_xvecxGTX asinGTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = asin(x[i]); - return result; - } - - template - detail::_xvecxGTX acosGTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = acos(x[i]); - return result; - } - - template - detail::_xvecxGTX atanGTX(const detail::_xvecxGTX& y, const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = atan(y[i], x[i]); - return result; - } - - template - detail::_xvecxGTX atanGTX(const detail::_xvecxGTX& y_over_x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = atan(y_over_x[i]); - return result; - } - - // Exponential Functions - template - detail::_xvecxGTX powGTX(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = pow(x[i], y[i]); - return result; - } - - template - detail::_xvecxGTX expGTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = exp(x[i]); - return result; - } - - template - detail::_xvecxGTX logGTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = log(x[i]); - return result; - } - - template - detail::_xvecxGTX exp2GTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = exp2(x[i]); - return result; - } - - template - detail::_xvecxGTX log2GTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = log2(x[i]); - return result; - } - - template - detail::_xvecxGTX sqrtGTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = sqrt(x[i]); - return result; - } - - template - detail::_xvecxGTX inversesqrtGTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = inversesqrt(x[i]); - return result; - } - - // Common Functions - template - detail::_xvecxGTX absGTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = abs(x[i]); - return result; - } - - template - detail::_xvecxGTX signGTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = sign(x[i]); - return result; - } - - template - detail::_xvecxGTX floorGTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = floor(x[i]); - return result; - } - - template - detail::_xvecxGTX ceilGTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = ceil(x[i]); - return result; - } - - template - detail::_xvecxGTX fractGTX(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = fract(x[i]); - return result; - } - - template - detail::_xvecxGTX modGTX(const detail::_xvecxGTX& x, T y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = mod(x[i], y); - return result; - } - - template - detail::_xvecxGTX modGTX( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = mod(x[i], y[i]); - return result; - } - - template - detail::_xvecxGTX minGTX( - const detail::_xvecxGTX& x, - T y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = min(x[i], y); - return result; - } - - template - detail::_xvecxGTX minGTX( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = min(x[i], y[i]); - return result; - } - - template - detail::_xvecxGTX maxGTX( - const detail::_xvecxGTX& x, - T y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = max(x[i], y); - return result; - } - - template - detail::_xvecxGTX maxGTX( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = max(x[i], y[i]); - return result; - } - - template - detail::_xvecxGTX clampGTX( - const detail::_xvecxGTX& x, - T minVal, - T maxVal) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = clamp(x[i], minVal, maxVal); - return result; - } - - template - detail::_xvecxGTX clampGTX( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& minVal, - const detail::_xvecxGTX& maxVal) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = clamp(x[i], minVal[i], maxVal[i]); - return result; - } - - template - detail::_xvecxGTX stepGTX( - T edge, - const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = step(edge, x[i]); - return result; - } - - template - detail::_xvecxGTX stepGTX( - const detail::_xvecxGTX& edge, - const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = step(edge[i], x[i]); - return result; - } - - template - detail::_xvecxGTX smoothstepGTX( - T edge0, - T edge1, - const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = step(edge0, edge1, x[i]); - return result; - } - - template - detail::_xvecxGTX smoothstepGTX( - const detail::_xvecxGTX& edge0, - const detail::_xvecxGTX& edge1, - const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = step(edge0[i], edge1[i], x[i]); - return result; - } - - // Geometric Functions - template - T lengthGTX( - const detail::_xvecxGTX& x) - { - T sqr = dot(x, x); - return sqrt(sqr); - } - - template - T distanceGTX( - const detail::_xvecxGTX& p0, - const detail::_xvecxGTX& p1) - { - return lengthGTX(p1 - p0); - } - - template - T dotGTX( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - T result = T(0); - for(int i = 0; i < N; ++i) - result += x[i] * y[i]; - return result; - } - - template - detail::_xvecxGTX normalizeGTX( - const detail::_xvecxGTX& x) - { - T sqr = dot(x, x); - return x * inversesqrt(sqr); - } - - template - detail::_xvecxGTX faceforwardGTX( - const detail::_xvecxGTX& Normal, - const detail::_xvecxGTX& I, - const detail::_xvecxGTX& Nref) - { - return dot(Nref, I) < T(0) ? Normal : -Normal; - } - - template - detail::_xvecxGTX reflectGTX( - const detail::_xvecxGTX& I, - const detail::_xvecxGTX& Normal) - { - return I - Normal * dot(Normal, I) * T(2); - } - - template - detail::_xvecxGTX refractGTX( - const detail::_xvecxGTX& I, - const detail::_xvecxGTX& Normal, - T eta) - { - T dot = dot(Normal, I); - T k = T(1) - eta * eta * (T(1) - dot * dot); - if(k < T(0)) - return detail::_xvecxGTX(T(0)); - else - return eta * I - (eta * dot + sqrt(k)) * Normal; - } - - // Vector Relational Functions - template - detail::_bvecxGTX lessThanGTX( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = lessThan(x[i], y[i]); - return result; - } - - template - detail::_bvecxGTX lessThanEqualGTX( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = lessThanEqual(x[i], y[i]); - return result; - } - - template - detail::_bvecxGTX greaterThanGTX( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = greaterThan(x[i], y[i]); - return result; - } - - template - detail::_bvecxGTX greaterThanEqualGTX( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = greaterThanEqual(x[i], y[i]); - return result; - } - - template - detail::_bvecxGTX equalGTX( - const detail::_bvecxGTX& x, - const detail::_bvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = equal(x[i], y[i]); - return result; - } - - template - detail::_bvecxGTX equalGTX( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = equal(x[i], y[i]); - return result; - } - - template - detail::_bvecxGTX notEqualGTX( - const detail::_bvecxGTX& x, - const detail::_bvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = equal(x[i], y[i]); - return result; - } - - template - detail::_bvecxGTX notEqualGTX( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = notEqual(x[i], y[i]); - return result; - } - - template - bool anyGTX(const detail::_bvecxGTX& x) - { - for(int i = 0; i< N; ++i) - if(x[i]) return true; - return false; - } - - template - bool allGTX(const detail::_bvecxGTX& x) - { - for(int i = 0; i< N; ++i) - if(!x[i]) return false; - return true; - } - - template - detail::_bvecxGTX notGTX( - const detail::_bvecxGTX& v) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = !v[i]; - return result; - } - - }//namespace vecx - }//namespace gtx - -} //namespace glm From a68bb0c534f52287f2c0802486f1f29b5c2e1459 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Apr 2010 11:11:09 +0100 Subject: [PATCH 10/10] Clean up promoted extensions --- glm/ext.hpp | 26 ++++++++----------- glm/gtx/double_float.hpp | 56 ---------------------------------------- glm/gtx/double_float.inl | 13 ---------- glm/gtx/half_float.hpp | 48 ---------------------------------- glm/gtx/half_float.inl | 16 ------------ 5 files changed, 11 insertions(+), 148 deletions(-) delete mode 100644 glm/gtx/double_float.hpp delete mode 100644 glm/gtx/double_float.inl delete mode 100644 glm/gtx/half_float.hpp delete mode 100644 glm/gtx/half_float.inl diff --git a/glm/ext.hpp b/glm/ext.hpp index c66ab45f..2f054c4e 100644 --- a/glm/ext.hpp +++ b/glm/ext.hpp @@ -2,7 +2,7 @@ // OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2009-05-01 -// Updated : 2010-02-20 +// Updated : 2010-04-30 // Licence : This source is under MIT License // File : glm/ext.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -10,16 +10,16 @@ #ifndef glm_ext #define glm_ext -#include "gtc/double_float.hpp" -#include "gtc/half_float.hpp" -#include "gtc/matrix_access.hpp" -#include "gtc/matrix_operation.hpp" -#include "gtc/matrix_projection.hpp" -#include "gtc/matrix_transform.hpp" -#include "gtc/quaternion.hpp" -#include "gtc/swizzle.hpp" -#include "gtc/type_precision.hpp" -#include "gtc/type_ptr.hpp" +#include "./gtc/double_float.hpp" +#include "./gtc/half_float.hpp" +#include "./gtc/matrix_access.hpp" +#include "./gtc/matrix_operation.hpp" +#include "./gtc/matrix_projection.hpp" +#include "./gtc/matrix_transform.hpp" +#include "./gtc/quaternion.hpp" +#include "./gtc/swizzle.hpp" +#include "./gtc/type_precision.hpp" +#include "./gtc/type_ptr.hpp" #include "./gtx/associated_min_max.hpp" #include "./gtx/bit.hpp" @@ -31,7 +31,6 @@ #include "./gtx/compatibility.hpp" #include "./gtx/component_wise.hpp" #include "./gtx/determinant.hpp" -#include "./gtx/double_float.hpp" #include "./gtx/epsilon.hpp" #include "./gtx/euler_angles.hpp" #include "./gtx/extend.hpp" @@ -40,7 +39,6 @@ #include "./gtx/fast_square_root.hpp" #include "./gtx/fast_trigonometry.hpp" #include "./gtx/gradient_paint.hpp" -#include "./gtx/half_float.hpp" #include "./gtx/handed_coordinate_space.hpp" #include "./gtx/inertia.hpp" #include "./gtx/integer.hpp" @@ -55,7 +53,6 @@ #include "./gtx/matrix_projection.hpp" #include "./gtx/matrix_query.hpp" #include "./gtx/matrix_selection.hpp" -//#include "./gtx/matx.hpp" #include "./gtx/mixed_product.hpp" #include "./gtx/norm.hpp" #include "./gtx/normal.hpp" @@ -82,7 +79,6 @@ #include "./gtx/vector_access.hpp" #include "./gtx/vector_angle.hpp" #include "./gtx/vector_query.hpp" -//#include "./gtx/vecx.hpp" #include "./gtx/verbose_operator.hpp" #include "./img/multiple.hpp" diff --git a/glm/gtx/double_float.hpp b/glm/gtx/double_float.hpp deleted file mode 100644 index ffbbc0e4..00000000 --- a/glm/gtx/double_float.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2008-10-05 -// Licence : This source is under MIT License -// File : glm/gtx/double_float.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTC_double_float -// - GLM_GTX_quaternion -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Note: -// - This implementation doesn't need to redefine all build-in functions to -// support double based type. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_double_float -#define glm_gtx_double_float - -// Dependency: -#include "../glm.hpp" -#include "../gtc/double_float.hpp" -#include "../gtx/quaternion.hpp" - -namespace glm -{ - namespace test{ - void main_gtx_double_float(); - }//namespace test - - namespace gtx{ - //! GLM_GTX_double_float extension: Add support for double precision flotting-point types - namespace double_float - { - //! Quaternion of single-precision floating-point numbers. - //! From GLM_GTX_double extension. - typedef detail::tquat fquat; - - //! Quaternion of double-precision floating-point numbers. - //! From GLM_GTX_double extension. - typedef detail::tquat dquat; - - }//namespace double_float - }//namespace gtx -}//namespace glm - -#define GLM_GTX_double_float namespace gtc::double_float; using namespace gtx::double_float -#ifndef GLM_GTX_GLOBAL -namespace glm {using GLM_GTX_double_float;} -#endif//GLM_GTX_GLOBAL - -#include "double_float.inl" - -#endif//glm_gtx_double_float diff --git a/glm/gtx/double_float.inl b/glm/gtx/double_float.inl deleted file mode 100644 index 6d14a352..00000000 --- a/glm/gtx/double_float.inl +++ /dev/null @@ -1,13 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-04-29 -// Updated : 2009-04-29 -// Licence : This source is under MIT License -// File : glm/gtc/double_float.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - -} diff --git a/glm/gtx/half_float.hpp b/glm/gtx/half_float.hpp deleted file mode 100644 index 519cb23a..00000000 --- a/glm/gtx/half_float.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2009-04-29 -// Licence : This source is under MIT License -// File : glm/gtx/half_float.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTC_half_float -// - GLM_GTX_quaternion -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_half_float -#define glm_gtx_half_float - -// Dependency: -#include "../glm.hpp" -#include "../gtc/half_float.hpp" -#include "../gtx/quaternion.hpp" - -namespace glm -{ - namespace test{ - void main_ext_gtx_half_float(); - }//namespace test - - namespace gtx{ - //! GLM_GTX_half_float extension: Add support for half precision flotting-point types - namespace half_float - { - //! Quaternion of half-precision floating-point numbers. - //! From GLM_GTX_half_float extension. - typedef detail::tquat hquat; - - }//namespace half_float - }//namespace gtx -}//namespace glm - -#define GLM_GTX_half_float namespace gtc::half_float; using namespace gtx::half_float; using namespace gtx::quaternion -#ifndef GLM_GTX_GLOBAL -namespace glm {using GLM_GTX_half_float;} -#endif//GLM_GTX_GLOBAL - -#include "half_float.inl" - -#endif//glm_gtx_half_float diff --git a/glm/gtx/half_float.inl b/glm/gtx/half_float.inl deleted file mode 100644 index 82ccb4ec..00000000 --- a/glm/gtx/half_float.inl +++ /dev/null @@ -1,16 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2008-10-02 -// Licence : This source is under MIT License -// File : glm/gtx/half.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace detail{ - - - -}//namespace detail -}//namespace glm