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

Issues resolving "unit-sized" objects #47

Open
1bardesign opened this issue Apr 5, 2018 · 1 comment
Open

Issues resolving "unit-sized" objects #47

1bardesign opened this issue Apr 5, 2018 · 1 comment

Comments

@1bardesign
Copy link

In the game I'm working on (along with several others previously) I prefer using tile unit positions rather than pixel unit positions. Think rather than a 32x32 box for each tile, a 1x1 box for each tile, and everything else in the world to a similar scale.

This almost works with bump (things do collide mostly correctly and performance is fine using an 8x8 spatial hash on a 512x20 map), but seems to brush up against some floating point error issues that result in "snags" that don't occur at larger scales.

To be clear, I'm not talking about performance hitches, but erroneous collisions against neighbouring (internal) tile edges while walking from one tile to another. I haven't had similar issues when writing similar AABB solutions myself (albeit usually without the swept AABB collisions), so it may be some bump-specific optimisation meddling here. Adjusting the DELTA inside bump didn't seem to help anything, and I didn't have the patience to dig further into the internals and find out what might be causing it.

I've managed to workaround this by scaling everything up by a factor of 32 for bump only, allowing me to work in other units for the rest of my game while keeping bump happy - but I figured I'd report it as it may save someone else a headache and maybe @kikito has some insight into why this otherwise great lib may have trouble with unit boxes 👍

@Tachytaenius
Copy link

Yeah, I'm getting it too, with 0.5 tile sizes and 1 as well. When I tried changing DELTA to 0 I began getting pushed on top of blocks that I was supposed to be hitting the sides of.

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

2 participants