// Use the given collision system to find where the closest collidable
// object is.
PickInfo pi = collision.pickAllWorldRay(heightRay, true, false);
if (pi.size() != 0) {
// Grab the first one
PickDetails pd = pi.get(0);
return pd.getDistance();
}
// Otherwise, if we did not find any ground, then return -1
return -1;
}