mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
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:
parent
fc1d884105
commit
0511f2f8f1
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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());*/
|
||||
|
Loading…
Reference in New Issue
Block a user