mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +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;
|
||||
_worldRotation = _parent._worldRotation + rotation;
|
||||
} else {
|
||||
_worldX = x;
|
||||
_worldY = y;
|
||||
_worldX = flipX ? -x : x;
|
||||
_worldY = flipX ? -y : y;
|
||||
_worldScaleX = scaleX;
|
||||
_worldScaleY = scaleY;
|
||||
_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->worldRotation) = self->parent->worldRotation + self->rotation;
|
||||
} else {
|
||||
CONST_CAST(float, self->worldX) = self->x;
|
||||
CONST_CAST(float, self->worldY) = self->y;
|
||||
CONST_CAST(float, self->worldX) = flipX ? -self->x : self->x;
|
||||
CONST_CAST(float, self->worldY) = flipX ? -self->y : self->y;
|
||||
CONST_CAST(float, self->worldScaleX) = self->scaleX;
|
||||
CONST_CAST(float, self->worldScaleY) = self->scaleY;
|
||||
CONST_CAST(float, self->worldRotation) = self->rotation;
|
||||
|
||||
@ -41,9 +41,17 @@ function Bone.new (data, parent)
|
||||
self.worldScaleX = parent.worldScaleX * self.scaleX
|
||||
self.worldScaleY = parent.worldScaleY * self.scaleY
|
||||
self.worldRotation = parent.worldRotation + self.rotation
|
||||
else
|
||||
if flipX then
|
||||
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.worldScaleY = self.scaleY
|
||||
self.worldRotation = self.rotation
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user