PathConstraintData.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /******************************************************************************
  2. * Spine Runtimes License Agreement
  3. * Last updated January 1, 2020. Replaces all prior versions.
  4. *
  5. * Copyright (c) 2013-2020, Esoteric Software LLC
  6. *
  7. * Integration of the Spine Runtimes into software or otherwise creating
  8. * derivative works of the Spine Runtimes is permitted under the terms and
  9. * conditions of Section 2 of the Spine Editor License Agreement:
  10. * http://esotericsoftware.com/spine-editor-license
  11. *
  12. * Otherwise, it is permitted to integrate the Spine Runtimes into software
  13. * or otherwise create derivative works of the Spine Runtimes (collectively,
  14. * "Products"), provided that each user of the Products must obtain their own
  15. * Spine Editor license and redistribution of the Products in any form must
  16. * include this license and copyright notice.
  17. *
  18. * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
  19. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  20. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
  22. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  23. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
  24. * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
  25. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. *****************************************************************************/
  29. #ifndef SPINE_PATHCONSTRAINTDATA_H_
  30. #define SPINE_PATHCONSTRAINTDATA_H_
  31. #include <spine/dll.h>
  32. #include <spine/BoneData.h>
  33. #include <spine/SlotData.h>
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. typedef enum {
  38. SP_POSITION_MODE_FIXED, SP_POSITION_MODE_PERCENT
  39. } spPositionMode;
  40. typedef enum {
  41. SP_SPACING_MODE_LENGTH, SP_SPACING_MODE_FIXED, SP_SPACING_MODE_PERCENT
  42. } spSpacingMode;
  43. typedef enum {
  44. SP_ROTATE_MODE_TANGENT, SP_ROTATE_MODE_CHAIN, SP_ROTATE_MODE_CHAIN_SCALE
  45. } spRotateMode;
  46. typedef struct spPathConstraintData {
  47. const char* const name;
  48. int order;
  49. int/*bool*/ skinRequired;
  50. int bonesCount;
  51. spBoneData** const bones;
  52. spSlotData* target;
  53. spPositionMode positionMode;
  54. spSpacingMode spacingMode;
  55. spRotateMode rotateMode;
  56. float offsetRotation;
  57. float position, spacing, rotateMix, translateMix;
  58. #ifdef __cplusplus
  59. spPathConstraintData() :
  60. name(0),
  61. order(0),
  62. skinRequired(0),
  63. bonesCount(0),
  64. bones(0),
  65. target(0),
  66. positionMode(SP_POSITION_MODE_FIXED),
  67. spacingMode(SP_SPACING_MODE_LENGTH),
  68. rotateMode(SP_ROTATE_MODE_TANGENT),
  69. offsetRotation(0),
  70. position(0),
  71. spacing(0),
  72. rotateMix(0),
  73. translateMix(0) {
  74. }
  75. #endif
  76. } spPathConstraintData;
  77. SP_API spPathConstraintData* spPathConstraintData_create (const char* name);
  78. SP_API void spPathConstraintData_dispose (spPathConstraintData* self);
  79. #ifdef SPINE_SHORT_NAMES
  80. typedef spPathConstraintData PathConstraintData;
  81. #define PathConstraintData_create(...) spPathConstraintData_create(__VA_ARGS__)
  82. #define PathConstraintData_dispose(...) spPathConstraintData_dispose(__VA_ARGS__)
  83. #endif
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #endif /* SPINE_PATHCONSTRAINTDATA_H_ */