arsa  2.7
Public Member Functions | Public Attributes | List of all members
irr::core::line2d< T > Class Template Reference

2D line between two points with intersection methods. More...

#include <line2d.h>

Public Member Functions

 line2d ()
 Default constructor for line going from (0,0) to (1,1). More...
 
 line2d (T xa, T ya, T xb, T yb)
 Constructor for line between the two points. More...
 
 line2d (const vector2d< T > &start, const vector2d< T > &end)
 Constructor for line between the two points given as vectors. More...
 
 line2d (const line2d< T > &other)
 Copy constructor. More...
 
line2d< T > operator+ (const vector2d< T > &point) const
 
line2d< T > & operator+= (const vector2d< T > &point)
 
line2d< T > operator- (const vector2d< T > &point) const
 
line2d< T > & operator-= (const vector2d< T > &point)
 
bool operator== (const line2d< T > &other) const
 
bool operator!= (const line2d< T > &other) const
 
void setLine (const T &xa, const T &ya, const T &xb, const T &yb)
 Set this line to new line going through the two points. More...
 
void setLine (const vector2d< T > &nstart, const vector2d< T > &nend)
 Set this line to new line going through the two points. More...
 
void setLine (const line2d< T > &line)
 Set this line to new line given as parameter. More...
 
getLength () const
 Get length of line. More...
 
getLengthSQ () const
 Get squared length of the line. More...
 
vector2d< T > getMiddle () const
 Get middle of the line. More...
 
vector2d< T > getVector () const
 Get the vector of the line. More...
 
bool intersectAsSegments (const line2d< T > &other) const
 
bool incidentSegments (const line2d< T > &other) const
 
bool nearlyParallel (const line2d< T > &line, const T factor=relativeErrorFactor< T >()) const
 
vector2d< T > fastLinesIntersection (const line2d< T > &l) const
 
bool lineIntersectSegment (const line2d< T > &segment, vector2d< T > &out) const
 
bool intersectWith (const line2d< T > &l, vector2d< T > &out, bool checkOnlySegments=true, bool ignoreCoincidentLines=false) const
 Tests if this line intersects with another line. More...
 
vector2d< T > getUnitVector () const
 Get unit vector of the line. More...
 
f64 getAngleWith (const line2d< T > &l) const
 Get angle between this line and given line. More...
 
getPointOrientation (const vector2d< T > &point) const
 Tells us if the given point lies to the left, right, or on the line. More...
 
bool isPointOnLine (const vector2d< T > &point) const
 Check if the given point is a member of the line. More...
 
bool isPointBetweenStartAndEnd (const vector2d< T > &point) const
 Check if the given point is between start and end of the line. More...
 
vector2d< T > getClosestPoint (const vector2d< T > &point, bool checkOnlySegments=true) const
 Get the closest point on this line to a point. More...
 
template<>
vector2df getClosestPoint (const vector2df &point, bool checkOnlySegments) const
 

Public Attributes

vector2d< T > start
 Start point of the line. More...
 
vector2d< T > end
 End point of the line. More...
 

Detailed Description

template<class T>
class irr::core::line2d< T >

2D line between two points with intersection methods.

Definition at line 18 of file line2d.h.

Constructor & Destructor Documentation

◆ line2d() [1/4]

template<class T>
irr::core::line2d< T >::line2d ( )
inline

Default constructor for line going from (0,0) to (1,1).

Definition at line 22 of file line2d.h.

22 : start(0,0), end(1,1) {}
vector2d< T > start
Start point of the line.
Definition: line2d.h:323
vector2d< T > end
End point of the line.
Definition: line2d.h:325

◆ line2d() [2/4]

template<class T>
irr::core::line2d< T >::line2d ( xa,
ya,
xb,
yb 
)
inline

Constructor for line between the two points.

Definition at line 24 of file line2d.h.

24 : start(xa, ya), end(xb, yb) {}
vector2d< T > start
Start point of the line.
Definition: line2d.h:323
vector2d< T > end
End point of the line.
Definition: line2d.h:325

◆ line2d() [3/4]

template<class T>
irr::core::line2d< T >::line2d ( const vector2d< T > &  start,
const vector2d< T > &  end 
)
inline

Constructor for line between the two points given as vectors.

Definition at line 26 of file line2d.h.

26 : start(start), end(end) {}
vector2d< T > start
Start point of the line.
Definition: line2d.h:323
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571
vector2d< T > end
End point of the line.
Definition: line2d.h:325

◆ line2d() [4/4]

template<class T>
irr::core::line2d< T >::line2d ( const line2d< T > &  other)
inline

Copy constructor.

Definition at line 28 of file line2d.h.

28 : start(other.start), end(other.end) {}
vector2d< T > start
Start point of the line.
Definition: line2d.h:323
vector2d< T > end
End point of the line.
Definition: line2d.h:325

Member Function Documentation

◆ fastLinesIntersection()

template<class T>
vector2d<T> irr::core::line2d< T >::fastLinesIntersection ( const line2d< T > &  l) const
inline

returns a intersection point of 2 lines (if lines are not parallel). Behaviour undefined if lines are parallel or coincident. It's on optimized intersectWith with checkOnlySegments=false and ignoreCoincidentLines=true

Definition at line 118 of file line2d.h.

119  {
120  const f32 commonDenominator = (f32)((l.end.Y - l.start.Y)*(end.X - start.X) -
121  (l.end.X - l.start.X)*(end.Y - start.Y));
122 
123  if ( commonDenominator != 0.f )
124  {
125  const f32 numeratorA = (f32)((l.end.X - l.start.X)*(start.Y - l.start.Y) -
126  (l.end.Y - l.start.Y)*(start.X - l.start.X));
127 
128  const f32 uA = numeratorA / commonDenominator;
129 
130  // Calculate the intersection point.
131  return vector2d<T> (
132  (T)(start.X + uA * (end.X - start.X)),
133  (T)(start.Y + uA * (end.Y - start.Y))
134  );
135  }
136  else
137  return l.start;
138  }
float f32
32 bit floating point variable.
Definition: irrTypes.h:108
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571
GLfloat f

◆ getAngleWith()

template<class T>
f64 irr::core::line2d< T >::getAngleWith ( const line2d< T > &  l) const
inline

Get angle between this line and given line.

Parameters
lOther line for test.
Returns
Angle in degrees.

Definition at line 268 of file line2d.h.

269  {
270  vector2d<T> vect = getVector();
271  vector2d<T> vect2 = l.getVector();
272  return vect.getAngleWith(vect2);
273  }
vector2d< T > getVector() const
Get the vector of the line.
Definition: line2d.h:68

◆ getClosestPoint() [1/2]

template<class T>
vector2d<T> irr::core::line2d< T >::getClosestPoint ( const vector2d< T > &  point,
bool  checkOnlySegments = true 
) const
inline

Get the closest point on this line to a point.

Parameters
checkOnlySegmentsDefault (true) is to return a point on the line-segment (between begin and end) of the line. When set to false the function will check for the first the closest point on the the line even when outside the segment.

Definition at line 302 of file line2d.h.

303  {
304  vector2d<f64> c((f64)(point.X-start.X), (f64)(point.Y- start.Y));
305  vector2d<f64> v((f64)(end.X-start.X), (f64)(end.Y-start.Y));
306  f64 d = v.getLength();
307  if ( d == 0 ) // can't tell much when the line is just a single point
308  return start;
309  v /= d;
310  f64 t = v.dotProduct(c);
311 
312  if ( checkOnlySegments )
313  {
314  if (t < 0) return vector2d<T>((T)start.X, (T)start.Y);
315  if (t > d) return vector2d<T>((T)end.X, (T)end.Y);
316  }
317 
318  v *= t;
319  return vector2d<T>((T)(start.X + v.X), (T)(start.Y + v.Y));
320  }
GLdouble GLdouble t
Definition: SDL_opengl.h:2071
vector2d< T > start
Start point of the line.
Definition: line2d.h:323
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571
double f64
64 bit floating point variable.
Definition: irrTypes.h:112
const GLdouble * v
Definition: SDL_opengl.h:2064
const GLubyte * c

◆ getClosestPoint() [2/2]

template<>
vector2df irr::core::line2d< irr::f32 >::getClosestPoint ( const vector2df point,
bool  checkOnlySegments 
) const
inline

Definition at line 330 of file line2d.h.

331  {
332  const vector2df c = point - start;
333  vector2df v = end - start;
334  const f32 d = (f32)v.getLength();
335  if ( d == 0 ) // can't tell much when the line is just a single point
336  return start;
337  v /= d;
338  const f32 t = v.dotProduct(c);
339 
340  if ( checkOnlySegments )
341  {
342  if (t < 0) return start;
343  if (t > d) return end;
344  }
345 
346  v *= t;
347  return start + v;
348  }
GLdouble GLdouble t
Definition: SDL_opengl.h:2071
vector2d< T > start
Start point of the line.
Definition: line2d.h:323
float f32
32 bit floating point variable.
Definition: irrTypes.h:108
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571
const GLdouble * v
Definition: SDL_opengl.h:2064
vector2d< T > end
End point of the line.
Definition: line2d.h:325
const GLubyte * c
vector2d< f32 > vector2df
Typedef for f32 2d vector.
Definition: vector2d.h:403

◆ getLength()

template<class T>
T irr::core::line2d< T >::getLength ( ) const
inline

Get length of line.

Returns
Length of the line.

Definition at line 53 of file line2d.h.

53 { return start.getDistanceFrom(end); }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ getLengthSQ()

template<class T>
T irr::core::line2d< T >::getLengthSQ ( ) const
inline

Get squared length of the line.

Returns
Squared length of line.

Definition at line 57 of file line2d.h.

57 { return start.getDistanceFromSQ(end); }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ getMiddle()

template<class T>
vector2d<T> irr::core::line2d< T >::getMiddle ( ) const
inline

Get middle of the line.

Returns
center of the line.

Definition at line 61 of file line2d.h.

62  {
63  return (start + end)/(T)2;
64  }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ getPointOrientation()

template<class T>
T irr::core::line2d< T >::getPointOrientation ( const vector2d< T > &  point) const
inline

Tells us if the given point lies to the left, right, or on the line.

Returns
0 if the point is on the line <0 if to the left, or >0 if to the right.

Definition at line 278 of file line2d.h.

279  {
280  return ( (end.X - start.X) * (point.Y - start.Y) -
281  (point.X - start.X) * (end.Y - start.Y) );
282  }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ getUnitVector()

template<class T>
vector2d<T> irr::core::line2d< T >::getUnitVector ( ) const
inline

Get unit vector of the line.

Returns
Unit vector of this line.

Definition at line 259 of file line2d.h.

260  {
261  T len = (T)(1.0 / getLength());
262  return vector2d<T>((end.X - start.X) * len, (end.Y - start.Y) * len);
263  }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571
GLenum GLsizei len
T getLength() const
Get length of line.
Definition: line2d.h:53

◆ getVector()

template<class T>
vector2d<T> irr::core::line2d< T >::getVector ( ) const
inline

Get the vector of the line.

Returns
The vector of the line.

Definition at line 68 of file line2d.h.

68 { return vector2d<T>( end.X - start.X, end.Y - start.Y); }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ incidentSegments()

template<class T>
bool irr::core::line2d< T >::incidentSegments ( const line2d< T > &  other) const
inline

Check if 2 segments are incident (intersects in exactly 1 point).

Definition at line 98 of file line2d.h.

99  {
100  return
101  start.checkOrientation( end, other.start) != start.checkOrientation( end, other.end)
102  && other.start.checkOrientation( other.end, start) != other.start.checkOrientation( other.end, end);
103  }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ intersectAsSegments()

template<class T>
bool irr::core::line2d< T >::intersectAsSegments ( const line2d< T > &  other) const
inline

Check if this segment intersects another segment, or if segments are coincindent (colinear).

Definition at line 72 of file line2d.h.

73  {
74  // Taken from:
75  // http://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/
76 
77  // Find the four orientations needed for general and
78  // special cases
79  s32 o1 = start.checkOrientation( end, other.start);
80  s32 o2 = start.checkOrientation( end, other.end);
81  s32 o3 = other.start.checkOrientation( other.end, start);
82  s32 o4 = other.start.checkOrientation( other.end, end);
83 
84  // General case
85  if (o1 != o2 && o3 != o4)
86  return true;
87 
88  // Special Cases to check if segments are coolinear
89  if (o1 == 0 && other.start.isBetweenPoints( start, end)) return true;
90  if (o2 == 0 && other.end.isBetweenPoints( start, end)) return true;
91  if (o3 == 0 && start.isBetweenPoints( other.start, other.end)) return true;
92  if (o4 == 0 && end.isBetweenPoints( other.start, other.end)) return true;
93 
94  return false; // Doesn't fall in any of the above cases
95  }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571
signed int s32
32 bit signed variable.
Definition: irrTypes.h:70

◆ intersectWith()

template<class T>
bool irr::core::line2d< T >::intersectWith ( const line2d< T > &  l,
vector2d< T > &  out,
bool  checkOnlySegments = true,
bool  ignoreCoincidentLines = false 
) const
inline

Tests if this line intersects with another line.

Parameters
lOther line to test intersection with.
checkOnlySegmentsDefault is to check intersection between the begin and endpoints. When set to false the function will check for the first intersection point when extending the lines.
outIf there is an intersection, the location of the intersection will be stored in this vector.
ignoreCoincidentLinesWhen true coincident lines (lines above each other) are never considered as intersecting. When false the center of the overlapping part is returned.
Returns
True if there is an intersection, false if not.

Definition at line 160 of file line2d.h.

161  {
162  // Uses the method given at:
163  // http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
164  const f32 commonDenominator = (f32)((l.end.Y - l.start.Y)*(end.X - start.X) -
165  (l.end.X - l.start.X)*(end.Y - start.Y));
166 
167  const f32 numeratorA = (f32)((l.end.X - l.start.X)*(start.Y - l.start.Y) -
168  (l.end.Y - l.start.Y)*(start.X -l.start.X));
169 
170  const f32 numeratorB = (f32)((end.X - start.X)*(start.Y - l.start.Y) -
171  (end.Y - start.Y)*(start.X -l.start.X));
172 
173  if(equals(commonDenominator, 0.f))
174  {
175  // The lines are either coincident or parallel
176  // if both numerators are 0, the lines are coincident
177  if(!ignoreCoincidentLines && equals(numeratorA, 0.f) && equals(numeratorB, 0.f))
178  {
179  // Try and find a common endpoint
180  if(l.start == start || l.end == start)
181  out = start;
182  else if(l.end == end || l.start == end)
183  out = end;
184  // now check if the two segments are disjunct
185  else if (l.start.X>start.X && l.end.X>start.X && l.start.X>end.X && l.end.X>end.X)
186  return false;
187  else if (l.start.Y>start.Y && l.end.Y>start.Y && l.start.Y>end.Y && l.end.Y>end.Y)
188  return false;
189  else if (l.start.X<start.X && l.end.X<start.X && l.start.X<end.X && l.end.X<end.X)
190  return false;
191  else if (l.start.Y<start.Y && l.end.Y<start.Y && l.start.Y<end.Y && l.end.Y<end.Y)
192  return false;
193  // else the lines are overlapping to some extent
194  else
195  {
196  // find the points which are not contributing to the
197  // common part
198  vector2d<T> maxp;
199  vector2d<T> minp;
200  if ((start.X>l.start.X && start.X>l.end.X && start.X>end.X) || (start.Y>l.start.Y && start.Y>l.end.Y && start.Y>end.Y))
201  maxp=start;
202  else if ((end.X>l.start.X && end.X>l.end.X && end.X>start.X) || (end.Y>l.start.Y && end.Y>l.end.Y && end.Y>start.Y))
203  maxp=end;
204  else if ((l.start.X>start.X && l.start.X>l.end.X && l.start.X>end.X) || (l.start.Y>start.Y && l.start.Y>l.end.Y && l.start.Y>end.Y))
205  maxp=l.start;
206  else
207  maxp=l.end;
208  if (maxp != start && ((start.X<l.start.X && start.X<l.end.X && start.X<end.X) || (start.Y<l.start.Y && start.Y<l.end.Y && start.Y<end.Y)))
209  minp=start;
210  else if (maxp != end && ((end.X<l.start.X && end.X<l.end.X && end.X<start.X) || (end.Y<l.start.Y && end.Y<l.end.Y && end.Y<start.Y)))
211  minp=end;
212  else if (maxp != l.start && ((l.start.X<start.X && l.start.X<l.end.X && l.start.X<end.X) || (l.start.Y<start.Y && l.start.Y<l.end.Y && l.start.Y<end.Y)))
213  minp=l.start;
214  else
215  minp=l.end;
216 
217  // one line is contained in the other. Pick the center
218  // of the remaining points, which overlap for sure
219  out = core::vector2d<T>();
220  if (start != maxp && start != minp)
221  out += start;
222  if (end != maxp && end != minp)
223  out += end;
224  if (l.start != maxp && l.start != minp)
225  out += l.start;
226  if (l.end != maxp && l.end != minp)
227  out += l.end;
228  out.X = (T)(out.X/2);
229  out.Y = (T)(out.Y/2);
230  }
231 
232  return true; // coincident
233  }
234 
235  return false; // parallel
236  }
237 
238  // Get the point of intersection on this line, checking that
239  // it is within the line segment.
240  const f32 uA = numeratorA / commonDenominator;
241  if (checkOnlySegments)
242  {
243  if(uA < 0.f || uA > 1.f)
244  return false; // Outside the line segment
245 
246  const f32 uB = numeratorB / commonDenominator;
247  if(uB < 0.f || uB > 1.f)
248  return false; // Outside the line segment
249  }
250 
251  // Calculate the intersection point.
252  out.X = (T)(start.X + uA * (end.X - start.X));
253  out.Y = (T)(start.Y + uA * (end.Y - start.Y));
254  return true;
255  }
vector2d< T > start
Start point of the line.
Definition: line2d.h:323
float f32
32 bit floating point variable.
Definition: irrTypes.h:108
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571
bool equals(const T a, const T b, const T tolerance=roundingError< T >())
returns if a equals b, taking possible rounding errors into account
Definition: irrMath.h:246
GLfloat f
vector2d< T > end
End point of the line.
Definition: line2d.h:325

◆ isPointBetweenStartAndEnd()

template<class T>
bool irr::core::line2d< T >::isPointBetweenStartAndEnd ( const vector2d< T > &  point) const
inline

Check if the given point is between start and end of the line.

Assumes that the point is already somewhere on the line.

Definition at line 294 of file line2d.h.

295  {
296  return point.isBetweenPoints(start, end);
297  }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ isPointOnLine()

template<class T>
bool irr::core::line2d< T >::isPointOnLine ( const vector2d< T > &  point) const
inline

Check if the given point is a member of the line.

Returns
True if point is between start and end, else false.

Definition at line 286 of file line2d.h.

287  {
288  T d = getPointOrientation(point);
289  return (d == 0 && point.isBetweenPoints(start, end));
290  }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571
T getPointOrientation(const vector2d< T > &point) const
Tells us if the given point lies to the left, right, or on the line.
Definition: line2d.h:278

◆ lineIntersectSegment()

template<class T>
bool irr::core::line2d< T >::lineIntersectSegment ( const line2d< T > &  segment,
vector2d< T > &  out 
) const
inline

Check if this line intersect a segment. The eventual intersection point is returned in "out".

Definition at line 141 of file line2d.h.

142  {
143  if (nearlyParallel( segment))
144  return false;
145 
146  out = fastLinesIntersection( segment);
147 
148  return out.isBetweenPoints( segment.start, segment.end);
149  }
bool nearlyParallel(const line2d< T > &line, const T factor=relativeErrorFactor< T >()) const
Definition: line2d.h:106
vector2d< T > fastLinesIntersection(const line2d< T > &l) const
Definition: line2d.h:118

◆ nearlyParallel()

template<class T>
bool irr::core::line2d< T >::nearlyParallel ( const line2d< T > &  line,
const factor = relativeErrorFactor<T>() 
) const
inline

Check if 2 lines/segments are parallel or nearly parallel.

Definition at line 106 of file line2d.h.

107  {
108  const vector2d<T> a = getVector();
109  const vector2d<T> b = line.getVector();
110 
111  return a.nearlyParallel( b, factor);
112  }
vector2d< T > getVector() const
Get the vector of the line.
Definition: line2d.h:68
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a

◆ operator!=()

template<class T>
bool irr::core::line2d< T >::operator!= ( const line2d< T > &  other) const
inline

Definition at line 40 of file line2d.h.

41  { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);}
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ operator+()

template<class T>
line2d<T> irr::core::line2d< T >::operator+ ( const vector2d< T > &  point) const
inline

Definition at line 32 of file line2d.h.

32 { return line2d<T>(start + point, end + point); }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ operator+=()

template<class T>
line2d<T>& irr::core::line2d< T >::operator+= ( const vector2d< T > &  point)
inline

Definition at line 33 of file line2d.h.

33 { start += point; end += point; return *this; }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ operator-()

template<class T>
line2d<T> irr::core::line2d< T >::operator- ( const vector2d< T > &  point) const
inline

Definition at line 35 of file line2d.h.

35 { return line2d<T>(start - point, end - point); }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ operator-=()

template<class T>
line2d<T>& irr::core::line2d< T >::operator-= ( const vector2d< T > &  point)
inline

Definition at line 36 of file line2d.h.

36 { start -= point; end -= point; return *this; }
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ operator==()

template<class T>
bool irr::core::line2d< T >::operator== ( const line2d< T > &  other) const
inline

Definition at line 38 of file line2d.h.

39  { return (start==other.start && end==other.end) || (end==other.start && start==other.end);}
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ setLine() [1/3]

template<class T>
void irr::core::line2d< T >::setLine ( const T &  xa,
const T &  ya,
const T &  xb,
const T &  yb 
)
inline

Set this line to new line going through the two points.

Definition at line 45 of file line2d.h.

45 {start.set(xa, ya); end.set(xb, yb);}
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ setLine() [2/3]

template<class T>
void irr::core::line2d< T >::setLine ( const vector2d< T > &  nstart,
const vector2d< T > &  nend 
)
inline

Set this line to new line going through the two points.

Definition at line 47 of file line2d.h.

47 {start.set(nstart); end.set(nend);}
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

◆ setLine() [3/3]

template<class T>
void irr::core::line2d< T >::setLine ( const line2d< T > &  line)
inline

Set this line to new line given as parameter.

Definition at line 49 of file line2d.h.

49 {start.set(line.start); end.set(line.end);}
GLuint GLuint end
Definition: SDL_opengl.h:1571
GLuint start
Definition: SDL_opengl.h:1571

Member Data Documentation

◆ end

template<class T>
vector2d<T> irr::core::line2d< T >::end

End point of the line.

Definition at line 325 of file line2d.h.

◆ start

template<class T>
vector2d<T> irr::core::line2d< T >::start

Start point of the line.

Definition at line 323 of file line2d.h.


The documentation for this class was generated from the following file: