mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-17 12:31:41 +08:00
parent
cc40f1be93
commit
6c353c1a38
@ -273,8 +273,8 @@ public class Bone implements Updatable {
|
||||
var x:Number = world[0] - _worldX, y:Number = world[1] - _worldY;
|
||||
var a:Number = _a, b:Number = _b, c:Number = _c, d:Number = _d;
|
||||
var invDet:Number = 1 / (a * d - b * c);
|
||||
world[0] = (x * a * invDet - y * b * invDet);
|
||||
world[1] = (y * d * invDet - x * c * invDet);
|
||||
world[0] = (x * d * invDet - y * b * invDet);
|
||||
world[1] = (y * a * invDet - x * c * invDet);
|
||||
}
|
||||
|
||||
public function localToWorld (local:Vector.<Number>) : void {
|
||||
|
||||
@ -221,8 +221,8 @@ void spBone_worldToLocal (spBone* self, float worldX, float worldY, float* local
|
||||
float x = worldX - self->worldX, y = worldY - self->worldY;
|
||||
float a = self->a, b = self->b, c = self->c, d = self->d;
|
||||
float invDet = 1 / (a * d - b * c);
|
||||
*localX = (x * a * invDet - y * b * invDet);
|
||||
*localY = (y * d * invDet - x * c * invDet);
|
||||
*localX = (x * d * invDet - y * b * invDet);
|
||||
*localY = (y * a * invDet - x * c * invDet);
|
||||
}
|
||||
|
||||
void spBone_localToWorld (spBone* self, float localX, float localY, float* worldX, float* worldY) {
|
||||
|
||||
@ -233,8 +233,8 @@ namespace Spine {
|
||||
float x = worldX - this.worldX, y = worldY - this.worldY;
|
||||
float a = this.a, b = this.b, c = this.c, d = this.d;
|
||||
float invDet = 1 / (a * d - b * c);
|
||||
localX = (x * a * invDet - y * b * invDet);
|
||||
localY = (y * d * invDet - x * c * invDet);
|
||||
localX = (x * d * invDet - y * b * invDet);
|
||||
localY = (y * a * invDet - x * c * invDet);
|
||||
}
|
||||
|
||||
public void LocalToWorld (float localX, float localY, out float worldX, out float worldY) {
|
||||
|
||||
@ -356,8 +356,8 @@ public class Bone implements Updatable {
|
||||
float x = world.x - worldX, y = world.y - worldY;
|
||||
float a = this.a, b = this.b, c = this.c, d = this.d;
|
||||
float invDet = 1 / (a * d - b * c);
|
||||
world.x = (x * a * invDet - y * b * invDet);
|
||||
world.y = (y * d * invDet - x * c * invDet);
|
||||
world.x = (x * d * invDet - y * b * invDet);
|
||||
world.y = (y * a * invDet - x * c * invDet);
|
||||
return world;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user