mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-08 00:04:54 +08:00
[c][cpp] Port of commit ccc5b2f: Fixed root bone transform for skeleton. See #1379.
This commit is contained in:
parent
6e54e8d819
commit
b2e151f3e7
@ -79,8 +79,8 @@ void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rota
|
||||
if (!parent) { /* Root bone. */
|
||||
float rotationY = rotation + 90 + shearY;
|
||||
CONST_CAST(float, self->a) = COS_DEG(rotation + shearX) * scaleX * sx;
|
||||
CONST_CAST(float, self->b) = COS_DEG(rotationY) * scaleY * sy;
|
||||
CONST_CAST(float, self->c) = SIN_DEG(rotation + shearX) * scaleX * sx;
|
||||
CONST_CAST(float, self->b) = COS_DEG(rotationY) * scaleY * sx;
|
||||
CONST_CAST(float, self->c) = SIN_DEG(rotation + shearX) * scaleX * sy;
|
||||
CONST_CAST(float, self->d) = SIN_DEG(rotationY) * scaleY * sy;
|
||||
CONST_CAST(float, self->worldX) = x * sx + self->skeleton->x;
|
||||
CONST_CAST(float, self->worldY) = y * sy + self->skeleton->y;
|
||||
|
||||
@ -107,8 +107,8 @@ Bone::updateWorldTransform(float x, float y, float rotation, float scaleX, float
|
||||
float sx = _skeleton.getScaleX();
|
||||
float sy = _skeleton.getScaleY();
|
||||
_a = MathUtil::cosDeg(rotation + shearX) * scaleX * sx;
|
||||
_b = MathUtil::cosDeg(rotationY) * scaleY * sy;
|
||||
_c = MathUtil::sinDeg(rotation + shearX) * scaleX * sx;
|
||||
_b = MathUtil::cosDeg(rotationY) * scaleY * sx;
|
||||
_c = MathUtil::sinDeg(rotation + shearX) * scaleX * sy;
|
||||
_d = MathUtil::sinDeg(rotationY) * scaleY * sy;
|
||||
_worldX = x * sx + _skeleton.getX();
|
||||
_worldY = y * sy + _skeleton.getY();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user