Public Types | Public Member Functions | Protected Attributes

OpenTissue::geometry::Capsule< math_types_ > Class Template Reference

#include <geometry_capsule.h>

Inheritance diagram for OpenTissue::geometry::Capsule< math_types_ >:
OpenTissue::geometry::VolumeShape< math_types_ > OpenTissue::function::SignedDistanceFunction< math_types_ > OpenTissue::utility::ClassID< Capsule< math_types_ > > OpenTissue::geometry::BaseShape< math_types_ > OpenTissue::function::ImplicitFunction< math_types_ > OpenTissue::utility::ClassIDInterface OpenTissue::collision::GeometryInterface< math_types_ > OpenTissue::utility::ClassIDInterface

List of all members.

Public Types

typedef math_types_ math_types
typedef math_types::value_traits value_traits
typedef math_types::real_type real_type
typedef math_types::vector3_type vector3_type
typedef math_types::matrix3x3_type matrix3x3_type
typedef math_types::quaternion_type quaternion_type

Public Member Functions

size_t const class_id () const
 Capsule ()
 Capsule (vector3_type const &point0, vector3_type const &point1, real_type const &radius)
virtual ~Capsule ()
void set (vector3_type const &point0, vector3_type const &point1, real_type const &radius)
vector3_typepoint0 ()
vector3_type const & point0 () const
vector3_typepoint1 ()
vector3_type const & point1 () const
real_typeradius ()
real_type const & radius () const
vector3_type get_support_point (vector3_type const &) const
real_type volume () const
real_type area () const
real_type diameter () const
void compute_surface_points (std::vector< vector3_type > &) const
vector3_type center () const
real_type evaluate (vector3_type const &x) const
vector3_type gradient (vector3_type const &x) const
vector3_type normal (vector3_type const &x) const
real_type signed_distance (vector3_type const &x) const
vector3_type closest_point_on_line_segment (vector3_type const &x) const
void translate (vector3_type const &T)
void rotate (matrix3x3_type const &R)
void scale (real_type const &s)
void compute_collision_aabb (vector3_type const &, matrix3x3_type const &, vector3_type &min_coord, vector3_type &max_coord) const

Protected Attributes

vector3_type m_point0
 End Point 0.
vector3_type m_point1
 End Point 1.
real_type m_radius
 Radius.

Detailed Description

template<typename math_types_>
class OpenTissue::geometry::Capsule< math_types_ >

Capsule


Member Typedef Documentation

template<typename math_types_ >
typedef math_types_ OpenTissue::geometry::Capsule< math_types_ >::math_types
template<typename math_types_ >
typedef math_types::matrix3x3_type OpenTissue::geometry::Capsule< math_types_ >::matrix3x3_type
template<typename math_types_ >
typedef math_types::quaternion_type OpenTissue::geometry::Capsule< math_types_ >::quaternion_type
template<typename math_types_ >
typedef math_types::real_type OpenTissue::geometry::Capsule< math_types_ >::real_type
template<typename math_types_ >
typedef math_types::value_traits OpenTissue::geometry::Capsule< math_types_ >::value_traits
template<typename math_types_ >
typedef math_types::vector3_type OpenTissue::geometry::Capsule< math_types_ >::vector3_type

Constructor & Destructor Documentation

template<typename math_types_ >
OpenTissue::geometry::Capsule< math_types_ >::Capsule (  )  [inline]
template<typename math_types_ >
OpenTissue::geometry::Capsule< math_types_ >::Capsule ( vector3_type const &  point0,
vector3_type const &  point1,
real_type const &  radius 
) [inline]
template<typename math_types_ >
virtual OpenTissue::geometry::Capsule< math_types_ >::~Capsule (  )  [inline, virtual]

Member Function Documentation

template<typename math_types_ >
real_type OpenTissue::geometry::Capsule< math_types_ >::area (  )  const [inline]
template<typename math_types_ >
vector3_type OpenTissue::geometry::Capsule< math_types_ >::center (  )  const [inline]
template<typename math_types_ >
size_t const OpenTissue::geometry::Capsule< math_types_ >::class_id (  )  const [inline, virtual]

Query the class ID.

Returns:
The object's class ID

Reimplemented from OpenTissue::utility::ClassID< Capsule< math_types_ > >.

template<typename math_types_ >
vector3_type OpenTissue::geometry::Capsule< math_types_ >::closest_point_on_line_segment ( vector3_type const &  x  )  const [inline]

Returns the point on the line seqment (p1-p0) that results in the shortest distance to p

template<typename math_types_ >
void OpenTissue::geometry::Capsule< math_types_ >::compute_collision_aabb ( vector3_type const &  ,
matrix3x3_type const &  ,
vector3_type min_coord,
vector3_type max_coord 
) const [inline]

Compute Bounding Box. This method computes an axis aligned bounding box (AABB) that encloses the geometry.

Parameters:
r The position of the model frame (i.e the coordinate frame the geometry lives in).
R The orientation of the model frame (i.e the coordinate frame the geometry lives in).
min_coord Upon return holds the minimum corner of the box.
max_coord Upon return holds the maximum corner of the box.
template<typename math_types_ >
void OpenTissue::geometry::Capsule< math_types_ >::compute_surface_points ( std::vector< vector3_type > &   )  const [inline]
template<typename math_types_ >
real_type OpenTissue::geometry::Capsule< math_types_ >::diameter (  )  const [inline]
template<typename math_types_ >
real_type OpenTissue::geometry::Capsule< math_types_ >::evaluate ( vector3_type const &  x  )  const [inline]

Implicit Capsule.

p0, p1 : end points r : radius

The idea is plain simple: 1) Construct a line l(t) := p0+t*(p1-p0) 2) Find the shortest distance from p to the line l(t) find t such that l(t)-p is perpendicular to p1-p0, e.g. (l(t)-p)*(p1-p0) = 0 3) Clamp t to [0;1], and determine x = l(t) this nice trick ensures we can handle both the cylinder and the hemispheres equally 4) Set F(p) := |x-p| - r F(p) < 0 <-- p inside capsule F(p) = 0 <-- p on capsule surface F(p) > 0 <-- p outside capsule

template<typename math_types_ >
vector3_type OpenTissue::geometry::Capsule< math_types_ >::get_support_point ( vector3_type const &   )  const [inline]
template<typename math_types_ >
vector3_type OpenTissue::geometry::Capsule< math_types_ >::gradient ( vector3_type const &  x  )  const [inline]
template<typename math_types_ >
vector3_type OpenTissue::geometry::Capsule< math_types_ >::normal ( vector3_type const &  x  )  const [inline]
template<typename math_types_ >
vector3_type const& OpenTissue::geometry::Capsule< math_types_ >::point0 (  )  const [inline]
template<typename math_types_ >
vector3_type& OpenTissue::geometry::Capsule< math_types_ >::point0 (  )  [inline]
template<typename math_types_ >
vector3_type const& OpenTissue::geometry::Capsule< math_types_ >::point1 (  )  const [inline]
template<typename math_types_ >
vector3_type& OpenTissue::geometry::Capsule< math_types_ >::point1 (  )  [inline]
template<typename math_types_ >
real_type& OpenTissue::geometry::Capsule< math_types_ >::radius (  )  [inline]
template<typename math_types_ >
real_type const& OpenTissue::geometry::Capsule< math_types_ >::radius (  )  const [inline]
template<typename math_types_ >
void OpenTissue::geometry::Capsule< math_types_ >::rotate ( matrix3x3_type const &  R  )  [inline]
template<typename math_types_ >
void OpenTissue::geometry::Capsule< math_types_ >::scale ( real_type const &  s  )  [inline]
template<typename math_types_ >
void OpenTissue::geometry::Capsule< math_types_ >::set ( vector3_type const &  point0,
vector3_type const &  point1,
real_type const &  radius 
) [inline]
template<typename math_types_ >
real_type OpenTissue::geometry::Capsule< math_types_ >::signed_distance ( vector3_type const &  x  )  const [inline]

Returns the point on the line seqment (p1-p0) that results in the shortest distance to p

template<typename math_types_ >
void OpenTissue::geometry::Capsule< math_types_ >::translate ( vector3_type const &  T  )  [inline]
template<typename math_types_ >
real_type OpenTissue::geometry::Capsule< math_types_ >::volume (  )  const [inline]

Member Data Documentation

template<typename math_types_ >
vector3_type OpenTissue::geometry::Capsule< math_types_ >::m_point0 [protected]

End Point 0.

template<typename math_types_ >
vector3_type OpenTissue::geometry::Capsule< math_types_ >::m_point1 [protected]

End Point 1.

template<typename math_types_ >
real_type OpenTissue::geometry::Capsule< math_types_ >::m_radius [protected]

Radius.


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