Generic integer x, y vector. More...
#include <Vector2i.hh>
Public Member Functions | |
Vector2i () | |
Constructor. | |
Vector2i (const int &_x, const int &_y) | |
Constructor. | |
Vector2i (const Vector2i &_pt) | |
Copy onstructor. | |
virtual | ~Vector2i () |
Destructor. | |
Vector2i | Cross (const Vector2i &_pt) const |
Return the cross product of this vector and pt. | |
int | Distance (const Vector2i &_pt) const |
Calc distance to the given point. | |
bool | IsFinite () const |
See if a point is finite (e.g., not nan) | |
void | Normalize () |
Normalize the vector length. | |
bool | operator!= (const Vector2i &_v) const |
Equality operators. | |
const Vector2i | operator* (const Vector2i &_v) const |
Multiplication operator. | |
const Vector2i | operator* (int _v) const |
Multiplication operator. | |
const Vector2i & | operator*= (const Vector2i &_v) |
Multiplication operators. | |
const Vector2i & | operator*= (int _v) |
Multiplication operator. | |
Vector2i | operator+ (const Vector2i &_v) const |
Addition operator. | |
const Vector2i & | operator+= (const Vector2i &_v) |
Addition assignment operator. | |
Vector2i | operator- (const Vector2i &_v) const |
Subtraction operator. | |
const Vector2i & | operator-= (const Vector2i &_v) |
Subtraction operators. | |
const Vector2i | operator/ (const Vector2i &_v) const |
Division operator. | |
const Vector2i | operator/ (int _v) const |
Division operator. | |
const Vector2i & | operator/= (const Vector2i &_v) |
Division operator. | |
const Vector2i & | operator/= (int _v) |
Division operator. | |
Vector2i & | operator= (const Vector2i &_v) |
Assignment operator. | |
const Vector2i & | operator= (int _value) |
Assignment operator. | |
bool | operator== (const Vector2i &_v) const |
Equality operator. | |
int | operator[] (unsigned int _index) const |
Array subscript operator. | |
void | Set (int _x, int _y) |
Set the contents of the vector. | |
Public Attributes | |
int | x |
x data | |
int | y |
y data | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const gazebo::math::Vector2i &_pt) |
Stream insertion operator. | |
std::istream & | operator>> (std::istream &_in, gazebo::math::Vector2i &_pt) |
Stream extraction operator. | |
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] | 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