VRay SDK for C++
|
General purpose vector in 3D space using float32. More...
#include <vraysdk.hpp>
Public Member Functions | |
Vector (const Vector &) noexcept=default | |
template<typename T > | |
Vector (T value) noexcept | |
template<typename T1 , typename T2 , typename T3 > | |
Vector (T1 x, T2 y, T3 z) noexcept | |
Vector (Vector &&) noexcept=default | |
float | length (void) const noexcept |
Returns the length of the vector. | |
float | lengthSqr (void) const noexcept |
Returns the squared length of the vector. | |
Vector & | makeZero (void) noexcept |
Sets the components of the vector. | |
Vector & | operator*= (double factor) noexcept |
Multiplies all components by the given number. | |
Vector & | operator*= (float factor) noexcept |
Multiplies all components by the given number. | |
Vector & | operator*= (int factor) noexcept |
Multiplies all components by the given number. | |
Vector & | operator+= (const Vector &other) noexcept |
Adds the components of the given vector. | |
Vector | operator- (void) const noexcept |
Reverses the sign of all components. | |
Vector & | operator-= (const Vector &other) noexcept |
Subtracts the components of the given vector. | |
Vector & | operator/= (double divisor) noexcept |
Divides all components by the given number. | |
Vector & | operator/= (float divisor) noexcept |
Divides all components by the given number. | |
Vector & | operator/= (int divisor) noexcept |
Divides all components by the given number. | |
Vector & | operator= (const Vector &) noexcept=default |
Vector & | operator= (Vector &&) noexcept=default |
const float & | operator[] (const int index) const noexcept |
Returns the i-th component (0 for x, 1 for y, 2 for z) as a const. | |
float & | operator[] (const int index) noexcept |
Returns the i-th component (0 for x, 1 for y, 2 for z) | |
void | rotate (const Vector &axis) noexcept |
Rotates the vector along the given axis. The length of the axis is the tangent of the angle of rotation. | |
template<typename T1 , typename T2 , typename T3 > | |
Vector & | set (T1 x_, T2 y_, T3 z_) noexcept |
Sets the components of the vector. | |
std::string | toString () const |
Public Attributes | |
union { | |
struct { | |
float x | |
float y | |
float z | |
} | |
float f [3] | |
}; | |
Related Functions | |
(Note that these are not member functions.) | |
float | length (const Vector &a) noexcept |
float | lengthSqr (const Vector &a) noexcept |
double | mixed (const Vector &a, const Vector &b, const Vector &c) noexcept |
Vector | mul (const Vector &a, const Vector &b) noexcept |
Vector | normalize (const Vector &a) noexcept |
bool | operator!= (const Vector &a, const Vector &b) noexcept |
double | operator* (const Vector &a, const Vector &b) noexcept |
Vector | operator* (const Vector &a, double factor) noexcept |
Vector | operator* (const Vector &a, float factor) noexcept |
Vector | operator* (const Vector &a, int factor) noexcept |
Vector | operator* (double factor, const Vector &a) noexcept |
Vector | operator* (float factor, const Vector &a) noexcept |
Vector | operator* (int factor, const Vector &a) |
Vector | operator+ (const Vector &a, const Vector &b) noexcept |
Vector | operator- (const Vector &a, const Vector &b) noexcept |
Vector | operator/ (const Vector &a, const Vector &b) noexcept |
Vector | operator/ (const Vector &a, double factor) noexcept |
Vector | operator/ (const Vector &a, float factor) noexcept |
Vector | operator/ (const Vector &a, int factor) noexcept |
bool | operator== (const Vector &a, const Vector &b) noexcept |
Vector | operator^ (const Vector &a, const Vector &b) noexcept |
void | rotate (const Vector &axis) noexcept |
Vector | rotate (const Vector &v, const Vector &axis) noexcept |
General purpose vector in 3D space using float32.
|
related |
Returns the length of the given vector
|
related |
Returns the squared length of the given vector
Returns the mixed product of the three vectors ((a^b)*c)
Mutiplies the components of the given vectors
Returns a unit vector along the direction of the given one
Multiplies the given vector by the given number.
Multiplies the given vector by the given number.
Multiplies the given vector by the given number.
Multiplies all components of the given vector by the given number.
Multiplies all components of the given vector by the given number.
Multiplies all components of the given vector by the given number.
Adds the components of the given vectors
Subtracts the components of the given vectors
Divides the components of the given vectors
Divides all components of the given vector by the given number.
Divides all components of the given vector by the given number.
Divides all components of the given vector by the given number.
Checks two vectors for exact equality NOTE: You may want to perform your own approximate comparison, element by element
Returns the cross product of two vectors
|
related |
Rotates the vector along the given axis. The length of the axis is the tangent of the angle of rotation.
Rotates the vector along the given axis. The length of the axis is the tangent of the angle of rotation.