mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
Fixed point attachment world rotation.
This commit is contained in:
parent
e8296ebc52
commit
e11cd56bac
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user