mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add structures (WIP)
This commit is contained in:
parent
3eec97f631
commit
2d7d03efbb
5 changed files with 145 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue