|
|
| vector3d () |
| | Default constructor (null vector).
|
|
| vector3d (T nx, T ny, T nz) |
| | Constructor with three different values.
|
|
| vector3d (T n) |
| | Constructor with the same value for all elements.
|
|
| vector3d (const vector3d< T > &other) |
| | Copy constructor.
|
|
vector3d< T > | operator- () const |
|
vector3d< T > & | operator= (const vector3d< T > &other) |
|
vector3d< T > | operator+ (const vector3d< T > &other) const |
|
vector3d< T > & | operator+= (const vector3d< T > &other) |
|
vector3d< T > | operator+ (const T val) const |
|
vector3d< T > & | operator+= (const T val) |
|
vector3d< T > | operator- (const vector3d< T > &other) const |
|
vector3d< T > & | operator-= (const vector3d< T > &other) |
|
vector3d< T > | operator- (const T val) const |
|
vector3d< T > & | operator-= (const T val) |
|
vector3d< T > | operator* (const vector3d< T > &other) const |
|
vector3d< T > & | operator*= (const vector3d< T > &other) |
|
vector3d< T > | operator* (const T v) const |
|
vector3d< T > & | operator*= (const T v) |
|
vector3d< T > | operator/ (const vector3d< T > &other) const |
|
vector3d< T > & | operator/= (const vector3d< T > &other) |
|
vector3d< T > | operator/ (const T v) const |
|
vector3d< T > & | operator/= (const T v) |
|
bool | operator<= (const vector3d< T > &other) const |
| | sort in order X, Y, Z. Equality with rounding tolerance.
|
|
bool | operator>= (const vector3d< T > &other) const |
| | sort in order X, Y, Z. Equality with rounding tolerance.
|
|
bool | operator< (const vector3d< T > &other) const |
| | sort in order X, Y, Z. Difference must be above rounding tolerance.
|
|
bool | operator> (const vector3d< T > &other) const |
| | sort in order X, Y, Z. Difference must be above rounding tolerance.
|
|
bool | operator== (const vector3d< T > &other) const |
| | use weak float compare
|
|
bool | operator!= (const vector3d< T > &other) const |
|
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
|
|
vector3d< T > & | set (const T nx, const T ny, const T nz) |
|
vector3d< T > & | set (const vector3d< T > &p) |
|
T | getLength () const |
| | Get length of the vector.
|
| T | getLengthSQ () const |
| | Get squared length of the vector.
|
|
T | dotProduct (const vector3d< T > &other) const |
| | Get the dot product with another vector.
|
| T | getDistanceFrom (const vector3d< T > &other) const |
| | Get distance from another point.
|
| T | getDistanceFromSQ (const vector3d< T > &other) const |
| | Returns squared distance from another point.
|
| vector3d< T > | crossProduct (const vector3d< T > &p) const |
| | Calculates the cross product with another 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.
|
| vector3d< T > & | normalize () |
| | Normalizes the vector.
|
|
vector3d< T > & | setLength (T newlength) |
| | Sets the length of the vector to a new value.
|
|
vector3d< T > & | invert () |
| | Inverts the vector.
|
| 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.
|
| 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.
|
| 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 > | getInterpolated (const vector3d< T > &other, f64 d) const |
| | Creates an interpolated vector between this vector and another vector.
|
| 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.
|
| 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.
|
| vector3d< T > | getHorizontalAngle () const |
| | Get the rotations that would make a (0,0,1) direction vector point in the same direction as this direction vector.
|
| vector3d< T > | getSphericalCoordinateAngles () const |
| | Get the spherical coordinate angles.
|
| vector3d< T > | rotationToDirection (const vector3d< T > &forwards=vector3d< T >(0, 0, 1)) const |
| | Builds a direction vector from (this) rotation vector.
|
| void | getAs4Values (T *array) const |
| | Fills an array of 4 values with the vector data (usually floats).
|
| void | getAs3Values (T *array) const |
| | Fills an array of 3 values with the vector data (usually floats).
|
|
vector3d< s32 > | operator/ (s32 val) const |
| | partial specialization for integer vectors
|
|
vector3d< s32 > & | operator/= (s32 val) |
|
vector3d< s32 > | getSphericalCoordinateAngles () const |
template<class T>
class irr::core::vector3d< T >
3d vector template class with lots of operators and methods.
The vector3d class is used in Irrlicht for three main purposes: 1) As a direction vector (most of the methods assume this). 2) As a position in 3d space (which is synonymous with a direction vector from the origin to this position). 3) To hold three Euler rotations, where X is pitch, Y is yaw and Z is roll.