public HitTestResult HitTest(UrbanChallenge.Common.Coordinates loc, float tol, WorldTransform wt, DisplayObjectFilter filter) { double dist = this.PartitionPath.GetClosestPoint(loc).Location.DistanceTo(loc); if (dist < 5) { return(new HitTestResult(this, true, (float)dist)); } else { return(new HitTestResult(this, false, float.MaxValue)); } }
public HitTestResult HitTest(UrbanChallenge.Common.Coordinates loc, float tol, WorldTransform wt, DisplayObjectFilter filter) { if (filter(this)) { Coordinates closest = this.GetClosest(loc); if ((float)loc.DistanceTo(closest) < 5 + tol) { return(new HitTestResult(this, true, (float)loc.DistanceTo(closest))); } } return(new HitTestResult(this, false, float.MaxValue)); }
public HitTestResult HitTest(UrbanChallenge.Common.Coordinates loc, float tol, WorldTransform wt, DisplayObjectFilter filter) { // check filter if (filter.Target == null || filter.Target is ArbiterParkingSpotWaypoint) { // get bounding box dependent on tolerance RectangleF bounding = this.GetBoundingBox(wt); bounding.Inflate(tol, tol); // check if contains point if (bounding.Contains(DrawingUtility.ToPointF(loc))) { return(new HitTestResult(this, true, (float)loc.DistanceTo(this.Position))); } } return(new HitTestResult(this, false, float.MaxValue)); }
public HitTestResult HitTest(UrbanChallenge.Common.Coordinates loc, float tol, WorldTransform wt, DisplayObjectFilter filter) { if (this.SafetyPolygon == null) { /*if (this.safetyZoneBegin.Equals(this.safetyZoneEnd)) * { * Console.WriteLine("dupilicate safety zone changed" + this.safetyZoneBegin.Location.ToString()); * this.safetyZoneBegin = this.lane.LanePath().StartPoint; * }*/ this.GenerateSafetyZone(); } if (this.SafetyPolygon.IsInside(loc) && DrawingUtility.DrawArbiterSafetyZones) { Coordinates center = new Coordinates((this.safetyZoneBegin.Location.X + this.safetyZoneEnd.Location.X) / 2.0, (this.safetyZoneEnd.Location.Y + this.safetyZoneBegin.Location.Y) / 2.0); return(new HitTestResult(this, true, (float)loc.DistanceTo(center))); } else { return(new HitTestResult(this, false, float.MaxValue)); } }
public bool ContainsVehicle(UrbanChallenge.Common.Coordinates center, double length, double width, UrbanChallenge.Common.Coordinates heading) { return(this.DistanceTo(center) == 0.0 ? true : false); }
public double DistanceTo(UrbanChallenge.Common.Coordinates loc) { return(this.Perimeter.PerimeterPolygon.IsInside(loc) ? 0.0 : Double.MaxValue); }
public void CancelMove(UrbanChallenge.Common.Coordinates orig, WorldTransform t) { throw new Exception("The method or operation is not implemented."); }
public HitTestResult HitTest(UrbanChallenge.Common.Coordinates loc, float tol, WorldTransform wt, DisplayObjectFilter filter) { return(new HitTestResult(this, false, float.MaxValue)); }
public override void CancelMove(UrbanChallenge.Common.Coordinates orig, RndfEditor.Display.Utilities.WorldTransform t) { this.VehicleState.Position = orig; }
public override void BeginMove(UrbanChallenge.Common.Coordinates orig, RndfEditor.Display.Utilities.WorldTransform t) { }
public void CancelMove(UrbanChallenge.Common.Coordinates orig, RndfEditor.Display.Utilities.WorldTransform t) { throw new Exception("The method or operation is not implemented."); }
public RndfEditor.Display.Utilities.HitTestResult HitTest(UrbanChallenge.Common.Coordinates loc, float tol, RndfEditor.Display.Utilities.WorldTransform wt, RndfEditor.Display.Utilities.DisplayObjectFilter filter) { return(new HitTestResult(this, false, float.MaxValue)); }
public void CancelMove(UrbanChallenge.Common.Coordinates orig, WorldTransform t) { this.position = orig; }
public void CompleteMove(UrbanChallenge.Common.Coordinates orig, UrbanChallenge.Common.Coordinates offset, WorldTransform t) { this.position = orig + offset; }
public void BeginMove(UrbanChallenge.Common.Coordinates orig, WorldTransform t) { }