Public Types | Public Member Functions | Public Attributes

OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ > Class Template Reference

#include <sdf_collision_policy.h>

List of all members.

Public Types

typedef bvh_type_ bvh_type
typedef coordsys_type_ coordsys_type
typedef bvh_type::bv_ptr bv_ptr
typedef bvh_type::bv_ptr_container bv_ptr_container
typedef bvh_type::bv_iterator bv_iterator
typedef coordsys_type::vector3_type vector3_type
typedef coordsys_type::value_type real_type

Public Member Functions

 CollisionPolicy ()
bool & flipped ()
bool const & flipped () const
real_typeenvelope ()
real_type const & envelope () const
coordsys_typewcs_xform ()
coordsys_type const & wcs_xform () const
template<typename contact_point_container >
void reset (contact_point_container &)
template<typename sdf_geometry_type >
bool overlap (coordsys_type const &xform, bv_ptr const &bv, sdf_geometry_type const &geometry)
template<typename sdf_geometry_type , typename contact_point_container >
void report (coordsys_type const &xform, bv_ptr const &bv, sdf_geometry_type const &geometry, contact_point_container &contacts)

Public Attributes

real_type m_envelope
 Collision envelope, should be set prior to collision query.
bool m_flipped
 generated contact points should be flipped or not.
coordsys_type m_wcs_xform

Detailed Description

template<typename bvh_type_, typename coordsys_type_>
class OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >

Signed Distance Field Collision Policy.


Member Typedef Documentation

template<typename bvh_type_, typename coordsys_type_>
typedef bvh_type::bv_iterator OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::bv_iterator
template<typename bvh_type_, typename coordsys_type_>
typedef bvh_type::bv_ptr OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::bv_ptr
template<typename bvh_type_, typename coordsys_type_>
typedef bvh_type::bv_ptr_container OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::bv_ptr_container
template<typename bvh_type_, typename coordsys_type_>
typedef bvh_type_ OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::bvh_type
template<typename bvh_type_, typename coordsys_type_>
typedef coordsys_type_ OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::coordsys_type
template<typename bvh_type_, typename coordsys_type_>
typedef coordsys_type::value_type OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::real_type
template<typename bvh_type_, typename coordsys_type_>
typedef coordsys_type::vector3_type OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::vector3_type

Constructor & Destructor Documentation

template<typename bvh_type_, typename coordsys_type_>
OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::CollisionPolicy (  )  [inline]

Member Function Documentation

template<typename bvh_type_, typename coordsys_type_>
real_type& OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::envelope (  )  [inline]

Collision Envelope. The size of the collision envelope dicates a threshold value, whenever objects are within the collision envelope of each other then the policy will report a collision.

Returns:
The size of the collision envelope.
template<typename bvh_type_, typename coordsys_type_>
real_type const& OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::envelope (  )  const [inline]
template<typename bvh_type_, typename coordsys_type_>
bool const& OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::flipped (  )  const [inline]
template<typename bvh_type_, typename coordsys_type_>
bool& OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::flipped (  )  [inline]

Contact Normal Flipped. The caller may have reversed the roles of objects A and B, in which case contact normals should be flipped when reporting them.

If object roles are reveres then flipped should be set to true. Default value is false.

Returns:
The size of the collision envelope.
template<typename bvh_type_, typename coordsys_type_>
template<typename sdf_geometry_type >
bool OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::overlap ( coordsys_type const &  xform,
bv_ptr const &  bv,
sdf_geometry_type const &  geometry 
) [inline]

Overlap Testing.

Parameters:
xform A coordinate transform that takes the geometry of the bv into the local model frame of the sdf geometry. bv A pointer to a bounding volume (bv) node.
geometry A signed distance field geometry.
Returns:
If the geometry of the bv (a sphere) is overlapping with the zero-level set of the signed distance field geometry then the return value it true otherwise it is false.
template<typename bvh_type_, typename coordsys_type_>
template<typename sdf_geometry_type , typename contact_point_container >
void OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::report ( coordsys_type const &  xform,
bv_ptr const &  bv,
sdf_geometry_type const &  geometry,
contact_point_container &  contacts 
) [inline]

Contact Point Reporting.

Parameters:
xform Coordinate transform, can be used to bring bv into model frame of geometry.
bv The bv (bounding volume) from object A.
geometry The geometry of object B.
contacts Upon return any contact point is added to this container. Note that the contact consist of a contact point, a contact normal and a separation/penetration distance. These are specified in the local coordinate system of the signed distance field geometry. The caller is responsible for converting these into the world coordinate system (WCS) if needed.

Note that by convention the contact normal is always pointing from the signed distance field geometry towards the bv geometry. That is normals are pointing from A towards B by convention.

template<typename bvh_type_, typename coordsys_type_>
template<typename contact_point_container >
void OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::reset ( contact_point_container &   )  [inline]

Reset. This method is invoked prior to performing any collision query.

template<typename bvh_type_, typename coordsys_type_>
coordsys_type const& OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::wcs_xform (  )  const [inline]
template<typename bvh_type_, typename coordsys_type_>
coordsys_type& OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::wcs_xform (  )  [inline]

World Coordinate System Transform. The policy uses this transfrom to convert generated contact points into the correct frame.

Returns:
A reference to the world coordinate system transform.

Member Data Documentation

template<typename bvh_type_, typename coordsys_type_>
real_type OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::m_envelope

Collision envelope, should be set prior to collision query.

template<typename bvh_type_, typename coordsys_type_>
bool OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::m_flipped

generated contact points should be flipped or not.

This boolean flag indicates whether normal directions on

template<typename bvh_type_, typename coordsys_type_>
coordsys_type OpenTissue::sdf::CollisionPolicy< bvh_type_, coordsys_type_ >::m_wcs_xform

Coordinate transform, brings a contact point from the local model frame of the geometry type into the world coordinate system.


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