public void ProbeHeightAhead(Vector3 Dir) { if (VSL.Body == null || VSL.Body.pqsController == null) { return; } if (LookAheadTime > RAD.LookAheadTime) { Obstacle = BestPoint; rewind(); } else if (LookAheadTimeDelta < 0.1) { if (BestPoint.Valid) { Obstacle = BestPoint; } rewind(); } CurPoint.Update(VSL.Physics.wCoM + Dir * (VSL.Geometry.R + Utils.ClampL(VSL.HorizontalSpeed, 0.1f) * LookAheadTime), VSL.Body); if (CurPoint > BestPoint) { BestPoint = CurPoint; } if (BestPoint > Obstacle) { Obstacle = BestPoint; } if (VSL.Altitude.Absolute - CurPoint.Altitude <= VSL.Geometry.H) { LookAheadTime -= LookAheadTimeDelta; LookAheadTimeDelta /= 2; } LookAheadTime += LookAheadTimeDelta; }