mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-04 10:40:09 -06:00
Remove glm_cols and glm_rows function calls in favor of built-in GLM functions
This commit is contained in:
Submodule ext/ghoul updated: 37757a2e83...1f97e924b3
@@ -36,8 +36,8 @@ glm::dmat2x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::dmat2x2 result;
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x2::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -63,8 +63,8 @@ glm::dmat2x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::dmat2x2 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x2::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, value[i][j]);
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat2x2 value) {
|
||||
glm::dmat2x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::dmat2x2 result = glm::dmat2x2(1.0);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::dmat2x2>::value * ghoul::glm_cols<glm::dmat2x2>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::dmat2x2>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x2::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::dmat2x2::value_type v;
|
||||
s >> v;
|
||||
@@ -104,8 +102,8 @@ glm::dmat2x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::dmat2x2 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x2::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::dmat2x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::dmat2x3 result;
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -63,8 +63,8 @@ glm::dmat2x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::dmat2x3 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, value[i][j]);
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat2x3 value) {
|
||||
glm::dmat2x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::dmat2x3 result = glm::dmat2x3(1.0);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::dmat2x3>::value * ghoul::glm_cols<glm::dmat2x3>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::dmat2x3>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::dmat2x3::value_type v;
|
||||
s >> v;
|
||||
@@ -104,8 +102,8 @@ glm::dmat2x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::dmat2x3 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::dmat2x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::dmat2x4 result;
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x4::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -63,8 +63,8 @@ glm::dmat2x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::dmat2x4 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x4::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, value[i][j]);
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat2x4 value) {
|
||||
glm::dmat2x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::dmat2x4 result = glm::dmat2x4(1.0);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::dmat2x4>::value * ghoul::glm_cols<glm::dmat2x4>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::dmat2x4>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x4::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::dmat2x4::value_type v;
|
||||
s >> v;
|
||||
@@ -104,8 +102,8 @@ glm::dmat2x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::dmat2x4 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat2x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat2x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat2x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x4::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::dmat3x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::dmat3x3 result;
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -63,8 +63,8 @@ glm::dmat3x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::dmat3x3 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, value[i][j]);
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat3x3 value) {
|
||||
glm::dmat3x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::dmat3x3 result = glm::dmat3x3(1.0);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::dmat3x3>::value * ghoul::glm_cols<glm::dmat3x3>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::dmat3x3>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::dmat3x3::value_type v;
|
||||
s >> v;
|
||||
@@ -104,8 +102,8 @@ glm::dmat3x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::dmat3x3 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::dmat3x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::dmat3x2 result;
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat3x2::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -63,8 +63,8 @@ glm::dmat3x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::dmat3x2 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat3x2::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, value[i][j]);
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat3x2 value) {
|
||||
glm::dmat3x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::dmat3x2 result = glm::dmat3x2(1.0);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::dmat3x2>::value * ghoul::glm_cols<glm::dmat3x2>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::dmat3x2>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat3x2::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::dmat3x2::value_type v;
|
||||
s >> v;
|
||||
@@ -104,8 +102,8 @@ glm::dmat3x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::dmat3x2 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat3x2::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::dmat3x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::dmat3x4 result;
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat3x4::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -63,8 +63,8 @@ glm::dmat3x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::dmat3x4 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat3x4::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, value[i][j]);
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::dmat3x4 value) {
|
||||
glm::dmat3x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::dmat3x4 result = glm::dmat3x4(1.0);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::dmat3x4>::value * ghoul::glm_cols<glm::dmat3x4>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::dmat3x4>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat3x4::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::dmat3x4::value_type v;
|
||||
s >> v;
|
||||
@@ -105,8 +103,8 @@ glm::dmat3x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::dmat3x4 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat3x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat3x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat3x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat3x4::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::dmat4x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::dmat4x4 result;
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x4::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -63,8 +63,8 @@ glm::dmat4x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::dmat4x4 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x4::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, value[i][j]);
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat4x4 value) {
|
||||
glm::dmat4x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::dmat4x4 result = glm::dmat4x4(1.0);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::dmat4x4>::value * ghoul::glm_cols<glm::dmat4x4>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::dmat4x4>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x4::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::dmat4x4::value_type v;
|
||||
s >> v;
|
||||
@@ -104,8 +102,8 @@ glm::dmat4x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::dmat4x4 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x4::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::dmat4x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::dmat4x2 result;
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x2::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -63,8 +63,8 @@ glm::dmat4x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::dmat4x2 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x2::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, value[i][j]);
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat4x2 value) {
|
||||
glm::dmat4x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::dmat4x2 result = glm::dmat4x2(1.0);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::dmat4x2>::value * ghoul::glm_cols<glm::dmat4x2>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::dmat4x2>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x2::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::dmat4x2::value_type v;
|
||||
s >> v;
|
||||
@@ -104,8 +102,8 @@ glm::dmat4x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::dmat4x2 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x2::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::dmat4x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::dmat4x3 result;
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x3::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -63,8 +63,8 @@ glm::dmat4x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::dmat4x3 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x3::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, value[i][j]);
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat4x3 value) {
|
||||
glm::dmat4x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::dmat4x3 result = glm::dmat4x3(1.0);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::dmat4x3>::value * ghoul::glm_cols<glm::dmat4x3>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::dmat4x3>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x3::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::dmat4x3::value_type v;
|
||||
s >> v;
|
||||
@@ -104,8 +102,8 @@ glm::dmat4x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::dmat4x3 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::dmat4x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::dmat4x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::dmat4x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::dmat4x3::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::mat2x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::mat2x2 result = glm::mat2x2(1.f);
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x2::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -65,8 +65,8 @@ glm::mat2x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::mat2x2 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x2::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, static_cast<lua_Number>(value[i][j]));
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -78,15 +78,13 @@ bool toLuaConversion(lua_State* state, glm::mat2x2 value) {
|
||||
glm::mat2x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::mat2x2 result = glm::mat2x2(1.f);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::mat2x2>::value * ghoul::glm_cols<glm::mat2x2>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::mat2x2>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x2::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::mat2x2::value_type v;
|
||||
s >> v;
|
||||
@@ -106,8 +104,8 @@ glm::mat2x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::mat2x2 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x2::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ glm::mat2x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::mat2x3 result = glm::mat2x3(1.f);
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x3::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -66,8 +66,8 @@ glm::mat2x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::mat2x3 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x3::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, static_cast<lua_Number>(value[i][j]));
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -79,15 +79,13 @@ bool toLuaConversion(lua_State* state, glm::mat2x3 value) {
|
||||
glm::mat2x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::mat2x3 result = glm::mat2x3(1.f);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::mat2x3>::value * ghoul::glm_cols<glm::mat2x3>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::mat2x3>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x3::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::mat2x3::value_type v;
|
||||
s >> v;
|
||||
@@ -107,8 +105,8 @@ glm::mat2x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::mat2x3 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x3::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::mat2x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::mat2x4 result = glm::mat2x4(1.f);
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x4::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -64,8 +64,8 @@ glm::mat2x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::mat2x4 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x4::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, static_cast<lua_Number>(value[i][j]));
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat2x4 value) {
|
||||
glm::mat2x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::mat2x4 result = glm::mat2x4(1.f);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::mat2x4>::value * ghoul::glm_cols<glm::mat2x4>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::mat2x4>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x4::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::mat2x4::value_type v;
|
||||
s >> v;
|
||||
@@ -105,8 +103,8 @@ glm::mat2x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::mat2x4 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat2x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat2x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat2x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat2x4::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::mat3x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::mat3x3 result = glm::mat3x3(1.f);
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x3::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -64,8 +64,8 @@ glm::mat3x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::mat3x3 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x3::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, static_cast<lua_Number>(value[i][j]));
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat3x3 value) {
|
||||
glm::mat3x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::mat3x3 result = glm::mat3x3(1.f);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::mat3x3>::value * ghoul::glm_cols<glm::mat3x3>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::mat3x3>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x3::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::mat3x3::value_type v;
|
||||
s >> v;
|
||||
@@ -105,8 +103,8 @@ glm::mat3x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::mat3x3 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x3::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::mat3x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::mat3x2 result = glm::mat3x2(1.f);
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x2::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -64,8 +64,8 @@ glm::mat3x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::mat3x2 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x2::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, static_cast<lua_Number>(value[i][j]));
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat3x2 value) {
|
||||
glm::mat3x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::mat3x2 result = glm::mat3x2(1.f);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::mat3x2>::value * ghoul::glm_cols<glm::mat3x2>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::mat3x2>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x2::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::mat3x2::value_type v;
|
||||
s >> v;
|
||||
@@ -105,8 +103,8 @@ glm::mat3x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::mat3x2 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x2::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::mat3x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::mat3x4 result = glm::mat3x4(1.f);
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x4::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -64,8 +64,8 @@ glm::mat3x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::mat3x4 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x4::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, static_cast<lua_Number>(value[i][j]));
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat3x4 value) {
|
||||
glm::mat3x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::mat3x4 result = glm::mat3x4(1.f);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::mat3x4>::value * ghoul::glm_cols<glm::mat3x4>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::mat3x4>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x4::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::mat3x4::value_type v;
|
||||
s >> v;
|
||||
@@ -105,8 +103,8 @@ glm::mat3x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::mat3x4 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat3x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat3x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat3x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat3x4::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ glm::mat4x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::mat4x4 result = glm::mat4x4(1.f);
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x4::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -66,8 +66,8 @@ glm::mat4x4 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::mat4x4 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x4::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, static_cast<lua_Number>(value[i][j]));
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -79,15 +79,13 @@ bool toLuaConversion(lua_State* state, glm::mat4x4 value) {
|
||||
glm::mat4x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::mat4x4 result = glm::mat4x4(1.f);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::mat4x4>::value * ghoul::glm_cols<glm::mat4x4>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::mat4x4>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x4::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::mat4x4::value_type v;
|
||||
s >> v;
|
||||
@@ -107,8 +105,8 @@ glm::mat4x4 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::mat4x4 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x4>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x4>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x4::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x4::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::mat4x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::mat4x2 result = glm::mat4x2(1.f);
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x2::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -64,8 +64,8 @@ glm::mat4x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::mat4x2 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x2::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, static_cast<lua_Number>(value[i][j]));
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat4x2 value) {
|
||||
glm::mat4x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::mat4x2 result = glm::mat4x2(1.f);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::mat4x2>::value * ghoul::glm_cols<glm::mat4x2>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::mat4x2>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x2::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::mat4x2::value_type v;
|
||||
s >> v;
|
||||
@@ -105,8 +103,8 @@ glm::mat4x2 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::mat4x2 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x2>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x2>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x2::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x2::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ glm::mat4x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
glm::mat4x3 result = glm::mat4x3(1.f);
|
||||
lua_pushnil(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x3::col_type::length(); ++j) {
|
||||
int hasNext = lua_next(state, -2);
|
||||
if (hasNext != 1) {
|
||||
success = false;
|
||||
@@ -64,8 +64,8 @@ glm::mat4x3 fromLuaConversion(lua_State* state, bool& success) {
|
||||
bool toLuaConversion(lua_State* state, glm::mat4x3 value) {
|
||||
lua_newtable(state);
|
||||
int number = 1;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x3::col_type::length(); ++j) {
|
||||
lua_pushnumber(state, static_cast<lua_Number>(value[i][j]));
|
||||
lua_rawseti(state, -2, number);
|
||||
++number;
|
||||
@@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat4x3 value) {
|
||||
glm::mat4x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
glm::mat4x3 result = glm::mat4x3(1.f);
|
||||
std::vector<std::string> tokens = ghoul::tokenizeString(val, ',');
|
||||
if (tokens.size() !=
|
||||
(ghoul::glm_rows<glm::mat4x3>::value * ghoul::glm_cols<glm::mat4x3>::value))
|
||||
{
|
||||
if (tokens.size() != ghoul::glm_components<glm::mat4x3>::value) {
|
||||
success = false;
|
||||
return result;
|
||||
}
|
||||
int number = 0;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x3::col_type::length(); ++j) {
|
||||
std::stringstream s(tokens[number]);
|
||||
glm::mat4x3::value_type v;
|
||||
s >> v;
|
||||
@@ -105,8 +103,8 @@ glm::mat4x3 fromStringConversion(const std::string& val, bool& success) {
|
||||
|
||||
bool toStringConversion(std::string& outValue, glm::mat4x3 inValue) {
|
||||
outValue = "[";
|
||||
for (glm::length_t i = 0; i < ghoul::glm_cols<glm::mat4x3>::value; ++i) {
|
||||
for (glm::length_t j = 0; j < ghoul::glm_rows<glm::mat4x3>::value; ++j) {
|
||||
for (glm::length_t i = 0; i < glm::mat4x3::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < glm::mat4x3::col_type::length(); ++j) {
|
||||
outValue += std::to_string(inValue[i][j]) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user