Skeleton.pkg 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. $#include "Graphics/Skeleton.h"
  2. struct Bone
  3. {
  4. Bone();
  5. ~Bone();
  6. String name_ @ name;
  7. StringHash nameHash_ @ nameHash;
  8. unsigned parentIndex_ @ parentIndex;
  9. Vector3 initialPosition_ @ initialPosition;
  10. Quaternion initialRotation_ @ initialRotation;
  11. Vector3 initialScale_ @ initialScale;
  12. Matrix3x4 offsetMatrix_ @ offsetMatrix;
  13. bool animated_ @ animated;
  14. unsigned char collisionMask_ @ collisionMask;
  15. float radius_ @ radius;
  16. BoundingBox boundingBox_ @ boundingBox;
  17. Node* node_ @ node;
  18. };
  19. class Skeleton
  20. {
  21. unsigned GetNumBones() const;
  22. Bone* GetRootBone();
  23. Bone* GetBone(const String name);
  24. Bone* GetBone(unsigned index);
  25. unsigned GetBoneIndex(const String boneName) const;
  26. unsigned GetBoneIndex(const Bone* bone) const;
  27. Bone* GetBoneParent(const Bone* bone);
  28. tolua_readonly tolua_property__get_set unsigned numBones;
  29. tolua_readonly tolua_property__get_set Bone* rootBone;
  30. };
  31. ${
  32. #define TOLUA_DISABLE_tolua_set_Bone_unsigned_collisionMask
  33. static int tolua_set_Bone_unsigned_collisionMask(lua_State* tolua_S)
  34. {
  35. Bone* self = (Bone*) tolua_tousertype(tolua_S,1,0);
  36. #ifndef TOLUA_RELEASE
  37. tolua_Error tolua_err;
  38. if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'collisionMask_'",NULL);
  39. if (!tolua_isnumber(tolua_S,2,0,&tolua_err))
  40. tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
  41. #endif
  42. self->collisionMask_ = BoneCollisionShape((unsigned char) tolua_tonumber(tolua_S,2,0))
  43. ;
  44. return 0;
  45. }
  46. $}