SOFA API  59c939c2
Open source framework for multi-physics simuation
sofa::defaulttype::RigidDeriv< 3, real > Class Template Reference

#include <RigidTypes.h>

Detailed Description

template<typename real>
class sofa::defaulttype::RigidDeriv< 3, real >

Degrees of freedom of 3D rigid bodies. Orientations are modeled using quaternions.

Protected Attributes

Vec3 vCenter
 
Vec3 vOrientation
 

Public Member Functions

 RigidDeriv ()
 
 RigidDeriv (const Vec3 &velCenter, const Vec3 &velOrient)
 
template<typename real2 >
 RigidDeriv (const RigidDeriv< 3, real2 > &c)
 
template<typename real2 >
 RigidDeriv (const Vec< 6, real2 > &v)
 
template<typename real2 >
 RigidDeriv (const real2 *ptr)
 
void clear ()
 
template<typename real2 >
void operator= (const RigidDeriv< 3, real2 > &c)
 
template<typename real2 >
void operator= (const Vec< 3, real2 > &v)
 
template<typename real2 >
void operator= (const Vec< 6, real2 > &v)
 
void operator+= (const RigidDeriv &a)
 
void operator-= (const RigidDeriv &a)
 
RigidDeriv< 3, real > operator+ (const RigidDeriv< 3, real > &a) const
 
template<typename real2 >
void operator*= (real2 a)
 
template<typename real2 >
void operator/= (real2 a)
 
RigidDeriv< 3, real > operator- () const
 
RigidDeriv< 3, real > operator- (const RigidDeriv< 3, real > &a) const
 
Real operator* (const RigidDeriv< 3, real > &a) const
 dot product, mostly used to compute residuals as sqrt(x*x) More...
 
real norm () const
 Euclidean norm. More...
 
Vec3getVCenter ()
 
Vec3getVOrientation ()
 
const Vec3getVCenter () const
 
const Vec3getVOrientation () const
 
Vec3getLinear ()
 
const Vec3getLinear () const
 
Vec3getAngular ()
 
const Vec3getAngular () const
 
VecAll getVAll () const
 
Vec3 velocityAtRotatedPoint (const Vec3 &p) const
 Velocity at point p, where p is the offset from the origin of the frame, given in the same coordinate system as the velocity of the origin. More...
 
real * ptr ()
 
const real * ptr () const
 
real & operator[] (int i)
 Access to i-th element. More...
 
const real & operator[] (int i) const
 Const access to i-th element. More...
 
Tests operators
bool operator== (const RigidDeriv< 3, real > &b) const
 
bool operator!= (const RigidDeriv< 3, real > &b) const
 

Static Public Member Functions

static unsigned int size ()
 

Friends

class RigidCoord< 3, real >
 
std::ostream & operator<< (std::ostream &out, const RigidDeriv< 3, real > &v)
 write to an output stream More...
 
std::istream & operator>> (std::istream &in, RigidDeriv< 3, real > &v)
 read from an input stream More...
 

Attribute details

template<typename real >
Vec3 sofa::defaulttype::RigidDeriv< 3, real >::vCenter
protected
template<typename real >
Vec3 sofa::defaulttype::RigidDeriv< 3, real >::vOrientation
protected

Constructor details

template<typename real >
sofa::defaulttype::RigidDeriv< 3, real >::RigidDeriv ( )
inline
template<typename real >
sofa::defaulttype::RigidDeriv< 3, real >::RigidDeriv ( const Vec3 velCenter,
const Vec3 velOrient 
)
inline
template<typename real >
template<typename real2 >
sofa::defaulttype::RigidDeriv< 3, real >::RigidDeriv ( const RigidDeriv< 3, real2 > &  c)
inline
template<typename real >
template<typename real2 >
sofa::defaulttype::RigidDeriv< 3, real >::RigidDeriv ( const Vec< 6, real2 > &  v)
inline
template<typename real >
template<typename real2 >
sofa::defaulttype::RigidDeriv< 3, real >::RigidDeriv ( const real2 *  ptr)
inline

Function details

template<typename real >
void sofa::defaulttype::RigidDeriv< 3, real >::clear ( )
inline
template<typename real >
Vec3& sofa::defaulttype::RigidDeriv< 3, real >::getAngular ( )
inline
template<typename real >
const Vec3& sofa::defaulttype::RigidDeriv< 3, real >::getAngular ( ) const
inline
template<typename real >
Vec3& sofa::defaulttype::RigidDeriv< 3, real >::getLinear ( )
inline
template<typename real >
const Vec3& sofa::defaulttype::RigidDeriv< 3, real >::getLinear ( ) const
inline
template<typename real >
VecAll sofa::defaulttype::RigidDeriv< 3, real >::getVAll ( ) const
inline
template<typename real >
Vec3& sofa::defaulttype::RigidDeriv< 3, real >::getVCenter ( )
inline
template<typename real >
const Vec3& sofa::defaulttype::RigidDeriv< 3, real >::getVCenter ( ) const
inline
template<typename real >
Vec3& sofa::defaulttype::RigidDeriv< 3, real >::getVOrientation ( )
inline
template<typename real >
const Vec3& sofa::defaulttype::RigidDeriv< 3, real >::getVOrientation ( ) const
inline
template<typename real >
real sofa::defaulttype::RigidDeriv< 3, real >::norm ( ) const
inline

Euclidean norm.

template<typename real >
bool sofa::defaulttype::RigidDeriv< 3, real >::operator!= ( const RigidDeriv< 3, real > &  b) const
inline
template<typename real >
Real sofa::defaulttype::RigidDeriv< 3, real >::operator* ( const RigidDeriv< 3, real > &  a) const
inline

dot product, mostly used to compute residuals as sqrt(x*x)

template<typename real >
template<typename real2 >
void sofa::defaulttype::RigidDeriv< 3, real >::operator*= ( real2  a)
inline
template<typename real >
RigidDeriv<3,real> sofa::defaulttype::RigidDeriv< 3, real >::operator+ ( const RigidDeriv< 3, real > &  a) const
inline
template<typename real >
void sofa::defaulttype::RigidDeriv< 3, real >::operator+= ( const RigidDeriv< 3, real > &  a)
inline
template<typename real >
RigidDeriv<3,real> sofa::defaulttype::RigidDeriv< 3, real >::operator- ( ) const
inline
template<typename real >
RigidDeriv<3,real> sofa::defaulttype::RigidDeriv< 3, real >::operator- ( const RigidDeriv< 3, real > &  a) const
inline
template<typename real >
void sofa::defaulttype::RigidDeriv< 3, real >::operator-= ( const RigidDeriv< 3, real > &  a)
inline
template<typename real >
template<typename real2 >
void sofa::defaulttype::RigidDeriv< 3, real >::operator/= ( real2  a)
inline
template<typename real >
template<typename real2 >
void sofa::defaulttype::RigidDeriv< 3, real >::operator= ( const RigidDeriv< 3, real2 > &  c)
inline
template<typename real >
template<typename real2 >
void sofa::defaulttype::RigidDeriv< 3, real >::operator= ( const Vec< 3, real2 > &  v)
inline
template<typename real >
template<typename real2 >
void sofa::defaulttype::RigidDeriv< 3, real >::operator= ( const Vec< 6, real2 > &  v)
inline
template<typename real >
bool sofa::defaulttype::RigidDeriv< 3, real >::operator== ( const RigidDeriv< 3, real > &  b) const
inline
template<typename real >
real& sofa::defaulttype::RigidDeriv< 3, real >::operator[] ( int  i)
inline

Access to i-th element.

template<typename real >
const real& sofa::defaulttype::RigidDeriv< 3, real >::operator[] ( int  i) const
inline

Const access to i-th element.

template<typename real >
real* sofa::defaulttype::RigidDeriv< 3, real >::ptr ( )
inline
template<typename real >
const real* sofa::defaulttype::RigidDeriv< 3, real >::ptr ( ) const
inline
template<typename real >
static unsigned int sofa::defaulttype::RigidDeriv< 3, real >::size ( void  )
inlinestatic
template<typename real >
Vec3 sofa::defaulttype::RigidDeriv< 3, real >::velocityAtRotatedPoint ( const Vec3 p) const
inline

Velocity at point p, where p is the offset from the origin of the frame, given in the same coordinate system as the velocity of the origin.

Enum details

template<typename real >
anonymous enum

Compile-time constant specifying the number of scalars within this vector (equivalent to the size() method)

Enumerator
total_size 
template<typename real >
anonymous enum

Compile-time constant specifying the number of dimensions of space (NOT equivalent to total_size for rigids)

Enumerator
spatial_dimensions 

Related details

template<typename real >
std::ostream& operator<< ( std::ostream &  out,
const RigidDeriv< 3, real > &  v 
)
friend

write to an output stream

template<typename real >
std::istream& operator>> ( std::istream &  in,
RigidDeriv< 3, real > &  v 
)
friend

read from an input stream

template<typename real >
friend class RigidCoord< 3, real >
friend