forward_kinematics.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_FORWARD_KINEMATICS_H
  9. #define IGL_FORWARD_KINEMATICS_H
  10. #include <Eigen/Core>
  11. #include <Eigen/Geometry>
  12. #include <vector>
  13. namespace igl
  14. {
  15. // Given a skeleton and a set of relative bone rotations compute absolute
  16. // rigid transformations for each bone.
  17. //
  18. // Inputs:
  19. // C #C by dim list of joint positions
  20. // BE #BE by 2 list of bone edge indices
  21. // P #BE list of parent indices into BE
  22. // dQ #BE list of relative rotations
  23. // Outputs:
  24. // vQ #BE list of absolute rotations
  25. // vT #BE list of absolute translations
  26. void forward_kinematics(
  27. const Eigen::MatrixXd & C,
  28. const Eigen::MatrixXi & BE,
  29. const Eigen::VectorXi & P,
  30. const std::vector<Eigen::Quaterniond> & dQ,
  31. std::vector<Eigen::Quaterniond> & vQ,
  32. std::vector<Eigen::Vector3d> & vT);
  33. };
  34. #ifdef IGL_HEADER_ONLY
  35. # include "forward_kinematics.cpp"
  36. #endif
  37. #endif