5#ifndef __IRR_POINT_3D_H_INCLUDED__
6#define __IRR_POINT_3D_H_INCLUDED__
95 return this->
equals(other);
100 return !this->
equals(other);
280 X = (
T)((
f64)b.X + ( ( a.X - b.X ) *
d ));
281 Y = (
T)((
f64)b.Y + ( ( a.Y - b.Y ) *
d ));
282 Z = (
T)((
f64)b.Z + ( ( a.Z - b.Z ) *
d ));
451 template<
class S,
class T>
Axis aligned bounding box in 3d dimensional space.
aabbox3d()
Default Constructor.
Self reallocating template array (like stl vector) with additional features.
3d vector template class with lots of operators and methods.
vector3d< T > operator/(const T v) const
T getDistanceFromSQ(const vector3d< T > &other) const
Returns squared distance from another point.
vector3d(const vector3d< T > &other)
Copy constructor.
vector3d(T n)
Constructor with the same value for all elements.
vector3d(T nx, T ny, T nz)
Constructor with three different values.
vector3d< T > & setLength(T newlength)
Sets the length of the vector to a new value.
vector3d< T > & set(const vector3d< T > &p)
vector3d< T > operator/(const vector3d< T > &other) const
vector3d< T > & operator-=(const T val)
vector3d< T > & interpolate(const vector3d< T > &a, const vector3d< T > &b, f64 d)
Sets this vector to the linearly interpolated vector between a and b.
bool operator<(const vector3d< T > &other) const
sort in order X, Y, Z. Difference must be above rounding tolerance.
vector3d< T > operator-(const vector3d< T > &other) const
T getLengthSQ() const
Get squared length of the vector.
vector3d< T > & operator*=(const vector3d< T > &other)
vector3d< T > operator*(const T v) const
bool operator!=(const vector3d< T > &other) const
vector3d< T > & operator=(const vector3d< T > &other)
bool operator<=(const vector3d< T > &other) const
sort in order X, Y, Z. Equality with rounding tolerance.
vector3d< T > getHorizontalAngle() const
Get the rotations that would make a (0,0,1) direction vector point in the same direction as this dire...
bool equals(const vector3d< T > &other, const T tolerance=(T) ROUNDING_ERROR_f32) const
returns if this vector equals the other one, taking floating point rounding errors into account
void rotateXZBy(f64 degrees, const vector3d< T > ¢er=vector3d< T >())
Rotates the vector by a specified number of degrees around the Y axis and the specified center.
vector3d< T > operator+(const T val) const
vector3d< T > crossProduct(const vector3d< T > &p) const
Calculates the cross product with another vector.
vector3d< T > operator*(const vector3d< T > &other) const
vector3d< T > & operator/=(const T v)
T getLength() const
Get length of the vector.
vector3d< T > & operator/=(const vector3d< T > &other)
vector3d< T > & operator-=(const vector3d< T > &other)
vector3d< T > getInterpolated(const vector3d< T > &other, f64 d) const
Creates an interpolated vector between this vector and another vector.
bool operator>=(const vector3d< T > &other) const
sort in order X, Y, Z. Equality with rounding tolerance.
T X
X coordinate of the vector.
vector3d< T > operator-(const T val) const
vector3d< T > & operator+=(const T val)
vector3d< T > & normalize()
Normalizes the vector.
vector3d< T > & operator*=(const T v)
void getAs4Values(T *array) const
Fills an array of 4 values with the vector data (usually floats).
vector3d< T > & operator+=(const vector3d< T > &other)
vector3d< T > getInterpolated_quadratic(const vector3d< T > &v2, const vector3d< T > &v3, f64 d) const
Creates a quadratically interpolated vector between this and two other vectors.
void rotateYZBy(f64 degrees, const vector3d< T > ¢er=vector3d< T >())
Rotates the vector by a specified number of degrees around the X axis and the specified center.
vector3d< T > & set(const T nx, const T ny, const T nz)
T getDistanceFrom(const vector3d< T > &other) const
Get distance from another point.
vector3d< T > rotationToDirection(const vector3d< T > &forwards=vector3d< T >(0, 0, 1)) const
Builds a direction vector from (this) rotation vector.
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.
T Z
Z coordinate of the vector.
void rotateXYBy(f64 degrees, const vector3d< T > ¢er=vector3d< T >())
Rotates the vector by a specified number of degrees around the Z axis and the specified center.
vector3d< T > & invert()
Inverts the vector.
bool operator>(const vector3d< T > &other) const
sort in order X, Y, Z. Difference must be above rounding tolerance.
T dotProduct(const vector3d< T > &other) const
Get the dot product with another vector.
vector3d()
Default constructor (null vector).
vector3d< T > getSphericalCoordinateAngles() const
Get the spherical coordinate angles.
T Y
Y coordinate of the vector.
vector3d< T > operator+(const vector3d< T > &other) const
void getAs3Values(T *array) const
Fills an array of 3 values with the vector data (usually floats).
vector3d< T > operator-() const
bool operator==(const vector3d< T > &other) const
use weak float compare
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
CMatrix4< T > operator*(const T scalar, const CMatrix4< T > &mat)
vector3d< s32 > vector3di
Typedef for an integer 3d vector.
const f64 DEGTORAD64
64bit constant for converting from degrees to radians (formally known as GRAD_PI2)
const f32 ROUNDING_ERROR_f32
bool equals(const f64 a, const f64 b, const f64 tolerance=ROUNDING_ERROR_f64)
returns if a equals b, taking possible rounding errors into account
REALINLINE f64 reciprocal_squareroot(const f64 x)
REALINLINE s32 round32(f32 x)
const f64 RADTODEG64
64bit constant for converting from radians to degrees
REALINLINE f32 squareroot(const f32 f)
Everything in the Irrlicht Engine can be found in this namespace.
float f32
32 bit floating point variable.
double f64
64 bit floating point variable.
signed int s32
32 bit signed variable.