Added glm::length and removed col_size and row_size
This commit is contained in:
parent
dc2b2cd5f6
commit
510abedf2b
@ -41,7 +41,7 @@ namespace glm
|
|||||||
GLM_STATIC_ASSERT(std::numeric_limits<typename matType::value_type>::is_iec559, "'matrixCompMult' only accept floating-point inputs");
|
GLM_STATIC_ASSERT(std::numeric_limits<typename matType::value_type>::is_iec559, "'matrixCompMult' only accept floating-point inputs");
|
||||||
|
|
||||||
matType result(matType::_null);
|
matType result(matType::_null);
|
||||||
for(typename matType::size_type i = 0; i < matType::row_size(); ++i)
|
for(length_t i = 0; i < result.length(); ++i)
|
||||||
result[i] = x[i] * y[i];
|
result[i] = x[i] * y[i];
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ namespace glm
|
|||||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'outerProduct' only accept floating-point inputs");
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'outerProduct' only accept floating-point inputs");
|
||||||
|
|
||||||
detail::tmat3x3<T, P> m(detail::tmat3x3<T, P>::null);
|
detail::tmat3x3<T, P> m(detail::tmat3x3<T, P>::null);
|
||||||
for(typename detail::tmat3x3<T, P>::size_type i(0); i < m.length(); ++i)
|
for(length_t i(0); i < m.length(); ++i)
|
||||||
m[i] = c * r[i];
|
m[i] = c * r[i];
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ namespace glm
|
|||||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'outerProduct' only accept floating-point inputs");
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'outerProduct' only accept floating-point inputs");
|
||||||
|
|
||||||
detail::tmat4x4<T, P> m(detail::tmat4x4<T, P>::null);
|
detail::tmat4x4<T, P> m(detail::tmat4x4<T, P>::null);
|
||||||
for(typename detail::tmat4x4<T, P>::size_type i(0); i < m.length(); ++i)
|
for(length_t i(0); i < m.length(); ++i)
|
||||||
m[i] = c * r[i];
|
m[i] = c * r[i];
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
@ -48,9 +48,6 @@ namespace detail
|
|||||||
typedef tmat2x2<T, P> type;
|
typedef tmat2x2<T, P> type;
|
||||||
typedef tmat2x2<T, P> transpose_type;
|
typedef tmat2x2<T, P> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
|
||||||
|
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
||||||
|
|
||||||
friend tmat2x2<T, P> inverse(tmat2x2<T, P> const & m);
|
friend tmat2x2<T, P> inverse(tmat2x2<T, P> const & m);
|
||||||
@ -123,8 +120,8 @@ namespace detail
|
|||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Accesses
|
// Accesses
|
||||||
|
|
||||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
GLM_FUNC_DECL col_type & operator[](length_t i);
|
||||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
|
||||||
|
|
||||||
// Unary updatable operators
|
// Unary updatable operators
|
||||||
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & m);
|
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & m);
|
||||||
|
@ -35,18 +35,6 @@ namespace detail
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::size_type tmat2x2<T, P>::col_size()
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::size_type tmat2x2<T, P>::row_size()
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Accesses
|
// Accesses
|
||||||
|
|
||||||
@ -54,7 +42,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type &
|
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type &
|
||||||
tmat2x2<T, P>::operator[]
|
tmat2x2<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
@ -65,7 +53,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const &
|
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const &
|
||||||
tmat2x2<T, P>::operator[]
|
tmat2x2<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
|
@ -49,9 +49,6 @@ namespace detail
|
|||||||
typedef tmat2x3<T, P> type;
|
typedef tmat2x3<T, P> type;
|
||||||
typedef tmat3x2<T, P> transpose_type;
|
typedef tmat3x2<T, P> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
|
||||||
|
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -114,8 +111,8 @@ namespace detail
|
|||||||
GLM_FUNC_DECL explicit tmat2x3(tmat4x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat2x3(tmat4x3<T, P> const & x);
|
||||||
|
|
||||||
// Accesses
|
// Accesses
|
||||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
GLM_FUNC_DECL col_type & operator[](length_t i);
|
||||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
|
||||||
|
|
||||||
// Unary updatable operators
|
// Unary updatable operators
|
||||||
GLM_FUNC_DECL tmat2x3<T, P> & operator= (tmat2x3<T, P> const & m);
|
GLM_FUNC_DECL tmat2x3<T, P> & operator= (tmat2x3<T, P> const & m);
|
||||||
|
@ -35,18 +35,6 @@ namespace detail
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::size_type tmat2x3<T, P>::col_size()
|
|
||||||
{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::size_type tmat2x3<T, P>::row_size()
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Accesses
|
// Accesses
|
||||||
|
|
||||||
@ -54,7 +42,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type &
|
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type &
|
||||||
tmat2x3<T, P>::operator[]
|
tmat2x3<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
@ -65,7 +53,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const &
|
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const &
|
||||||
tmat2x3<T, P>::operator[]
|
tmat2x3<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
|
@ -49,9 +49,6 @@ namespace detail
|
|||||||
typedef tmat2x4<T, P> type;
|
typedef tmat2x4<T, P> type;
|
||||||
typedef tmat4x2<T, P> transpose_type;
|
typedef tmat4x2<T, P> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
|
||||||
|
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -116,8 +113,8 @@ namespace detail
|
|||||||
GLM_FUNC_DECL explicit tmat2x4(tmat4x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat2x4(tmat4x3<T, P> const & x);
|
||||||
|
|
||||||
// Accesses
|
// Accesses
|
||||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
GLM_FUNC_DECL col_type & operator[](length_t i);
|
||||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
|
||||||
|
|
||||||
// Unary updatable operators
|
// Unary updatable operators
|
||||||
GLM_FUNC_DECL tmat2x4<T, P>& operator= (tmat2x4<T, P> const & m);
|
GLM_FUNC_DECL tmat2x4<T, P>& operator= (tmat2x4<T, P> const & m);
|
||||||
|
@ -35,18 +35,6 @@ namespace detail
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::size_type tmat2x4<T, P>::col_size()
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::size_type tmat2x4<T, P>::row_size()
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Accesses
|
// Accesses
|
||||||
|
|
||||||
@ -54,7 +42,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type &
|
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type &
|
||||||
tmat2x4<T, P>::operator[]
|
tmat2x4<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
@ -65,7 +53,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const &
|
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const &
|
||||||
tmat2x4<T, P>::operator[]
|
tmat2x4<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
|
@ -49,9 +49,6 @@ namespace detail
|
|||||||
typedef tmat3x2<T, P> type;
|
typedef tmat3x2<T, P> type;
|
||||||
typedef tmat2x3<T, P> transpose_type;
|
typedef tmat2x3<T, P> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
|
||||||
|
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -120,8 +117,8 @@ namespace detail
|
|||||||
GLM_FUNC_DECL explicit tmat3x2(tmat4x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat3x2(tmat4x3<T, P> const & x);
|
||||||
|
|
||||||
// Accesses
|
// Accesses
|
||||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
GLM_FUNC_DECL col_type & operator[](length_t i);
|
||||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
|
||||||
|
|
||||||
// Unary updatable operators
|
// Unary updatable operators
|
||||||
GLM_FUNC_DECL tmat3x2<T, P> & operator= (tmat3x2<T, P> const & m);
|
GLM_FUNC_DECL tmat3x2<T, P> & operator= (tmat3x2<T, P> const & m);
|
||||||
|
@ -35,18 +35,6 @@ namespace detail
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::size_type tmat3x2<T, P>::col_size()
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::size_type tmat3x2<T, P>::row_size()
|
|
||||||
{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Accesses
|
// Accesses
|
||||||
|
|
||||||
@ -54,7 +42,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type &
|
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type &
|
||||||
tmat3x2<T, P>::operator[]
|
tmat3x2<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
@ -65,7 +53,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const &
|
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const &
|
||||||
tmat3x2<T, P>::operator[]
|
tmat3x2<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
|
@ -48,9 +48,6 @@ namespace detail
|
|||||||
typedef tmat3x3<T, P> type;
|
typedef tmat3x3<T, P> type;
|
||||||
typedef tmat3x3<T, P> transpose_type;
|
typedef tmat3x3<T, P> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
|
||||||
|
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
||||||
|
|
||||||
friend tmat3x3<T, P> inverse(tmat3x3<T, P> const & m);
|
friend tmat3x3<T, P> inverse(tmat3x3<T, P> const & m);
|
||||||
@ -126,8 +123,8 @@ namespace detail
|
|||||||
GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T, P> const & x);
|
||||||
|
|
||||||
// Accesses
|
// Accesses
|
||||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
GLM_FUNC_DECL col_type & operator[](length_t i);
|
||||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
|
||||||
|
|
||||||
// Unary updatable operators
|
// Unary updatable operators
|
||||||
GLM_FUNC_DECL tmat3x3<T, P>& operator= (tmat3x3<T, P> const & m);
|
GLM_FUNC_DECL tmat3x3<T, P>& operator= (tmat3x3<T, P> const & m);
|
||||||
|
@ -35,18 +35,6 @@ namespace detail
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::size_type tmat3x3<T, P>::col_size()
|
|
||||||
{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::size_type tmat3x3<T, P>::row_size()
|
|
||||||
{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Accesses
|
// Accesses
|
||||||
|
|
||||||
@ -54,7 +42,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type &
|
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type &
|
||||||
tmat3x3<T, P>::operator[]
|
tmat3x3<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
@ -65,7 +53,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const &
|
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const &
|
||||||
tmat3x3<T, P>::operator[]
|
tmat3x3<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
|
@ -49,9 +49,6 @@ namespace detail
|
|||||||
typedef tmat3x4<T, P> type;
|
typedef tmat3x4<T, P> type;
|
||||||
typedef tmat4x3<T, P> transpose_type;
|
typedef tmat4x3<T, P> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
|
||||||
|
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -120,8 +117,8 @@ namespace detail
|
|||||||
GLM_FUNC_DECL explicit tmat3x4(tmat4x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat3x4(tmat4x3<T, P> const & x);
|
||||||
|
|
||||||
// Accesses
|
// Accesses
|
||||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
GLM_FUNC_DECL col_type & operator[](length_t i);
|
||||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
|
||||||
|
|
||||||
// Unary updatable operators
|
// Unary updatable operators
|
||||||
GLM_FUNC_DECL tmat3x4<T, P> & operator= (tmat3x4<T, P> const & m);
|
GLM_FUNC_DECL tmat3x4<T, P> & operator= (tmat3x4<T, P> const & m);
|
||||||
|
@ -35,18 +35,6 @@ namespace detail
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::size_type tmat3x4<T, P>::col_size()
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::size_type tmat3x4<T, P>::row_size()
|
|
||||||
{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Accesses
|
// Accesses
|
||||||
|
|
||||||
@ -54,7 +42,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type &
|
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type &
|
||||||
tmat3x4<T, P>::operator[]
|
tmat3x4<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
@ -65,7 +53,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const &
|
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const &
|
||||||
tmat3x4<T, P>::operator[]
|
tmat3x4<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
|
@ -49,9 +49,6 @@ namespace detail
|
|||||||
typedef tmat4x2<T, P> type;
|
typedef tmat4x2<T, P> type;
|
||||||
typedef tmat2x4<T, P> transpose_type;
|
typedef tmat2x4<T, P> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
|
||||||
|
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -125,8 +122,8 @@ namespace detail
|
|||||||
GLM_FUNC_DECL explicit tmat4x2(tmat3x4<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat4x2(tmat3x4<T, P> const & x);
|
||||||
|
|
||||||
// Accesses
|
// Accesses
|
||||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
GLM_FUNC_DECL col_type & operator[](length_t i);
|
||||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
|
||||||
|
|
||||||
// Unary updatable operators
|
// Unary updatable operators
|
||||||
GLM_FUNC_DECL tmat4x2<T, P>& operator= (tmat4x2<T, P> const & m);
|
GLM_FUNC_DECL tmat4x2<T, P>& operator= (tmat4x2<T, P> const & m);
|
||||||
|
@ -35,18 +35,6 @@ namespace detail
|
|||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::size_type tmat4x2<T, P>::col_size()
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::size_type tmat4x2<T, P>::row_size()
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Accesses
|
// Accesses
|
||||||
|
|
||||||
@ -54,7 +42,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type &
|
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type &
|
||||||
tmat4x2<T, P>::operator[]
|
tmat4x2<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
@ -65,7 +53,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const &
|
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const &
|
||||||
tmat4x2<T, P>::operator[]
|
tmat4x2<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
|
@ -49,9 +49,6 @@ namespace detail
|
|||||||
typedef tmat4x3<T, P> type;
|
typedef tmat4x3<T, P> type;
|
||||||
typedef tmat3x4<T, P> transpose_type;
|
typedef tmat3x4<T, P> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
|
||||||
|
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -35,18 +35,6 @@ namespace detail
|
|||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::size_type tmat4x3<T, P>::col_size()
|
|
||||||
{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::size_type tmat4x3<T, P>::row_size()
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Accesses
|
// Accesses
|
||||||
|
|
||||||
|
@ -52,9 +52,6 @@ namespace detail
|
|||||||
typedef tmat4x4<T, P> type;
|
typedef tmat4x4<T, P> type;
|
||||||
typedef tmat4x4<T, P> transpose_type;
|
typedef tmat4x4<T, P> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
|
||||||
|
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
|
||||||
|
|
||||||
friend tmat4x4<T, P> inverse(tmat4x4<T, P> const & m);
|
friend tmat4x4<T, P> inverse(tmat4x4<T, P> const & m);
|
||||||
@ -135,8 +132,8 @@ namespace detail
|
|||||||
GLM_FUNC_DECL explicit tmat4x4(tmat4x3<T, P> const & x);
|
GLM_FUNC_DECL explicit tmat4x4(tmat4x3<T, P> const & x);
|
||||||
|
|
||||||
// Accesses
|
// Accesses
|
||||||
GLM_FUNC_DECL col_type & operator[](size_type i);
|
GLM_FUNC_DECL col_type & operator[](length_t i);
|
||||||
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
|
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
|
||||||
|
|
||||||
// Unary updatable operators
|
// Unary updatable operators
|
||||||
GLM_FUNC_DECL tmat4x4<T, P> & operator= (tmat4x4<T, P> const & m);
|
GLM_FUNC_DECL tmat4x4<T, P> & operator= (tmat4x4<T, P> const & m);
|
||||||
|
@ -35,18 +35,6 @@ namespace detail
|
|||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::size_type tmat4x4<T, P>::col_size()
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::size_type tmat4x4<T, P>::row_size()
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Accesses
|
// Accesses
|
||||||
|
|
||||||
@ -54,7 +42,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type &
|
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type &
|
||||||
tmat4x4<T, P>::operator[]
|
tmat4x4<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
@ -65,7 +53,7 @@ namespace detail
|
|||||||
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const &
|
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const &
|
||||||
tmat4x4<T, P>::operator[]
|
tmat4x4<T, P>::operator[]
|
||||||
(
|
(
|
||||||
size_type i
|
length_t i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
|
@ -32,14 +32,14 @@ namespace glm
|
|||||||
GLM_FUNC_QUALIFIER genType row
|
GLM_FUNC_QUALIFIER genType row
|
||||||
(
|
(
|
||||||
genType const & m,
|
genType const & m,
|
||||||
int const & index,
|
length_t const & index,
|
||||||
typename genType::row_type const & x
|
typename genType::row_type const & x
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(index >= 0 && index < m.col_size());
|
assert(index >= 0 && index < m[0].length());
|
||||||
|
|
||||||
genType Result = m;
|
genType Result = m;
|
||||||
for(int i = 0; i < genType::row_size(); ++i)
|
for(length_t i = 0; i < m.length(); ++i)
|
||||||
Result[i][index] = x[i];
|
Result[i][index] = x[i];
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
@ -48,13 +48,13 @@ namespace glm
|
|||||||
GLM_FUNC_QUALIFIER typename genType::row_type row
|
GLM_FUNC_QUALIFIER typename genType::row_type row
|
||||||
(
|
(
|
||||||
genType const & m,
|
genType const & m,
|
||||||
int const & index
|
length_t const & index
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(index >= 0 && index < m.col_size());
|
assert(index >= 0 && index < m[0].length());
|
||||||
|
|
||||||
typename genType::row_type Result;
|
typename genType::row_type Result;
|
||||||
for(int i = 0; i < genType::row_size(); ++i)
|
for(length_t i = 0; i < m.length(); ++i)
|
||||||
Result[i] = m[i][index];
|
Result[i] = m[i][index];
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
@ -63,11 +63,11 @@ namespace glm
|
|||||||
GLM_FUNC_QUALIFIER genType column
|
GLM_FUNC_QUALIFIER genType column
|
||||||
(
|
(
|
||||||
genType const & m,
|
genType const & m,
|
||||||
int const & index,
|
length_t const & index,
|
||||||
typename genType::col_type const & x
|
typename genType::col_type const & x
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(index >= 0 && index < m.row_size());
|
assert(index >= 0 && index < m.length());
|
||||||
|
|
||||||
genType Result = m;
|
genType Result = m;
|
||||||
Result[index] = x;
|
Result[index] = x;
|
||||||
@ -78,10 +78,10 @@ namespace glm
|
|||||||
GLM_FUNC_QUALIFIER typename genType::col_type column
|
GLM_FUNC_QUALIFIER typename genType::col_type column
|
||||||
(
|
(
|
||||||
genType const & m,
|
genType const & m,
|
||||||
int const & index
|
length_t const & index
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(index >= 0 && index < m.row_size());
|
assert(index >= 0 && index < m.length());
|
||||||
|
|
||||||
return m[index];
|
return m[index];
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ namespace glm
|
|||||||
T const & epsilon)
|
T const & epsilon)
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
for(int i = 0; result && i < 2 ; ++i)
|
for(length_t i = 0; result && i < 2 ; ++i)
|
||||||
result = isNull(m[i], epsilon);
|
result = isNull(m[i], epsilon);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -32,7 +32,7 @@ namespace glm
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
for(int i = 0; result && i < 3 ; ++i)
|
for(length_t i = 0; result && i < 3 ; ++i)
|
||||||
result = isNull(m[i], epsilon);
|
result = isNull(m[i], epsilon);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ namespace glm
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
for(int i = 0; result && i < 4 ; ++i)
|
for(length_t i = 0; result && i < 4 ; ++i)
|
||||||
result = isNull(m[i], epsilon);
|
result = isNull(m[i], epsilon);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -58,13 +58,13 @@ namespace glm
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
for(int i(0); result && i < matType<T, P>::col_size(); ++i)
|
for(length_t i(0); result && i < m[0].length(); ++i)
|
||||||
{
|
{
|
||||||
for(int j(0); result && j < i ; ++j)
|
for(length_t j(0); result && j < i ; ++j)
|
||||||
result = abs(m[i][j]) <= epsilon;
|
result = abs(m[i][j]) <= epsilon;
|
||||||
if(result)
|
if(result)
|
||||||
result = abs(m[i][i] - 1) <= epsilon;
|
result = abs(m[i][i] - 1) <= epsilon;
|
||||||
for(int j(i + 1); result && j < matType<T, P>::row_size(); ++j)
|
for(length_t j(i + 1); result && j < m.length(); ++j)
|
||||||
result = abs(m[i][j]) <= epsilon;
|
result = abs(m[i][j]) <= epsilon;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -78,12 +78,12 @@ namespace glm
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
bool result(true);
|
bool result(true);
|
||||||
for(int i(0); result && i < m.length(); ++i)
|
for(length_t i(0); result && i < m.length(); ++i)
|
||||||
result = isNormalized(m[i], epsilon);
|
result = isNormalized(m[i], epsilon);
|
||||||
for(int i(0); result && i < m.length(); ++i)
|
for(length_t i(0); result && i < m.length(); ++i)
|
||||||
{
|
{
|
||||||
typename detail::tmat2x2<T, P>::col_type v;
|
typename detail::tmat2x2<T, P>::col_type v;
|
||||||
for(int j(0); j < m.length(); ++j)
|
for(length_t j(0); j < m.length(); ++j)
|
||||||
v[j] = m[j][i];
|
v[j] = m[j][i];
|
||||||
result = isNormalized(v, epsilon);
|
result = isNormalized(v, epsilon);
|
||||||
}
|
}
|
||||||
@ -98,12 +98,12 @@ namespace glm
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
bool result(true);
|
bool result(true);
|
||||||
for(int i(0); result && i < m.length(); ++i)
|
for(length_t i(0); result && i < m.length(); ++i)
|
||||||
result = isNormalized(m[i], epsilon);
|
result = isNormalized(m[i], epsilon);
|
||||||
for(int i(0); result && i < m.length(); ++i)
|
for(length_t i(0); result && i < m.length(); ++i)
|
||||||
{
|
{
|
||||||
typename detail::tmat3x3<T, P>::col_type v;
|
typename detail::tmat3x3<T, P>::col_type v;
|
||||||
for(int j(0); j < m.length(); ++j)
|
for(length_t j(0); j < m.length(); ++j)
|
||||||
v[j] = m[j][i];
|
v[j] = m[j][i];
|
||||||
result = isNormalized(v, epsilon);
|
result = isNormalized(v, epsilon);
|
||||||
}
|
}
|
||||||
@ -118,12 +118,12 @@ namespace glm
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
bool result(true);
|
bool result(true);
|
||||||
for(int i(0); result && i < m.length(); ++i)
|
for(length_t i(0); result && i < m.length(); ++i)
|
||||||
result = isNormalized(m[i], epsilon);
|
result = isNormalized(m[i], epsilon);
|
||||||
for(int i(0); result && i < m.length(); ++i)
|
for(length_t i(0); result && i < m.length(); ++i)
|
||||||
{
|
{
|
||||||
typename detail::tmat4x4<T, P>::col_type v;
|
typename detail::tmat4x4<T, P>::col_type v;
|
||||||
for(int j(0); j < m.length(); ++j)
|
for(length_t j(0); j < m.length(); ++j)
|
||||||
v[j] = m[j][i];
|
v[j] = m[j][i];
|
||||||
result = isNormalized(v, epsilon);
|
result = isNormalized(v, epsilon);
|
||||||
}
|
}
|
||||||
@ -138,15 +138,15 @@ namespace glm
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
bool result(true);
|
bool result(true);
|
||||||
for(int i(0); result && i < m.length() - 1; ++i)
|
for(length_t i(0); result && i < m.length() - 1; ++i)
|
||||||
for(int j(i + 1); result && j < m.length(); ++j)
|
for(length_t j(i + 1); result && j < m.length(); ++j)
|
||||||
result = areOrthogonal(m[i], m[j], epsilon);
|
result = areOrthogonal(m[i], m[j], epsilon);
|
||||||
|
|
||||||
if(result)
|
if(result)
|
||||||
{
|
{
|
||||||
matType<T, P> tmp = transpose(m);
|
matType<T, P> tmp = transpose(m);
|
||||||
for(int i(0); result && i < m.length() - 1 ; ++i)
|
for(length_t i(0); result && i < m.length() - 1 ; ++i)
|
||||||
for(int j(i + 1); result && j < m.length(); ++j)
|
for(length_t j(i + 1); result && j < m.length(); ++j)
|
||||||
result = areOrthogonal(tmp[i], tmp[j], epsilon);
|
result = areOrthogonal(tmp[i], tmp[j], epsilon);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -68,8 +68,6 @@ namespace detail
|
|||||||
typedef fvec4SIMD row_type;
|
typedef fvec4SIMD row_type;
|
||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
static size_type value_size();
|
static size_type value_size();
|
||||||
static size_type col_size();
|
|
||||||
static size_type row_size();
|
|
||||||
static bool is_matrix();
|
static bool is_matrix();
|
||||||
|
|
||||||
fvec4SIMD Data[4];
|
fvec4SIMD Data[4];
|
||||||
@ -108,8 +106,8 @@ namespace detail
|
|||||||
//explicit tmat4x4(tmat4x3<T> const & x);
|
//explicit tmat4x4(tmat4x3<T> const & x);
|
||||||
|
|
||||||
// Accesses
|
// Accesses
|
||||||
fvec4SIMD & operator[](size_type i);
|
fvec4SIMD & operator[](length_t i);
|
||||||
fvec4SIMD const & operator[](size_type i) const;
|
fvec4SIMD const & operator[](length_t i) const;
|
||||||
|
|
||||||
// Unary updatable operators
|
// Unary updatable operators
|
||||||
fmat4x4SIMD & operator= (fmat4x4SIMD const & m);
|
fmat4x4SIMD & operator= (fmat4x4SIMD const & m);
|
||||||
|
@ -15,16 +15,6 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD::size_type fmat4x4SIMD::value_size()
|
|||||||
return sizeof(value_type);
|
return sizeof(value_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
GLM_FUNC_QUALIFIER fmat4x4SIMD::size_type fmat4x4SIMD::col_size()
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
GLM_FUNC_QUALIFIER fmat4x4SIMD::size_type fmat4x4SIMD::row_size()
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD()
|
GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD()
|
||||||
{
|
{
|
||||||
#ifndef GLM_SIMD_ENABLE_DEFAULT_INIT
|
#ifndef GLM_SIMD_ENABLE_DEFAULT_INIT
|
||||||
@ -98,24 +88,20 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD
|
|||||||
|
|
||||||
GLM_FUNC_QUALIFIER fvec4SIMD & fmat4x4SIMD::operator[]
|
GLM_FUNC_QUALIFIER fvec4SIMD & fmat4x4SIMD::operator[]
|
||||||
(
|
(
|
||||||
fmat4x4SIMD::size_type i
|
length i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(
|
assert(i < this->length());
|
||||||
//i >= fmat4x4SIMD::size_type(0) &&
|
|
||||||
i < fmat4x4SIMD::col_size());
|
|
||||||
|
|
||||||
return this->Data[i];
|
return this->Data[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
GLM_FUNC_QUALIFIER fvec4SIMD const & fmat4x4SIMD::operator[]
|
GLM_FUNC_QUALIFIER fvec4SIMD const & fmat4x4SIMD::operator[]
|
||||||
(
|
(
|
||||||
fmat4x4SIMD::size_type i
|
length i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
assert(
|
assert(i < this->length());
|
||||||
//i >= fmat4x4SIMD::size_type(0) &&
|
|
||||||
i < fmat4x4SIMD::col_size());
|
|
||||||
|
|
||||||
return this->Data[i];
|
return this->Data[i];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user