PhysicsConstraintData.cs 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /******************************************************************************
  2. * Spine Runtimes License Agreement
  3. * Last updated July 28, 2023. Replaces all prior versions.
  4. *
  5. * Copyright (c) 2013-2023, 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 or
  13. * 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 THE
  27. * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. *****************************************************************************/
  29. namespace Spine {
  30. /// <summary>
  31. /// Stores the setup pose for a <see cref="PhysicsConstraint"/>.
  32. /// <para>
  33. /// See <a href="http://esotericsoftware.com/spine-physics-constraints">Physics constraints</a> in the Spine User Guide.</para>
  34. /// </summary>
  35. public class PhysicsConstraintData : ConstraintData {
  36. internal BoneData bone;
  37. internal float x, y, rotate, scaleX, shearX, limit;
  38. internal float step, inertia, strength, damping, massInverse, wind, gravity, mix;
  39. internal bool inertiaGlobal, strengthGlobal, dampingGlobal, massGlobal, windGlobal, gravityGlobal, mixGlobal;
  40. public PhysicsConstraintData (string name) : base(name) {
  41. }
  42. /// <summary>The bone constrained by this physics constraint.</summary>
  43. public BoneData Bone { get { return bone; } }
  44. public float Step { get { return step; } set { step = value; } }
  45. public float X { get { return x; } set { x = value; } }
  46. public float Y { get { return y; } set { y = value; } }
  47. public float Rotate { get { return rotate; } set { rotate = value; } }
  48. public float ScaleX { get { return scaleX; } set { scaleX = value; } }
  49. public float ShearX { get { return shearX; } set { shearX = value; } }
  50. public float Limit { get { return limit; } set { limit = value; } }
  51. public float Inertia { get { return inertia; } set { inertia = value; } }
  52. public float Strength { get { return strength; } set { strength = value; } }
  53. public float Damping { get { return damping; } set { damping = value; } }
  54. public float MassInverse { get { return massInverse; } set { massInverse = value; } }
  55. public float Wind { get { return wind; } set { wind = value; } }
  56. public float Gravity { get { return gravity; } set { gravity = value; } }
  57. /// <summary>A percentage (0-1) that controls the mix between the constrained and unconstrained poses.</summary>
  58. public float Mix { get { return mix; } set { mix = value; } }
  59. public bool InertiaGlobal { get { return inertiaGlobal; } set { inertiaGlobal = value; } }
  60. public bool StrengthGlobal { get { return strengthGlobal; } set { strengthGlobal = value; } }
  61. public bool DampingGlobal { get { return dampingGlobal; } set { dampingGlobal = value; } }
  62. public bool MassGlobal { get { return massGlobal; } set { massGlobal = value; } }
  63. public bool WindGlobal { get { return windGlobal; } set { windGlobal = value; } }
  64. public bool GravityGlobal { get { return gravityGlobal; } set { gravityGlobal = value; } }
  65. public bool MixGlobal { get { return mixGlobal; } set { mixGlobal = value; } }
  66. }
  67. }