فهرست منبع

Merge branch 'master' of https://github.com/esotericsoftware/spine-runtimes

badlogic 8 سال پیش
والد
کامیت
ac5d11ca0d
1فایلهای تغییر یافته به همراه12 افزوده شده و 12 حذف شده
  1. 12 12
      spine-csharp/src/IkConstraint.cs

+ 12 - 12
spine-csharp/src/IkConstraint.cs

@@ -87,7 +87,7 @@ namespace Spine {
 			float id = 1 / (p.a * p.d - p.b * p.c);
 			float x = targetX - p.worldX, y = targetY - p.worldY;
 			float tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay;
-			float rotationIK = MathUtils.Atan2(ty, tx) * MathUtils.RadDeg - bone.ashearX - bone.arotation;
+			float rotationIK = (float)Math.Atan2(ty, tx) * MathUtils.RadDeg - bone.ashearX - bone.arotation;
 			if (bone.ascaleX < 0) rotationIK += 180;
 			if (rotationIK > 180)
 				rotationIK -= 360;
@@ -156,12 +156,12 @@ namespace Spine {
 				else if (cos > 1) cos = 1;
 				a2 = (float)Math.Acos(cos) * bendDir;
 				a = l1 + l2 * cos;
-				b = l2 * MathUtils.Sin(a2);
-				a1 = MathUtils.Atan2(ty * a - tx * b, tx * a + ty * b);
+				b = l2 * (float)Math.Sin(a2);
+				a1 = (float)Math.Atan2(ty * a - tx * b, tx * a + ty * b);
 			} else {
 				a = psx * l2;
 				b = psy * l2;
-				float aa = a * a, bb = b * b, dd = tx * tx + ty * ty, ta = MathUtils.Atan2(ty, tx);
+				float aa = a * a, bb = b * b, dd = tx * tx + ty * ty, ta = (float)Math.Atan2(ty, tx);
 				c = bb * l1 * l1 + aa * dd - aa * bb;
 				float c1 = -2 * bb * l1, c2 = bb - aa;
 				d = c1 * c1 - 4 * c2 * c;
@@ -173,8 +173,8 @@ namespace Spine {
 					float r = Math.Abs(r0) < Math.Abs(r1) ? r0 : r1;
 					if (r * r <= dd) {
 						y = (float)Math.Sqrt(dd - r * r) * bendDir;
-						a1 = ta - MathUtils.Atan2(y, r);
-						a2 = MathUtils.Atan2(y / psy, (r - l1) / psx);
+						a1 = ta - (float)Math.Atan2(y, r);
+						a2 = (float)Math.Atan2(y / psy, (r - l1) / psx);
 						goto outer;
 					}
 				}
@@ -190,13 +190,13 @@ namespace Spine {
 				x = l1 - a;
 				d = x * x;
 				if (d < minDist) {
-					minAngle = MathUtils.PI;
+					minAngle = (float)Math.PI;
 					minDist = d;
 					minX = x;
 				}
 				float angle = (float)Math.Acos(-a * l1 / (aa - bb));
-				x = a * MathUtils.Cos(angle) + l1;
-				y = b * MathUtils.Sin(angle);
+				x = a * (float)Math.Cos(angle) + l1;
+				y = b * (float)Math.Sin(angle);
 				d = x * x + y * y;
 				if (d < minDist) {
 					minAngle = angle;
@@ -211,15 +211,15 @@ namespace Spine {
 					maxY = y;
 				}
 				if (dd <= (minDist + maxDist) / 2) {
-					a1 = ta - MathUtils.Atan2(minY * bendDir, minX);
+					a1 = ta - (float)Math.Atan2(minY * bendDir, minX);
 					a2 = minAngle * bendDir;
 				} else {
-					a1 = ta - MathUtils.Atan2(maxY * bendDir, maxX);
+					a1 = ta - (float)Math.Atan2(maxY * bendDir, maxX);
 					a2 = maxAngle * bendDir;
 				}
 			}
 			outer:
-			float os = MathUtils.Atan2(cy, cx) * s2;
+			float os = (float)Math.Atan2(cy, cx) * s2;
 			float rotation = parent.arotation;
 			a1 = (a1 - os) * MathUtils.RadDeg + os1 - rotation;
 			if (a1 > 180)