From 0511f2f8f1a7db8914f7e85329d2da8abdc2509d Mon Sep 17 00:00:00 2001 From: Nou Date: Sun, 10 May 2015 20:17:32 -0700 Subject: [PATCH] Animations accessible. Pass map of animation names and phases and pass a vector of the lods you want to animate. --- extensions/common/simulation/object.cpp | 12 ++++++------ extensions/common/simulation/object.hpp | 2 +- extensions/tests/p3d_parser.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/extensions/common/simulation/object.cpp b/extensions/common/simulation/object.cpp index bdb737c599..39354e4e45 100644 --- a/extensions/common/simulation/object.cpp +++ b/extensions/common/simulation/object.cpp @@ -414,14 +414,14 @@ ace::simulation::object::~object() } -void ace::simulation::object::animate(const std::map &animation_state, const std::vector &selected_lods) +void ace::simulation::object::animate(const std::map &animation_state, const std::vector &selected_lods) { - std::vector lods; - lods.push_back(1); animation_transform identity_transform; - identity_transform[1].first = glm::mat4(); - identity_transform[1].second = ace::vector3(0, 0, 0); - this->root_bone->animate(animation_state, lods, identity_transform); + for (uint32_t lod_id : selected_lods) { + identity_transform[lod_id].first = glm::mat4(); + identity_transform[lod_id].second = ace::vector3(0, 0, 0); + } + this->root_bone->animate(animation_state, selected_lods, identity_transform); } diff --git a/extensions/common/simulation/object.hpp b/extensions/common/simulation/object.hpp index b9dbb6e661..a77da9d5cf 100644 --- a/extensions/common/simulation/object.hpp +++ b/extensions/common/simulation/object.hpp @@ -209,7 +209,7 @@ namespace ace { std::vector animations; - void animate(const std::map &, const std::vector &); + void animate(const std::map &, const std::vector &); std::map all_bones; diff --git a/extensions/tests/p3d_parser.cpp b/extensions/tests/p3d_parser.cpp index 4b761e61c6..5b6072a690 100644 --- a/extensions/tests/p3d_parser.cpp +++ b/extensions/tests/p3d_parser.cpp @@ -31,7 +31,7 @@ int main(int argc, char **argv) { test_phases["box1"] = 1.0f; std::vector test_lods; test_lods.push_back("GEO"); - _object.animate(test_phases, test_lods); + //_object.animate(test_phases, test_lods); /*printf("lod 0 face 0: %f %f %f\n\n", _object.lods[0]->faces[0]->vertices[0]->x(), _object.lods[0]->faces[0]->vertices[1]->y(), _object.lods[0]->selections[0]->faces[0]->vertices[0]->z());*/