mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 17:56:04 +08:00
Forgot to flip the root bone for some runtimes since the skeleton is now placed separately from the root bone.
This commit is contained in:
parent
e6d7cf8b26
commit
22fabe8769
@ -39,8 +39,8 @@ public class Bone {
|
|||||||
_worldScaleY = _parent._worldScaleY * scaleY;
|
_worldScaleY = _parent._worldScaleY * scaleY;
|
||||||
_worldRotation = _parent._worldRotation + rotation;
|
_worldRotation = _parent._worldRotation + rotation;
|
||||||
} else {
|
} else {
|
||||||
_worldX = x;
|
_worldX = flipX ? -x : x;
|
||||||
_worldY = y;
|
_worldY = flipX ? -y : y;
|
||||||
_worldScaleX = scaleX;
|
_worldScaleX = scaleX;
|
||||||
_worldScaleY = scaleY;
|
_worldScaleY = scaleY;
|
||||||
_worldRotation = rotation;
|
_worldRotation = rotation;
|
||||||
|
|||||||
@ -62,8 +62,8 @@ void Bone_updateWorldTransform (Bone* self, int flipX, int flipY) {
|
|||||||
CONST_CAST(float, self->worldScaleY) = self->parent->worldScaleY * self->scaleY;
|
CONST_CAST(float, self->worldScaleY) = self->parent->worldScaleY * self->scaleY;
|
||||||
CONST_CAST(float, self->worldRotation) = self->parent->worldRotation + self->rotation;
|
CONST_CAST(float, self->worldRotation) = self->parent->worldRotation + self->rotation;
|
||||||
} else {
|
} else {
|
||||||
CONST_CAST(float, self->worldX) = self->x;
|
CONST_CAST(float, self->worldX) = flipX ? -self->x : self->x;
|
||||||
CONST_CAST(float, self->worldY) = self->y;
|
CONST_CAST(float, self->worldY) = flipX ? -self->y : self->y;
|
||||||
CONST_CAST(float, self->worldScaleX) = self->scaleX;
|
CONST_CAST(float, self->worldScaleX) = self->scaleX;
|
||||||
CONST_CAST(float, self->worldScaleY) = self->scaleY;
|
CONST_CAST(float, self->worldScaleY) = self->scaleY;
|
||||||
CONST_CAST(float, self->worldRotation) = self->rotation;
|
CONST_CAST(float, self->worldRotation) = self->rotation;
|
||||||
|
|||||||
@ -42,8 +42,16 @@ function Bone.new (data, parent)
|
|||||||
self.worldScaleY = parent.worldScaleY * self.scaleY
|
self.worldScaleY = parent.worldScaleY * self.scaleY
|
||||||
self.worldRotation = parent.worldRotation + self.rotation
|
self.worldRotation = parent.worldRotation + self.rotation
|
||||||
else
|
else
|
||||||
self.worldX = self.x
|
if flipX then
|
||||||
self.worldY = self.y
|
self.worldX = -self.x
|
||||||
|
else
|
||||||
|
self.worldX = self.x
|
||||||
|
end
|
||||||
|
if flipY then
|
||||||
|
self.worldY = -self.y
|
||||||
|
else
|
||||||
|
self.worldY = self.y
|
||||||
|
end
|
||||||
self.worldScaleX = self.scaleX
|
self.worldScaleX = self.scaleX
|
||||||
self.worldScaleY = self.scaleY
|
self.worldScaleY = self.scaleY
|
||||||
self.worldRotation = self.rotation
|
self.worldRotation = self.rotation
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user