Lerige Posted January 19, 2015 Share Posted January 19, 2015 Hi all, Since this is my first post here, I'll start with congratulations to the developers and contributors of this library. Very nice work.So nice that have started to play with it I have a question regarding the follow camera between 1.14 and 2.0 alpha.I have no issue using 1.14. But it seems the camera is broken in 2.0:with 1.14 cameraTarget.rotation.y will return negative values if this angle is greater than PI.with 2.0 it will return positive values in any case (no mean to make a difference between PI/2 and -PI/2 for example, the value is PI/2 in both cases).Any explanation for this behavior ?I hope the topic has not been answered elsewhere, but I found nothing. Quote Link to comment Share on other sites More sharing options...
JUL Posted January 20, 2015 Share Posted January 20, 2015 0, 1, 2, 3-3,-2,-1,-0 I think ray (And I'm drunk btw fyi, that's the beauty of it all) this.ray= new Phaser.Line(0, 0, 0, 0);//you attach that to anywhere, like yourSprite.ray or whatever)this.ray.setTo(this.x, this.body.y+map.tileHeight, obj.x, obj.body.y+map.tileHeight);//"this being the thing ray is attached to, of course, like kites, in the sky, attached to things around) And then from this point you get tons of stuufs.Such as, an angle : this.ray.angle And A freaking distance this.ray.length With those two things (whatever was your question) 85% of your projectile stuffs are done.But yeah angle.See beginneng of post for what's returned. Quote Link to comment Share on other sites More sharing options...
Lerige Posted January 20, 2015 Author Share Posted January 20, 2015 Thanks for your answer and I have to apologize cause it was a too fast question... I've just found the answer : I was using ToEulerAngles to define my target rotation from a physic engine... and ToEulerAngles has been rewritten between 1.14 and 2.0... I've just still have to understand the difference now Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.