PolyBone.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 "PolySceneEntity.h"
  14. #include "PolyMesh.h"
  15. #include "PolyFont.h"
  16. #include "PolyCoreServices.h"
  17. #include "PolySceneLabel.h"
  18. namespace Polycode {
  19. class _PolyExport Bone : public SceneEntity {
  20. public:
  21. Bone(string boneName);
  22. ~Bone();
  23. void enableBoneLabel(Font *font, float size, float scale);
  24. string getName();
  25. void Render();
  26. void setParentBone(Bone *bone);
  27. void addChildBone(Bone *bone);
  28. Bone* getParentBone();
  29. int getNumChildBones();
  30. Bone *getChildBone(unsigned int index);
  31. Matrix4 getBoneMatrix();
  32. void setBoneMatrix(Matrix4 matrix);
  33. Matrix4 getRestMatrix();
  34. Matrix4 getFullRestMatrix();
  35. Matrix4 getParentRestMatrix();
  36. Matrix4 getFinalMatrix();
  37. void setRestMatrix(Matrix4 matrix);
  38. int parentBoneId;
  39. protected:
  40. Matrix4 boneMatrix;
  41. Matrix4 restMatrix;
  42. Bone* parentBone;
  43. vector<Bone*> childBones;
  44. string boneName;
  45. Mesh *boneMesh;
  46. };
  47. }