diff --git a/examples/libs/kine/Kine.hpp b/examples/libs/kine/Kine.hpp index 0e84497a8..25a2d31f5 100644 --- a/examples/libs/kine/Kine.hpp +++ b/examples/libs/kine/Kine.hpp @@ -36,9 +36,9 @@ namespace kine { threepp::Matrix4 result; for (unsigned i = 0, j = 0; i < components_.size(); ++i) { - auto& c = components_[i]; - if (dynamic_cast(c.get())) { - result.multiply(joints_[j]->getTransformation(values[j++])); + const auto& c = components_[i]; + if (auto joint = dynamic_cast(c.get())) { + result.multiply(joint->getTransformation(values.at(j++))); } else { result.multiply(c->getTransformation()); }