Added glm::length and removed col_size and row_size

This commit is contained in:
Christophe Riccio
2013-12-24 09:14:51 +01:00
parent dc2b2cd5f6
commit 510abedf2b
23 changed files with 107 additions and 258 deletions

View File

@@ -32,14 +32,14 @@ namespace glm
GLM_FUNC_QUALIFIER genType row
(
genType const & m,
int const & index,
length_t const & index,
typename genType::row_type const & x
)
{
assert(index >= 0 && index < m.col_size());
assert(index >= 0 && index < m[0].length());
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];
return Result;
}
@@ -48,13 +48,13 @@ namespace glm
GLM_FUNC_QUALIFIER typename genType::row_type row
(
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;
for(int i = 0; i < genType::row_size(); ++i)
for(length_t i = 0; i < m.length(); ++i)
Result[i] = m[i][index];
return Result;
}
@@ -63,11 +63,11 @@ namespace glm
GLM_FUNC_QUALIFIER genType column
(
genType const & m,
int const & index,
length_t const & index,
typename genType::col_type const & x
)
{
assert(index >= 0 && index < m.row_size());
assert(index >= 0 && index < m.length());
genType Result = m;
Result[index] = x;
@@ -78,10 +78,10 @@ namespace glm
GLM_FUNC_QUALIFIER typename genType::col_type column
(
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];
}