mirror of
https://github.com/g-truc/glm.git
synced 2024-11-29 11:24:35 +00:00
Fixes submitted by ticket #30
This commit is contained in:
parent
4409032a9d
commit
e07f5f1f24
@ -18,6 +18,8 @@ int main()
|
||||
glm::mat2x3 o = m / x;
|
||||
glm::mat2x3 p = x * m;
|
||||
glm::mat2x3 q = m * x;
|
||||
|
||||
glm::mat2x3::col_type v1 = m[3]
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -436,6 +436,10 @@ namespace detail
|
||||
m[1] * s);
|
||||
}
|
||||
|
||||
// X
|
||||
// X
|
||||
// X X
|
||||
// X X
|
||||
template <typename T>
|
||||
inline tmat2x2<T> operator*
|
||||
(
|
||||
@ -460,6 +464,9 @@ namespace detail
|
||||
m[0][1] * v.x + m[1][1] * v.y);
|
||||
}
|
||||
|
||||
// X X
|
||||
// X X
|
||||
// X X
|
||||
template <typename T>
|
||||
inline typename tmat2x2<T>::row_type operator*
|
||||
(
|
||||
@ -468,8 +475,8 @@ namespace detail
|
||||
)
|
||||
{
|
||||
return detail::tvec2<T>(
|
||||
m[0][0] * v.x + m[0][1] * v.y,
|
||||
m[1][0] * v.x + m[1][1] * v.y);
|
||||
v.x * m[0][0] + v.y * m[0][1],
|
||||
v.x * m[1][0] + v.y * m[1][1]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -433,8 +433,8 @@ namespace detail
|
||||
)
|
||||
{
|
||||
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,
|
||||
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w);
|
||||
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
|
||||
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -384,7 +384,7 @@ namespace detail
|
||||
typename tmat3x2<T>::value_type const & s
|
||||
)
|
||||
{
|
||||
return tmat3x4<T>(
|
||||
return tmat3x2<T>(
|
||||
m[0] - s,
|
||||
m[1] - s,
|
||||
m[2] - s);
|
||||
@ -420,7 +420,7 @@ namespace detail
|
||||
inline tmat3x2<T> operator*
|
||||
(
|
||||
typename tmat3x2<T>::value_type const & s,
|
||||
const tmat3x2<T> & m
|
||||
tmat3x2<T> const & m
|
||||
)
|
||||
{
|
||||
return tmat3x2<T>(
|
||||
@ -474,7 +474,7 @@ namespace detail
|
||||
const T SrcB12 = m2[1][2];
|
||||
|
||||
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[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12;
|
||||
Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12;
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -348,18 +348,18 @@ namespace detail
|
||||
template <typename T>
|
||||
inline tmat3x3<T> & tmat3x3<T>::operator++ ()
|
||||
{
|
||||
this->value[0]++;
|
||||
this->value[1]++;
|
||||
this->value[2]++;
|
||||
++this->value[0];
|
||||
++this->value[1];
|
||||
++this->value[2];
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline tmat3x3<T> & tmat3x3<T>::operator-- ()
|
||||
{
|
||||
this->value[0]--;
|
||||
this->value[1]--;
|
||||
this->value[2]--;
|
||||
--this->value[0];
|
||||
--this->value[1];
|
||||
--this->value[2];
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
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);
|
||||
}
|
||||
|
||||
// X X X
|
||||
// X X X
|
||||
// X X X
|
||||
// X X X
|
||||
// X X X X
|
||||
template <typename T>
|
||||
inline typename tmat3x4<T>::row_type operator*
|
||||
(
|
||||
@ -454,9 +459,9 @@ namespace detail
|
||||
)
|
||||
{
|
||||
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,
|
||||
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);
|
||||
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
|
||||
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3],
|
||||
v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -514,7 +514,7 @@ namespace detail
|
||||
T const SrcB13 = m2[1][3];
|
||||
|
||||
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[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;
|
||||
Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13;
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace detail
|
||||
size_type i
|
||||
)
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace detail
|
||||
size_type i
|
||||
) const
|
||||
{
|
||||
assert(i < col_size());
|
||||
assert(i < this->row_size());
|
||||
return this->value[i];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user