Skip to content

Commit

Permalink
It's now possible to adjust the accuracy of the FindNearestPoint func…
Browse files Browse the repository at this point in the history
…tion from within the sample control.
  • Loading branch information
BlizzCrafter committed Mar 12, 2020
1 parent d872122 commit e4fc903
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class FindNearestPointControl : TransformControl

private Vector2 _NearestPoint = Vector2.Zero;
private float _NearestPointSplinePosition = 0f;
public float NearestPointAccuracy { get; set; } = Setup.SplineMarkerResolution;

protected override void Initialize()
{
Expand Down Expand Up @@ -59,7 +60,7 @@ protected override void Update(GameTime gameTime)

if (MySpline != null)
{
_NearestPoint = MySpline.FindNearestPoint(TestTransform.Position, out _NearestPointSplinePosition);
_NearestPoint = MySpline.FindNearestPoint(TestTransform.Position, out _NearestPointSplinePosition, NearestPointAccuracy);
}
}

Expand Down
Loading

0 comments on commit e4fc903

Please sign in to comment.