SkinNode.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef SKIN_NODE_H
  2. #define SKIN_NODE_H
  3. #include "SceneNode.h"
  4. #include "SkinPatchNode.h"
  5. #include "Vec.h"
  6. #include "Math.h"
  7. #include "Properties.h"
  8. class Skin;
  9. class SkelAnimModelNodeCtrl;
  10. /// A skin scene node
  11. class SkinNode: public SceneNode
  12. {
  13. public:
  14. SkelAnimModelNodeCtrl* skelAnimModelNodeCtrl; ///< @todo fix this crap
  15. SkinNode(): SceneNode(SNT_SKIN, true, NULL) {}
  16. /// @name Accessors
  17. /// @{
  18. GETTER_RW(Vec<Vec3>, heads, getHeads)
  19. GETTER_RW(Vec<Vec3>, tails, getTails)
  20. GETTER_RW(Vec<Mat3>, boneRotations, getBoneRotations)
  21. GETTER_RW(Vec<Vec3>, boneTranslations, getBoneTranslations)
  22. const Skin& getSkin() const {return *skin;}
  23. GETTER_R(Obb, visibilityShapeWSpace, getVisibilityShapeWSpace)
  24. GETTER_R(Vec<SkinPatchNode*>, patches, getPatcheNodes)
  25. /// @}
  26. void init(const char* filename);
  27. /// Update boundingShapeWSpace from bone tails (not heads as well cause its faster that way). The tails come
  28. /// from the previous frame
  29. void moveUpdate();
  30. void frameUpdate() {}
  31. private:
  32. RsrcPtr<Skin> skin; ///< The resource
  33. Vec<SkinPatchNode*> patches;
  34. Obb visibilityShapeWSpace;
  35. /// @name Bone data
  36. /// @{
  37. Vec<Vec3> heads;
  38. Vec<Vec3> tails;
  39. Vec<Mat3> boneRotations;
  40. Vec<Vec3> boneTranslations;
  41. /// @}
  42. };
  43. #endif