add vec2, vec3, vec4 libraries
This commit is contained in:
@@ -221,19 +221,10 @@ namespace lua {
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/// @brief pushes vector table to the stack and updates it with glm vec4
|
||||
inline int setvec4(lua::State* L, int idx, glm::vec4 vec) {
|
||||
template<int n>
|
||||
inline int setvec(lua::State* L, int idx, glm::vec<n, float> vec) {
|
||||
pushvalue(L, idx);
|
||||
for (uint i = 0; i < 4; i++) {
|
||||
pushnumber(L, vec[i]);
|
||||
rawseti(L, i+1);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/// @brief pushes vector table to the stack and updates it with glm vec3
|
||||
inline int setvec3(lua::State* L, int idx, glm::vec3 vec) {
|
||||
pushvalue(L, idx);
|
||||
for (uint i = 0; i < 3; i++) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
pushnumber(L, vec[i]);
|
||||
rawseti(L, i+1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user