#include <mbd_body.h>
Public Types | |
typedef mbd_types::math_policy | math_policy |
typedef mbd_types::math_policy::real_type | real_type |
typedef mbd_types::math_policy::vector3_type | vector3_type |
typedef mbd_types::math_policy::matrix3x3_type | matrix3x3_type |
typedef mbd_types::math_policy::quaternion_type | quaternion_type |
typedef mbd_types::math_policy::size_type | size_type |
typedef mbd_types::math_policy::value_traits | value_traits |
typedef mbd_types::node_traits | node_traits |
typedef mbd_types::indirect_joint_iterator | indirect_joint_iterator |
typedef mbd_types::const_indirect_joint_iterator | const_indirect_joint_iterator |
typedef mbd_types::indirect_edge_iterator | indirect_edge_iterator |
typedef mbd_types::indirect_force_iterator | indirect_force_iterator |
typedef mbd_types::const_indirect_force_iterator | const_indirect_force_iterator |
Public Member Functions | |
indirect_joint_iterator | joint_begin () |
indirect_joint_iterator | joint_end () |
const_indirect_joint_iterator | joint_begin () const |
const_indirect_joint_iterator | joint_end () const |
indirect_edge_iterator | edge_begin () |
indirect_edge_iterator | edge_end () |
indirect_force_iterator | force_begin () |
indirect_force_iterator | force_end () |
const_indirect_force_iterator | force_begin () const |
const_indirect_force_iterator | force_end () const |
Body () | |
~Body () | |
Body (Body const &body) | |
void | clear () |
void | compute_forces_and_torques (vector3_type &F, vector3_type &T) const |
void | attach (force_type *force) |
void | detach (force_type *force) |
void | set_position (vector3_type const &r) |
void | set_orientation (quaternion_type const &Q) |
void | set_velocity (vector3_type const &V) |
void | set_spin (vector3_type const &W) |
void | set_mass (real_type const &mass) |
void | set_inertia_bf (matrix3x3_type const &I_BF) |
void | get_position (vector3_type &r) const |
void | get_orientation (quaternion_type &Q) const |
void | get_orientation (matrix3x3_type &R) const |
void | get_velocity (vector3_type &V) const |
void | get_spin (vector3_type &W) const |
real_type | get_inverse_mass () const |
real_type | get_mass () const |
void | get_inverse_inertia_bf (matrix3x3_type &invI_BF) const |
void | get_inverse_inertia_wcs (matrix3x3_type &invI_WCS) const |
void | get_inertia_wcs (matrix3x3_type &I_WCS) const |
bool | is_active () const |
void | set_active (bool const &active) |
bool | is_sleepy () const |
void | set_sleepy (bool const &sleepy) |
void | set_material_idx (size_type const &idx) |
size_type | get_material_idx () const |
bool | has_finite_rotation_update () const |
void | set_finite_rotation_update (bool const &active) |
bool | has_finite_rotation_axis () const |
void | get_finite_rotation_axis (vector3_type &r_axis) const |
void | set_finite_rotation_axis (vector3_type const &r_axis) |
bool | is_scripted () const |
void | set_scripted_motion (scripted_motion_type *motion) |
void | compute_scripted_motion (real_type const &time) |
bool | is_fixed () const |
void | set_fixed (bool const &fixed) |
real_type | compute_kinetic_energy () const |
bool | has_joints () const |
bool | has_active_joints () const |
bool | has_joint_to (body_type const *body) const |
void | set_geometry (geometry_type *geometry) |
geometry_type * | get_geometry () const |
void | compute_collision_aabb (vector3_type const &r, matrix3x3_type const &R, vector3_type &min_coord, vector3_type &max_coord, real_type const &envelope) const |
Public Attributes | |
joint_ptr_container | m_joints |
A list containing pointers to all joints this body is part of. | |
edge_ptr_container | m_edges |
A list containing pointers to all incident edges to this body. That is all body pairs this body is part of. | |
size_type | m_tag |
Tag, can be used for anything, for instance traversing bodies... | |
Protected Types | |
typedef mbd_types::geometry_type | geometry_type |
typedef mbd_types::body_type | body_type |
typedef mbd_types::joint_type | joint_type |
typedef mbd_types::edge_type | edge_type |
typedef mbd_types::force_type | force_type |
typedef mbd_types::scripted_motion_type | scripted_motion_type |
typedef mbd_types::joint_ptr_container | joint_ptr_container |
typedef mbd_types::edge_ptr_container | edge_ptr_container |
typedef mbd_types::force_ptr_container | force_ptr_container |
typedef edge_ptr_container::iterator | edge_ptr_iterator |
typedef edge_ptr_container::const_iterator | const_edge_ptr_iterator |
typedef joint_ptr_container::iterator | joint_ptr_iterator |
typedef joint_ptr_container::const_iterator | const_joint_ptr_iterator |
Protected Attributes | |
force_ptr_container | m_forces |
A list of pointers to all external forces influencing the rigid body. | |
scripted_motion_type * | m_scripted_motion |
A pointer to a scripted motion, if set this body is automatically scripted if null the body is either fixed or free moving. | |
size_type | m_material_idx |
Unique index identifying the material properties of the node. | |
bool | m_active |
bool | m_sleepy |
Boolean flag indicating wheter the body is sleepy or not. | |
bool | m_fixed |
Boolean flag indicating if the body is fixed or not. | |
bool | m_scripted |
Boolean flag indicating if the body is scripted or not. | |
bool | m_finite_rotation_update |
Finite rotation update flag. To be used during position update. | |
vector3_type | m_r_axis |
Finite rotation axis, can be used during position update. | |
vector3_type | m_r |
The current position of the node in WCS. | |
quaternion_type | m_Q |
The current orientation of the node in WCS. | |
vector3_type | m_P |
Linear momentum on CM in WCS. | |
vector3_type | m_L |
Angular momentum wrt. CM in WCS. | |
vector3_type | m_V |
Linear velocity of CM in WCS . | |
vector3_type | m_W |
Angular velocity around CM in WCS . | |
matrix3x3_type | m_invI_WCS |
Inverse Inertia tensor wrt CM in WCS. | |
matrix3x3_type | m_invI_BF |
Inverse Inertia tensor wrt CM in BF. | |
matrix3x3_type | m_I_WCS |
Inertia tensor wrt CM in WCS. | |
matrix3x3_type | m_I_BF |
Inertia tensor wrt CM in BF. | |
real_type | m_inv_mass |
Inverse mass. | |
real_type | m_mass |
mass. | |
matrix3x3_type | m_R |
Orientation of BF in WCS (as a Matrix). | |
geometry_type * | m_geometry |
The geometry of the rigid body. |
typedef mbd_types::body_type OpenTissue::mbd::Body< mbd_types >::body_type [protected] |
typedef edge_ptr_container::const_iterator OpenTissue::mbd::Body< mbd_types >::const_edge_ptr_iterator [protected] |
typedef mbd_types::const_indirect_force_iterator OpenTissue::mbd::Body< mbd_types >::const_indirect_force_iterator |
typedef mbd_types::const_indirect_joint_iterator OpenTissue::mbd::Body< mbd_types >::const_indirect_joint_iterator |
typedef joint_ptr_container::const_iterator OpenTissue::mbd::Body< mbd_types >::const_joint_ptr_iterator [protected] |
typedef mbd_types::edge_ptr_container OpenTissue::mbd::Body< mbd_types >::edge_ptr_container [protected] |
typedef edge_ptr_container::iterator OpenTissue::mbd::Body< mbd_types >::edge_ptr_iterator [protected] |
typedef mbd_types::edge_type OpenTissue::mbd::Body< mbd_types >::edge_type [protected] |
typedef mbd_types::force_ptr_container OpenTissue::mbd::Body< mbd_types >::force_ptr_container [protected] |
typedef mbd_types::force_type OpenTissue::mbd::Body< mbd_types >::force_type [protected] |
typedef mbd_types::geometry_type OpenTissue::mbd::Body< mbd_types >::geometry_type [protected] |
typedef mbd_types::indirect_edge_iterator OpenTissue::mbd::Body< mbd_types >::indirect_edge_iterator |
typedef mbd_types::indirect_force_iterator OpenTissue::mbd::Body< mbd_types >::indirect_force_iterator |
typedef mbd_types::indirect_joint_iterator OpenTissue::mbd::Body< mbd_types >::indirect_joint_iterator |
typedef mbd_types::joint_ptr_container OpenTissue::mbd::Body< mbd_types >::joint_ptr_container [protected] |
typedef joint_ptr_container::iterator OpenTissue::mbd::Body< mbd_types >::joint_ptr_iterator [protected] |
typedef mbd_types::joint_type OpenTissue::mbd::Body< mbd_types >::joint_type [protected] |
typedef mbd_types::math_policy OpenTissue::mbd::Body< mbd_types >::math_policy |
typedef mbd_types::math_policy::matrix3x3_type OpenTissue::mbd::Body< mbd_types >::matrix3x3_type |
typedef mbd_types::node_traits OpenTissue::mbd::Body< mbd_types >::node_traits |
typedef mbd_types::math_policy::quaternion_type OpenTissue::mbd::Body< mbd_types >::quaternion_type |
typedef mbd_types::math_policy::real_type OpenTissue::mbd::Body< mbd_types >::real_type |
typedef mbd_types::scripted_motion_type OpenTissue::mbd::Body< mbd_types >::scripted_motion_type [protected] |
typedef mbd_types::math_policy::size_type OpenTissue::mbd::Body< mbd_types >::size_type |
typedef mbd_types::math_policy::value_traits OpenTissue::mbd::Body< mbd_types >::value_traits |
typedef mbd_types::math_policy::vector3_type OpenTissue::mbd::Body< mbd_types >::vector3_type |
OpenTissue::mbd::Body< mbd_types >::Body | ( | ) | [inline] |
OpenTissue::mbd::Body< mbd_types >::~Body | ( | ) | [inline] |
OpenTissue::mbd::Body< mbd_types >::Body | ( | Body< mbd_types > const & | body | ) | [inline] |
void OpenTissue::mbd::Body< mbd_types >::attach | ( | force_type * | force | ) | [inline] |
Attach force_type Type. Notice that forces are actually more like a type, than a single instance of force, thus gravity can for instance be shared by all bodies in a configuration.
force | A pointer to the force that should be attached to this body. There is no test for multiple attachments. |
void OpenTissue::mbd::Body< mbd_types >::clear | ( | ) | [inline] |
void OpenTissue::mbd::Body< mbd_types >::compute_collision_aabb | ( | vector3_type const & | r, | |
matrix3x3_type const & | R, | |||
vector3_type & | min_coord, | |||
vector3_type & | max_coord, | |||
real_type const & | envelope | |||
) | const [inline] |
void OpenTissue::mbd::Body< mbd_types >::compute_forces_and_torques | ( | vector3_type & | F, | |
vector3_type & | T | |||
) | const [inline] |
Compute External Forces and Torques.
F | upon return this parameter holds the total external force acting on the center of mass of the body. | |
T | upon return this parameter holds the total external torque acting around the center of mass of the body. |
real_type OpenTissue::mbd::Body< mbd_types >::compute_kinetic_energy | ( | ) | const [inline] |
Retrieve Total Kinetic Energy of body_type. Note this is re-evaluated on every invocation.
void OpenTissue::mbd::Body< mbd_types >::compute_scripted_motion | ( | real_type const & | time | ) | [inline] |
Compute Scripted Motion. If body is scripted, then this method will compute the state of the scripted motion at the specified time and update the body state to the newly computed state.
time | The time at which the scripted motion should be computed. |
void OpenTissue::mbd::Body< mbd_types >::detach | ( | force_type * | force | ) | [inline] |
Detach force_type Type.
force | A pointer to the force type that should be removed. |
indirect_edge_iterator OpenTissue::mbd::Body< mbd_types >::edge_begin | ( | ) | [inline] |
indirect_edge_iterator OpenTissue::mbd::Body< mbd_types >::edge_end | ( | ) | [inline] |
const_indirect_force_iterator OpenTissue::mbd::Body< mbd_types >::force_begin | ( | ) | const [inline] |
indirect_force_iterator OpenTissue::mbd::Body< mbd_types >::force_begin | ( | ) | [inline] |
indirect_force_iterator OpenTissue::mbd::Body< mbd_types >::force_end | ( | ) | [inline] |
const_indirect_force_iterator OpenTissue::mbd::Body< mbd_types >::force_end | ( | ) | const [inline] |
void OpenTissue::mbd::Body< mbd_types >::get_finite_rotation_axis | ( | vector3_type & | r_axis | ) | const [inline] |
Retrieve Finite Rotation Axis.
param r_axis Upon return this parameter contains the finite rotaiton axis.
geometry_type* OpenTissue::mbd::Body< mbd_types >::get_geometry | ( | ) | const [inline] |
Get Geometry Type.
void OpenTissue::mbd::Body< mbd_types >::get_inertia_wcs | ( | matrix3x3_type & | I_WCS | ) | const [inline] |
Get the world frame inertia tensor.
invI_WCS | Upon return this argument holds the value of the world frame inertia tensor. |
void OpenTissue::mbd::Body< mbd_types >::get_inverse_inertia_bf | ( | matrix3x3_type & | invI_BF | ) | const [inline] |
Get Inverse body_type Frame Inertia Tensor.
invI_BF | Upon return this argument holds the value of the inverse body frame inertia tensor. |
void OpenTissue::mbd::Body< mbd_types >::get_inverse_inertia_wcs | ( | matrix3x3_type & | invI_WCS | ) | const [inline] |
Get Inverse World Frame Inertia Tensor.
invI_WCS | Upon return this argument holds the value of the inverse world frame inertia tensor. |
real_type OpenTissue::mbd::Body< mbd_types >::get_inverse_mass | ( | ) | const [inline] |
Get Inverse total Mass.
real_type OpenTissue::mbd::Body< mbd_types >::get_mass | ( | ) | const [inline] |
Get the total mass.
size_type OpenTissue::mbd::Body< mbd_types >::get_material_idx | ( | ) | const [inline] |
Get material_type Index
void OpenTissue::mbd::Body< mbd_types >::get_orientation | ( | quaternion_type & | Q | ) | const [inline] |
Get Orientation.
Q | Upon return this argument holds the value of the orientation of the principal axes wrt. the world coordinate system representated as a quaterion. |
void OpenTissue::mbd::Body< mbd_types >::get_orientation | ( | matrix3x3_type & | R | ) | const [inline] |
Get Orientation.
R | Upon return this argument holds the value of the orientation of the principal axes wrt. the world coordinate system representated as a matrix. |
void OpenTissue::mbd::Body< mbd_types >::get_position | ( | vector3_type & | r | ) | const [inline] |
Get Position.
r | Upon return this argument holds the value of the position of the center of mass wrt. the world coordinate system. |
void OpenTissue::mbd::Body< mbd_types >::get_spin | ( | vector3_type & | W | ) | const [inline] |
Get Spin
W | Upon return this argument holds the value of the angular velocity around the center of mass wrt. the world coordinate system. |
void OpenTissue::mbd::Body< mbd_types >::get_velocity | ( | vector3_type & | V | ) | const [inline] |
Get Velocity.
V | Upon return this argument holds the value of the linear velocity of the center of mass wrt. the world coordinate system. |
bool OpenTissue::mbd::Body< mbd_types >::has_active_joints | ( | ) | const [inline] |
Retrieve Active joint_type Status.
bool OpenTissue::mbd::Body< mbd_types >::has_finite_rotation_axis | ( | ) | const [inline] |
Has Finite Rotation Axis Query.
bool OpenTissue::mbd::Body< mbd_types >::has_finite_rotation_update | ( | ) | const [inline] |
Finite Rotation Update Query.
bool OpenTissue::mbd::Body< mbd_types >::has_joint_to | ( | body_type const * | body | ) | const [inline] |
Retrieve joint_type Connection Status.
body | A pointer to another body. |
bool OpenTissue::mbd::Body< mbd_types >::has_joints | ( | ) | const [inline] |
Retrieve joint_type Status.
bool OpenTissue::mbd::Body< mbd_types >::is_active | ( | ) | const [inline] |
Retrieve Active Status.
bool OpenTissue::mbd::Body< mbd_types >::is_fixed | ( | ) | const [inline] |
Retrieve Fixed Status.
bool OpenTissue::mbd::Body< mbd_types >::is_scripted | ( | ) | const [inline] |
Retrieve Scripted Status.
bool OpenTissue::mbd::Body< mbd_types >::is_sleepy | ( | ) | const [inline] |
Retrieve Sleepy State.
indirect_joint_iterator OpenTissue::mbd::Body< mbd_types >::joint_begin | ( | ) | [inline] |
const_indirect_joint_iterator OpenTissue::mbd::Body< mbd_types >::joint_begin | ( | ) | const [inline] |
const_indirect_joint_iterator OpenTissue::mbd::Body< mbd_types >::joint_end | ( | ) | const [inline] |
indirect_joint_iterator OpenTissue::mbd::Body< mbd_types >::joint_end | ( | ) | [inline] |
void OpenTissue::mbd::Body< mbd_types >::set_active | ( | bool const & | active | ) | [inline] |
Set Active Status.
active | The new active status value. |
void OpenTissue::mbd::Body< mbd_types >::set_finite_rotation_axis | ( | vector3_type const & | r_axis | ) | [inline] |
Set Finite Rotation Axis. Note setting the rotation axis implies that finite rotation update state is set to be on.
r_axis | The new finite rotation axis to be used. If it is zero then the finite rotation axis will be turned off. |
void OpenTissue::mbd::Body< mbd_types >::set_finite_rotation_update | ( | bool const & | active | ) | [inline] |
Set Finite Rotation Update.
active | Boolean flag indicating whetever finite rotation update is active or not. |
void OpenTissue::mbd::Body< mbd_types >::set_fixed | ( | bool const & | fixed | ) | [inline] |
Set fixed body.
fixed | Boolean value indicating whetever the body is fixed or not. |
void OpenTissue::mbd::Body< mbd_types >::set_geometry | ( | geometry_type * | geometry | ) | [inline] |
Set Geometry.
geometry | A pointer to the geometry type of this rigid body. |
void OpenTissue::mbd::Body< mbd_types >::set_inertia_bf | ( | matrix3x3_type const & | I_BF | ) | [inline] |
Set body_type Frame Inertia Tensor The world frame inertia tensors are automatically updated, also the angular momentum is affected.
I_BF | The new body frame inertia tensor. |
void OpenTissue::mbd::Body< mbd_types >::set_mass | ( | real_type const & | mass | ) | [inline] |
Set Total body_type Mass. Automatically computes the inverse mass, and implicitly effects the linear momentum.
mass | The new total mass of the body, must be positive. |
void OpenTissue::mbd::Body< mbd_types >::set_material_idx | ( | size_type const & | idx | ) | [inline] |
Set material_type Index. material_type properties are defined between two materials, a material is uniquely identified by an index value. So if you want a material like iron dedicate a unique index to mean ``iron'', if you have another object made of say rubber, it will have another unique index. If the iron and rubber objects come into contact, their material indices are used to look up the material properties between iron and rubber.
By default all bodies get material index zero, upon creation.
idx | The new material index of the body. |
void OpenTissue::mbd::Body< mbd_types >::set_orientation | ( | quaternion_type const & | Q | ) | [inline] |
Set Orientation. Note that this method will update the world coordinate system inertia tensor.
Q | The new orientation, that is the rotation of the principal axes wrt. the world coordinate frame. |
void OpenTissue::mbd::Body< mbd_types >::set_position | ( | vector3_type const & | r | ) | [inline] |
Set Position.
r | The new position of the center of mass of this body. |
void OpenTissue::mbd::Body< mbd_types >::set_scripted_motion | ( | scripted_motion_type * | motion | ) | [inline] |
Set Scripted Motion.
motion | A pointer to the scripted motion that should be used for the scripted body. If null the body is set to be non-scripted. Thus the end-user can toggle a rigid body to be scripted and non-scripted. |
void OpenTissue::mbd::Body< mbd_types >::set_sleepy | ( | bool const & | sleepy | ) | [inline] |
Set Sleepy Status.
sleepy | The new sleepy status of the body. |
void OpenTissue::mbd::Body< mbd_types >::set_spin | ( | vector3_type const & | W | ) | [inline] |
Set Angular Velocity. This method implicitly effects the angular momemtum.
W | The angular velocity around the center of mass wrt. the world coordinate system. |
void OpenTissue::mbd::Body< mbd_types >::set_velocity | ( | vector3_type const & | V | ) | [inline] |
Set Velocity. This method implicitly effects the linear momemtum.
V | The new linear velocity of the center of mass wrt. the world coordinate system. |
bool OpenTissue::mbd::Body< mbd_types >::m_active [protected] |
Boolean flag indicating whatever this node is active in the configuration.
edge_ptr_container OpenTissue::mbd::Body< mbd_types >::m_edges |
A list containing pointers to all incident edges to this body. That is all body pairs this body is part of.
bool OpenTissue::mbd::Body< mbd_types >::m_finite_rotation_update [protected] |
Finite rotation update flag. To be used during position update.
bool OpenTissue::mbd::Body< mbd_types >::m_fixed [protected] |
Boolean flag indicating if the body is fixed or not.
force_ptr_container OpenTissue::mbd::Body< mbd_types >::m_forces [protected] |
A list of pointers to all external forces influencing the rigid body.
geometry_type* OpenTissue::mbd::Body< mbd_types >::m_geometry [protected] |
The geometry of the rigid body.
matrix3x3_type OpenTissue::mbd::Body< mbd_types >::m_I_BF [protected] |
Inertia tensor wrt CM in BF.
matrix3x3_type OpenTissue::mbd::Body< mbd_types >::m_I_WCS [protected] |
Inertia tensor wrt CM in WCS.
real_type OpenTissue::mbd::Body< mbd_types >::m_inv_mass [protected] |
Inverse mass.
matrix3x3_type OpenTissue::mbd::Body< mbd_types >::m_invI_BF [protected] |
Inverse Inertia tensor wrt CM in BF.
matrix3x3_type OpenTissue::mbd::Body< mbd_types >::m_invI_WCS [protected] |
Inverse Inertia tensor wrt CM in WCS.
joint_ptr_container OpenTissue::mbd::Body< mbd_types >::m_joints |
A list containing pointers to all joints this body is part of.
vector3_type OpenTissue::mbd::Body< mbd_types >::m_L [protected] |
Angular momentum wrt. CM in WCS.
real_type OpenTissue::mbd::Body< mbd_types >::m_mass [protected] |
mass.
size_type OpenTissue::mbd::Body< mbd_types >::m_material_idx [protected] |
Unique index identifying the material properties of the node.
vector3_type OpenTissue::mbd::Body< mbd_types >::m_P [protected] |
Linear momentum on CM in WCS.
quaternion_type OpenTissue::mbd::Body< mbd_types >::m_Q [protected] |
The current orientation of the node in WCS.
matrix3x3_type OpenTissue::mbd::Body< mbd_types >::m_R [protected] |
Orientation of BF in WCS (as a Matrix).
vector3_type OpenTissue::mbd::Body< mbd_types >::m_r [protected] |
The current position of the node in WCS.
vector3_type OpenTissue::mbd::Body< mbd_types >::m_r_axis [protected] |
Finite rotation axis, can be used during position update.
bool OpenTissue::mbd::Body< mbd_types >::m_scripted [protected] |
Boolean flag indicating if the body is scripted or not.
scripted_motion_type* OpenTissue::mbd::Body< mbd_types >::m_scripted_motion [protected] |
A pointer to a scripted motion, if set this body is automatically scripted if null the body is either fixed or free moving.
bool OpenTissue::mbd::Body< mbd_types >::m_sleepy [protected] |
Boolean flag indicating wheter the body is sleepy or not.
size_type OpenTissue::mbd::Body< mbd_types >::m_tag |
Tag, can be used for anything, for instance traversing bodies...
vector3_type OpenTissue::mbd::Body< mbd_types >::m_V [protected] |
Linear velocity of CM in WCS .
vector3_type OpenTissue::mbd::Body< mbd_types >::m_W [protected] |
Angular velocity around CM in WCS .