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

Bounds function incorrect placement #7

Open
greim opened this issue Feb 3, 2017 · 0 comments
Open

Bounds function incorrect placement #7

greim opened this issue Feb 3, 2017 · 0 comments

Comments

@greim
Copy link
Contributor

greim commented Feb 3, 2017

I may not understand what it's supposed to do, or maybe it's a bug, but I can't seem to get them to position correctly. If I change the math a little bit from this:

box (w,thickness) inf restitution (cx, hExt+halfThick) (0,0) meta,
box (w,thickness) inf restitution (cx, -(hExt+halfThick)) (0,0) meta,
box (thickness,h) inf restitution (wExt+halfThick, cy) (0,0) meta,
box (thickness,h) inf restitution (-(wExt+halfThick), cy) (0,0) meta

To this:

box (w,thickness) inf restitution (cx, cy + (hExt+halfThick)) (0,0) meta,
box (w,thickness) inf restitution (cx, cy - (hExt+halfThick)) (0,0) meta,
box (thickness,h) inf restitution (cx + (wExt+halfThick), cy) (0,0) meta,
box (thickness,h) inf restitution (cx - (wExt+halfThick), cy) (0,0) meta

Then it behaves exactly as I expect.

https://github.com/jastice/boxes-and-bubbles/blob/master/src/BoxesAndBubbles.elm#L109-L112

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

No branches or pull requests

1 participant