God this is driving me nuts. It should be so
I have a world system whereby a grid of 31x31 in grid units is
mapped over a range of real values ranging from -15.5 to +15.5
collision detection reasons, I need a function that will basically do a mod such
that when applied to my real X or Z coordinate, it tells me (as a range 0-1) how
far into a grid cell I am. I would expect the routine to return 0.1 if I'm a
tenth into a particular grid square.
But, whatever combinations of
mod,floor,ceil,etc I've tried, when the real coord is negative, I get a 0.9
instead of a 0.1
I'm kinda looking for a float version of "&"
Any ideas what I'm doing wrong ?
RoundDown=crt floorf btw
GetGridXFromWorld (tF32 WorldX)
tINT GetGridYFromWorld (tF32
I would expect this function to return how far into
the current square I am as a normalised "percentage". It's changed a lot but
this is definitely wrong. I just can't seem to fix it!