#include <mbd_oscillation.h>
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 &litude) |
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. |
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.
typedef mbd_types::body_type OpenTissue::mbd::Oscillation< mbd_types >::body_type [protected] |
Reimplemented from OpenTissue::mbd::ScriptedMotionInterface< mbd_types >.
typedef mbd_types::math_policy OpenTissue::mbd::Oscillation< mbd_types >::math_policy [protected] |
typedef math_policy::quaternion_type OpenTissue::mbd::Oscillation< mbd_types >::quaternion_type [protected] |
Reimplemented from OpenTissue::mbd::ScriptedMotionInterface< mbd_types >.
typedef math_policy::real_type OpenTissue::mbd::Oscillation< mbd_types >::real_type [protected] |
Reimplemented from OpenTissue::mbd::ScriptedMotionInterface< mbd_types >.
typedef math_policy::value_traits OpenTissue::mbd::Oscillation< mbd_types >::value_traits [protected] |
typedef math_policy::vector3_type OpenTissue::mbd::Oscillation< mbd_types >::vector3_type [protected] |
Reimplemented from OpenTissue::mbd::ScriptedMotionInterface< mbd_types >.
OpenTissue::mbd::Oscillation< mbd_types >::Oscillation | ( | ) | [inline] |
virtual OpenTissue::mbd::Oscillation< mbd_types >::~Oscillation | ( | ) | [inline, virtual] |
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.
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 >.
real_type OpenTissue::mbd::Oscillation< mbd_types >::get_amplitude | ( | ) | const [inline] |
void OpenTissue::mbd::Oscillation< mbd_types >::get_direction | ( | vector3_type & | dir | ) | const [inline] |
Get Oscillation Direction.
dir | Upon return this vector argument holds a unit vector giving the direction of the oscillation. |
real_type OpenTissue::mbd::Oscillation< mbd_types >::get_frequency | ( | ) | const [inline] |
void OpenTissue::mbd::Oscillation< mbd_types >::get_origin | ( | vector3_type & | origin | ) | const [inline] |
Get Origin.
origin | Upon return this vector argument holds the value of the current origin. |
real_type OpenTissue::mbd::Oscillation< mbd_types >::get_phase | ( | ) | const [inline] |
void OpenTissue::mbd::Oscillation< mbd_types >::set_amplitude | ( | real_type const & | amplitude | ) | [inline] |
void OpenTissue::mbd::Oscillation< mbd_types >::set_direction | ( | vector3_type const & | dir | ) | [inline] |
Set oscillation direction.
dir The new oscillation direction.
void OpenTissue::mbd::Oscillation< mbd_types >::set_frequency | ( | real_type const & | frequency | ) | [inline] |
void OpenTissue::mbd::Oscillation< mbd_types >::set_origin | ( | vector3_type const & | origin | ) | [inline] |
Set Origin.
origin The new origin.
void OpenTissue::mbd::Oscillation< mbd_types >::set_phase | ( | real_type const & | phase | ) | [inline] |
real_type OpenTissue::mbd::Oscillation< mbd_types >::m_amplitude [protected] |
The amplitude of the oscillation. Default value is 10.
vector3_type OpenTissue::mbd::Oscillation< mbd_types >::m_dir [protected] |
The oscillation direction. Default value is (1,0,0).
real_type OpenTissue::mbd::Oscillation< mbd_types >::m_frequency [protected] |
The frequency of the oscillation. Default value is 2 PI.
vector3_type OpenTissue::mbd::Oscillation< mbd_types >::m_origin [protected] |
The origin. Default value is (0,0,0).
real_type OpenTissue::mbd::Oscillation< mbd_types >::m_phase [protected] |
The phase shift of the oscillation. Default value is PI.