Fix duDebugDrawHeightfieldLayer and RecastDebugDraw cleanup

This commit is contained in:
Kawe Mazidjatari 2022-07-27 12:38:02 +02:00
parent df99664d2a
commit 4c8027b319

View File

@ -380,11 +380,11 @@ void duDebugDrawHeightfieldLayer(duDebugDraw* dd, const struct rcHeightfieldLaye
// Layer bounds
float bmin[3], bmax[3];
bmin[0] = layer.bmin[0] + layer.minx*cs;
bmin[1] = layer.bmin[1];
bmin[2] = layer.bmin[2] + layer.miny*cs;
bmin[1] = layer.bmin[1] + layer.miny*cs;
bmin[2] = layer.bmin[2];
bmax[0] = layer.bmin[0] + (layer.maxx+1)*cs;
bmax[1] = layer.bmax[1];
bmax[2] = layer.bmin[2] + (layer.maxy+1)*cs;
bmax[1] = layer.bmax[1] + (layer.maxy+1)*cs;
bmax[2] = layer.bmin[2];
duDebugDrawBoxWire(dd, bmin[0],bmin[1],bmin[2], bmax[0],bmax[1],bmax[2], duTransCol(color,128), 2.0f);
// Layer height
@ -407,8 +407,8 @@ void duDebugDrawHeightfieldLayer(duDebugDraw* dd, const struct rcHeightfieldLaye
col = duLerpCol(color, dd->areaToCol(area), 32);
const float fx = layer.bmin[0] + x*cs;
const float fy = layer.bmin[1] + (lh+1)*ch;
const float fz = layer.bmin[2] + y*cs;
const float fz = layer.bmin[1] + y*cs;
const float fy = layer.bmin[2] + (lh+1)*ch;
dd->vertex(fx, fy, fz, col);
dd->vertex(fx+cs, fy, fz, col);