Joint.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef JOINT_H_
  2. #define JOINT_H_
  3. #include "Node.h"
  4. namespace gameplay
  5. {
  6. class MeshSkin;
  7. class Package;
  8. /**
  9. * Defines a basic hierachial structure of transformation spaces.
  10. */
  11. class Joint : public Node
  12. {
  13. friend class Node;
  14. friend class MeshSkin;
  15. friend class Package;
  16. public:
  17. /**
  18. * @see Node::getType()
  19. */
  20. Node::Type getType() const;
  21. /**
  22. * Returns the inverse bind pose matrix for this joint.
  23. *
  24. * @return Inverse bind pose matrix.
  25. */
  26. const Matrix& getInverseBindPose() const;
  27. protected:
  28. /**
  29. * Constructor.
  30. */
  31. Joint(const char* id);
  32. /**
  33. * Destructor.
  34. */
  35. virtual ~Joint();
  36. /**
  37. * Creates a new joint with the given id.
  38. *
  39. * @param id ID string.
  40. *
  41. * @return Newly created joint.
  42. */
  43. static Joint* create(const char* id);
  44. /**
  45. * Sets the inverse bind pose matrix.
  46. *
  47. * @param m Matrix representing the inverse bind pose for this Joint.
  48. */
  49. void setInverseBindPose(const Matrix& m);
  50. void updateJointMatrix(const Matrix& bindShape, Vector4* matrixPalette);
  51. void transformChanged();
  52. Matrix _bindPose;
  53. bool _jointMatrixDirty;
  54. unsigned int _skinCount;
  55. };
  56. }
  57. #endif