Added GLM 0.9.0.6 changes

This commit is contained in:
Christophe Riccio 2010-12-20 01:24:59 +00:00
commit 1cef1cc4d9
11 changed files with 49 additions and 36 deletions

View File

@ -560,7 +560,7 @@ namespace glm
inline detail::tvec3<T> min inline detail::tvec3<T> min
( (
detail::tvec3<T> const & x, detail::tvec3<T> const & x,
typename detail::tvec2<T>::value_type const & y typename detail::tvec3<T>::value_type const & y
) )
{ {
return detail::tvec3<T>( return detail::tvec3<T>(

View File

@ -32,7 +32,7 @@ namespace detail
size_type i size_type i
) )
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -43,7 +43,7 @@ namespace detail
size_type i size_type i
) const ) const
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -436,6 +436,10 @@ namespace detail
m[1] * s); m[1] * s);
} }
// X
// X
// X X
// X X
template <typename T> template <typename T>
inline tmat2x2<T> operator* inline tmat2x2<T> operator*
( (
@ -460,6 +464,9 @@ namespace detail
m[0][1] * v.x + m[1][1] * v.y); m[0][1] * v.x + m[1][1] * v.y);
} }
// X X
// X X
// X X
template <typename T> template <typename T>
inline typename tmat2x2<T>::row_type operator* inline typename tmat2x2<T>::row_type operator*
( (
@ -468,8 +475,8 @@ namespace detail
) )
{ {
return detail::tvec2<T>( return detail::tvec2<T>(
m[0][0] * v.x + m[0][1] * v.y, v.x * m[0][0] + v.y * m[0][1],
m[1][0] * v.x + m[1][1] * v.y); v.x * m[1][0] + v.y * m[1][1]);
} }
template <typename T> template <typename T>

View File

@ -32,7 +32,7 @@ namespace detail
size_type i size_type i
) )
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -43,7 +43,7 @@ namespace detail
size_type i size_type i
) const ) const
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }

View File

@ -32,7 +32,7 @@ namespace detail
size_type i size_type i
) )
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -43,7 +43,7 @@ namespace detail
size_type i size_type i
) const ) const
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -433,8 +433,8 @@ namespace detail
) )
{ {
return typename tmat2x4<T>::row_type( return typename tmat2x4<T>::row_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]);
} }
template <typename T> template <typename T>

View File

@ -32,7 +32,7 @@ namespace detail
size_type i size_type i
) )
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -43,7 +43,7 @@ namespace detail
size_type i size_type i
) const ) const
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -384,7 +384,7 @@ namespace detail
typename tmat3x2<T>::value_type const & s typename tmat3x2<T>::value_type const & s
) )
{ {
return tmat3x4<T>( return tmat3x2<T>(
m[0] - s, m[0] - s,
m[1] - s, m[1] - s,
m[2] - s); m[2] - s);
@ -420,7 +420,7 @@ namespace detail
inline tmat3x2<T> operator* inline tmat3x2<T> operator*
( (
typename tmat3x2<T>::value_type const & s, typename tmat3x2<T>::value_type const & s,
const tmat3x2<T> & m tmat3x2<T> const & m
) )
{ {
return tmat3x2<T>( return tmat3x2<T>(
@ -474,7 +474,7 @@ namespace detail
const T SrcB12 = m2[1][2]; const T SrcB12 = m2[1][2];
tmat2x2<T> Result(tmat2x2<T>::null); tmat2x2<T> Result(tmat2x2<T>::null);
Result[0][0] = SrcA00 * SrcB00 + SrcA01 * SrcB01 + SrcA20 * SrcB02; Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12;
Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12;

View File

@ -32,7 +32,7 @@ namespace detail
size_type i size_type i
) )
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -43,7 +43,7 @@ namespace detail
size_type i size_type i
) const ) const
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -348,18 +348,18 @@ namespace detail
template <typename T> template <typename T>
inline tmat3x3<T> & tmat3x3<T>::operator++ () inline tmat3x3<T> & tmat3x3<T>::operator++ ()
{ {
this->value[0]++; ++this->value[0];
this->value[1]++; ++this->value[1];
this->value[2]++; ++this->value[2];
return *this; return *this;
} }
template <typename T> template <typename T>
inline tmat3x3<T> & tmat3x3<T>::operator-- () inline tmat3x3<T> & tmat3x3<T>::operator-- ()
{ {
this->value[0]--; --this->value[0];
this->value[1]--; --this->value[1];
this->value[2]--; --this->value[2];
return *this; return *this;
} }

View File

@ -32,7 +32,7 @@ namespace detail
size_type i size_type i
) )
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -43,7 +43,7 @@ namespace detail
size_type i size_type i
) const ) const
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -446,6 +446,11 @@ namespace detail
m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z); m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z);
} }
// X X X
// X X X
// X X X
// X X X
// X X X X
template <typename T> template <typename T>
inline typename tmat3x4<T>::row_type operator* inline typename tmat3x4<T>::row_type operator*
( (
@ -454,9 +459,9 @@ namespace detail
) )
{ {
return typename tmat3x4<T>::row_type( return typename tmat3x4<T>::row_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3],
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]);
} }
template <typename T> template <typename T>

View File

@ -32,7 +32,7 @@ namespace detail
size_type i size_type i
) )
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -43,7 +43,7 @@ namespace detail
size_type i size_type i
) const ) const
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -514,7 +514,7 @@ namespace detail
T const SrcB13 = m2[1][3]; T const SrcB13 = m2[1][3];
tmat2x2<T> Result(tmat2x2<T>::null); tmat2x2<T> Result(tmat2x2<T>::null);
Result[0][0] = SrcA00 * SrcB00 + SrcA01 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;
Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13;

View File

@ -32,7 +32,7 @@ namespace detail
size_type i size_type i
) )
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -43,7 +43,7 @@ namespace detail
size_type i size_type i
) const ) const
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }

View File

@ -32,7 +32,7 @@ namespace detail
size_type i size_type i
) )
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }
@ -43,7 +43,7 @@ namespace detail
size_type i size_type i
) const ) const
{ {
assert(i < col_size()); assert(i < this->row_size());
return this->value[i]; return this->value[i];
} }

View File

@ -141,6 +141,7 @@ namespace transform2
result[0][0] = scale; result[0][0] = scale;
result[1][1] = scale; result[1][1] = scale;
result[2][2] = scale; result[2][2] = scale;
return result;
} }
template <typename T> template <typename T>