add structures (WIP)

This commit is contained in:
MihailRis
2024-08-22 20:35:41 +03:00
parent 3eec97f631
commit 2d7d03efbb
5 changed files with 145 additions and 0 deletions
+25
View File
@@ -38,6 +38,20 @@ namespace dynamic {
}
}
/// TODO: remove raw pointer overloads
template <int n>
void get_vec(
const dynamic::Map* root,
const std::string& name,
glm::vec<n, int>& vec
) {
if (const auto& list = root->list(name)) {
for (size_t i = 0; i < n; i++) {
vec[i] = list->integer(i);
}
}
}
template <int n>
void get_vec(
const dynamic::List_sptr& root, size_t index, glm::vec<n, float>& vec
@@ -49,6 +63,17 @@ namespace dynamic {
}
}
template <int n>
void get_vec(
const dynamic::List_sptr& root, size_t index, glm::vec<n, int>& vec
) {
if (const auto& list = root->list(index)) {
for (size_t i = 0; i < n; i++) {
vec[i] = list->integer(i);
}
}
}
template <int n, int m>
void get_mat(
const dynamic::Map_sptr& root,