TransformConstraintData.cpp 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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/TransformConstraintData.h>
  33. #include <spine/BoneData.h>
  34. #include <assert.h>
  35. using namespace spine;
  36. TransformConstraintData::TransformConstraintData(const String &name) :
  37. ConstraintData(name),
  38. _target(NULL),
  39. _rotateMix(0),
  40. _translateMix(0),
  41. _scaleMix(0),
  42. _shearMix(0),
  43. _offsetRotation(0),
  44. _offsetX(0),
  45. _offsetY(0),
  46. _offsetScaleX(0),
  47. _offsetScaleY(0),
  48. _offsetShearY(0),
  49. _relative(false),
  50. _local(false) {
  51. }
  52. Vector<BoneData *> &TransformConstraintData::getBones() {
  53. return _bones;
  54. }
  55. BoneData *TransformConstraintData::getTarget() {
  56. return _target;
  57. }
  58. float TransformConstraintData::getRotateMix() {
  59. return _rotateMix;
  60. }
  61. float TransformConstraintData::getTranslateMix() {
  62. return _translateMix;
  63. }
  64. float TransformConstraintData::getScaleMix() {
  65. return _scaleMix;
  66. }
  67. float TransformConstraintData::getShearMix() {
  68. return _shearMix;
  69. }
  70. float TransformConstraintData::getOffsetRotation() {
  71. return _offsetRotation;
  72. }
  73. float TransformConstraintData::getOffsetX() {
  74. return _offsetX;
  75. }
  76. float TransformConstraintData::getOffsetY() {
  77. return _offsetY;
  78. }
  79. float TransformConstraintData::getOffsetScaleX() {
  80. return _offsetScaleX;
  81. }
  82. float TransformConstraintData::getOffsetScaleY() {
  83. return _offsetScaleY;
  84. }
  85. float TransformConstraintData::getOffsetShearY() {
  86. return _offsetShearY;
  87. }
  88. bool TransformConstraintData::isRelative() {
  89. return _relative;
  90. }
  91. bool TransformConstraintData::isLocal() {
  92. return _local;
  93. }