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