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

Bounding box is wrong for window/game object factor != 1 #10

Open
bil-bas opened this issue Aug 21, 2010 · 2 comments
Open

Bounding box is wrong for window/game object factor != 1 #10

bil-bas opened this issue Aug 21, 2010 · 2 comments

Comments

@bil-bas
Copy link
Contributor

bil-bas commented Aug 21, 2010

  1. shown wrong position (in :debug mode)
  2. need to scale it by 1/factor or they are wrong sizes

Fix is either to scale x & y (* factor) when displayed and scale w/h (/factor) for collisions.

@bil-bas
Copy link
Contributor Author

bil-bas commented Aug 31, 2010

Ah, this is caused by using retrofication. Sorry, I didn't realise. If objects have "trait :retrofy" and a factor != 1, then the boxes are wrongly calculated.

@bil-bas
Copy link
Contributor Author

bil-bas commented Aug 31, 2010

Ah, I used a workaround to make this work though, which was

trait :bounding_box, :debug => true, :scale =>  0.25 # where factor was 4

The boxes were still drawn in the incorrect positions but their interactions were then correct (that is, they collided correctly).

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