PathConstraint.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  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. using System;
  30. namespace Spine {
  31. /// <summary>
  32. /// <para>
  33. /// Stores the current pose for a path constraint. A path constraint adjusts the rotation, translation, and scale of the
  34. /// constrained bones so they follow a <see cref="PathAttachment"/>.</para>
  35. /// <para>
  36. /// See <a href="http://esotericsoftware.com/spine-path-constraints">Path constraints</a> in the Spine User Guide.</para>
  37. /// </summary>
  38. public class PathConstraint : IUpdatable {
  39. const int NONE = -1, BEFORE = -2, AFTER = -3;
  40. const float Epsilon = 0.00001f;
  41. internal PathConstraintData data;
  42. internal ExposedList<Bone> bones;
  43. internal Slot target;
  44. internal float position, spacing, mixRotate, mixX, mixY;
  45. internal bool active;
  46. internal ExposedList<float> spaces = new ExposedList<float>(), positions = new ExposedList<float>();
  47. internal ExposedList<float> world = new ExposedList<float>(), curves = new ExposedList<float>(), lengths = new ExposedList<float>();
  48. internal float[] segments = new float[10];
  49. public PathConstraint (PathConstraintData data, Skeleton skeleton) {
  50. if (data == null) throw new ArgumentNullException("data", "data cannot be null.");
  51. if (skeleton == null) throw new ArgumentNullException("skeleton", "skeleton cannot be null.");
  52. this.data = data;
  53. bones = new ExposedList<Bone>(data.Bones.Count);
  54. foreach (BoneData boneData in data.bones)
  55. bones.Add(skeleton.FindBone(boneData.name));
  56. target = skeleton.FindSlot(data.target.name);
  57. position = data.position;
  58. spacing = data.spacing;
  59. mixRotate = data.mixRotate;
  60. mixX = data.mixX;
  61. mixY = data.mixY;
  62. }
  63. /// <summary>Copy constructor.</summary>
  64. public PathConstraint (PathConstraint constraint, Skeleton skeleton) {
  65. if (constraint == null) throw new ArgumentNullException("constraint cannot be null.");
  66. if (skeleton == null) throw new ArgumentNullException("skeleton cannot be null.");
  67. data = constraint.data;
  68. bones = new ExposedList<Bone>(constraint.Bones.Count);
  69. foreach (Bone bone in constraint.Bones)
  70. bones.Add(skeleton.Bones.Items[bone.data.index]);
  71. target = skeleton.slots.Items[constraint.target.data.index];
  72. position = constraint.position;
  73. spacing = constraint.spacing;
  74. mixRotate = constraint.mixRotate;
  75. mixX = constraint.mixX;
  76. mixY = constraint.mixY;
  77. }
  78. public static void ArraysFill (float[] a, int fromIndex, int toIndex, float val) {
  79. for (int i = fromIndex; i < toIndex; i++)
  80. a[i] = val;
  81. }
  82. public void Update () {
  83. PathAttachment attachment = target.Attachment as PathAttachment;
  84. if (attachment == null) return;
  85. float mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY;
  86. if (mixRotate == 0 && mixX == 0 && mixY == 0) return;
  87. PathConstraintData data = this.data;
  88. bool tangents = data.rotateMode == RotateMode.Tangent, scale = data.rotateMode == RotateMode.ChainScale;
  89. int boneCount = this.bones.Count, spacesCount = tangents ? boneCount : boneCount + 1;
  90. Bone[] bonesItems = this.bones.Items;
  91. float[] spaces = this.spaces.Resize(spacesCount).Items, lengths = scale ? this.lengths.Resize(boneCount).Items : null;
  92. float spacing = this.spacing;
  93. switch (data.spacingMode) {
  94. case SpacingMode.Percent:
  95. if (scale) {
  96. for (int i = 0, n = spacesCount - 1; i < n; i++) {
  97. Bone bone = bonesItems[i];
  98. float setupLength = bone.data.length;
  99. if (setupLength < PathConstraint.Epsilon)
  100. lengths[i] = 0;
  101. else {
  102. float x = setupLength * bone.a, y = setupLength * bone.c;
  103. lengths[i] = (float)Math.Sqrt(x * x + y * y);
  104. }
  105. }
  106. }
  107. ArraysFill(spaces, 1, spacesCount, spacing);
  108. break;
  109. case SpacingMode.Proportional: {
  110. float sum = 0;
  111. for (int i = 0, n = spacesCount - 1; i < n;) {
  112. Bone bone = bonesItems[i];
  113. float setupLength = bone.data.length;
  114. if (setupLength < PathConstraint.Epsilon) {
  115. if (scale) lengths[i] = 0;
  116. spaces[++i] = spacing;
  117. } else {
  118. float x = setupLength * bone.a, y = setupLength * bone.c;
  119. float length = (float)Math.Sqrt(x * x + y * y);
  120. if (scale) lengths[i] = length;
  121. spaces[++i] = length;
  122. sum += length;
  123. }
  124. }
  125. if (sum > 0) {
  126. sum = spacesCount / sum * spacing;
  127. for (int i = 1; i < spacesCount; i++)
  128. spaces[i] *= sum;
  129. }
  130. break;
  131. }
  132. default: {
  133. bool lengthSpacing = data.spacingMode == SpacingMode.Length;
  134. for (int i = 0, n = spacesCount - 1; i < n;) {
  135. Bone bone = bonesItems[i];
  136. float setupLength = bone.data.length;
  137. if (setupLength < PathConstraint.Epsilon) {
  138. if (scale) lengths[i] = 0;
  139. spaces[++i] = spacing;
  140. } else {
  141. float x = setupLength * bone.a, y = setupLength * bone.c;
  142. float length = (float)Math.Sqrt(x * x + y * y);
  143. if (scale) lengths[i] = length;
  144. spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length / setupLength;
  145. }
  146. }
  147. break;
  148. }
  149. }
  150. float[] positions = ComputeWorldPositions(attachment, spacesCount, tangents);
  151. float boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;
  152. bool tip;
  153. if (offsetRotation == 0) {
  154. tip = data.rotateMode == RotateMode.Chain;
  155. } else {
  156. tip = false;
  157. Bone p = target.bone;
  158. offsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.DegRad : -MathUtils.DegRad;
  159. }
  160. for (int i = 0, p = 3; i < boneCount; i++, p += 3) {
  161. Bone bone = bonesItems[i];
  162. bone.worldX += (boneX - bone.worldX) * mixX;
  163. bone.worldY += (boneY - bone.worldY) * mixY;
  164. float x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;
  165. if (scale) {
  166. float length = lengths[i];
  167. if (length >= PathConstraint.Epsilon) {
  168. float s = ((float)Math.Sqrt(dx * dx + dy * dy) / length - 1) * mixRotate + 1;
  169. bone.a *= s;
  170. bone.c *= s;
  171. }
  172. }
  173. boneX = x;
  174. boneY = y;
  175. if (mixRotate > 0) {
  176. float a = bone.a, b = bone.b, c = bone.c, d = bone.d, r, cos, sin;
  177. if (tangents)
  178. r = positions[p - 1];
  179. else if (spaces[i + 1] < PathConstraint.Epsilon)
  180. r = positions[p + 2];
  181. else
  182. r = MathUtils.Atan2(dy, dx);
  183. r -= MathUtils.Atan2(c, a);
  184. if (tip) {
  185. cos = MathUtils.Cos(r);
  186. sin = MathUtils.Sin(r);
  187. float length = bone.data.length;
  188. boneX += (length * (cos * a - sin * c) - dx) * mixRotate;
  189. boneY += (length * (sin * a + cos * c) - dy) * mixRotate;
  190. } else
  191. r += offsetRotation;
  192. if (r > MathUtils.PI)
  193. r -= MathUtils.PI2;
  194. else if (r < -MathUtils.PI) //
  195. r += MathUtils.PI2;
  196. r *= mixRotate;
  197. cos = MathUtils.Cos(r);
  198. sin = MathUtils.Sin(r);
  199. bone.a = cos * a - sin * c;
  200. bone.b = cos * b - sin * d;
  201. bone.c = sin * a + cos * c;
  202. bone.d = sin * b + cos * d;
  203. }
  204. bone.UpdateAppliedTransform();
  205. }
  206. }
  207. float[] ComputeWorldPositions (PathAttachment path, int spacesCount, bool tangents) {
  208. Slot target = this.target;
  209. float position = this.position;
  210. float[] spaces = this.spaces.Items, output = this.positions.Resize(spacesCount * 3 + 2).Items, world;
  211. bool closed = path.Closed;
  212. int verticesLength = path.WorldVerticesLength, curveCount = verticesLength / 6, prevCurve = NONE;
  213. float pathLength, multiplier;
  214. if (!path.ConstantSpeed) {
  215. float[] lengths = path.Lengths;
  216. curveCount -= closed ? 1 : 2;
  217. pathLength = lengths[curveCount];
  218. if (data.positionMode == PositionMode.Percent) position *= pathLength;
  219. switch (data.spacingMode) {
  220. case SpacingMode.Percent:
  221. multiplier = pathLength;
  222. break;
  223. case SpacingMode.Proportional:
  224. multiplier = pathLength / spacesCount;
  225. break;
  226. default:
  227. multiplier = 1;
  228. break;
  229. }
  230. world = this.world.Resize(8).Items;
  231. for (int i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {
  232. float space = spaces[i] * multiplier;
  233. position += space;
  234. float p = position;
  235. if (closed) {
  236. p %= pathLength;
  237. if (p < 0) p += pathLength;
  238. curve = 0;
  239. } else if (p < 0) {
  240. if (prevCurve != BEFORE) {
  241. prevCurve = BEFORE;
  242. path.ComputeWorldVertices(target, 2, 4, world, 0, 2);
  243. }
  244. AddBeforePosition(p, world, 0, output, o);
  245. continue;
  246. } else if (p > pathLength) {
  247. if (prevCurve != AFTER) {
  248. prevCurve = AFTER;
  249. path.ComputeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);
  250. }
  251. AddAfterPosition(p - pathLength, world, 0, output, o);
  252. continue;
  253. }
  254. // Determine curve containing position.
  255. for (; ; curve++) {
  256. float length = lengths[curve];
  257. if (p > length) continue;
  258. if (curve == 0)
  259. p /= length;
  260. else {
  261. float prev = lengths[curve - 1];
  262. p = (p - prev) / (length - prev);
  263. }
  264. break;
  265. }
  266. if (curve != prevCurve) {
  267. prevCurve = curve;
  268. if (closed && curve == curveCount) {
  269. path.ComputeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);
  270. path.ComputeWorldVertices(target, 0, 4, world, 4, 2);
  271. } else
  272. path.ComputeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);
  273. }
  274. AddCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], output, o,
  275. tangents || (i > 0 && space < PathConstraint.Epsilon));
  276. }
  277. return output;
  278. }
  279. // World vertices.
  280. if (closed) {
  281. verticesLength += 2;
  282. world = this.world.Resize(verticesLength).Items;
  283. path.ComputeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);
  284. path.ComputeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);
  285. world[verticesLength - 2] = world[0];
  286. world[verticesLength - 1] = world[1];
  287. } else {
  288. curveCount--;
  289. verticesLength -= 4;
  290. world = this.world.Resize(verticesLength).Items;
  291. path.ComputeWorldVertices(target, 2, verticesLength, world, 0, 2);
  292. }
  293. // Curve lengths.
  294. float[] curves = this.curves.Resize(curveCount).Items;
  295. pathLength = 0;
  296. float x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;
  297. float tmpx, tmpy, dddfx, dddfy, ddfx, ddfy, dfx, dfy;
  298. for (int i = 0, w = 2; i < curveCount; i++, w += 6) {
  299. cx1 = world[w];
  300. cy1 = world[w + 1];
  301. cx2 = world[w + 2];
  302. cy2 = world[w + 3];
  303. x2 = world[w + 4];
  304. y2 = world[w + 5];
  305. tmpx = (x1 - cx1 * 2 + cx2) * 0.1875f;
  306. tmpy = (y1 - cy1 * 2 + cy2) * 0.1875f;
  307. dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375f;
  308. dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375f;
  309. ddfx = tmpx * 2 + dddfx;
  310. ddfy = tmpy * 2 + dddfy;
  311. dfx = (cx1 - x1) * 0.75f + tmpx + dddfx * 0.16666667f;
  312. dfy = (cy1 - y1) * 0.75f + tmpy + dddfy * 0.16666667f;
  313. pathLength += (float)Math.Sqrt(dfx * dfx + dfy * dfy);
  314. dfx += ddfx;
  315. dfy += ddfy;
  316. ddfx += dddfx;
  317. ddfy += dddfy;
  318. pathLength += (float)Math.Sqrt(dfx * dfx + dfy * dfy);
  319. dfx += ddfx;
  320. dfy += ddfy;
  321. pathLength += (float)Math.Sqrt(dfx * dfx + dfy * dfy);
  322. dfx += ddfx + dddfx;
  323. dfy += ddfy + dddfy;
  324. pathLength += (float)Math.Sqrt(dfx * dfx + dfy * dfy);
  325. curves[i] = pathLength;
  326. x1 = x2;
  327. y1 = y2;
  328. }
  329. if (data.positionMode == PositionMode.Percent) position *= pathLength;
  330. switch (data.spacingMode) {
  331. case SpacingMode.Percent:
  332. multiplier = pathLength;
  333. break;
  334. case SpacingMode.Proportional:
  335. multiplier = pathLength / spacesCount;
  336. break;
  337. default:
  338. multiplier = 1;
  339. break;
  340. }
  341. float[] segments = this.segments;
  342. float curveLength = 0;
  343. for (int i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {
  344. float space = spaces[i] * multiplier;
  345. position += space;
  346. float p = position;
  347. if (closed) {
  348. p %= pathLength;
  349. if (p < 0) p += pathLength;
  350. curve = 0;
  351. } else if (p < 0) {
  352. AddBeforePosition(p, world, 0, output, o);
  353. continue;
  354. } else if (p > pathLength) {
  355. AddAfterPosition(p - pathLength, world, verticesLength - 4, output, o);
  356. continue;
  357. }
  358. // Determine curve containing position.
  359. for (; ; curve++) {
  360. float length = curves[curve];
  361. if (p > length) continue;
  362. if (curve == 0)
  363. p /= length;
  364. else {
  365. float prev = curves[curve - 1];
  366. p = (p - prev) / (length - prev);
  367. }
  368. break;
  369. }
  370. // Curve segment lengths.
  371. if (curve != prevCurve) {
  372. prevCurve = curve;
  373. int ii = curve * 6;
  374. x1 = world[ii];
  375. y1 = world[ii + 1];
  376. cx1 = world[ii + 2];
  377. cy1 = world[ii + 3];
  378. cx2 = world[ii + 4];
  379. cy2 = world[ii + 5];
  380. x2 = world[ii + 6];
  381. y2 = world[ii + 7];
  382. tmpx = (x1 - cx1 * 2 + cx2) * 0.03f;
  383. tmpy = (y1 - cy1 * 2 + cy2) * 0.03f;
  384. dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006f;
  385. dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006f;
  386. ddfx = tmpx * 2 + dddfx;
  387. ddfy = tmpy * 2 + dddfy;
  388. dfx = (cx1 - x1) * 0.3f + tmpx + dddfx * 0.16666667f;
  389. dfy = (cy1 - y1) * 0.3f + tmpy + dddfy * 0.16666667f;
  390. curveLength = (float)Math.Sqrt(dfx * dfx + dfy * dfy);
  391. segments[0] = curveLength;
  392. for (ii = 1; ii < 8; ii++) {
  393. dfx += ddfx;
  394. dfy += ddfy;
  395. ddfx += dddfx;
  396. ddfy += dddfy;
  397. curveLength += (float)Math.Sqrt(dfx * dfx + dfy * dfy);
  398. segments[ii] = curveLength;
  399. }
  400. dfx += ddfx;
  401. dfy += ddfy;
  402. curveLength += (float)Math.Sqrt(dfx * dfx + dfy * dfy);
  403. segments[8] = curveLength;
  404. dfx += ddfx + dddfx;
  405. dfy += ddfy + dddfy;
  406. curveLength += (float)Math.Sqrt(dfx * dfx + dfy * dfy);
  407. segments[9] = curveLength;
  408. segment = 0;
  409. }
  410. // Weight by segment length.
  411. p *= curveLength;
  412. for (; ; segment++) {
  413. float length = segments[segment];
  414. if (p > length) continue;
  415. if (segment == 0)
  416. p /= length;
  417. else {
  418. float prev = segments[segment - 1];
  419. p = segment + (p - prev) / (length - prev);
  420. }
  421. break;
  422. }
  423. AddCurvePosition(p * 0.1f, x1, y1, cx1, cy1, cx2, cy2, x2, y2, output, o, tangents || (i > 0 && space < PathConstraint.Epsilon));
  424. }
  425. return output;
  426. }
  427. static void AddBeforePosition (float p, float[] temp, int i, float[] output, int o) {
  428. float x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = MathUtils.Atan2(dy, dx);
  429. output[o] = x1 + p * MathUtils.Cos(r);
  430. output[o + 1] = y1 + p * MathUtils.Sin(r);
  431. output[o + 2] = r;
  432. }
  433. static void AddAfterPosition (float p, float[] temp, int i, float[] output, int o) {
  434. float x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = MathUtils.Atan2(dy, dx);
  435. output[o] = x1 + p * MathUtils.Cos(r);
  436. output[o + 1] = y1 + p * MathUtils.Sin(r);
  437. output[o + 2] = r;
  438. }
  439. static void AddCurvePosition (float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2,
  440. float[] output, int o, bool tangents) {
  441. if (p < PathConstraint.Epsilon || float.IsNaN(p)) {
  442. output[o] = x1;
  443. output[o + 1] = y1;
  444. output[o + 2] = (float)Math.Atan2(cy1 - y1, cx1 - x1);
  445. return;
  446. }
  447. float tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
  448. float ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
  449. float x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
  450. output[o] = x;
  451. output[o + 1] = y;
  452. if (tangents) {
  453. if (p < 0.001f)
  454. output[o + 2] = (float)Math.Atan2(cy1 - y1, cx1 - x1);
  455. else
  456. output[o + 2] = (float)Math.Atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
  457. }
  458. }
  459. /// <summary>The position along the path.</summary>
  460. public float Position { get { return position; } set { position = value; } }
  461. /// <summary>The spacing between bones.</summary>
  462. public float Spacing { get { return spacing; } set { spacing = value; } }
  463. /// <summary>A percentage (0-1) that controls the mix between the constrained and unconstrained rotations.</summary>
  464. public float MixRotate { get { return mixRotate; } set { mixRotate = value; } }
  465. /// <summary>A percentage (0-1) that controls the mix between the constrained and unconstrained translation X.</summary>
  466. public float MixX { get { return mixX; } set { mixX = value; } }
  467. /// <summary>A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y.</summary>
  468. public float MixY { get { return mixY; } set { mixY = value; } }
  469. /// <summary>The bones that will be modified by this path constraint.</summary>
  470. public ExposedList<Bone> Bones { get { return bones; } }
  471. /// <summary>The slot whose path attachment will be used to constrained the bones.</summary>
  472. public Slot Target { get { return target; } set { target = value; } }
  473. public bool Active { get { return active; } }
  474. /// <summary>The path constraint's setup pose data.</summary>
  475. public PathConstraintData Data { get { return data; } }
  476. }
  477. }