Tizen Native API
5.0
|
A three dimensional vector. More...
Public Member Functions | |
Vector3 () | |
Constructor. | |
Vector3 (float x, float y, float z) | |
Constructor. | |
Vector3 (const float *array) | |
Conversion constructor from an array of three floats. | |
Vector3 (const Vector2 &vec2) | |
Constructor. | |
Vector3 (const Vector4 &vec4) | |
Constructor. | |
Vector3 & | operator= (const float *array) |
Assignment operator. | |
Vector3 & | operator= (const Vector2 &rhs) |
Assignment operator. | |
Vector3 & | operator= (const Vector4 &rhs) |
Assignment operator. | |
Vector3 | operator+ (const Vector3 &rhs) const |
Addition operator. | |
Vector3 & | operator+= (const Vector3 &rhs) |
Addition assignment operator. | |
Vector3 | operator- (const Vector3 &rhs) const |
Subtraction operator. | |
Vector3 & | operator-= (const Vector3 &rhs) |
Subtraction assignment operator. | |
Vector3 | operator* (const Vector3 &rhs) const |
Multiplication operator. | |
Vector3 | operator* (float rhs) const |
Multiplication operator. | |
Vector3 & | operator*= (const Vector3 &rhs) |
Multiplication assignment operator. | |
Vector3 & | operator*= (float rhs) |
Multiplication assignment operator. | |
Vector3 & | operator*= (const Quaternion &rhs) |
Multiplication assignment operator. | |
Vector3 | operator/ (const Vector3 &rhs) const |
Division operator. | |
Vector3 | operator/ (float rhs) const |
Division operator. | |
Vector3 & | operator/= (const Vector3 &rhs) |
Division assignment operator. | |
Vector3 & | operator/= (float rhs) |
Division assignment operator. | |
Vector3 | operator- () const |
Unary negation operator. | |
bool | operator== (const Vector3 &rhs) const |
Equality operator. | |
bool | operator!= (const Vector3 &rhs) const |
Inequality operator. | |
const float & | operator[] (const uint32_t index) const |
Const array subscript operator overload. | |
float & | operator[] (const uint32_t index) |
Mutable array subscript operator overload. | |
float | Dot (const Vector3 &other) const |
Returns the dot product of this vector and another vector. | |
Vector3 | Cross (const Vector3 &other) const |
Returns the cross produce of this vector and another vector. | |
float | Length () const |
Returns the length of the vector. | |
float | LengthSquared () const |
Returns the length of the vector squared. | |
void | Normalize () |
Sets the vector to be unit length, whilst maintaining its direction. | |
void | Clamp (const Vector3 &min, const Vector3 &max) |
Clamps the vector between minimum and maximum vectors. | |
const float * | AsFloat () const |
Returns the contents of the vector as an array of 3 floats. | |
float * | AsFloat () |
Returns the contents of the vector as an array of 3 floats. | |
const Vector2 & | GetVectorXY () const |
Returns the x & y components (or width & height, or r & g) as a Vector2. | |
Vector2 & | GetVectorXY () |
Returns the x & y components (or width & height, or r & g) as a Vector2. | |
const Vector2 & | GetVectorYZ () const |
Returns the y & z components (or height & depth, or g & b) as a Vector2. | |
Vector2 & | GetVectorYZ () |
Returns the y & z components (or height & depth, or g & b) as a Vector2. | |
Static Public Attributes | |
static const Vector3 | ONE |
(1.0f,1.0f,1.0f) | |
static const Vector3 | XAXIS |
Vector representing the X axis. | |
static const Vector3 | YAXIS |
Vector representing the Y axis. | |
static const Vector3 | ZAXIS |
Vector representing the Z axis. | |
static const Vector3 | NEGATIVE_XAXIS |
Vector representing the negative X axis. | |
static const Vector3 | NEGATIVE_YAXIS |
Vector representing the negative Y axis. | |
static const Vector3 | NEGATIVE_ZAXIS |
Vector representing the negative Z axis. | |
static const Vector3 | ZERO |
(0.0f, 0.0f, 0.0f) |
A three dimensional vector.
Constructor.
Dali::Vector3::Vector3 | ( | float | x, |
float | y, | ||
float | z | ||
) | [explicit] |
Constructor.
[in] | x | (or width) component |
[in] | y | (or height) component |
[in] | z | (or depth) component |
Dali::Vector3::Vector3 | ( | const float * | array | ) | [explicit] |
Conversion constructor from an array of three floats.
[in] | array | Array of xyz |
Dali::Vector3::Vector3 | ( | const Vector2 & | vec2 | ) | [explicit] |
Dali::Vector3::Vector3 | ( | const Vector4 & | vec4 | ) | [explicit] |
const float* Dali::Vector3::AsFloat | ( | ) | const |
Returns the contents of the vector as an array of 3 floats.
The order of the values in this array are as follows: 0: x (or width, or r) 1: y (or height, or g) 2: z (or depth, or b)
float* Dali::Vector3::AsFloat | ( | ) |
Returns the contents of the vector as an array of 3 floats.
The order of the values in this array are as follows: 0: x (or width, or r) 1: y (or height, or g) 2: z (or depth, or b)
void Dali::Vector3::Clamp | ( | const Vector3 & | min, |
const Vector3 & | max | ||
) |
Clamps the vector between minimum and maximum vectors.
[in] | min | The minimum vector |
[in] | max | The maximum vector |
Vector3 Dali::Vector3::Cross | ( | const Vector3 & | other | ) | const |
Returns the cross produce of this vector and another vector.
The cross produce of two vectors is a vector which is perpendicular to the plane of the two vectors. This is great for calculating normals and making matrices orthogonal.
[in] | other | The other vector |
float Dali::Vector3::Dot | ( | const Vector3 & | other | ) | const |
Returns the dot product of this vector and another vector.
The dot product is the length of one vector in the direction of another vector. This is great for lighting, threshold testing the angle between two unit vectors, calculating the distance between two points in a particular direction.
[in] | other | The other vector |
const Vector2& Dali::Vector3::GetVectorXY | ( | ) | const |
const Vector2& Dali::Vector3::GetVectorYZ | ( | ) | const |
float Dali::Vector3::Length | ( | ) | const |
Returns the length of the vector.
float Dali::Vector3::LengthSquared | ( | ) | const |
Returns the length of the vector squared.
This is more efficient than Length() for threshold testing as it avoids the use of a square root.
void Dali::Vector3::Normalize | ( | ) |
Sets the vector to be unit length, whilst maintaining its direction.
bool Dali::Vector3::operator!= | ( | const Vector3 & | rhs | ) | const |
Inequality operator.
Utilizes appropriate machine epsilon values.
[in] | rhs | The vector to test against |
Multiplication operator.
[in] | rhs | The vector to multiply |
Vector3 Dali::Vector3::operator* | ( | float | rhs | ) | const |
Multiplication operator.
[in] | rhs | The float value to scale the vector |
Multiplication assignment operator.
[in] | rhs | The vector to multiply |
Vector3& Dali::Vector3::operator*= | ( | float | rhs | ) |
Multiplication assignment operator.
[in] | rhs | The float value to scale the vector |
Vector3& Dali::Vector3::operator*= | ( | const Quaternion & | rhs | ) |
Multiplication assignment operator.
[in] | rhs | The Quaternion value to multiply the vector by |
Addition operator.
[in] | rhs | Vector to add |
Addition assignment operator.
[in] | rhs | Vector to add |
Subtraction operator.
[in] | rhs | The vector to subtract |
Vector3 Dali::Vector3::operator- | ( | ) | const |
Unary negation operator.
Subtraction assignment operator.
[in] | rhs | The vector to subtract |
Division operator.
[in] | rhs | The vector to divide |
Vector3 Dali::Vector3::operator/ | ( | float | rhs | ) | const |
Division operator.
[in] | rhs | The float value to scale the vector by |
Division assignment operator.
[in] | rhs | The vector to divide |
Vector3& Dali::Vector3::operator/= | ( | float | rhs | ) |
Division assignment operator.
[in] | rhs | The float value to scale the vector by |
Vector3& Dali::Vector3::operator= | ( | const float * | array | ) |
Assignment operator.
[in] | array | Array of floats |
Assignment operator.
[in] | rhs | Vector to assign |
Assignment operator.
[in] | rhs | Vector to assign |
bool Dali::Vector3::operator== | ( | const Vector3 & | rhs | ) | const |
Equality operator.
Utilizes appropriate machine epsilon values.
[in] | rhs | The vector to test against |
const float& Dali::Vector3::operator[] | ( | const uint32_t | index | ) | const |
Const array subscript operator overload.
Asserts if index is out of range. Should be 0, 1 or 2.
[in] | index | Subscript index |
float& Dali::Vector3::operator[] | ( | const uint32_t | index | ) |
Mutable array subscript operator overload.
Asserts if index is out of range. Should be 0, 1 or 2.
[in] | index | Subscript index |