67 public:
Vector3(
const double &_x,
const double &_y,
const double &_z);
78 public:
double GetSum()
const;
83 public:
double Distance(
const Vector3 &_pt)
const;
90 public:
double Distance(
double _x,
double _y,
double _z)
const;
94 public:
double GetLength()
const;
98 public:
double GetSquaredLength()
const;
110 public:
Vector3 GetRounded()
const;
116 public:
inline void Set(
double _x = 0,
double _y = 0 ,
double _z = 0)
129 public:
double Dot(
const Vector3 &_pt)
const;
133 public:
Vector3 GetAbs()
const;
137 public:
Vector3 GetPerpendicular()
const;
151 public:
double GetDistToLine(
const Vector3 &_pt1,
const Vector3 &_pt2);
156 public:
void SetToMax(
const Vector3 &_v);
161 public:
void SetToMin(
const Vector3 &_v);
165 public:
double GetMax()
const;
169 public:
double GetMin()
const;
179 public:
Vector3 &operator =(
double _value);
194 return Vector3(-this->x, -this->y, -this->z);
226 public:
const Vector3 operator/(
double _v)
const;
231 public:
const Vector3 &operator/=(
double _v);
250 {
return Vector3(_v.
x * _s, _v.
y * _s, _v.
z * _s); }
255 public:
Vector3 operator*(
double _v)
const;
260 public:
const Vector3 &operator*=(
double _v);
266 public:
bool operator ==(
const Vector3 &_pt)
const;
272 public:
bool operator!=(
const Vector3 &_v)
const;
275 public:
bool IsFinite()
const;
280 if (!std::isfinite(this->x))
282 if (!std::isfinite(this->y))
284 if (!std::isfinite(this->z))
289 public:
double operator[](
unsigned int index)
const;
293 public:
void Round(
int _precision);
299 public:
bool Equal(
const Vector3 &_v)
const;
330 _in.setf(std::ios_base::skipws);
331 _in >> _pt.
x >> _pt.
y >> _pt.
z;
static const Vector3 UnitZ
math::Vector3(0, 0, 1)
Definition: Vector3.hh:58
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
friend std::istream & operator>>(std::istream &_in, gazebo::math::Vector3 &_pt)
Stream extraction operator.
Definition: Vector3.hh:326
double x
X location.
Definition: Vector3.hh:302
double z
Z location.
Definition: Vector3.hh:308
Vector3 operator-() const
Negation operator.
Definition: Vector3.hh:192
void Correct()
Corrects any nan values.
Definition: Vector3.hh:278
friend std::ostream & operator<<(std::ostream &_out, const gazebo::math::Vector3 &_pt)
Stream insertion operator.
Definition: Vector3.hh:314
static const Vector3 One
math::Vector3(1, 1, 1)
Definition: Vector3.hh:49
static const Vector3 UnitX
math::Vector3(1, 0, 0)
Definition: Vector3.hh:52
void Set(double _x=0, double _y=0, double _z=0)
Set the contents of the vector.
Definition: Vector3.hh:116
Vector3 operator-(const Vector3 &_pt) const
Subtraction operators.
Definition: Vector3.hh:200
static const Vector3 UnitY
math::Vector3(0, 1, 0)
Definition: Vector3.hh:55
static const Vector3 Zero
math::Vector3(0, 0, 0)
Definition: Vector3.hh:46
T precision(const T &_a, const unsigned int &_precision)
get value at a specified precision
Definition: Helpers.hh:179
friend Vector3 operator*(double _s, const Vector3 &_v)
Multiplication operators.
Definition: Vector3.hh:248
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
double y
Y location.
Definition: Vector3.hh:305