Quellcode durchsuchen

[c][cpp] Port of commit ccc5b2f: Fixed root bone transform for skeleton. See #1379.

badlogic vor 6 Jahren
Ursprung
Commit
b2e151f3e7
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 2 2
      spine-c/spine-c/src/spine/Bone.c
  2. 2 2
      spine-cpp/spine-cpp/src/spine/Bone.cpp

+ 2 - 2
spine-c/spine-c/src/spine/Bone.c

@@ -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;

+ 2 - 2
spine-cpp/spine-cpp/src/spine/Bone.cpp

@@ -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();