Untold Engine
Beta v0.0.16
docs
|
The U4DVector3n class is in charge of implementing 3D Linear Algebra Vector operations. These operations include: Addition, subtraction, scalar multiplication, dot product, cross product, among others. More...
Public Member Functions | |
U4DVector3n () | |
Constructor which creates a default 3D vector. That is, it creates a vector with x, y and z components equal to zero. | |
U4DVector3n (float nx, float ny, float nz) | |
Constructor which creates a 3D vector with x,y, and z components. More... | |
~U4DVector3n () | |
Default destructor of a vector. | |
U4DVector3n (const U4DVector3n &a) | |
Copy Constructor for a 3D vector. More... | |
U4DVector3n & | operator= (const U4DVector3n &a) |
Copy Constructor for 3D vector. More... | |
bool | operator== (const U4DVector3n &a) |
Method which compares if two 3D vectors are equal. More... | |
void | operator+= (const U4DVector3n &v) |
Method that calculates the addition of two vectors. More... | |
U4DVector3n | operator+ (const U4DVector3n &v) const |
Method that calculates the addition of two vectors. More... | |
void | operator-= (const U4DVector3n &v) |
Method that Calculates the difference between of two vectors. More... | |
U4DVector3n | operator- (const U4DVector3n &v) const |
Method that calculates the difference of two vectors. More... | |
void | operator*= (const float s) |
Method which multiplies a 3D vector by a scalar. More... | |
U4DVector3n | operator* (const float s) const |
Method which multiplies a 3D vector by a scalar. More... | |
U4DQuaternion | operator* (U4DQuaternion &q) const |
Method which multiplies a 3D vector by a quaternion. More... | |
void | operator/= (const float s) |
Method which divides a 3D vector by a scalar. More... | |
U4DVector3n | operator/ (const float s) const |
Method which divides a 3D vector by a scalar. More... | |
float | operator* (const U4DVector3n &v) const |
Method that calculates the dot product between two 3D vectors. More... | |
float | dot (const U4DVector3n &v) const |
Method that calculates the dot product between two 3D vectors. More... | |
float | angle (const U4DVector3n &v) |
Method that calculates the angle between two 3D vectors. More... | |
void | operator%= (const U4DVector3n &v) |
Method that calculates the cross product of two 3D vectors. More... | |
U4DVector3n | operator% (const U4DVector3n &v) const |
Method that calculates the cross product of two 3D vectors. More... | |
U4DVector3n | cross (const U4DVector3n &v) const |
Method that calculates the cross product of two 3D vectors. More... | |
void | conjugate () |
Method that computes the conjugate of a 3D vector. More... | |
void | normalize () |
Method that computes that normalizes a 3D vector. More... | |
float | magnitude () |
Method which calculates the magnitude of a 3D vector. More... | |
float | magnitudeSquare () |
Method which calculates the magnitude square of vector. That is, the square root of the magnitude is not computed. More... | |
U4DPoint3n | toPoint () |
Method to convert 3D vector to a 3D point. More... | |
void | zero () |
Method to set the current 3D vector to a zero-value 3D vector. That is, it sets all its components to zero. More... | |
void | absolute () |
Method which calculates absolute value of a 3D vector. More... | |
U4DVector3n | rotateVectorAboutAngleAndAxis (float uAngle, U4DVector3n &uAxis) |
Method which rotates the 3D vector about an axis by the specified angle amount. More... | |
void | computeOrthonormalBasis (U4DVector3n &uTangent1, U4DVector3n &uTangent2) |
Method which computes the Orthonormal Basis of the 3D vector given two tangential 3D vectors. More... | |
void | negate () |
Method which negates the 3D vector components of the vector. | |
float | getX () |
returns the x component of the vector More... | |
float | getY () |
returns the y component of the vector More... | |
float | getZ () |
returns the z component of the vector More... | |
void | show () |
Method which prints the components value of the 3D vector to the console log window. | |
void | show (std::string uString) |
Method which prints the components value of the 3D vector to the console log window with a user message. More... | |
Public Attributes | |
float | x |
x vector component | |
float | y |
y vector component | |
float | z |
z vector component | |
The U4DVector3n class is in charge of implementing 3D Linear Algebra Vector operations. These operations include: Addition, subtraction, scalar multiplication, dot product, cross product, among others.
U4DEngine::U4DVector3n::U4DVector3n | ( | float | nx, |
float | ny, | ||
float | nz | ||
) |
Constructor which creates a 3D vector with x,y, and z components.
nx | x component |
ny | y component |
nz | z component |
U4DEngine::U4DVector3n::U4DVector3n | ( | const U4DVector3n & | a | ) |
Copy Constructor for a 3D vector.
3D | vector to copy |
void U4DEngine::U4DVector3n::absolute | ( | ) |
Method which calculates absolute value of a 3D vector.
float U4DEngine::U4DVector3n::angle | ( | const U4DVector3n & | v | ) |
Method that calculates the angle between two 3D vectors.
v | A 3D vector to compute the dot product with |
void U4DEngine::U4DVector3n::computeOrthonormalBasis | ( | U4DVector3n & | uTangent1, |
U4DVector3n & | uTangent2 | ||
) |
Method which computes the Orthonormal Basis of the 3D vector given two tangential 3D vectors.
uTangent1 | Tangential 3D Vector |
uTangent2 | Tangential 3D Vector |
void U4DEngine::U4DVector3n::conjugate | ( | ) |
Method that computes the conjugate of a 3D vector.
U4DVector3n U4DEngine::U4DVector3n::cross | ( | const U4DVector3n & | v | ) | const |
Method that calculates the cross product of two 3D vectors.
v | A 3D vector to compute the cross product with |
float U4DEngine::U4DVector3n::dot | ( | const U4DVector3n & | v | ) | const |
Method that calculates the dot product between two 3D vectors.
v | A 3D vector to compute the dot product with |
float U4DEngine::U4DVector3n::getX | ( | ) |
returns the x component of the vector
float U4DEngine::U4DVector3n::getY | ( | ) |
returns the y component of the vector
float U4DEngine::U4DVector3n::getZ | ( | ) |
returns the z component of the vector
float U4DEngine::U4DVector3n::magnitude | ( | ) |
Method which calculates the magnitude of a 3D vector.
float U4DEngine::U4DVector3n::magnitudeSquare | ( | ) |
Method which calculates the magnitude square of vector. That is, the square root of the magnitude is not computed.
void U4DEngine::U4DVector3n::normalize | ( | ) |
Method that computes that normalizes a 3D vector.
U4DVector3n U4DEngine::U4DVector3n::operator% | ( | const U4DVector3n & | v | ) | const |
Method that calculates the cross product of two 3D vectors.
v | A 3D vector to compute the cross product with |
void U4DEngine::U4DVector3n::operator%= | ( | const U4DVector3n & | v | ) |
Method that calculates the cross product of two 3D vectors.
v | A 3D vector to compute the cross product with |
U4DVector3n U4DEngine::U4DVector3n::operator* | ( | const float | s | ) | const |
Method which multiplies a 3D vector by a scalar.
s | Scalar value to multiply |
float U4DEngine::U4DVector3n::operator* | ( | const U4DVector3n & | v | ) | const |
Method that calculates the dot product between two 3D vectors.
v | A 3D vector to compute the dot product with |
U4DQuaternion U4DEngine::U4DVector3n::operator* | ( | U4DQuaternion & | q | ) | const |
Method which multiplies a 3D vector by a quaternion.
q | Quaternion to multiply |
void U4DEngine::U4DVector3n::operator*= | ( | const float | s | ) |
Method which multiplies a 3D vector by a scalar.
s | Scalar value to multiply |
U4DVector3n U4DEngine::U4DVector3n::operator+ | ( | const U4DVector3n & | v | ) | const |
Method that calculates the addition of two vectors.
v | 3D vector to add |
void U4DEngine::U4DVector3n::operator+= | ( | const U4DVector3n & | v | ) |
Method that calculates the addition of two vectors.
v | Vector to add. |
U4DVector3n U4DEngine::U4DVector3n::operator- | ( | const U4DVector3n & | v | ) | const |
Method that calculates the difference of two vectors.
v | 3D vector to subtract |
void U4DEngine::U4DVector3n::operator-= | ( | const U4DVector3n & | v | ) |
Method that Calculates the difference between of two vectors.
v | 3D vector to subtract |
U4DVector3n U4DEngine::U4DVector3n::operator/ | ( | const float | s | ) | const |
Method which divides a 3D vector by a scalar.
s | Scalar value to divide |
void U4DEngine::U4DVector3n::operator/= | ( | const float | s | ) |
Method which divides a 3D vector by a scalar.
s | Scalar value to divide |
U4DVector3n & U4DEngine::U4DVector3n::operator= | ( | const U4DVector3n & | a | ) |
Copy Constructor for 3D vector.
3D | vector to copy |
bool U4DEngine::U4DVector3n::operator== | ( | const U4DVector3n & | a | ) |
Method which compares if two 3D vectors are equal.
a | 3D vector to compare to |
U4DVector3n U4DEngine::U4DVector3n::rotateVectorAboutAngleAndAxis | ( | float | uAngle, |
U4DVector3n & | uAxis | ||
) |
Method which rotates the 3D vector about an axis by the specified angle amount.
uAngle | Angle in degrees to rotate |
uAxis | Axis to rotate vector about |
void U4DEngine::U4DVector3n::show | ( | std::string | uString | ) |
Method which prints the components value of the 3D vector to the console log window with a user message.
uString | Message to pring along with the vector components |
U4DPoint3n U4DEngine::U4DVector3n::toPoint | ( | ) |
Method to convert 3D vector to a 3D point.
void U4DEngine::U4DVector3n::zero | ( | ) |
Method to set the current 3D vector to a zero-value 3D vector. That is, it sets all its components to zero.