Generic integer x, y vector. More...
#include <math/gzmath.hh>
Public Member Functions | |
Vector2i () | |
Constructor. More... | |
Vector2i (const int &_x, const int &_y) | |
Constructor. More... | |
Vector2i (const Vector2i &_pt) | |
Copy onstructor. More... | |
virtual | ~Vector2i () |
Destructor. More... | |
Vector2i | Cross (const Vector2i &_pt) const |
Return the cross product of this vector and _pt. More... | |
int | Distance (const Vector2i &_pt) const |
Calc distance to the given point. More... | |
bool | IsFinite () const |
See if a point is finite (e.g., not nan) More... | |
void | Normalize () |
Normalize the vector length. More... | |
bool | operator!= (const Vector2i &_v) const |
Equality operators. More... | |
const Vector2i | operator* (const Vector2i &_v) const |
Multiplication operator. More... | |
const Vector2i | operator* (int _v) const |
Multiplication operator. More... | |
const Vector2i & | operator*= (const Vector2i &_v) |
Multiplication operators. More... | |
const Vector2i & | operator*= (int _v) |
Multiplication operator. More... | |
Vector2i | operator+ (const Vector2i &_v) const |
Addition operator. More... | |
const Vector2i & | operator+= (const Vector2i &_v) |
Addition assignment operator. More... | |
Vector2i | operator- (const Vector2i &_v) const |
Subtraction operator. More... | |
const Vector2i & | operator-= (const Vector2i &_v) |
Subtraction operators. More... | |
const Vector2i | operator/ (const Vector2i &_v) const |
Division operator. More... | |
const Vector2i | operator/ (int _v) const |
Division operator. More... | |
const Vector2i & | operator/= (const Vector2i &_v) |
Division operator. More... | |
const Vector2i & | operator/= (int _v) |
Division operator. More... | |
Vector2i & | operator= (const Vector2i &_v) |
Assignment operator. More... | |
const Vector2i & | operator= (int _value) |
Assignment operator. More... | |
bool | operator== (const Vector2i &_v) const |
Equality operator. More... | |
int | operator[] (unsigned int _index) const |
Array subscript operator. More... | |
void | Set (int _x, int _y) |
Set the contents of the vector. More... | |
Public Attributes | |
int | x |
x data More... | |
int | y |
y data More... | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const gazebo::math::Vector2i &_pt) |
Stream insertion operator. More... | |
std::istream & | operator>> (std::istream &_in, gazebo::math::Vector2i &_pt) |
Stream extraction operator. More... | |
Generic integer x, y vector.
gazebo::math::Vector2i::Vector2i | ( | ) |
Constructor.
gazebo::math::Vector2i::Vector2i | ( | const int & | _x, |
const int & | _y | ||
) |
Constructor.
[in] | _x | value along x |
[in] | _y | value along y |
gazebo::math::Vector2i::Vector2i | ( | const Vector2i & | _pt) |
Copy onstructor.
[in] | _pt | a point |
|
virtual |
Destructor.
Return the cross product of this vector and _pt.
[in] | _pt | the other vector |
int gazebo::math::Vector2i::Distance | ( | const Vector2i & | _pt) | const |
Calc distance to the given point.
[in] | _pt | a point |
bool gazebo::math::Vector2i::IsFinite | ( | ) | const |
See if a point is finite (e.g., not nan)
void gazebo::math::Vector2i::Normalize | ( | ) |
Normalize the vector length.
bool gazebo::math::Vector2i::operator!= | ( | const Vector2i & | _v) | const |
Equality operators.
_v | the vector to compare with |
Multiplication operator.
[in] | _v | the vector |
const Vector2i gazebo::math::Vector2i::operator* | ( | int | _v) | const |
Multiplication operator.
[in] | _v | the scaling factor |
Multiplication operators.
[in] | _v | the vector |
const Vector2i& gazebo::math::Vector2i::operator*= | ( | int | _v) |
Multiplication operator.
[in] | _v | scaling factor |
Addition operator.
[in] | _v | the vector to add |
Addition assignment operator.
[in] | _v | the vector to add |
Subtraction operator.
[in] | _v | the vector to substract |
Subtraction operators.
[in] | _v | the vector to substract |
Division operator.
[in] | _v | the vector to divide |
const Vector2i gazebo::math::Vector2i::operator/ | ( | int | _v) | const |
Division operator.
[in] | _v | the vector to divide |
Division operator.
[in] | _v | the vector to divide |
const Vector2i& gazebo::math::Vector2i::operator/= | ( | int | _v) |
Division operator.
[in] | _v | the vector to divide |
Assignment operator.
[in] | _v | the value |
const Vector2i& gazebo::math::Vector2i::operator= | ( | int | _value) |
Assignment operator.
[in] | _value | the value for x and y |
bool gazebo::math::Vector2i::operator== | ( | const Vector2i & | _v) | const |
Equality operator.
_v | the vector to compare with |
int gazebo::math::Vector2i::operator[] | ( | unsigned int | _index) | const |
Array subscript operator.
[in] | _index | the array index |
void gazebo::math::Vector2i::Set | ( | int | _x, |
int | _y | ||
) |
Set the contents of the vector.
[in] | _x | value along x |
[in] | _y | value along y |
|
friend |
Stream insertion operator.
[in] | _out | output stream |
[in] | pt | Vector2i to output |
|
friend |
Stream extraction operator.
[in] | _in | input stream |
[in] | _pt | Vector3 to read values into |
int gazebo::math::Vector2i::x |
x data
int gazebo::math::Vector2i::y |
y data