- Изменено
C Runtime spBone_worldToLocal Flip Issue
Hi all,
I've been struggling with some odd results when setting IK control positions for a root flipped skeleton using the c runtime. I've tracked the issue to the spBone_worldToLocal function. This does not seem to take into account if a parent bone is flipped or not.
Changing it to something like this fixes the issue for me (though you prob want something for y flip as well):
void spBone_worldToLocalFlip(spBone* self, float worldX, float worldY, float* localX, float* localY)
{
float x = worldX - self->worldX, y = worldY - self->worldY;
float a = self->a, b = self->b, c = self->c, d = self->d;
//new flip code
a *= self->worldSignX;
d *= self->worldSignX;
float invDet = 1 / (a * d - b * c);
*localX = (x * a * invDet - y * b * invDet);
*localY = (y * d * invDet - x * c * invDet);
}
I'm surprised noone has come across this!
David.
Are you using spine 3.0? if so:
[initialise standard response]
The C runtimes haven't been updated for spine 3.0+. Please use the correct editor version for your runtimes
[/standard response]
[standard response counter]
https://twitter.com/EsotericSoft/status/699371485715111936
[/standard response counter]
:p
What? spine-c has been updated for 3.0.
Just not 3.1
Pharan написалWhat? spine-c has been updated for 3.0.
Just not 3.1
:o
nobody told me!