Public Member Functions | Protected Types | Protected Attributes

OpenTissue::mbd::Oscillation< mbd_types > Class Template Reference

#include <mbd_oscillation.h>

Inheritance diagram for OpenTissue::mbd::Oscillation< mbd_types >:
OpenTissue::mbd::ScriptedMotionInterface< mbd_types >

List of all members.

Public Member Functions

 Oscillation ()
virtual ~Oscillation ()
void compute (body_type const &body, real_type const &time, vector3_type &r, quaternion_type &q, vector3_type &v, vector3_type &w)
void set_origin (vector3_type const &origin)
void get_origin (vector3_type &origin) const
void set_direction (vector3_type const &dir)
void get_direction (vector3_type &dir) const
void set_frequency (real_type const &frequency)
real_type get_frequency () const
void set_phase (real_type const &phase)
real_type get_phase () const
void set_amplitude (real_type const &amplitude)
real_type get_amplitude () const

Protected Types

typedef mbd_types::body_type body_type
typedef mbd_types::math_policy math_policy
typedef math_policy::value_traits value_traits
typedef math_policy::real_type real_type
typedef math_policy::vector3_type vector3_type
typedef
math_policy::quaternion_type 
quaternion_type

Protected Attributes

vector3_type m_origin
 The origin. Default value is (0,0,0).
vector3_type m_dir
 The oscillation direction. Default value is (1,0,0).
real_type m_amplitude
 The amplitude of the oscillation. Default value is 10.
real_type m_frequency
 The frequency of the oscillation. Default value is 2 PI.
real_type m_phase
 The phase shift of the oscillation. Default value is PI.

Detailed Description

template<typename mbd_types>
class OpenTissue::mbd::Oscillation< mbd_types >

Oscillation Motion (callback) Class.

Example of usage:

types::Sphere sphere; types::body_type body; types::Oscillation oscillation; types::configuration_type configuration;

oscillation.set_frequency(value_traits::pi()/4.); body.set_scripted_motion(&oscillation); body.set_geometry(sphere); oscillation.set_origin(vector3_type(0,sphere.radius(),0)); configuration.add(&body);

Notice that you have to add both a geometry and a scripted motion to a scripted object.


Member Typedef Documentation

template<typename mbd_types >
typedef mbd_types::body_type OpenTissue::mbd::Oscillation< mbd_types >::body_type [protected]
template<typename mbd_types >
typedef mbd_types::math_policy OpenTissue::mbd::Oscillation< mbd_types >::math_policy [protected]
template<typename mbd_types >
typedef math_policy::quaternion_type OpenTissue::mbd::Oscillation< mbd_types >::quaternion_type [protected]
template<typename mbd_types >
typedef math_policy::real_type OpenTissue::mbd::Oscillation< mbd_types >::real_type [protected]
template<typename mbd_types >
typedef math_policy::value_traits OpenTissue::mbd::Oscillation< mbd_types >::value_traits [protected]
template<typename mbd_types >
typedef math_policy::vector3_type OpenTissue::mbd::Oscillation< mbd_types >::vector3_type [protected]

Constructor & Destructor Documentation

template<typename mbd_types >
OpenTissue::mbd::Oscillation< mbd_types >::Oscillation (  )  [inline]
template<typename mbd_types >
virtual OpenTissue::mbd::Oscillation< mbd_types >::~Oscillation (  )  [inline, virtual]

Member Function Documentation

template<typename mbd_types >
void OpenTissue::mbd::Oscillation< mbd_types >::compute ( body_type const &  body,
real_type const &  time,
vector3_type r,
quaternion_type q,
vector3_type v,
vector3_type w 
) [inline, virtual]

Compute State of Scripted body_type.

Parameters:
body A pointer to the rigid body where the scripted motion should be evaluated for.
time The time at which the scripted motion should be evaluated.
r Upon return this vector should contain the position of the center of mass.
q Upon return this argument should contain the orientation representated as a quaternion.
v Upon return this vector contains the value of the linear velocity of the center of mass.
w Upon return this vector contains the value of the angular velocity.

Implements OpenTissue::mbd::ScriptedMotionInterface< mbd_types >.

template<typename mbd_types >
real_type OpenTissue::mbd::Oscillation< mbd_types >::get_amplitude (  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::Oscillation< mbd_types >::get_direction ( vector3_type dir  )  const [inline]

Get Oscillation Direction.

Parameters:
dir Upon return this vector argument holds a unit vector giving the direction of the oscillation.
template<typename mbd_types >
real_type OpenTissue::mbd::Oscillation< mbd_types >::get_frequency (  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::Oscillation< mbd_types >::get_origin ( vector3_type origin  )  const [inline]

Get Origin.

Parameters:
origin Upon return this vector argument holds the value of the current origin.
template<typename mbd_types >
real_type OpenTissue::mbd::Oscillation< mbd_types >::get_phase (  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::Oscillation< mbd_types >::set_amplitude ( real_type const &  amplitude  )  [inline]
template<typename mbd_types >
void OpenTissue::mbd::Oscillation< mbd_types >::set_direction ( vector3_type const &  dir  )  [inline]

Set oscillation direction.

dir The new oscillation direction.

template<typename mbd_types >
void OpenTissue::mbd::Oscillation< mbd_types >::set_frequency ( real_type const &  frequency  )  [inline]
template<typename mbd_types >
void OpenTissue::mbd::Oscillation< mbd_types >::set_origin ( vector3_type const &  origin  )  [inline]

Set Origin.

origin The new origin.

template<typename mbd_types >
void OpenTissue::mbd::Oscillation< mbd_types >::set_phase ( real_type const &  phase  )  [inline]

Member Data Documentation

template<typename mbd_types >
real_type OpenTissue::mbd::Oscillation< mbd_types >::m_amplitude [protected]

The amplitude of the oscillation. Default value is 10.

template<typename mbd_types >
vector3_type OpenTissue::mbd::Oscillation< mbd_types >::m_dir [protected]

The oscillation direction. Default value is (1,0,0).

template<typename mbd_types >
real_type OpenTissue::mbd::Oscillation< mbd_types >::m_frequency [protected]

The frequency of the oscillation. Default value is 2 PI.

template<typename mbd_types >
vector3_type OpenTissue::mbd::Oscillation< mbd_types >::m_origin [protected]

The origin. Default value is (0,0,0).

template<typename mbd_types >
real_type OpenTissue::mbd::Oscillation< mbd_types >::m_phase [protected]

The phase shift of the oscillation. Default value is PI.


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