ML Reference
|
Class to define the geometry primitive "Line" consisting of a position and a direction. More...
#include <mlLine.h>
Public Member Functions | |
Line () | |
Constructor. Position is set to (0,0,0) and dir is set to (1,0,0). | |
Line (const Vector3 &p0, const Vector3 &p1) | |
Constructor for line passing p0 and p1. | |
bool | setValue (const Vector3 &p0, const Vector3 &p1) |
Initializes line passing through p0 and p1. | |
Vector3 | getClosestPoint (const Vector3 &point) const |
Returns the point on the line which is closest to point. | |
double | distance (const Vector3 &point) const |
Returns the distance of point to the line. | |
const Vector3 & | getPosition () const |
Returns the reference point on the line. | |
const Vector3 & | getDirection () const |
Returns the direction of the line. | |
Vector3 | getVector (double lambda) const |
Returns a point on line parametrized by lambda. | |
bool | getClosestPoints (const Line &line2, Vector3 &pointOnLine, Vector3 &pointOnLine2) const |
Finds the two closest points on this and line2 and stores them in pointOnLine and pointOnLine2, respectively. | |
Class to define the geometry primitive "Line" consisting of a position and a direction.
ml::Line::Line | ( | ) |
Constructor. Position is set to (0,0,0) and dir is set to (1,0,0).
double ml::Line::distance | ( | const Vector3 & | point | ) | const |
Returns the distance of point to the line.
Returns the point on the line which is closest to point.
bool ml::Line::getClosestPoints | ( | const Line & | line2, |
Vector3 & | pointOnLine, | ||
Vector3 & | pointOnLine2 ) const |
Finds the two closest points on this and line2 and stores them in pointOnLine and pointOnLine2, respectively.
Returns true if lines are not parallel.
|
inline |
|
inline |
|
inline |
Initializes line passing through p0 and p1.
Returns true if p0 != p1, otherwise the direction of the line is left unchanged and false is returned.