Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials |
2D line between two points with intersection methods. More...
#include <line2d.h>
Public Member Functions | |
f64 | getAngleWith (const line2d< T > &l) const |
Get angle between this line and given line. | |
vector2d< T > | getClosestPoint (const vector2d< T > &point) const |
Get the closest point on this line to a point. | |
f64 | getLength () const |
Get length of line. | |
T | getLengthSQ () const |
Get squared length of the line. | |
vector2d< T > | getMiddle () const |
Get middle of the line. | |
T | getPointOrientation (const vector2d< T > &point) const |
Tells us if the given point lies to the left, right, or on the line. | |
vector2d< T > | getUnitVector () const |
Get unit vector of the line. | |
vector2d< T > | getVector () const |
Get the vector of the line. | |
bool | intersectWith (const line2d< T > &l, vector2d< T > &out) const |
Tests if this line intersects with another line. | |
bool | isPointBetweenStartAndEnd (const vector2d< T > &point) const |
Check if the given point is between start and end of the line. | |
bool | isPointOnLine (const vector2d< T > &point) const |
Check if the given point is a member of the line. | |
line2d () | |
Default constructor for line going from (0,0) to (1,1). | |
line2d (T xa, T ya, T xb, T yb) | |
Constructor for line between the two points. | |
line2d (const vector2d< T > &start, const vector2d< T > &end) | |
Constructor for line between the two points given as vectors. | |
line2d (const line2d< T > &other) | |
Copy constructor. | |
bool | operator!= (const line2d< T > &other) const |
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 |
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. | |
void | setLine (const vector2d< T > &nstart, const vector2d< T > &nend) |
Set this line to new line going through the two points. | |
void | setLine (const line2d< T > &line) |
Set this line to new line given as parameter. |
Public Attributes | |
vector2d< T > | end |
End point of the line. | |
vector2d< T > | start |
Start point of the line. |
2D line between two points with intersection methods.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get angle between this line and given line.
\param l Other line for test.
Definition at line 180 of file line2d.h.
References irr::core::vector2d< T >::getAngleWith(), and irr::core::line2d< T >::getVector().
|
inline |
Get the closest point on this line to a point.
Definition at line 212 of file line2d.h.
References irr::core::vector2d< T >::dotProduct(), irr::core::line2d< T >::end, irr::core::vector2d< T >::getLength(), and irr::core::line2d< T >::start.
|
inline |
Get length of line.
Definition at line 53 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
Referenced by irr::core::line2d< T >::getUnitVector().
|
inline |
Get squared length of the line.
Definition at line 57 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
|
inline |
Get middle of the line.
Definition at line 61 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
|
inline |
Tells us if the given point lies to the left, right, or on the line.
\return 0 if the point is on the line
<0 if to the left, or >0 if to the right.
Definition at line 190 of file line2d.h.
References irr::core::line2d< T >::end, irr::core::line2d< T >::start, irr::core::vector2d< T >::X, and irr::core::vector2d< T >::Y.
Referenced by irr::core::line2d< T >::isPointOnLine().
|
inline |
Get unit vector of the line.
Definition at line 171 of file line2d.h.
References irr::core::line2d< T >::end, irr::core::line2d< T >::getLength(), and irr::core::line2d< T >::start.
|
inline |
Get the vector of the line.
Definition at line 68 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
Referenced by irr::core::line2d< T >::getAngleWith().
|
inline |
Tests if this line intersects with another line.
\param l: Other line to test intersection with.
out,: | If there is an intersection, the location of the intersection will be stored in this vector. |
Definition at line 75 of file line2d.h.
References irr::core::line2d< T >::end, irr::core::equals(), irr::core::line2d< T >::start, irr::core::vector2d< T >::X, and irr::core::vector2d< T >::Y.
|
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 206 of file line2d.h.
References irr::core::line2d< T >::end, irr::core::vector2d< T >::isBetweenPoints(), and irr::core::line2d< T >::start.
|
inline |
Check if the given point is a member of the line.
Definition at line 198 of file line2d.h.
References irr::core::line2d< T >::end, irr::core::line2d< T >::getPointOrientation(), irr::core::vector2d< T >::isBetweenPoints(), and irr::core::line2d< T >::start.
|
inline |
Definition at line 40 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
|
inline |
Definition at line 32 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
|
inline |
Definition at line 33 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
|
inline |
Definition at line 35 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
|
inline |
Definition at line 36 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
|
inline |
Definition at line 38 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
|
inline |
Set this line to new line going through the two points.
Definition at line 45 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
|
inline |
Set this line to new line going through the two points.
Definition at line 47 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
|
inline |
Set this line to new line given as parameter.
Definition at line 49 of file line2d.h.
References irr::core::line2d< T >::end, and irr::core::line2d< T >::start.
vector2d<T> irr::core::line2d< T >::end |
End point of the line.
Definition at line 230 of file line2d.h.
Referenced by irr::core::line2d< T >::getClosestPoint(), irr::core::line2d< T >::getLength(), irr::core::line2d< T >::getLengthSQ(), irr::core::line2d< T >::getMiddle(), irr::core::line2d< T >::getPointOrientation(), irr::core::line2d< T >::getUnitVector(), irr::core::line2d< T >::getVector(), irr::core::line2d< T >::intersectWith(), irr::core::line2d< T >::isPointBetweenStartAndEnd(), irr::core::line2d< T >::isPointOnLine(), irr::core::line2d< T >::operator!=(), irr::core::line2d< T >::operator+(), irr::core::line2d< T >::operator+=(), irr::core::line2d< T >::operator-(), irr::core::line2d< T >::operator-=(), irr::core::line2d< T >::operator==(), and irr::core::line2d< T >::setLine().
vector2d<T> irr::core::line2d< T >::start |
Start point of the line.
Definition at line 228 of file line2d.h.
Referenced by irr::core::line2d< T >::getClosestPoint(), irr::core::line2d< T >::getLength(), irr::core::line2d< T >::getLengthSQ(), irr::core::line2d< T >::getMiddle(), irr::core::line2d< T >::getPointOrientation(), irr::core::line2d< T >::getUnitVector(), irr::core::line2d< T >::getVector(), irr::core::line2d< T >::intersectWith(), irr::core::line2d< T >::isPointBetweenStartAndEnd(), irr::core::line2d< T >::isPointOnLine(), irr::core::line2d< T >::operator!=(), irr::core::line2d< T >::operator+(), irr::core::line2d< T >::operator+=(), irr::core::line2d< T >::operator-(), irr::core::line2d< T >::operator-=(), irr::core::line2d< T >::operator==(), and irr::core::line2d< T >::setLine().
The Irrlicht
Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated
on Fri Mar 21 2014 04:40:21 by Doxygen
(1.8.1.2) |