sofa::defaulttype::SolidTypes< R >::SpatialVector Class Reference

A spatial vector. More...

#include <SolidTypes.h>

Collaboration diagram for sofa::defaulttype::SolidTypes< R >::SpatialVector:

Collaboration graph
[legend]

Public Member Functions

void clear ()
 SpatialVector ()
 SpatialVector (const Vec &l, const Vec &f)
SpatialVector & operator+= (const SpatialVector &v)
SpatialVector operator* (Real a) const
SpatialVector & operator*= (Real a)
SpatialVector operator+ (const SpatialVector &v) const
SpatialVector operator- (const SpatialVector &v) const
SpatialVector operator- () const
Real operator* (const SpatialVector &v) const
 Spatial dot product (cross terms).
SpatialVector cross (const SpatialVector &v) const
 Spatial cross product.
SpatialVector operator* (const Mat66 &) const
 product with a dense matrix
Vec & getLinearVelocity ()
 If the SpatialVector models a spatial velocity, then the linear velocity is the freeVec.
const Vec & getLinearVelocity () const
void setLinearVelocity (const Vec &v)
Vec & getAngularVelocity ()
 If the SpatialVector models a spatial velocity, then the angular velocity is the lineVec.
const Vec & getAngularVelocity () const
void setAngularVelocity (const Vec &v)
Vec & getTorque ()
 If the SpatialVector models a spatial force, then the torque is the freeVec.
const Vec & getTorque () const
void setTorque (const Vec &v)
Vec & getForce ()
 If the SpatialVector models a spatial force, then the torque is the lineVec.
const Vec & getForce () const
void setForce (const Vec &v)

Data Fields

Vec lineVec
Vec freeVec

Friends

std::ostream & operator<< (std::ostream &out, const SpatialVector &t)
 write to an output stream

Detailed Description

template<class R = float>
class sofa::defaulttype::SolidTypes< R >::SpatialVector

A spatial vector.

When representing a velocity, lineVec is the angular velocity and freeVec is the linear velocity. When representing a spatial force, lineVec is the force and freeVec is the torque.

Definition at line 75 of file SolidTypes.h.


Constructor & Destructor Documentation

template<class R >
sofa::defaulttype::SolidTypes< R >::SpatialVector::SpatialVector (  )  [inline]

template<class R >
sofa::defaulttype::SolidTypes< R >::SpatialVector::SpatialVector ( const Vec &  l,
const Vec &  f 
) [inline]

Parameters:
l The line vector: angular velocity, or force
f The free vector: linear velocity, or torque

Definition at line 58 of file SolidTypes.inl.


Member Function Documentation

template<class R >
void sofa::defaulttype::SolidTypes< R >::SpatialVector::clear (  )  [inline]

template<class R >
SolidTypes< R >::SpatialVector sofa::defaulttype::SolidTypes< R >::SpatialVector::cross ( const SpatialVector &  v  )  const [inline]

template<class R = float>
const Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getAngularVelocity (  )  const [inline]

template<class R = float>
Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getAngularVelocity (  )  [inline]

If the SpatialVector models a spatial velocity, then the angular velocity is the lineVec.

Otherwise, the SpatialVector models a spatial force, and this method returns a force.

Definition at line 134 of file SolidTypes.h.

References sofa::defaulttype::SolidTypes< R >::SpatialVector::lineVec.

Referenced by sofa::component::contextobject::CoordinateSystem::apply().

template<class R = float>
const Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getForce (  )  const [inline]

template<class R = float>
Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getForce (  )  [inline]

If the SpatialVector models a spatial force, then the torque is the lineVec.

Otherwise, the SpatialVector models a spatial velocity, and this method returns an angular velocity.

Definition at line 163 of file SolidTypes.h.

References sofa::defaulttype::SolidTypes< R >::SpatialVector::lineVec.

template<class R = float>
const Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getLinearVelocity (  )  const [inline]

template<class R = float>
Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getLinearVelocity (  )  [inline]

If the SpatialVector models a spatial velocity, then the linear velocity is the freeVec.

Otherwise, the SpatialVector models a spatial force, and this method returns a torque.

Definition at line 120 of file SolidTypes.h.

References sofa::defaulttype::SolidTypes< R >::SpatialVector::freeVec.

Referenced by sofa::component::contextobject::CoordinateSystem::apply().

template<class R = float>
const Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getTorque (  )  const [inline]

template<class R = float>
Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getTorque (  )  [inline]

If the SpatialVector models a spatial force, then the torque is the freeVec.

Otherwise, the SpatialVector models a spatial velocity, and this method returns a linear velocity.

Definition at line 149 of file SolidTypes.h.

References sofa::defaulttype::SolidTypes< R >::SpatialVector::freeVec.

template<class R >
SolidTypes< R >::SpatialVector sofa::defaulttype::SolidTypes< R >::SpatialVector::operator* ( const Mat66 &  m  )  const [inline]

template<class R >
SolidTypes< R >::Real sofa::defaulttype::SolidTypes< R >::SpatialVector::operator* ( const SpatialVector &  v  )  const [inline]

template<class R = float>
SpatialVector sofa::defaulttype::SolidTypes< R >::SpatialVector::operator* ( Real  a  )  const [inline]

template<class R = float>
SpatialVector& sofa::defaulttype::SolidTypes< R >::SpatialVector::operator*= ( Real  a  )  [inline]

template<class R >
SolidTypes< R >::SpatialVector sofa::defaulttype::SolidTypes< R >::SpatialVector::operator+ ( const SpatialVector &  v  )  const [inline]

template<class R >
SolidTypes< R >::SpatialVector & sofa::defaulttype::SolidTypes< R >::SpatialVector::operator+= ( const SpatialVector &  v  )  [inline]

template<class R >
SolidTypes< R >::SpatialVector sofa::defaulttype::SolidTypes< R >::SpatialVector::operator- (  )  const [inline]

template<class R >
SolidTypes< R >::SpatialVector sofa::defaulttype::SolidTypes< R >::SpatialVector::operator- ( const SpatialVector &  v  )  const [inline]

template<class R = float>
void sofa::defaulttype::SolidTypes< R >::SpatialVector::setAngularVelocity ( const Vec &  v  )  [inline]

template<class R = float>
void sofa::defaulttype::SolidTypes< R >::SpatialVector::setForce ( const Vec &  v  )  [inline]

template<class R = float>
void sofa::defaulttype::SolidTypes< R >::SpatialVector::setLinearVelocity ( const Vec &  v  )  [inline]

template<class R = float>
void sofa::defaulttype::SolidTypes< R >::SpatialVector::setTorque ( const Vec &  v  )  [inline]


Friends And Related Function Documentation

template<class R = float>
std::ostream& operator<< ( std::ostream &  out,
const SpatialVector &  t 
) [friend]

write to an output stream

Definition at line 113 of file SolidTypes.h.


Field Documentation

template<class R = float>
Vec sofa::defaulttype::SolidTypes< R >::SpatialVector::freeVec

template<class R = float>
Vec sofa::defaulttype::SolidTypes< R >::SpatialVector::lineVec


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

Generated on Sun Nov 23 04:23:54 2008 for Sofa by  doxygen 1.5.7.1