BoneData.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. #ifdef SPINE_UE4
  30. #include "SpinePluginPrivatePCH.h"
  31. #endif
  32. #include <spine/BoneData.h>
  33. #include <assert.h>
  34. using namespace spine;
  35. BoneData::BoneData(int index, const String &name, BoneData *parent) :
  36. _index(index),
  37. _name(name),
  38. _parent(parent),
  39. _length(0),
  40. _x(0),
  41. _y(0),
  42. _rotation(0),
  43. _scaleX(1),
  44. _scaleY(1),
  45. _shearX(0),
  46. _shearY(0),
  47. _transformMode(TransformMode_Normal),
  48. _skinRequired(false) {
  49. assert(index >= 0);
  50. assert(_name.length() > 0);
  51. }
  52. int BoneData::getIndex() {
  53. return _index;
  54. }
  55. const String &BoneData::getName() {
  56. return _name;
  57. }
  58. BoneData *BoneData::getParent() {
  59. return _parent;
  60. }
  61. float BoneData::getLength() {
  62. return _length;
  63. }
  64. void BoneData::setLength(float inValue) {
  65. _length = inValue;
  66. }
  67. float BoneData::getX() {
  68. return _x;
  69. }
  70. void BoneData::setX(float inValue) {
  71. _x = inValue;
  72. }
  73. float BoneData::getY() {
  74. return _y;
  75. }
  76. void BoneData::setY(float inValue) {
  77. _y = inValue;
  78. }
  79. float BoneData::getRotation() {
  80. return _rotation;
  81. }
  82. void BoneData::setRotation(float inValue) {
  83. _rotation = inValue;
  84. }
  85. float BoneData::getScaleX() {
  86. return _scaleX;
  87. }
  88. void BoneData::setScaleX(float inValue) {
  89. _scaleX = inValue;
  90. }
  91. float BoneData::getScaleY() {
  92. return _scaleY;
  93. }
  94. void BoneData::setScaleY(float inValue) {
  95. _scaleY = inValue;
  96. }
  97. float BoneData::getShearX() {
  98. return _shearX;
  99. }
  100. void BoneData::setShearX(float inValue) {
  101. _shearX = inValue;
  102. }
  103. float BoneData::getShearY() {
  104. return _shearY;
  105. }
  106. void BoneData::setShearY(float inValue) {
  107. _shearY = inValue;
  108. }
  109. TransformMode BoneData::getTransformMode() {
  110. return _transformMode;
  111. }
  112. void BoneData::setTransformMode(TransformMode inValue) {
  113. _transformMode = inValue;
  114. }
  115. bool BoneData::isSkinRequired() {
  116. return _skinRequired;
  117. }
  118. void BoneData::setSkinRequired(bool inValue) {
  119. _skinRequired = inValue;
  120. }