Public Member Functions | Static Public Member Functions | Public Attributes | Friends
Vector3 Class Reference

Generic double x,y,z vector. More...

#include <Vector3.hh>

List of all members.

Public Member Functions

 Vector3 ()
 Constructor.
 Vector3 (const double &x, const double &y, const double &z)
 Constructor.
 Vector3 (const Vector3 &pt)
 Constructor.
virtual ~Vector3 ()
 Destructor.
double Distance (const Vector3 &pt) const
 Calc distance to the given point.
double GetLength () const
 Returns the length (magnitude) of the vector.
double GetSquaredLength () const
 Return the square of the length (magnitude) of the vector.
void Normalize ()
 Normalize the vector length.
Vector3 Round ()
 Round to near whole number, return the result.
Vector3 GetRounded () const
 Get a rounded version of this vector.
void Set (double x=0, double y=0, double z=0)
 Set the contents of the vector.
Vector3 GetCrossProd (const Vector3 &pt) const
 Return the cross product of this vector and pt.
double GetDotProd (const Vector3 &pt) const
 Return the dot product of this vector and pt.
Vector3 GetAbs () const
 Get the absolute value of the vector
Vector3 GetPerpendicular () const
 Return a vector that is perpendicular to this one.
double GetDistToPlane (const Vector3 &_dir, const Vector3 &_planeNormal, double _d) const
 Get distance to a plane, given a direction.
double GetDistToLine (const Vector3 &_pt1, const Vector3 &_pt2)
 Get distance to a line.
void SetToMax (const Vector3 &v)
 Set this vector's components to the maximum of itself and the passed in vector.
void SetToMin (const Vector3 &v)
 Set this vector's components to the minimum of itself and the passed in vector.
const Vector3operator= (const Vector3 &pt)
 Equal operator.
const Vector3operator= (double value)
 Equal operator.
Vector3 operator+ (const Vector3 &pt) const
 Addition operator.
const Vector3operator+= (const Vector3 &pt)
 Addition operator.
Vector3 operator- (const Vector3 &pt) const
 Subtraction operators.
const Vector3operator-= (const Vector3 &pt)
 Subtraction operators.
const Vector3 operator/ (const Vector3 &pt) const
 Division operators.
const Vector3operator/= (const Vector3 &pt)
 Division operators.
const Vector3 operator/ (double v) const
 Division operators.
const Vector3operator/= (double v)
 Division operators.
const Vector3 operator* (const Vector3 &pt) const
 Multiplication operators.
const Vector3operator*= (const Vector3 &pt)
 Multiplication operators.
const Vector3 operator* (double v) const
 Multiplication operators.
const Vector3operator*= (double v)
 Multiplication operators.
bool operator== (const Vector3 &pt) const
 Equality operators.
bool operator!= (const Vector3 &pt) const
 Equality operators.
bool IsFinite () const
 See if a point is finite (e.g., not nan)
void Correct ()
 Corrects any nan values.
double operator[] (unsigned int index) const
 [] operator
void Round (int _precision)
 Round all values to _precision decimal places.
bool Equal (const Vector3 &_v) const
 Returns true if the two vectors are exacatly equal.

Static Public Member Functions

static Vector3 GetNormal (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3)
 Get a normal vector to a triangle.

Public Attributes

double x
 X location.
double y
 Y location.
double z
 Z location.

Friends

std::ostream & operator<< (std::ostream &out, const gazebo::math::Vector3 &pt)
 Ostream operator.
std::istream & operator>> (std::istream &in, gazebo::math::Vector3 &pt)
 Istream operator.

Detailed Description

Generic double x,y,z vector.


Member Function Documentation

double GetDistToPlane ( const Vector3 _dir,
const Vector3 _planeNormal,
double  _d 
) const

Get distance to a plane, given a direction.

Treats this vector as a ray


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const gazebo::math::Vector3 pt 
) [friend]

Ostream operator.

Parameters:
outOstream
ptVector3 to output
Returns:
The Ostream
std::istream& operator>> ( std::istream &  in,
gazebo::math::Vector3 pt 
) [friend]

Istream operator.

Parameters:
inOstream
ptVector3 to read values into
Returns:
The istream

The documentation for this class was generated from the following file: