Fixed point attachment world rotation.

This commit is contained in:
NathanSweet 2016-12-01 14:36:47 +01:00
parent e8296ebc52
commit e11cd56bac

View File

@ -87,9 +87,9 @@ public class PointAttachment extends Attachment {
}
public float computeWorldRotation (Bone bone) {
float x = cos(rotation), y = sin(rotation);
x = x * bone.getA() + y * bone.getB() + bone.getWorldX();
y = x * bone.getC() + y * bone.getD() + bone.getWorldY();
return (float)Math.atan2(y, x);
float cos = cosDeg(rotation), sin = sinDeg(rotation);
float x = cos * bone.getA() + sin * bone.getB();
float y = cos * bone.getC() + sin * bone.getD();
return (float)Math.atan2(y, x) * radDeg;
}
}