mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix player collision calculation
This commit is contained in:
parent
690f7ff724
commit
1e00a82db5
1 changed files with 2 additions and 2 deletions
|
|
@ -152,7 +152,7 @@ static bool calc_collision_neg(
|
|||
return false;
|
||||
}
|
||||
glm::vec3 offset(0.0f, stepHeight, 0.0f);
|
||||
for (int iy = 0; iy <= (half[ny]-E)*2/s; iy++) {
|
||||
for (int iy = 0; iy <= ((half-offset)[ny]-E)*2/s; iy++) {
|
||||
glm::vec3 coord;
|
||||
coord[ny] = ((pos+offset)[ny]-half[ny]+E) + iy * s;
|
||||
for (int iz = 0; iz <= (half[nz]-E)*2/s; iz++){
|
||||
|
|
@ -185,7 +185,7 @@ static void calc_collision_pos(
|
|||
return;
|
||||
}
|
||||
glm::vec3 offset(0.0f, stepHeight, 0.0f);
|
||||
for (int iy = 0; iy <= (half[ny]-E)*2/s; iy++) {
|
||||
for (int iy = 0; iy <= ((half-offset)[ny]-E)*2/s; iy++) {
|
||||
glm::vec3 coord;
|
||||
coord[ny] = ((pos+offset)[ny]-half[ny]+E) + iy * s;
|
||||
for (int iz = 0; iz <= (half[nz]-E)*2/s; iz++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue