mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[csharp] Fix rotation spinning out of control.
Port of: 7996f2b
This commit is contained in:
parent
9b259c66e0
commit
671c921089
@ -334,10 +334,10 @@ namespace Spine {
|
|||||||
// Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.
|
// Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.
|
||||||
float r1 = pose == MixBlend.Setup ? bone.data.rotation : bone.rotation;
|
float r1 = pose == MixBlend.Setup ? bone.data.rotation : bone.rotation;
|
||||||
float total, diff = r2 - r1;
|
float total, diff = r2 - r1;
|
||||||
|
diff -= (16384 - (int)(16384.499999999996 - diff / 360)) * 360;
|
||||||
if (diff == 0) {
|
if (diff == 0) {
|
||||||
total = timelinesRotation[i];
|
total = timelinesRotation[i];
|
||||||
} else {
|
} else {
|
||||||
diff -= (16384 - (int)(16384.499999999996 - diff / 360)) * 360;
|
|
||||||
float lastTotal, lastDiff;
|
float lastTotal, lastDiff;
|
||||||
if (firstFrame) {
|
if (firstFrame) {
|
||||||
lastTotal = 0;
|
lastTotal = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user