TerrainBlock's getHeight(Vector3f position) method says it returns Float.NaN if the location is not within the heightmap bounds. However when I compare it to Float.NaN in an if statement using == it is not equal. Both print as NaN. Could this just be some floating point error where they are off by a small fraction. If so what is the best way to compare them?
Use Float.isNan().
NaN cannot be compared to itself in java…
Thanks that works.