mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 14:08:28 +00:00
Testing rotation fix (again)
This commit is contained in:
parent
d2d03d0312
commit
969a574a75
1 changed files with 17 additions and 6 deletions
|
@ -86,22 +86,33 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent
|
|||
var viewportHeight = renderer.height;
|
||||
|
||||
skeleton.x = calcMatrix.tx;
|
||||
skeleton.y = viewportHeight - calcMatrix.ty;
|
||||
|
||||
skeleton.scaleX = calcMatrix.scaleX;
|
||||
skeleton.scaleY = calcMatrix.scaleY;
|
||||
|
||||
// window.m2 = [ calcMatrix.a, calcMatrix.b, calcMatrix.c, calcMatrix.d, calcMatrix.e, calcMatrix.f, calcMatrix.rotation, calcMatrix.rotationNormalized ];
|
||||
// window.scaleX = calcMatrix.scaleX;
|
||||
// window.scaleY = calcMatrix.scaleY;
|
||||
// window.rotation = RadToDeg(CounterClockwise(calcMatrix.rotation)) + 90;
|
||||
|
||||
if (camera.renderToTexture)
|
||||
{
|
||||
skeleton.y = calcMatrix.ty;
|
||||
skeleton.scaleY = calcMatrix.scaleY * -1;
|
||||
skeleton.scaleY *= -1;
|
||||
}
|
||||
|
||||
if (skeleton.scaleX < 0)
|
||||
{
|
||||
// +90 degrees to account for the difference in Spine vs. Phaser rotation
|
||||
src.root.rotation = RadToDeg(CounterClockwise(calcMatrix.rotation)) + 90;
|
||||
}
|
||||
else
|
||||
{
|
||||
skeleton.y = viewportHeight - calcMatrix.ty;
|
||||
skeleton.scaleY = calcMatrix.scaleY;
|
||||
// +90 degrees to account for the difference in Spine vs. Phaser rotation
|
||||
src.root.rotation = RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90;
|
||||
}
|
||||
|
||||
// +90 degrees to account for the difference in Spine vs. Phaser rotation
|
||||
src.root.rotation = RadToDeg(CounterClockwise(calcMatrix.rotation)) + 90;
|
||||
|
||||
// Add autoUpdate option
|
||||
skeleton.updateWorldTransform();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue