PolyBone.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * PolyBone.h
  3. * Poly
  4. *
  5. * Created by Ivan Safrin on 9/5/08.
  6. * Copyright 2008 __MyCompanyName__. All rights reserved.
  7. *
  8. */
  9. // @package BasicTypes
  10. #pragma once
  11. #include "PolyLogger.h"
  12. #include "PolyGlobals.h"
  13. #include "PolyString.h"
  14. #include "PolySceneEntity.h"
  15. #include "PolyMesh.h"
  16. #include "PolyCoreServices.h"
  17. #include "PolySceneLabel.h"
  18. #include "PolySceneLine.h"
  19. namespace Polycode {
  20. class _PolyExport Bone : public SceneEntity {
  21. public:
  22. Bone(String boneName);
  23. ~Bone();
  24. void enableBoneLabel(String labelFont, Number size, Number scale, Color labelColor);
  25. String getName();
  26. void Render();
  27. void setParentBone(Bone *bone);
  28. void addChildBone(Bone *bone);
  29. Bone* getParentBone();
  30. int getNumChildBones();
  31. Bone *getChildBone(unsigned int index);
  32. Matrix4 getBoneMatrix();
  33. void setBoneMatrix(Matrix4 matrix);
  34. Matrix4 getRestMatrix();
  35. Matrix4 getFullRestMatrix();
  36. Matrix4 getParentRestMatrix();
  37. Matrix4 getFinalMatrix();
  38. void setRestMatrix(Matrix4 matrix);
  39. void setBaseMatrix(Matrix4 matrix);
  40. Matrix4 getBaseMatrix() { return baseMatrix; }
  41. Matrix4 getFullBaseMatrix();
  42. int parentBoneId;
  43. Matrix4 boneMatrix;
  44. Matrix4 restMatrix;
  45. Matrix4 baseMatrix;
  46. protected:
  47. Mesh *boneMesh;
  48. Bone* parentBone;
  49. vector<Bone*> childBones;
  50. String boneName;
  51. };
  52. }