From 02911a2bf439e0d5fd035c1c6e1c09acab19f534 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Tue, 5 Dec 2023 20:18:14 +0100 Subject: [PATCH] [csharp] Port of commit 9cd5b3b. Fixed shear causing physics to explode. --- spine-csharp/src/PhysicsConstraint.cs | 2 +- spine-csharp/src/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spine-csharp/src/PhysicsConstraint.cs b/spine-csharp/src/PhysicsConstraint.cs index 3d5770403..15b2f0ecf 100644 --- a/spine-csharp/src/PhysicsConstraint.cs +++ b/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; diff --git a/spine-csharp/src/package.json b/spine-csharp/src/package.json index 52232a879..877b23450 100644 --- a/spine-csharp/src/package.json +++ b/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",