PathConstraintData.cpp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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/PathConstraintData.h>
  33. #include <spine/BoneData.h>
  34. #include <spine/SlotData.h>
  35. #include <assert.h>
  36. using namespace spine;
  37. PathConstraintData::PathConstraintData(const String &name) :
  38. ConstraintData(name),
  39. _target(NULL),
  40. _positionMode(PositionMode_Fixed),
  41. _spacingMode(SpacingMode_Length),
  42. _rotateMode(RotateMode_Tangent),
  43. _offsetRotation(0),
  44. _position(0),
  45. _spacing(0),
  46. _rotateMix(0),
  47. _translateMix(0) {
  48. }
  49. Vector<BoneData *> &PathConstraintData::getBones() {
  50. return _bones;
  51. }
  52. SlotData *PathConstraintData::getTarget() {
  53. return _target;
  54. }
  55. void PathConstraintData::setTarget(SlotData *inValue) {
  56. _target = inValue;
  57. }
  58. PositionMode PathConstraintData::getPositionMode() {
  59. return _positionMode;
  60. }
  61. void PathConstraintData::setPositionMode(PositionMode inValue) {
  62. _positionMode = inValue;
  63. }
  64. SpacingMode PathConstraintData::getSpacingMode() {
  65. return _spacingMode;
  66. }
  67. void PathConstraintData::setSpacingMode(SpacingMode inValue) {
  68. _spacingMode = inValue;
  69. }
  70. RotateMode PathConstraintData::getRotateMode() {
  71. return _rotateMode;
  72. }
  73. void PathConstraintData::setRotateMode(RotateMode inValue) {
  74. _rotateMode = inValue;
  75. }
  76. float PathConstraintData::getOffsetRotation() {
  77. return _offsetRotation;
  78. }
  79. void PathConstraintData::setOffsetRotation(float inValue) {
  80. _offsetRotation = inValue;
  81. }
  82. float PathConstraintData::getPosition() {
  83. return _position;
  84. }
  85. void PathConstraintData::setPosition(float inValue) {
  86. _position = inValue;
  87. }
  88. float PathConstraintData::getSpacing() {
  89. return _spacing;
  90. }
  91. void PathConstraintData::setSpacing(float inValue) {
  92. _spacing = inValue;
  93. }
  94. float PathConstraintData::getRotateMix() {
  95. return _rotateMix;
  96. }
  97. void PathConstraintData::setRotateMix(float inValue) {
  98. _rotateMix = inValue;
  99. }
  100. float PathConstraintData::getTranslateMix() {
  101. return _translateMix;
  102. }
  103. void PathConstraintData::setTranslateMix(float inValue) {
  104. _translateMix = inValue;
  105. }