Animations accessible. Pass map of animation names and phases and pass a vector of the lods you want to animate.

This commit is contained in:
Nou 2015-05-10 20:17:32 -07:00
parent fc1d884105
commit 0511f2f8f1
3 changed files with 8 additions and 8 deletions

View File

@ -414,14 +414,14 @@ ace::simulation::object::~object()
}
void ace::simulation::object::animate(const std::map<std::string, float> &animation_state, const std::vector<std::string> &selected_lods)
void ace::simulation::object::animate(const std::map<std::string, float> &animation_state, const std::vector<uint32_t> &selected_lods)
{
std::vector<uint32_t> lods;
lods.push_back(1);
animation_transform identity_transform;
identity_transform[1].first = glm::mat4();
identity_transform[1].second = ace::vector3<float>(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<float>(0, 0, 0);
}
this->root_bone->animate(animation_state, selected_lods, identity_transform);
}

View File

@ -209,7 +209,7 @@ namespace ace {
std::vector<animation_p> animations;
void animate(const std::map<std::string, float> &, const std::vector<std::string> &);
void animate(const std::map<std::string, float> &, const std::vector<std::uint32_t> &);
std::map<std::string, bone_p> all_bones;

View File

@ -31,7 +31,7 @@ int main(int argc, char **argv) {
test_phases["box1"] = 1.0f;
std::vector<std::string> 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());*/