Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Position / Set Angle. #4

Closed
schoening opened this issue Feb 28, 2014 · 2 comments
Closed

Set Position / Set Angle. #4

schoening opened this issue Feb 28, 2014 · 2 comments

Comments

@schoening
Copy link

It would be a very good feature to be able to set the position and angle, rather than having to translate and "add" to the angle.

For instance.. with the translate. If I want to set the position of the polygon to my model. I have to:
polygon.translate( model.position.x - polygon.pos.x, model.position.y - polygon.pos.y)

@jriecken
Copy link
Owner

Yeah, this is on my list of things to do (this is pretty much the same issue as #3)

If I get some time this weekend I'll take a stab at implementing this.

@jriecken
Copy link
Owner

jriecken commented Mar 2, 2014

I just added angle and offset properties (and setAngle/setOffset methods) to the polygon that affect the computed collision polygon (whose points are now in a property called calcPoints).

The rotate and translate methods are still there, but they affect the original points (so any angle or offset will be applied on top of that)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants