Skeleton.pkg 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. $#include "Skeleton.h"
  2. /// %Bone in a skeleton.
  3. struct Bone
  4. {
  5. /// Construct with defaults.
  6. Bone();
  7. /// Bone name.
  8. String name_ @ name;
  9. /// Bone name hash.
  10. StringHash nameHash_ @ nameHash;
  11. /// Parent bone index.
  12. unsigned parentIndex_ @ parentIndex;
  13. /// Reset position.
  14. Vector3 initialPosition_ @ initialPosition;
  15. /// Reset rotation.
  16. Quaternion initialRotation_ @ initialRotation;
  17. /// Reset scale.
  18. Vector3 initialScale_ @ initialScale;
  19. /// Offset matrix.
  20. Matrix3x4 offsetMatrix_ @ offsetMatrix;
  21. /// Animation enable flag.
  22. bool animated_ @ animated;
  23. /// Supported collision types.
  24. unsigned char collisionMask_ @ collisionMask;
  25. /// Radius.
  26. float radius_ @ radius;
  27. /// Local-space bounding box.
  28. BoundingBox boundingBox_ @ boundingBox;
  29. /// Scene node.
  30. Node* node_ @ node;
  31. };
  32. /// Hierarchical collection of bones.
  33. class Skeleton
  34. {
  35. public:
  36. /// Return number of bones.
  37. unsigned GetNumBones() const;
  38. /// Return root bone.
  39. Bone* GetRootBone();
  40. /// Return bone by index.
  41. Bone* GetBone(unsigned index);
  42. };