[as3][c][cpp][csharp][libgdx][lua][ts] Fixed updateAppliedTransform for the root bone.

This commit is contained in:
Nathan Sweet 2021-09-16 17:00:10 -06:00
parent 4785dcc212
commit 77774608bf
7 changed files with 14 additions and 14 deletions

View File

@ -253,8 +253,8 @@ package spine {
internal function updateAppliedTransform() : void {
var parent : Bone = this.parent;
if (parent == null) {
ax = worldX;
ay = worldY;
ax = worldX - skeleton.x;
ay = worldY - skeleton.y;
arotation = Math.atan2(c, a) * MathUtils.radDeg;
ascaleX = Math.sqrt(a * a + c * c);
ascaleY = Math.sqrt(b * b + d * d);

View File

@ -218,8 +218,8 @@ float spBone_getWorldScaleY(spBone *self) {
void spBone_updateAppliedTransform(spBone *self) {
spBone *parent = self->parent;
if (!parent) {
self->ax = self->worldX;
self->ay = self->worldY;
self->ax = self->worldX - self->skeleton->x;
self->ay = self->worldY - self->skeleton->y;
self->arotation = ATAN2(self->c, self->a) * RAD_DEG;
self->ascaleX = SQRT(self->a * self->a + self->c * self->c);
self->ascaleY = SQRT(self->b * self->b + self->d * self->d);

View File

@ -493,8 +493,8 @@ float Bone::getWorldScaleY() {
void Bone::updateAppliedTransform() {
Bone *parent = _parent;
if (!parent) {
_ax = _worldX;
_ay = _worldY;
_ax = _worldX - _skeleton.getX();
_ay = _worldY - _skeleton.getY();
_arotation = MathUtil::atan2(_c, _a) * MathUtil::Rad_Deg;
_ascaleX = MathUtil::sqrt(_a * _a + _c * _c);
_ascaleY = MathUtil::sqrt(_b * _b + _d * _d);

View File

@ -277,8 +277,8 @@ namespace Spine {
internal void UpdateAppliedTransform () {
Bone parent = this.parent;
if (parent == null) {
ax = worldX;
ay = worldY;
ax = worldX - skeleton.x;
ay = worldY - skeleton.y;
arotation = MathUtils.Atan2(c, a) * MathUtils.RadDeg;
ascaleX = (float)Math.Sqrt(a * a + c * c);
ascaleY = (float)Math.Sqrt(b * b + d * d);

View File

@ -397,8 +397,8 @@ public class Bone implements Updatable {
public void updateAppliedTransform () {
Bone parent = this.parent;
if (parent == null) {
ax = worldX;
ay = worldY;
ax = worldX - skeleton.x;
ay = worldY - skeleton.y;
float a = this.a, b = this.b, c = this.c, d = this.d;
arotation = atan2(c, a) * radDeg;
ascaleX = (float)Math.sqrt(a * a + c * c);

View File

@ -214,8 +214,8 @@ end
function Bone:updateAppliedTransform ()
local parent = self.parent
if not parent then
self.ax = self.worldX
self.ay = self.worldY
self.ax = self.worldX - self.skeleton.x
self.ay = self.worldY - self.skeleton.y
local a = self.a
local b = self.b
local c = self.c

View File

@ -298,8 +298,8 @@ export class Bone implements Updatable {
updateAppliedTransform () {
let parent = this.parent;
if (!parent) {
this.ax = this.worldX;
this.ay = this.worldY;
this.ax = this.worldX - this.skeleton.x;
this.ay = this.worldY - this.skeleton.y;
this.arotation = Math.atan2(this.c, this.a) * MathUtils.radDeg;
this.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);
this.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);