public Shape RaycastOne(Segment segment, out float lambda, out Vec2 normal, bool solidShapes, object userData)
{
lambda = 0;
normal = new Vec2(0, 0);
int maxCount = 1;
Shape[] shape = new Shape[maxCount];
int count = Raycast(segment, shape, maxCount, solidShapes, userData);
if (count == 0)
return null;
Box2DXDebug.Assert(count == 1);
//Redundantly do TestSegment a second time, as the previous one's results are inaccessible
XForm xf = shape[0].GetBody().GetXForm();
shape[0].TestSegment(xf, out lambda, out normal, segment, 1);
//We already know it returns true
return shape[0];
}