Terrain Ray Casting
I was attempting to use the SegmentIntersect method of the Heightmap object in order to find a collision between the ray of my mouse and the terrain (for world editing purposes). However, it comes up with some pretty funky results. I did notice a bug report about this in the bug forum, and I was wondering if there was a fix for it, or if I'm going about it the wrong way? Thanks.
public Vector3 IntersectTerrain(Ray aRay)
{
Vector3 oPos,oNorm;
float oDist;
if (!skin.SegmentIntersect(out oDist, out oPos, out oNorm, new Segment(aRay.Position, aRay.Direction * mapsize * scale)))
oPos = Vector3.Zero;
return oPos;
}