apply this code from "John Miles" <jmiles@pop.net>: ----------------------------------- The dGeomBoxPointDepth() function is documented to work for points both inside and outside the box geom.  However, because the current implementation always returns the minimum distance between the point and any side of the box, it often returns meaningless results for input points outside the box.
apply this code from
"John Miles" <jmiles@pop.net>:
-----------------------------------
The dGeomBoxPointDepth() function is documented to work for points both
inside and outside the box geom.  However, because the current
implementation always returns the minimum distance between the point and any
side of the box, it often returns meaningless results for input points
outside the box.

This implementation behaves identically to the current one for points inside
the box, but uses a different approximation for exterior-point distances.
The *largest* positive distance between the point and any side needs to be
returned in this case.  (Consider an exterior point that's only slightly
above the top plane of a box, but several units to the left.  The previous
implementation would have returned the distance from the point to the top
plane, which is grossly incorrect, rather than the left plane.)

Apart from any user applications that call dGeomBoxPointDepth(), the
function appears to be used only by the dTerrainY/Z contribution, as far as
I can tell.  This rewritten version (below) has been tested with dTerrainY
and seems to work fine.   It still isn't formally "right," but the
approximation it returns for exterior-point depths is at least reasonable.
-------------------------------------


forrestv/opende,forrestv/opende,forrestv/opende,forrestv/opende,forrestv/opende