[runtimes] Port of fix for TransformMode.noRotationOrReflection applying skeleton scale twice. See #1668.

This commit is contained in:
badlogic 2020-05-06 19:47:08 +02:00
parent c73f8c1f42
commit 6a317a1e3f
19 changed files with 23 additions and 22 deletions

View File

@ -57,7 +57,7 @@ package spine {
public var worldY : Number;
internal var _sorted : Boolean;
public var active : Boolean;
/** @param parent May be null. */
public function Bone(data : BoneData, skeleton : Skeleton, parent : Bone) {
@ -68,7 +68,7 @@ package spine {
_parent = parent;
setToSetupPose();
}
public function isActive() : Boolean {
return active;
}
@ -102,8 +102,8 @@ package spine {
var parent : Bone = _parent;
if (!parent) { // Root bone.
rotationY = rotation + 90 + shearY;
var skeleton : Skeleton = _skeleton;
rotationY = rotation + 90 + shearY;
var skeleton : Skeleton = _skeleton;
this.a = MathUtils.cosDeg(rotation + shearX) * scaleX * sx;
this.b = MathUtils.cosDeg(rotationY) * scaleY * sx;
this.c = MathUtils.sinDeg(rotation + shearX) * scaleX * sy;
@ -161,7 +161,7 @@ package spine {
this.b = pa * lb - pb * ld;
this.c = pc * la + pd * lc;
this.d = pc * lb + pd * ld;
break;
return;
}
case TransformMode.noScale:
case TransformMode.noScaleOrReflection: {
@ -182,11 +182,11 @@ package spine {
la = MathUtils.cosDeg(shearX) * scaleX;
lb = MathUtils.cosDeg(90 + shearY) * scaleY;
lc = MathUtils.sinDeg(shearX) * scaleX;
ld = MathUtils.sinDeg(90 + shearY) * scaleY;
ld = MathUtils.sinDeg(90 + shearY) * scaleY;
this.a = za * la + zb * lc;
this.b = za * lb + zb * ld;
this.c = zc * la + zd * lc;
this.d = zc * lb + zd * ld;
this.d = zc * lb + zd * ld;
break;
}
}

View File

@ -139,7 +139,7 @@ void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rota
CONST_CAST(float, self->b) = pa * lb - pb * ld;
CONST_CAST(float, self->c) = pc * la + pd * lc;
CONST_CAST(float, self->d) = pc * lb + pd * ld;
break;
return;
}
case SP_TRANSFORMMODE_NOSCALE:
case SP_TRANSFORMMODE_NOSCALEORREFLECTION: {

View File

@ -168,7 +168,7 @@ void Bone::updateWorldTransform(float x, float y, float rotation, float scaleX,
_b = pa * lb - pb * ld;
_c = pc * la + pd * lc;
_d = pc * lb + pd * ld;
break;
return;
}
case TransformMode_NoScale:
case TransformMode_NoScaleOrReflection: {

View File

@ -162,6 +162,7 @@ function Bone:updateWorldTransformWith (x, y, rotation, scaleX, scaleY, shearX,
self.b = pa * lb - pb * ld
self.c = pc * la + pd * lc
self.d = pc * lb + pd * ld
return
elseif transformMode == TransformMode.noScale or transformMode == TransformMode.noScaleOrReflection then
local cos = math_cos(math_rad(rotation))
local sin = math_sin(math_rad(rotation))

View File

@ -2583,7 +2583,7 @@ var spine;
this.b = pa * lb - pb * ld;
this.c = pc * la + pd * lc;
this.d = pc * lb + pd * ld;
break;
return;
}
case spine.TransformMode.NoScale:
case spine.TransformMode.NoScaleOrReflection: {

File diff suppressed because one or more lines are too long

View File

@ -2583,7 +2583,7 @@ var spine;
this.b = pa * lb - pb * ld;
this.c = pc * la + pd * lc;
this.d = pc * lb + pd * ld;
break;
return;
}
case spine.TransformMode.NoScale:
case spine.TransformMode.NoScaleOrReflection: {

File diff suppressed because one or more lines are too long

View File

@ -2583,7 +2583,7 @@ var spine;
this.b = pa * lb - pb * ld;
this.c = pc * la + pd * lc;
this.d = pc * lb + pd * ld;
break;
return;
}
case spine.TransformMode.NoScale:
case spine.TransformMode.NoScaleOrReflection: {

File diff suppressed because one or more lines are too long

View File

@ -2583,7 +2583,7 @@ var spine;
this.b = pa * lb - pb * ld;
this.c = pc * la + pd * lc;
this.d = pc * lb + pd * ld;
break;
return;
}
case spine.TransformMode.NoScale:
case spine.TransformMode.NoScaleOrReflection: {

File diff suppressed because one or more lines are too long

View File

@ -2583,7 +2583,7 @@ var spine;
this.b = pa * lb - pb * ld;
this.c = pc * la + pd * lc;
this.d = pc * lb + pd * ld;
break;
return;
}
case spine.TransformMode.NoScale:
case spine.TransformMode.NoScaleOrReflection: {

File diff suppressed because one or more lines are too long

View File

@ -2583,7 +2583,7 @@ var spine;
this.b = pa * lb - pb * ld;
this.c = pc * la + pd * lc;
this.d = pc * lb + pd * ld;
break;
return;
}
case spine.TransformMode.NoScale:
case spine.TransformMode.NoScaleOrReflection: {

File diff suppressed because one or more lines are too long

View File

@ -219,7 +219,7 @@ module spine {
this.b = pa * lb - pb * ld;
this.c = pc * la + pd * lc;
this.d = pc * lb + pd * ld;
break;
return;
}
case TransformMode.NoScale:
case TransformMode.NoScaleOrReflection: {