#include <sgVector4.h>
Public Member Functions | |
sgVector4 (float x_=0.0f, float y_=0.0f, float z_=0.0f, float w_=0.0f) | |
sgVector4 (const sgVector4 &other) | |
sgVector4 (const sgQuaternion &other) | |
bool | operator== (const sgVector4 &other) |
bool | operator!= (const sgVector4 &other) |
sgVector4 & | operator= (const sgVector4 &other) |
sgVector4 & | operator= (const float &other) |
sgVector4 & | operator= (const sgQuaternion &other) |
sgVector4 & | operator+= (const sgVector4 &other) |
sgVector4 & | operator-= (const sgVector4 &other) |
sgVector4 & | operator*= (const sgVector4 &other) |
sgVector4 & | operator/= (const sgVector4 &other) |
sgVector4 | operator+ (const sgVector4 &other) |
sgVector4 | operator- (const sgVector4 &other) |
sgVector4 | operator* (const sgVector4 &other) |
sgVector4 | operator/ (const sgVector4 &other) |
sgVector4 & | operator+= (const float &other) |
sgVector4 & | operator-= (const float &other) |
sgVector4 & | operator*= (const float &other) |
sgVector4 & | operator/= (const float &other) |
sgVector4 | operator+ (const float &other) |
sgVector4 | operator- (const float &other) |
sgVector4 | operator* (const float &other) |
sgVector4 | operator/ (const float &other) |
sgVector4 & | operator*= (const sgMatrix4x4 &other) |
sgVector4 | operator* (const sgMatrix4x4 &other) |
float | length () |
void | makeIdentity () |
void | normalize () |
float | dot (sgVector4 &other) |
sgVector4 | cross (sgVector4 &other) |
float | dist (sgVector4 &other) |
Public Attributes | |
float | x |
float | y |
float | z |
float | w |
4D vector class. Stores a vector with four elements and provides functionality for it.
sgVector4::sgVector4 | ( | float | x_ = 0.0f , |
|
float | y_ = 0.0f , |
|||
float | z_ = 0.0f , |
|||
float | w_ = 0.0f | |||
) |
Constructor. Initializes a new instance.
x_ | the x value | |
y_ | the y value | |
z_ | the z value | |
w_ | the w value |
sgVector4::sgVector4 | ( | const sgVector4 & | other | ) |
Constructor. Initializes a new instance.
other | vector to copy the values from |
sgVector4::sgVector4 | ( | const sgQuaternion & | other | ) |
Constructor. Initializes a new instance from a quaternion.
other | quaternion to to get the axis-angle components from |
Cross product. The cross product of the vector with the other one (ignoring the fourth parameter).
other | another vector |
float sgVector4::dist | ( | sgVector4 & | other | ) |
Distance. The distance of the vector with the other one.
other | another vector |
float sgVector4::dot | ( | sgVector4 & | other | ) |
Dot product. The dot product of the vector with the other one.
other | another vector |
float sgVector4::length | ( | ) |
Length. Get the length of the vector.
void sgVector4::makeIdentity | ( | ) |
Make identity. Sets the vectors components to 0.
void sgVector4::normalize | ( | ) |
Normalize. Keeps the vectors direction, but sets its length to 1.
bool sgVector4::operator!= | ( | const sgVector4 & | other | ) |
Not equal. Checks if two instances do not equal each other.
sgVector4 sgVector4::operator* | ( | const sgMatrix4x4 & | other | ) |
Multiply. Transforms the vector with the matrix, with the matrix on the right.
sgVector4 sgVector4::operator* | ( | const float & | other | ) |
Multiply. Multiply the scalar to each component of the vector.
Multiply. Multiply the two vectors component wise.
sgVector4 & sgVector4::operator*= | ( | const sgMatrix4x4 & | other | ) |
Multiply. Transforms the vector with the matrix, with the matrix on the right.
sgVector4 & sgVector4::operator*= | ( | const float & | other | ) |
Multiply. Multiply the scalar to each component of the vector.
Multiply. Multiply the two vectors component wise.
sgVector4 sgVector4::operator+ | ( | const float & | other | ) |
Add. Add the scalar to each component of the vector.
sgVector4 & sgVector4::operator+= | ( | const float & | other | ) |
Add. Add the scalar to each component of the vector.
Add. Add the two vectors component wise.
sgVector4 sgVector4::operator- | ( | const float & | other | ) |
Substract. Substract the scalar from each component of the vector.
Substract. Substract the two vectors component wise.
sgVector4 & sgVector4::operator-= | ( | const float & | other | ) |
Substract. Substract the scalar from each component of the vector.
Substract. Substract the two vectors component wise.
sgVector4 sgVector4::operator/ | ( | const float & | other | ) |
Divide. Divide each component of the vector by the scalar.
Divide. Divide the two vectors component wise.
sgVector4 & sgVector4::operator/= | ( | const float & | other | ) |
Divide. Divide each component of the vector by the scalar.
Divide. Divide the two vectors component wise.
sgVector4 & sgVector4::operator= | ( | const sgQuaternion & | other | ) |
Copy. Copy the quaternions rotations axis-angle representation to the vector.
sgVector4 & sgVector4::operator= | ( | const float & | other | ) |
Copy. Sets all components to the value of the scalar.
Copy. Copy the values of one instance to the other.
bool sgVector4::operator== | ( | const sgVector4 & | other | ) |
Equal. Checks if two instances equal each other.
float sgVector4::w |
W. The vectors w component.
float sgVector4::x |
X. The vectors x component.
float sgVector4::y |
Y. The vectors y component.
float sgVector4::z |
Z. The vectors z component.