BoundingBoxAttachment.cs 903 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. namespace Spine
  3. {
  4. public class BoundingBoxAttachment : Attachment
  5. {
  6. public BoundingBoxAttachment(string name) : base(name)
  7. {
  8. }
  9. public float[] Vertices
  10. {
  11. get
  12. {
  13. return this.vertices;
  14. }
  15. set
  16. {
  17. this.vertices = value;
  18. }
  19. }
  20. public void ComputeWorldVertices(Bone bone, float[] worldVertices)
  21. {
  22. float num = bone.skeleton.x + bone.worldX;
  23. float num2 = bone.skeleton.y + bone.worldY;
  24. float m = bone.m00;
  25. float m2 = bone.m01;
  26. float m3 = bone.m10;
  27. float m4 = bone.m11;
  28. float[] array = this.vertices;
  29. int i = 0;
  30. int num3 = array.Length;
  31. while (i < num3)
  32. {
  33. float num4 = array[i];
  34. float num5 = array[i + 1];
  35. worldVertices[i] = num4 * m + num5 * m2 + num;
  36. worldVertices[i + 1] = num4 * m3 + num5 * m4 + num2;
  37. i += 2;
  38. }
  39. }
  40. internal float[] vertices;
  41. }
  42. }