Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

base::Vector3 Class Reference

Collaboration diagram for base::Vector3:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Coords { X = 1, Y = 2, Z = 3, Coords3D = 4 }

Public Member Functions

 Vector3 ()
 Vector3 (Real xc, Real yc, Real zc)
 Vector3 (const Vector3 &v)
 Vector3 (const osg::Vec3 &v)
 ~Vector3 ()
void setZero () throw ()
bool isZero () const throw ()
bool equalsZero (Real eps=consts::epsilon)
Real & e (Int i) throw ()
const Real & e (Int i) const throw ()
Real & at (Int i) throw (std::out_of_range)
const Real & at (Int i) const throw (std::out_of_range)
Real & operator[] (Int i)
const Real & operator[] (Int i) const
Vector3 & operator= (const Vector3 &src) throw ()
bool operator== (const Vector3 &v) const throw ()
bool operator!= (const Vector3 &v) const throw ()
bool equals (const Vector3 &v, Real epsilon=consts::epsilon) const throw ()
Real norm () const throw ()
Real magnitude () const throw ()
Real length () const throw ()
Vector3 & negate () throw ()
Vector3 & normalize ()
Real magNormalize ()
Vector3 & cross (const Vector3 &p) throw ()
Vector3 & cross (const Vector3 &a, const Vector3 &b) throw ()
Real dot (const Vector3 &p) const throw ()
Vector3 & operator+= (const Vector3 &v2) throw ()
Vector3 & operator-= (const Vector3 &v2) throw ()
Vector3 & operator *= (const Real &s) throw ()
Vector3 & operator/= (const Real &s)
Int largestAxis () const
const Real * c_array () const
Real * c_array ()
osg::Vec3 toVec3 () const
void serialize (Serializer &s)
 read or write object state to Serializer


Static Public Member Functions

Vector3 min (const base::array< Vector3 > &vectors)
Vector3 max (const base::array< Vector3 > &vectors)
void minmax (const base::array< Vector3 > &vectors, Vector3 &minimum, Vector3 &maximum)

Public Attributes

Real x
Real y
Real z

Member Enumeration Documentation

enum base::Vector3::Coords
 

Enumeration values:
X 
Y 
Z 
Coords3D 

Definition at line 60 of file Vector3.


Constructor & Destructor Documentation

base::Vector3::Vector3 (   )  [inline]
 

Definition at line 52 of file Vector3.

References base::Real, and z.

Referenced by cross(), negate(), normalize(), operator *=(), operator+=(), operator-=(), operator/=(), and operator=().

base::Vector3::Vector3 (  Real  xc,
Real  yc,
Real  zc
)  [inline]
 

Definition at line 53 of file Vector3.

References base::Real, and z.

base::Vector3::Vector3 (  const Vector3 &  v  )  [inline]
 

Definition at line 54 of file Vector3.

References operator=().

base::Vector3::Vector3 (  const osg::Vec3 &  v  )  [inline]
 

Definition at line 56 of file Vector3.

References z.

base::Vector3::~Vector3 (   )  [inline]
 

Definition at line 58 of file Vector3.


Member Function Documentation

const Real& base::Vector3::at (  Int  i  )  const throw (std::out_of_range) [inline]
 

Definition at line 91 of file Vector3.

References Exception, base::Int, base::Real, and z.

Real& base::Vector3::at (  Int  i  )  throw (std::out_of_range) [inline]
 

Definition at line 83 of file Vector3.

References Exception, base::Int, base::Real, and z.

Real* base::Vector3::c_array (   )  [inline]
 

Definition at line 185 of file Vector3.

References base::Real.

const Real* base::Vector3::c_array (   )  const [inline]
 

Definition at line 184 of file Vector3.

References base::Real.

Vector3& base::Vector3::cross (  const Vector3 &  a,
const Vector3 &  b
)  throw () [inline]
 

Definition at line 158 of file Vector3.

References cross(), and Vector3().

Vector3& base::Vector3::cross (  const Vector3 &  p  )  throw () [inline]
 

Definition at line 155 of file Vector3.

References Vector3(), and z.

Referenced by cross().

Real base::Vector3::dot (  const Vector3 &  p  )  const throw () [inline]
 

Definition at line 161 of file Vector3.

References base::Real, and z.

Referenced by robot::TestRobot::PlatformControlInterface::getInput().

const Real& base::Vector3::e (  Int  i  )  const throw () [inline]
 

Definition at line 77 of file Vector3.

References Assertm, base::Int, base::Real, and z.

Real& base::Vector3::e (  Int  i  )  throw () [inline]
 

Definition at line 71 of file Vector3.

References Assertm, base::Int, base::Real, and z.

Referenced by base::Quat4::at(), base::Quat4::e(), and operator[]().

bool base::Vector3::equals (  const Vector3 &  v,
Real  epsilon = consts::epsilon
)  const throw () [inline]
 

Definition at line 129 of file Vector3.

References base::equals(), base::Real, and z.

Referenced by gfx::Line3::contains(), physics::OBBCollisionModel::Moment::equals(), gfx::Triangle3::equals(), gfx::Segment3::equals(), gfx::Line3::equals(), gfx::Disc3::equals(), and base::Quat4::equals().

bool base::Vector3::equalsZero (  Real  eps = consts::epsilon  )  [inline]
 

Definition at line 68 of file Vector3.

References base::equals(), base::Real, and z.

bool base::Vector3::isZero (   )  const throw () [inline]
 

Definition at line 65 of file Vector3.

References z.

Int base::Vector3::largestAxis (   )  const [inline]
 

Definition at line 177 of file Vector3.

References base::abs(), base::Int, base::Real, and z.

Referenced by physics::BoundingBox::longestAxis().

Real base::Vector3::length (   )  const throw () [inline]
 

Definition at line 143 of file Vector3.

References magnitude(), and base::Real.

Referenced by gfx::Line3::distanceTo(), magNormalize(), normalize(), and gfx::Plane::Plane().

Real base::Vector3::magnitude (   )  const throw () [inline]
 

Definition at line 140 of file Vector3.

References norm(), base::Real, and base::sqrt().

Referenced by length().

Real base::Vector3::magNormalize (   )  [inline]
 

Definition at line 152 of file Vector3.

References Assert, length(), base::Real, and z.

Vector3 base::Vector3::max (  const base::array< Vector3 > &  vectors  )  [static]
 

Vector3 base::Vector3::min (  const base::array< Vector3 > &  vectors  )  [static]
 

void base::Vector3::minmax (  const base::array< Vector3 > &  vectors,
Vector3 &  minimum,
Vector3 &  maximum
)  [static]
 

Vector3& base::Vector3::negate (   )  throw () [inline]
 

Definition at line 146 of file Vector3.

References Vector3(), and z.

Referenced by base::Quat4::conjugate(), and base::Quat4::negate().

Real base::Vector3::norm (   )  const throw () [inline]
 

Definition at line 137 of file Vector3.

References base::Real, and z.

Referenced by magnitude().

Vector3& base::Vector3::normalize (   )  [inline]
 

Definition at line 149 of file Vector3.

References Assert, length(), base::Real, Vector3(), and z.

Referenced by gfx::Disc3::Disc3(), robot::TestRobot::PlatformControlInterface::getInput(), gfx::Line3::Line3(), gfx::Triangle3::normal(), gfx::Line3::operator=(), gfx::Disc3::operator=(), and gfx::Plane::Plane().

Vector3& base::Vector3::operator *= (  const Real &  s  )  throw () [inline]
 

Definition at line 171 of file Vector3.

References base::Real, Vector3(), and z.

bool base::Vector3::operator!= (  const Vector3 &  v  )  const throw () [inline]
 

Definition at line 121 of file Vector3.

References z.

Vector3& base::Vector3::operator+= (  const Vector3 &  v2  )  throw () [inline]
 

Definition at line 165 of file Vector3.

References Vector3(), and z.

Vector3& base::Vector3::operator-= (  const Vector3 &  v2  )  throw () [inline]
 

Definition at line 168 of file Vector3.

References Vector3(), and z.

Vector3& base::Vector3::operator/= (  const Real &  s  )  [inline]
 

Definition at line 174 of file Vector3.

References base::Real, Vector3(), and z.

Vector3& base::Vector3::operator= (  const Vector3 &  src  )  throw () [inline]
 

Definition at line 105 of file Vector3.

References Vector3(), and z.

Referenced by Vector3().

bool base::Vector3::operator== (  const Vector3 &  v  )  const throw () [inline]
 

Definition at line 114 of file Vector3.

References z.

const Real& base::Vector3::operator[] (  Int  i  )  const [inline]
 

Definition at line 102 of file Vector3.

References e(), base::Int, and base::Real.

Real& base::Vector3::operator[] (  Int  i  )  [inline]
 

Definition at line 99 of file Vector3.

References e(), base::Int, and base::Real.

void base::Vector3::serialize (  Serializer &  s  ) 
 

read or write object state to Serializer

Referenced by base::Serializer::operator()().

void base::Vector3::setZero (   )  throw () [inline]
 

Definition at line 62 of file Vector3.

References base::Real, and z.

Referenced by base::Transform::getTranslation().

osg::Vec3 base::Vector3::toVec3 (   )  const [inline]
 

Definition at line 187 of file Vector3.

References z.


Member Data Documentation

Real base::Vector3::x
 

Definition at line 198 of file Vector3.

Referenced by base::Quat4::c_array(), base::Vector4::equals(), physics::Box::getBoundingSphere(), physics::PositionableOrientable::getPosition2D(), physics::BoundingBox::intersect(), base::Matrix4::Matrix4(), base::Quat4::norm(), base::operator<<(), base::Orient::operator=(), base::Vector4::operator==(), gfx::TriangleDesc::pointInTri(), physics::Polyhedron::Vertex::serialize(), base::Quat4::setIdentity(), robot::TestRobot::PlatformControlInterface::setOutput(), physics::OBBCollisionModel::OBB::size(), physics::BoundingBox::size(), gfx::TriangleDesc::TriangleDesc(), and base::Vector4::Vector4().

Real base::Vector3::y
 

Definition at line 198 of file Vector3.

Referenced by base::Vector4::equals(), physics::Box::getBoundingSphere(), physics::PositionableOrientable::getPosition2D(), physics::BoundingBox::intersect(), base::Matrix4::Matrix4(), base::Quat4::norm(), base::operator<<(), base::Orient::operator=(), base::Vector4::operator==(), gfx::TriangleDesc::pointInTri(), physics::Polyhedron::Vertex::serialize(), base::Quat4::setIdentity(), robot::TestRobot::PlatformControlInterface::setOutput(), physics::BoundingBox::size(), gfx::TriangleDesc::TriangleDesc(), and base::Vector4::Vector4().

Real base::Vector3::z
 

Definition at line 198 of file Vector3.

Referenced by at(), cross(), dot(), e(), base::Vector4::equals(), equals(), equalsZero(), physics::Box::getBoundingSphere(), robot::TestRobot::PlatformControlInterface::getInput(), physics::BoundingBox::intersect(), isZero(), largestAxis(), magNormalize(), base::Matrix4::Matrix4(), negate(), norm(), base::Quat4::norm(), normalize(), operator *=(), operator!=(), operator+=(), operator-=(), operator/=(), base::operator<<(), operator=(), base::Orient::operator=(), base::Vector4::operator==(), operator==(), gfx::TriangleDesc::pointInTri(), physics::Polyhedron::Vertex::serialize(), base::Quat4::setIdentity(), setZero(), physics::BoundingBox::size(), toVec3(), gfx::TriangleDesc::TriangleDesc(), Vector3(), and base::Vector4::Vector4().


The documentation for this class was generated from the following file:
Generated on Thu Jul 29 16:39:34 2004 for OpenSim by doxygen 1.3.6