Variables and functions named "Y" are used throughout the codebase to refer to Z values
grahamboree opened this issue · comments
It's super confusing that there are cases where z coordinate values are used in variables with the name y
. The use of the ambiguous height
and width
rather than a name that indicates the axis to which that size applies is also confusing. There's nothing functionaly wrong about the code, it's just using very misleading variable names.
rcGetDirOffsetY
is a great example case
recastnavigation/Recast/Include/Recast.h
Lines 1093 to 1101 in d0b2ed8
We should endevor to name things what they are, and avoid ambiguous terms like "width" and "height".
Since many of these cases are user-facing in the Recast interface, we should take care to not introduce breaking changes to the API outside of a major release.
I've started renaming things in implementations to be more accurate and am making notes of places in the interface that would require a major update to change.
"Height" is also used ambiguously to sometimes refer to the number of cells of the heightfield along the z-axis, and sometimes to refer to the number of heightfield cells along the y-axis.
Z-axis "height":
recastnavigation/Recast/Include/Recast.h
Lines 204 to 205 in b51925b
Y-axis "height":
recastnavigation/Recast/Include/Recast.h
Lines 266 to 269 in b51925b