draw_skeleton_3d.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_OPENGL2_DRAW_SKELETON_3D_H
  9. #define IGL_OPENGL2_DRAW_SKELETON_3D_H
  10. #include "../igl_inline.h"
  11. #include "../material_colors.h"
  12. #include <Eigen/Core>
  13. namespace igl
  14. {
  15. namespace opengl2
  16. {
  17. // Draw a skeleton
  18. //
  19. // Inputs:
  20. // C #C by dim List of joint rest positions
  21. // BE #BE by 2 list of bone edge indices into C
  22. // T #BE*(dim+1) by dim matrix of stacked transposed bone transformations
  23. // color #BE|1 by 4 list of color
  24. // half_bbd half bounding box diagonal to determine scaling {1.0}
  25. template <
  26. typename DerivedC,
  27. typename DerivedBE,
  28. typename DerivedT,
  29. typename Derivedcolor>
  30. IGL_INLINE void draw_skeleton_3d(
  31. const Eigen::PlainObjectBase<DerivedC> & C,
  32. const Eigen::PlainObjectBase<DerivedBE> & BE,
  33. const Eigen::PlainObjectBase<DerivedT> & T,
  34. const Eigen::PlainObjectBase<Derivedcolor> & color,
  35. const double half_bbd=0.5);
  36. // Default color
  37. template <typename DerivedC, typename DerivedBE, typename DerivedT>
  38. IGL_INLINE void draw_skeleton_3d(
  39. const Eigen::PlainObjectBase<DerivedC> & C,
  40. const Eigen::PlainObjectBase<DerivedBE> & BE,
  41. const Eigen::PlainObjectBase<DerivedT> & T);
  42. template <typename DerivedC, typename DerivedBE>
  43. IGL_INLINE void draw_skeleton_3d(
  44. const Eigen::PlainObjectBase<DerivedC> & C,
  45. const Eigen::PlainObjectBase<DerivedBE> & BE);
  46. }
  47. }
  48. #ifndef IGL_STATIC_LIBRARY
  49. # include "draw_skeleton_3d.cpp"
  50. #endif
  51. #endif