Tizen Native API
5.5
|
A two dimensional vector. More...
Public Member Functions | |
Vector2 () | |
Constructor. | |
Vector2 (float x, float y) | |
Constructor. | |
Vector2 (const float *array) | |
Conversion constructor from an array of two floats. | |
Vector2 (const Vector3 &vec3) | |
Constructor. | |
Vector2 (const Vector4 &vec4) | |
Constructor. | |
Vector2 & | operator= (const float *array) |
Assignment operator. | |
Vector2 & | operator= (const Vector3 &rhs) |
Assignment operator. | |
Vector2 & | operator= (const Vector4 &rhs) |
Assignment operator. | |
Vector2 | operator+ (const Vector2 &rhs) const |
Addition operator. | |
Vector2 & | operator+= (const Vector2 &rhs) |
Addition assignment operator. | |
Vector2 | operator- (const Vector2 &rhs) const |
Subtraction operator. | |
Vector2 & | operator-= (const Vector2 &rhs) |
Subtraction assignment operator. | |
Vector2 | operator* (const Vector2 &rhs) const |
Multiplication operator. | |
Vector2 | operator* (float rhs) const |
Multiplication operator. | |
Vector2 & | operator*= (const Vector2 &rhs) |
Multiplication assignment operator. | |
Vector2 & | operator*= (float rhs) |
Multiplication assignment operator. | |
Vector2 | operator/ (const Vector2 &rhs) const |
Division operator. | |
Vector2 | operator/ (float rhs) const |
Division operator. | |
Vector2 & | operator/= (const Vector2 &rhs) |
Division assignment operator. | |
Vector2 & | operator/= (float rhs) |
Division assignment operator. | |
Vector2 | operator- () const |
Unary negation operator. | |
bool | operator== (const Vector2 &rhs) const |
Equality operator. | |
bool | operator!= (const Vector2 &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 | 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 Vector2 &min, const Vector2 &max) |
Clamps the vector between minimum and maximum vectors. | |
const float * | AsFloat () const |
Returns the contents of the vector as an array of 2 floats. | |
float * | AsFloat () |
Returns the contents of the vector as an array of 2 floats. | |
Static Public Attributes | |
static const Vector2 | ONE |
(1.0f,1.0f) | |
static const Vector2 | XAXIS |
Vector representing the X axis. | |
static const Vector2 | YAXIS |
Vector representing the Y axis. | |
static const Vector2 | NEGATIVE_XAXIS |
Vector representing the negative X axis. | |
static const Vector2 | NEGATIVE_YAXIS |
Vector representing the negative Y axis. | |
static const Vector2 | ZERO |
(0.0f, 0.0f) |
A two dimensional vector.
Constructor.
Dali::Vector2::Vector2 | ( | float | x, |
float | y | ||
) | [explicit] |
Constructor.
[in] | x | x or width component |
[in] | y | y or height component |
Dali::Vector2::Vector2 | ( | const float * | array | ) | [explicit] |
Conversion constructor from an array of two floats.
[in] | array | Array of xy |
Dali::Vector2::Vector2 | ( | const Vector3 & | vec3 | ) | [explicit] |
Dali::Vector2::Vector2 | ( | const Vector4 & | vec4 | ) | [explicit] |
const float* Dali::Vector2::AsFloat | ( | ) | const |
Returns the contents of the vector as an array of 2 floats.
The order of the values in this array are as follows: 0: x (or width) 1: y (or height)
float* Dali::Vector2::AsFloat | ( | ) |
Returns the contents of the vector as an array of 2 floats.
The order of the values in this array are as follows: 0: x (or width) 1: y (or height)
void Dali::Vector2::Clamp | ( | const Vector2 & | min, |
const Vector2 & | max | ||
) |
Clamps the vector between minimum and maximum vectors.
[in] | min | The minimum vector |
[in] | max | The maximum vector |
float Dali::Vector2::Length | ( | ) | const |
Returns the length of the vector.
float Dali::Vector2::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::Vector2::Normalize | ( | ) |
Sets the vector to be unit length, whilst maintaining its direction.
bool Dali::Vector2::operator!= | ( | const Vector2 & | rhs | ) | const |
Inequality operator.
Utilizes appropriate machine epsilon values.
[in] | rhs | The vector to test against |
Multiplication operator.
[in] | rhs | The vector to multiply |
Vector2 Dali::Vector2::operator* | ( | float | rhs | ) | const |
Multiplication operator.
[in] | rhs | The float value to scale the vector |
Multiplication assignment operator.
[in] | rhs | The vector to multiply |
Vector2& Dali::Vector2::operator*= | ( | float | rhs | ) |
Multiplication assignment operator.
[in] | rhs | The float value to scale the vector |
Addition operator.
[in] | rhs | Vector to add |
Addition assignment operator.
[in] | rhs | Vector to add |
Subtraction operator.
[in] | rhs | The vector to subtract |
Vector2 Dali::Vector2::operator- | ( | ) | const |
Unary negation operator.
Subtraction assignment operator.
[in] | rhs | The vector to subtract |
Division operator.
[in] | rhs | The vector to divide |
Vector2 Dali::Vector2::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 |
Vector2& Dali::Vector2::operator/= | ( | float | rhs | ) |
Division assignment operator.
[in] | rhs | The float value to scale the vector by |
Vector2& Dali::Vector2::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::Vector2::operator== | ( | const Vector2 & | rhs | ) | const |
Equality operator.
Utilizes appropriate machine epsilon values.
[in] | rhs | The vector to test against |
const float& Dali::Vector2::operator[] | ( | const uint32_t | index | ) | const |
Const array subscript operator overload.
Asserts if index is out of range. Should be 0 or 1.
[in] | index | Subscript index |
float& Dali::Vector2::operator[] | ( | const uint32_t | index | ) |
Mutable array subscript operator overload.
Asserts if index is out of range. Should be 0 or 1.
[in] | index | Subscript index |