-
Notifications
You must be signed in to change notification settings - Fork 96
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
util.normalize() is rounding? #45
Comments
I don't know. Probably, test it out. It came from the original. It sounds like math.floor() would be better, but I can't be sure. |
If we have a position like |
Makes sense to me. |
|
That's my mistake, I changed the normalize function without fully testing the ramifications. I'll submit a PR to revert the change. |
Just to clarify: Seems to be the reason at least (didn't look much further into it). |
That makes more sense. I was assuming that the corners of a block would align with whole numbers with the center point being This seems counter intuitive to me, but perhaps that just because I've played too much Minecraft. |
Might be worth considering changing it. Dirty test:
Though the difference is probably not big enough to actually have an impact on the game. |
In retrospect, I think the current behaviour, with using the blocks centre as the integer coordinates and adding +0.5/-0.5, seems to be much simpler behaviour. The rounding might be a bit odd, but changing the structure just to get rid of the rounding isn't really worth it. I think an approach using numpy, like discussed in #56 (it hasn't been implemented yet aside from those tests in @TristanTrim's fork, right?), would be much better. |
I'm working on writing some unit tests for some of the existing code and saw that the
normalize()
function in the util module is usinground()
. The documentation for the function says it returns the block containing the input position, so should this be usingmath.floor()
instead?The text was updated successfully, but these errors were encountered: