finding the distance to a point in the terrain

At the point where the ray collides, you can retrieve the distance between your object and the collision point by doing:

yourCollisionEntry.getSurfacePoint(yourObject).lengthSquared()
1 Like