octomap 1.5.0
octomath::Vector3 Class Reference

This class represents a three-dimensional vector. More...

Public Member Functions

double angleTo (const Vector3 &other) const
Vector3 cross (const Vector3 &other) const
 Three-dimensional vector (cross) product.
 DEPRECATED (inline Vector3 unit() const )
 DEPRECATED (double norm2() const )
double distance (const Vector3 &other) const
double distanceXY (const Vector3 &other) const
double dot (const Vector3 &other) const
double norm () const
Vector3normalize ()
Vector3 normalized () const
float & operator() (unsigned int i)
const float & operator() (unsigned int i) const
Vector3 operator* (float x) const
void operator*= (float x)
Vector3 operator+ (const Vector3 &other) const
void operator+= (const Vector3 &other)
Vector3 operator- () const
Vector3 operator- (const Vector3 &other) const
void operator-= (const Vector3 &other)
void operator/= (float x)
Vector3operator= (const Vector3 &other)
 Assignment operator.
bool operator== (const Vector3 &other) const
float & pitch ()
const float & pitch () const
std::istream & read (std::istream &s)
std::istream & readBinary (std::istream &s)
const float & roll () const
float & roll ()
Vector3rotate_IP (double roll, double pitch, double yaw)
 Vector3 ()
 Default constructor.
 Vector3 (float x, float y, float z)
 Constructor.
 Vector3 (const Vector3 &other)
 Copy constructor.
std::ostream & write (std::ostream &s) const
std::ostream & writeBinary (std::ostream &s) const
const float & x () const
float & x ()
float & y ()
const float & y () const
float & yaw ()
const float & yaw () const
const float & z () const
float & z ()

Protected Attributes

float data [3]

Detailed Description

This class represents a three-dimensional vector.

The three-dimensional vector can be used to represent a translation in three-dimensional space or to represent the attitude of an object using Euler angle.


Constructor & Destructor Documentation

octomath::Vector3::Vector3 ( ) [inline]

Default constructor.

References data.

Referenced by cross().

octomath::Vector3::Vector3 ( const Vector3 other) [inline]

Copy constructor.

Parameters:
othera vector of dimension 3

References data.

octomath::Vector3::Vector3 ( float  x,
float  y,
float  z 
) [inline]

Constructor.

Constructs a three-dimensional vector from three single values x, y, z or roll, pitch, yaw

References data, x(), y(), and z().


Member Function Documentation

double octomath::Vector3::angleTo ( const Vector3 other) const [inline]

References dot(), and norm().

Vector3 octomath::Vector3::cross ( const Vector3 other) const [inline]

Three-dimensional vector (cross) product.

Calculates the tree-dimensional cross product, which represents the vector orthogonal to the plane defined by this and other.

Returns:
this x other

References Vector3(), x(), y(), and z().

octomath::Vector3::DEPRECATED ( double norm2()  const) [inline]

References norm().

octomath::Vector3::DEPRECATED ( inline Vector3 unit()  const) [inline]

References normalized().

double octomath::Vector3::distance ( const Vector3 other) const [inline]

References x(), y(), and z().

Referenced by octomap::MapCollection< MAPNODE >::castRay().

double octomath::Vector3::distanceXY ( const Vector3 other) const [inline]

References x(), and y().

double octomath::Vector3::dot ( const Vector3 other) const [inline]

References x(), y(), and z().

Referenced by angleTo().

double octomath::Vector3::norm ( ) const [inline]
Vector3& octomath::Vector3::normalize ( ) [inline]

References norm().

Referenced by normalized().

Vector3 octomath::Vector3::normalized ( ) const [inline]
const float& octomath::Vector3::operator() ( unsigned int  i) const [inline]

References data.

Referenced by norm(), pitch(), readBinary(), roll(), writeBinary(), x(), y(), yaw(), and z().

float& octomath::Vector3::operator() ( unsigned int  i) [inline]

References data.

Vector3 octomath::Vector3::operator* ( float  x) const [inline]

References x().

void octomath::Vector3::operator*= ( float  x) [inline]

References data, and x().

Vector3 octomath::Vector3::operator+ ( const Vector3 other) const [inline]
void octomath::Vector3::operator+= ( const Vector3 other) [inline]

References data.

Vector3 octomath::Vector3::operator- ( ) const [inline]

References data.

Vector3 octomath::Vector3::operator- ( const Vector3 other) const [inline]
void octomath::Vector3::operator-= ( const Vector3 other) [inline]

References data.

void octomath::Vector3::operator/= ( float  x) [inline]

References data, and x().

Vector3& octomath::Vector3::operator= ( const Vector3 other) [inline]

Assignment operator.

Parameters:
othera vector of dimension 3

References data.

bool octomath::Vector3::operator== ( const Vector3 other) const [inline]
const float& octomath::Vector3::pitch ( ) const [inline]

References operator()().

float& octomath::Vector3::pitch ( ) [inline]
std::istream & octomath::Vector3::read ( std::istream &  s)
std::istream & octomath::Vector3::readBinary ( std::istream &  s)
float& octomath::Vector3::roll ( ) [inline]
const float& octomath::Vector3::roll ( ) const [inline]

References operator()().

Vector3 & octomath::Vector3::rotate_IP ( double  roll,
double  pitch,
double  yaw 
)

References x(), y(), and z().

Referenced by generateSphereTree(), and main().

std::ostream & octomath::Vector3::write ( std::ostream &  s) const

Referenced by octomath::Pose6D::write().

std::ostream & octomath::Vector3::writeBinary ( std::ostream &  s) const

References operator()().

Referenced by octomath::Pose6D::writeBinary().

const float& octomath::Vector3::x ( ) const [inline]

References operator()().

const float& octomath::Vector3::y ( ) const [inline]

References operator()().

const float& octomath::Vector3::yaw ( ) const [inline]

References operator()().

float& octomath::Vector3::yaw ( ) [inline]
const float& octomath::Vector3::z ( ) const [inline]

References operator()().


Field Documentation


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