ClosestPointTo
Introduction
Code Example
using FlatRedBall.Math.Geometry;
using FlatRedBall.Input;Sprite sprite;
Segment segment;sprite = SpriteManager.AddSprite("redball.bmp");
segment = new Segment(
-20, // first point X
-8, // first point Y
20, // second point X
8); // second point Y
// Let's make a visible representation of the segment
Line line = ShapeManager.AddLine();
line.RelativePoint1 = new Point3D(
segment.Point1.X,
segment.Point1.Y);
line.RelativePoint2 = new Point3D(
segment.Point2.X,
segment.Point2.Y);
Last updated
Was this helpful?