SOFA API  014b24ea
Open source framework for multi-physics simuation
sofa::defaulttype::SolidTypes< R >::SpatialVector Class Reference

#include <SolidTypes.h>

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

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.

Public Attributes

Vec lineVec
 
Vec freeVec
 

Public Member Functions

void clear ()
 
 SpatialVector ()
 
 SpatialVector (const Vec &l, const Vec &f)
 
SpatialVectoroperator+= (const SpatialVector &v)
 
SpatialVector operator* (Real a) const
 
SpatialVectoroperator*= (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) More...
 
SpatialVector cross (const SpatialVector &v) const
 Spatial cross product. More...
 
SpatialVector operator* (const Mat66 &) const
 product with a dense matrix More...
 
VecgetLinearVelocity ()
 
const VecgetLinearVelocity () const
 
void setLinearVelocity (const Vec &v)
 
VecgetAngularVelocity ()
 
const VecgetAngularVelocity () const
 
void setAngularVelocity (const Vec &v)
 
VecgetTorque ()
 
const VecgetTorque () const
 
void setTorque (const Vec &v)
 
VecgetForce ()
 
const VecgetForce () const
 
void setForce (const Vec &v)
 

Friends

std::ostream & operator<< (std::ostream &out, const SpatialVector &t)
 write to an output stream More...
 
std::istream & operator>> (std::istream &in, SpatialVector &t)
 read from an input stream More...
 

Attribute details

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

Constructor details

template<class R >
sofa::defaulttype::SolidTypes< R >::SpatialVector::SpatialVector ( )
template<class R >
sofa::defaulttype::SolidTypes< R >::SpatialVector::SpatialVector ( const Vec l,
const Vec f 
)
Parameters
lThe line vector: angular velocity, or force
fThe free vector: linear velocity, or torque

Function details

template<class R >
void sofa::defaulttype::SolidTypes< R >::SpatialVector::clear ( )
template<class R >
SolidTypes< R >::SpatialVector sofa::defaulttype::SolidTypes< R >::SpatialVector::cross ( const SpatialVector v) const

Spatial cross product.

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.

template<class R = float>
const Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getAngularVelocity ( ) 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.

template<class R = float>
const Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getForce ( ) 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.

template<class R = float>
const Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getLinearVelocity ( ) 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.

template<class R = float>
const Vec& sofa::defaulttype::SolidTypes< R >::SpatialVector::getTorque ( ) const
inline
template<class R = float>
SpatialVector sofa::defaulttype::SolidTypes< R >::SpatialVector::operator* ( Real  a) const
inline
template<class R >
SolidTypes< R >::Real sofa::defaulttype::SolidTypes< R >::SpatialVector::operator* ( const SpatialVector v) const

Spatial dot product (cross terms)

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

product with a dense matrix

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
template<class R >
SolidTypes< R >::SpatialVector & sofa::defaulttype::SolidTypes< R >::SpatialVector::operator+= ( const SpatialVector v)
template<class R >
SolidTypes< R >::SpatialVector sofa::defaulttype::SolidTypes< R >::SpatialVector::operator- ( const SpatialVector v) const
template<class R >
SolidTypes< R >::SpatialVector sofa::defaulttype::SolidTypes< R >::SpatialVector::operator- ( ) const
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

Related details

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

write to an output stream

template<class R = float>
std::istream& operator>> ( std::istream &  in,
SpatialVector t 
)
friend

read from an input stream