Tizen Native API  4.0
Dali::Vector3 Struct Reference

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.
Vector3operator= (const float *array)
 Assignment operator.
Vector3operator= (const Vector2 &rhs)
 Assignment operator.
Vector3operator= (const Vector4 &rhs)
 Assignment operator.
Vector3 operator+ (const Vector3 &rhs) const
 Addition operator.
Vector3operator+= (const Vector3 &rhs)
 Addition assignment operator.
Vector3 operator- (const Vector3 &rhs) const
 Subtraction operator.
Vector3operator-= (const Vector3 &rhs)
 Subtraction assignment operator.
Vector3 operator* (const Vector3 &rhs) const
 Multiplication operator.
Vector3 operator* (float rhs) const
 Multiplication operator.
Vector3operator*= (const Vector3 &rhs)
 Multiplication assignment operator.
Vector3operator*= (float rhs)
 Multiplication assignment operator.
Vector3operator*= (const Quaternion &rhs)
 Multiplication assignment operator.
Vector3 operator/ (const Vector3 &rhs) const
 Division operator.
Vector3 operator/ (float rhs) const
 Division operator.
Vector3operator/= (const Vector3 &rhs)
 Division assignment operator.
Vector3operator/= (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 unsigned int index) const
 Const array subscript operator overload.
float & operator[] (const unsigned int 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 Vector2GetVectorXY () const
 Returns the x & y components (or width & height, or r & g) as a Vector2.
Vector2GetVectorXY ()
 Returns the x & y components (or width & height, or r & g) as a Vector2.
const Vector2GetVectorYZ () const
 Returns the y & z components (or height & depth, or g & b) as a Vector2.
Vector2GetVectorYZ ()
 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)

Detailed Description

A three dimensional vector.

Since:
2.4, DALi version 1.0.0

Constructor & Destructor Documentation

Constructor.

Since:
2.4, DALi version 1.0.0
Dali::Vector3::Vector3 ( float  x,
float  y,
float  z 
) [explicit]

Constructor.

Since:
2.4, DALi version 1.0.0
Parameters:
[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.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]arrayArray of xyz
Dali::Vector3::Vector3 ( const Vector2 vec2) [explicit]

Constructor.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]vec2Vector2 to create this vector from
Dali::Vector3::Vector3 ( const Vector4 vec4) [explicit]

Constructor.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]vec4Vector4 to create this vector from

Member Function Documentation

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)

Since:
2.4, DALi version 1.0.0
Returns:
The vector contents as an array of 3 floats
Note:
inlined for performance reasons (generates less code than a function call)

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)

Since:
2.4, DALi version 1.0.0
Returns:
The vector contents as an array of 3 floats
Note:
inlined for performance reasons (generates less code than a function call)
void Dali::Vector3::Clamp ( const Vector3 min,
const Vector3 max 
)

Clamps the vector between minimum and maximum vectors.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]minThe minimum vector
[in]maxThe 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.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]otherThe other vector
Returns:
The cross product
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.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]otherThe other vector
Returns:
The dot product

Returns the x & y components (or width & height, or r & g) as a Vector2.

Since:
2.4, DALi version 1.0.0
Returns:
The partial vector contents as Vector2 (x,y)
Note:
inlined for performance reasons (generates less code than a function call)

Returns the x & y components (or width & height, or r & g) as a Vector2.

Since:
2.4, DALi version 1.0.0
Returns:
The partial vector contents as Vector2 (x,y)
Note:
inlined for performance reasons (generates less code than a function call)

Returns the y & z components (or height & depth, or g & b) as a Vector2.

Since:
2.4, DALi version 1.0.0
Returns:
The partial vector contents as Vector2 (y,z)
Note:
inlined for performance reasons (generates less code than a function call)

Returns the y & z components (or height & depth, or g & b) as a Vector2.

Since:
2.4, DALi version 1.0.0
Returns:
The partial vector contents as Vector2 (y,z)
Note:
inlined for performance reasons (generates less code than a function call)
float Dali::Vector3::Length ( ) const

Returns the length of the vector.

Since:
2.4, DALi version 1.0.0
Returns:
The length of the vector

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.

Since:
2.4, DALi version 1.0.0
Returns:
The length of the vector squared

Sets the vector to be unit length, whilst maintaining its direction.

Since:
2.4, DALi version 1.0.0
bool Dali::Vector3::operator!= ( const Vector3 rhs) const

Inequality operator.

Utilizes appropriate machine epsilon values.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe vector to test against
Returns:
True if the vectors are not equal
Vector3 Dali::Vector3::operator* ( const Vector3 rhs) const

Multiplication operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe vector to multiply
Returns:
A vector containing the result of the multiplication
Vector3 Dali::Vector3::operator* ( float  rhs) const

Multiplication operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe float value to scale the vector
Returns:
A vector containing the result of the scaling
Vector3& Dali::Vector3::operator*= ( const Vector3 rhs)

Multiplication assignment operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe vector to multiply
Returns:
Itself
Vector3& Dali::Vector3::operator*= ( float  rhs)

Multiplication assignment operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe float value to scale the vector
Returns:
Itself
Vector3& Dali::Vector3::operator*= ( const Quaternion rhs)

Multiplication assignment operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe Quaternion value to multiply the vector by
Returns:
Itself
Vector3 Dali::Vector3::operator+ ( const Vector3 rhs) const

Addition operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsVector to add
Returns:
A vector containing the result of the addition
Vector3& Dali::Vector3::operator+= ( const Vector3 rhs)

Addition assignment operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsVector to add
Returns:
Itself
Vector3 Dali::Vector3::operator- ( const Vector3 rhs) const

Subtraction operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe vector to subtract
Returns:
A vector containing the result of the subtraction
Vector3 Dali::Vector3::operator- ( ) const

Unary negation operator.

Since:
2.4, DALi version 1.0.0
Returns:
A vector containg the negation
Vector3& Dali::Vector3::operator-= ( const Vector3 rhs)

Subtraction assignment operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe vector to subtract
Returns:
Itself
Vector3 Dali::Vector3::operator/ ( const Vector3 rhs) const

Division operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe vector to divide
Returns:
A vector containing the result of the division
Vector3 Dali::Vector3::operator/ ( float  rhs) const

Division operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe float value to scale the vector by
Returns:
A vector containing the result of the scaling
Vector3& Dali::Vector3::operator/= ( const Vector3 rhs)

Division assignment operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe vector to divide
Returns:
Itself
Vector3& Dali::Vector3::operator/= ( float  rhs)

Division assignment operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe float value to scale the vector by
Returns:
Itself
Vector3& Dali::Vector3::operator= ( const float *  array)

Assignment operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]arrayArray of floats
Returns:
Itself
Vector3& Dali::Vector3::operator= ( const Vector2 rhs)

Assignment operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsVector to assign
Returns:
Itself
Vector3& Dali::Vector3::operator= ( const Vector4 rhs)

Assignment operator.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsVector to assign
Returns:
Itself
bool Dali::Vector3::operator== ( const Vector3 rhs) const

Equality operator.

Utilizes appropriate machine epsilon values.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsThe vector to test against
Returns:
True if the vectors are equal
const float& Dali::Vector3::operator[] ( const unsigned int  index) const

Const array subscript operator overload.

Asserts if index is out of range. Should be 0, 1 or 2.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]indexSubscript index
Returns:
The float at the given index
float& Dali::Vector3::operator[] ( const unsigned int  index)

Mutable array subscript operator overload.

Asserts if index is out of range. Should be 0, 1 or 2.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]indexSubscript index
Returns:
The float at the given index