Browse Source

[csharp] Port of commit 9cd5b3b. Fixed shear causing physics to explode.

Harald Csaszar 1 year ago
parent
commit
02911a2bf4
2 changed files with 2 additions and 2 deletions
  1. 1 1
      spine-csharp/src/PhysicsConstraint.cs
  2. 1 1
      spine-csharp/src/package.json

+ 1 - 1
spine-csharp/src/PhysicsConstraint.cs

@@ -168,7 +168,7 @@ namespace Spine {
 					if (rotateOrShearX || scaleX) {
 						float ca = (float)Math.Atan2(bone.c, bone.a), c, s, mr = 0;
 						if (rotateOrShearX) {
-							mr = mix * data.rotate;
+							mr = (data.rotate + data.shearX) * mix;
 							float dx = cx - bone.worldX, dy = cy - bone.worldY, r = (float)Math.Atan2(dy + ty, dx + tx) - ca - rotateOffset * mr;
 							rotateOffset += (r - (float)Math.Ceiling(r * MathUtils.InvPI2 - 0.5f) * MathUtils.PI2) * i;
 							r = rotateOffset * mr + ca;

+ 1 - 1
spine-csharp/src/package.json

@@ -2,7 +2,7 @@
 	"name": "com.esotericsoftware.spine.spine-csharp",
 	"displayName": "spine-csharp Runtime",
 	"description": "This plugin provides the spine-csharp core runtime.",
-	"version": "4.2.4",
+	"version": "4.2.5",
 	"unity": "2018.3",
 	"author": {
 		"name": "Esoteric Software",