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:
parent
ea5bbb8673
commit
89f7d5c948
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue