Classes | Public Member Functions | Protected Types | Protected Attributes

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

#include <mbd_geometry_dispatcher.h>

List of all members.

Classes

class  constraint_traits
class  edge_traits
class  node_traits

Public Member Functions

 GeometryDispatcher ()
template<class T1 , class T2 >
void bind (bool(*f)(T1 &, T2 &, collision_info_type &))
bool run (edge_type *edge)
void add (body_type *)
void remove (body_type *)
void clear ()
void init (configuration_type &configuration)

Protected Types

typedef
mbd_types::configuration_type 
configuration_type
typedef mbd_types::geometry_type geometry_type
typedef
mbd_types::collision_info_type 
collision_info_type
typedef mbd_types::body_type body_type
typedef mbd_types::edge_type edge_type
typedef
OpenTissue::utility::dispatchers::DynamicTableDispatcher
< geometry_type, false, bool,
collision_info_type
dispatcher_type

Protected Attributes

dispatcher_type m_dispatcher
 The dispatcher.
configuration_typem_configuration
 A pointer to the configuration.

Detailed Description

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

Geometry Dispatcher. This class should be used as a narrow phase collision detection module in a collision ddetection engine. This class merely tries to figure out what kind of geometries a pair of bodies have and then call the appropriate collision detection algorithm for the specific pair of geometries.

The idea is to setup a table of pointers to so-called collider functions. The geometry types of the objects are then used to lookup the collider that should be invoked. This way the pairing of geometry types takes constant time, regardless of how many geometry types one have.


Member Typedef Documentation

template<typename mbd_types>
typedef mbd_types::body_type OpenTissue::mbd::GeometryDispatcher< mbd_types >::body_type [protected]
template<typename mbd_types>
typedef mbd_types::collision_info_type OpenTissue::mbd::GeometryDispatcher< mbd_types >::collision_info_type [protected]
template<typename mbd_types>
typedef mbd_types::configuration_type OpenTissue::mbd::GeometryDispatcher< mbd_types >::configuration_type [protected]
template<typename mbd_types>
typedef mbd_types::edge_type OpenTissue::mbd::GeometryDispatcher< mbd_types >::edge_type [protected]
template<typename mbd_types>
typedef mbd_types::geometry_type OpenTissue::mbd::GeometryDispatcher< mbd_types >::geometry_type [protected]

Constructor & Destructor Documentation

template<typename mbd_types>
OpenTissue::mbd::GeometryDispatcher< mbd_types >::GeometryDispatcher (  )  [inline]

Member Function Documentation

template<typename mbd_types>
void OpenTissue::mbd::GeometryDispatcher< mbd_types >::add ( body_type  )  [inline]
template<typename mbd_types>
template<class T1 , class T2 >
void OpenTissue::mbd::GeometryDispatcher< mbd_types >::bind ( bool(*)(T1 &, T2 &, collision_info_type &)  f  )  [inline]

This method binds a collision handler to the geometry dispatcher.

Parameters:
f The collision handler function. The first two arguments must be ``geometry types'' the third argument must be a collision info and the return value must be bool.
template<typename mbd_types>
void OpenTissue::mbd::GeometryDispatcher< mbd_types >::clear (  )  [inline]
template<typename mbd_types>
void OpenTissue::mbd::GeometryDispatcher< mbd_types >::init ( configuration_type configuration  )  [inline]
template<typename mbd_types>
void OpenTissue::mbd::GeometryDispatcher< mbd_types >::remove ( body_type  )  [inline]
template<typename mbd_types>
bool OpenTissue::mbd::GeometryDispatcher< mbd_types >::run ( edge_type edge  )  [inline]

Run Narrow Phase Collision Detection Algorithm

Parameters:
edge A pointer to an edge represeting the body pair that should be proceesed.
Returns:
If a penetration was detected the return value is true otherwise it is false.

Member Data Documentation

template<typename mbd_types>
configuration_type* OpenTissue::mbd::GeometryDispatcher< mbd_types >::m_configuration [protected]

A pointer to the configuration.

template<typename mbd_types>
dispatcher_type OpenTissue::mbd::GeometryDispatcher< mbd_types >::m_dispatcher [protected]

The dispatcher.


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