mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[as3][c][cpp][csharp][libgdx][lua][ts] Fixed updateAppliedTransform for the root bone.
This commit is contained in:
parent
4785dcc212
commit
77774608bf
@ -253,8 +253,8 @@ package spine {
|
|||||||
internal function updateAppliedTransform() : void {
|
internal function updateAppliedTransform() : void {
|
||||||
var parent : Bone = this.parent;
|
var parent : Bone = this.parent;
|
||||||
if (parent == null) {
|
if (parent == null) {
|
||||||
ax = worldX;
|
ax = worldX - skeleton.x;
|
||||||
ay = worldY;
|
ay = worldY - skeleton.y;
|
||||||
arotation = Math.atan2(c, a) * MathUtils.radDeg;
|
arotation = Math.atan2(c, a) * MathUtils.radDeg;
|
||||||
ascaleX = Math.sqrt(a * a + c * c);
|
ascaleX = Math.sqrt(a * a + c * c);
|
||||||
ascaleY = Math.sqrt(b * b + d * d);
|
ascaleY = Math.sqrt(b * b + d * d);
|
||||||
|
|||||||
@ -218,8 +218,8 @@ float spBone_getWorldScaleY(spBone *self) {
|
|||||||
void spBone_updateAppliedTransform(spBone *self) {
|
void spBone_updateAppliedTransform(spBone *self) {
|
||||||
spBone *parent = self->parent;
|
spBone *parent = self->parent;
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
self->ax = self->worldX;
|
self->ax = self->worldX - self->skeleton->x;
|
||||||
self->ay = self->worldY;
|
self->ay = self->worldY - self->skeleton->y;
|
||||||
self->arotation = ATAN2(self->c, self->a) * RAD_DEG;
|
self->arotation = ATAN2(self->c, self->a) * RAD_DEG;
|
||||||
self->ascaleX = SQRT(self->a * self->a + self->c * self->c);
|
self->ascaleX = SQRT(self->a * self->a + self->c * self->c);
|
||||||
self->ascaleY = SQRT(self->b * self->b + self->d * self->d);
|
self->ascaleY = SQRT(self->b * self->b + self->d * self->d);
|
||||||
|
|||||||
@ -493,8 +493,8 @@ float Bone::getWorldScaleY() {
|
|||||||
void Bone::updateAppliedTransform() {
|
void Bone::updateAppliedTransform() {
|
||||||
Bone *parent = _parent;
|
Bone *parent = _parent;
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
_ax = _worldX;
|
_ax = _worldX - _skeleton.getX();
|
||||||
_ay = _worldY;
|
_ay = _worldY - _skeleton.getY();
|
||||||
_arotation = MathUtil::atan2(_c, _a) * MathUtil::Rad_Deg;
|
_arotation = MathUtil::atan2(_c, _a) * MathUtil::Rad_Deg;
|
||||||
_ascaleX = MathUtil::sqrt(_a * _a + _c * _c);
|
_ascaleX = MathUtil::sqrt(_a * _a + _c * _c);
|
||||||
_ascaleY = MathUtil::sqrt(_b * _b + _d * _d);
|
_ascaleY = MathUtil::sqrt(_b * _b + _d * _d);
|
||||||
|
|||||||
@ -277,8 +277,8 @@ namespace Spine {
|
|||||||
internal void UpdateAppliedTransform () {
|
internal void UpdateAppliedTransform () {
|
||||||
Bone parent = this.parent;
|
Bone parent = this.parent;
|
||||||
if (parent == null) {
|
if (parent == null) {
|
||||||
ax = worldX;
|
ax = worldX - skeleton.x;
|
||||||
ay = worldY;
|
ay = worldY - skeleton.y;
|
||||||
arotation = MathUtils.Atan2(c, a) * MathUtils.RadDeg;
|
arotation = MathUtils.Atan2(c, a) * MathUtils.RadDeg;
|
||||||
ascaleX = (float)Math.Sqrt(a * a + c * c);
|
ascaleX = (float)Math.Sqrt(a * a + c * c);
|
||||||
ascaleY = (float)Math.Sqrt(b * b + d * d);
|
ascaleY = (float)Math.Sqrt(b * b + d * d);
|
||||||
|
|||||||
@ -397,8 +397,8 @@ public class Bone implements Updatable {
|
|||||||
public void updateAppliedTransform () {
|
public void updateAppliedTransform () {
|
||||||
Bone parent = this.parent;
|
Bone parent = this.parent;
|
||||||
if (parent == null) {
|
if (parent == null) {
|
||||||
ax = worldX;
|
ax = worldX - skeleton.x;
|
||||||
ay = worldY;
|
ay = worldY - skeleton.y;
|
||||||
float a = this.a, b = this.b, c = this.c, d = this.d;
|
float a = this.a, b = this.b, c = this.c, d = this.d;
|
||||||
arotation = atan2(c, a) * radDeg;
|
arotation = atan2(c, a) * radDeg;
|
||||||
ascaleX = (float)Math.sqrt(a * a + c * c);
|
ascaleX = (float)Math.sqrt(a * a + c * c);
|
||||||
|
|||||||
@ -214,8 +214,8 @@ end
|
|||||||
function Bone:updateAppliedTransform ()
|
function Bone:updateAppliedTransform ()
|
||||||
local parent = self.parent
|
local parent = self.parent
|
||||||
if not parent then
|
if not parent then
|
||||||
self.ax = self.worldX
|
self.ax = self.worldX - self.skeleton.x
|
||||||
self.ay = self.worldY
|
self.ay = self.worldY - self.skeleton.y
|
||||||
local a = self.a
|
local a = self.a
|
||||||
local b = self.b
|
local b = self.b
|
||||||
local c = self.c
|
local c = self.c
|
||||||
|
|||||||
@ -298,8 +298,8 @@ export class Bone implements Updatable {
|
|||||||
updateAppliedTransform () {
|
updateAppliedTransform () {
|
||||||
let parent = this.parent;
|
let parent = this.parent;
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
this.ax = this.worldX;
|
this.ax = this.worldX - this.skeleton.x;
|
||||||
this.ay = this.worldY;
|
this.ay = this.worldY - this.skeleton.y;
|
||||||
this.arotation = Math.atan2(this.c, this.a) * MathUtils.radDeg;
|
this.arotation = Math.atan2(this.c, this.a) * MathUtils.radDeg;
|
||||||
this.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);
|
this.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);
|
||||||
this.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);
|
this.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user