3D Vector class. More...
Inherited by Polycode::Vertex.
Public Member Functions | |
Vector3 (Number x, Number y, Number z) | |
Create from x,y,z coordinates. | |
Vector3 (Number val) | |
Create from single value for all coordinates. | |
Vector3 () | |
Default constructor. | |
void | set (Number x, Number y, Number z) |
Sets the vector from x,y,z coordinates. | |
Number | distance (const Vector3 &vec2) const |
Returns the distance from this vector to another one. | |
Number | angleBetween (const Vector3 &dest) |
Returns the angle between this and the specified vectors. | |
Number | length () const |
Returns the vector length. | |
Number | dot (const Vector3 &u) const |
Returns the dot product with another vector. | |
Vector3 | crossProduct (const Vector3 &vec2) const |
Returns the cross product with another vector. | |
void | Normalize () |
Normalizes the vector. | |
Operators | |
Vector3 | operator* (const Number val) const |
Vector3 | operator/ (const Number val) const |
Vector3 & | operator= (const Vector3 &v2) |
Vector3 & | operator+= (const Vector3 &v2) |
Vector3 & | operator-= (const Vector3 &v2) |
Vector3 | operator+ (const Vector3 &v2) const |
bool | operator== (const Vector3 &v2) |
bool | operator!= (const Vector3 &v2) |
Public Attributes | |
Number | x |
X coordinate. | |
Number | y |
Y coordinate. | |
Number | z |
Z coordinate. |
3D Vector class.
Vector3::Vector3 | ( | Number | x, | |
Number | y, | |||
Number | z | |||
) |
Create from x,y,z coordinates.
x | X coordinate. | |
y | Y coordinate. | |
z | Z coordinate. |
Vector3::Vector3 | ( | Number | val | ) |
Create from single value for all coordinates.
val | Value for all coordinates |
Number Polycode::Vector3::angleBetween | ( | const Vector3 & | dest | ) | [inline] |
Returns the angle between this and the specified vectors.
Returns the cross product with another vector.
vec2 | Second vector. |
Number Polycode::Vector3::distance | ( | const Vector3 & | vec2 | ) | const [inline] |
Returns the distance from this vector to another one.
vec2 | Second vector. |
Number Polycode::Vector3::dot | ( | const Vector3 & | u | ) | const [inline] |
Returns the dot product with another vector.
Number Polycode::Vector3::length | ( | ) | const [inline] |
Returns the vector length.
void Vector3::set | ( | Number | x, | |
Number | y, | |||
Number | z | |||
) |
Sets the vector from x,y,z coordinates.
x | X coordinate. | |
y | Y coordinate. | |
z | Z coordinate. |