I think this should return 1, not 0.

Like this, I can loop over the column/row facing
the collision side, ie for z = tile; z < tile + len.
This commit is contained in:
King_DuckZ 2018-03-01 23:19:27 +00:00
parent ea5bbb8673
commit 89f7d5c948

View file

@ -34,8 +34,8 @@ namespace curry {
vec2us check_tiles_count (const vec2us& parObjSize, const vec2f& parDirection) {
assert(parObjSize > 0);
const uint16_t horz = (parDirection.y() != 0.0f ? parObjSize.x() : 0);
const uint16_t vert = (parDirection.x() != 0.0f ? parObjSize.y() : 0);
const uint16_t horz = (parDirection.y() != 0.0f ? parObjSize.x() : 1);
const uint16_t vert = (parDirection.x() != 0.0f ? parObjSize.y() : 1);
return vec2us(horz, vert);
}