5 #ifndef __IRR_LINE_3D_H_INCLUDED__
6 #define __IRR_LINE_3D_H_INCLUDED__
26 line3d(T xa, T ya, T za, T xb, T yb, T zb) :
start(xa, ya, za),
end(xb, yb, zb) {}
45 void setLine(
const T& xa,
const T& ya,
const T& za,
const T& xb,
const T& yb,
const T& zb)
46 {
start.set(xa, ya, za);
end.set(xb, yb, zb);}
118 T d = sradius * sradius - (c*c - v*v);
line3d()
Default constructor.
line3d< T > & operator-=(const vector3d< T > &point)
line3d(T xa, T ya, T za, T xb, T yb, T zb)
Constructor with two points.
line3d< T > operator-(const vector3d< T > &point) const
line3d< T > operator+(const vector3d< T > &point) const
void setLine(const T &xa, const T &ya, const T &za, const T &xb, const T &yb, const T &zb)
Set this line to a new line going through the two points.
vector3d< T > getVector() const
Get vector of line.
bool isPointBetweenStartAndEnd(const vector3d< T > &point) const
Check if the given point is between start and end of the line.
REALINLINE f32 squareroot(const f32 f)
vector3d< T > getMiddle() const
Get middle of line.
3d vector template class with lots of operators and methods.
3D line between two points with intersection methods.
double f64
64 bit floating point variable.
bool isBetweenPoints(const vector3d< T > &begin, const vector3d< T > &end) const
Returns if this vector interpreted as a point is on a line between two other points.
vector3d< T > getClosestPoint(const vector3d< T > &point) const
Get the closest point on this line to a point.
T getLength() const
Get length of line.
vector3d< T > end
End point of line.
line3d(const vector3d< T > &start, const vector3d< T > &end)
Constructor with two points as vectors.
line3d< s32 > line3di
Typedef for an integer line.
void setLine(const line3d< T > &line)
Set this line to new line given as parameter.
bool getIntersectionWithSphere(vector3d< T > sorigin, T sradius, f64 &outdistance) const
Check if the line intersects with a shpere.
T getLengthSQ() const
Get squared length of line.
vector3d< T > start
Start point of line.
bool operator!=(const line3d< T > &other) const
bool operator==(const line3d< T > &other) const
T dotProduct(const vector3d< T > &other) const
Get the dot product with another vector.
line3d< T > & operator+=(const vector3d< T > &point)
void setLine(const vector3d< T > &nstart, const vector3d< T > &nend)
Set this line to a new line going through the two points.
line3d< f32 > line3df
Typedef for an f32 line.
T getLength() const
Get length of the vector.