mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 10:46:53 +08:00
Fixed spBone_worldToLocalRotationY
* crashes when bone has no parent * doesn't calculate local rotation when bone has parent
This commit is contained in:
parent
7e5aa7db2b
commit
b795ba2f4e
@ -213,7 +213,7 @@ float spBone_worldToLocalRotationX (spBone* self) {
|
|||||||
|
|
||||||
float spBone_worldToLocalRotationY (spBone* self) {
|
float spBone_worldToLocalRotationY (spBone* self) {
|
||||||
spBone* parent = self->parent;
|
spBone* parent = self->parent;
|
||||||
if (self->parent) return self->rotation;
|
if (!parent) return self->rotation;
|
||||||
return ATAN2(parent->a * self->d - parent->c * self->b, parent->d * self->b - parent->b * self->d) * RAD_DEG;
|
return ATAN2(parent->a * self->d - parent->c * self->b, parent->d * self->b - parent->b * self->d) * RAD_DEG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user