コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LineSegment2D"/> class.
 /// </summary>
 /// <param name="start">The starting point</param>
 /// <param name="direction">The direction of the line</param>
 /// <param name="length">The length of the line</param>
 public LineSegment2D(Vector2 start, Vector2 direction, float length)
 {
     this._start = start;
     this._end   = start + direction.normalized * length;
     _line       = Line2D.FromPoints(_start, _end);
 }
コード例 #2
0
 /// <summary>
 /// Recalibrates the <see cref="Line2D"/> field.
 /// </summary>
 private void SetLine2D()
 {
     _line = Line2D.FromPoints(Start, End);
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LineSegment2D"/> class.
 /// </summary>
 ///
 /// <param name="start">Segment's start point.</param>
 /// <param name="end">Segment's end point.</param>
 ///
 /// <exception cref="ArgumentException">Thrown if the two points are the same.</exception>
 ///
 public LineSegment2D(Vector2 start, Vector2 end)
 {
     _line       = Line2D.FromPoints(start, end);
     this._start = start;
     this._end   = end;
 }