add structures (WIP)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user