Cheetah Software  1.0
Collision< T > Class Template Referenceabstract

#include <Collision.h>

+ Inheritance diagram for Collision< T >:
+ Collaboration diagram for Collision< T >:

Public Member Functions

 Collision (const T &mu, const T &resti)
 
virtual ~Collision ()
 
virtual bool ContactDetection (const Vec3< T > &cp_pos, T &penetration, Mat3< T > &cp_frame)=0
 
const T & getFrictionCoeff ()
 
const T & getRestitutionCoeff ()
 

Protected Attributes

_mu
 
_restitution_coeff
 

Detailed Description

template<typename T>
class Collision< T >

Abstract Collision Class

Definition at line 17 of file Collision.h.

Constructor & Destructor Documentation

template<typename T>
Collision< T >::Collision ( const T &  mu,
const T &  resti 
)
inline

Construct a new collision

Parameters
mu: coefficient of friction
resti: coefficient of restitution (v_rebound / v_impact)

Definition at line 24 of file Collision.h.

24 : _mu(mu), _restitution_coeff(resti) {}
T _restitution_coeff
Definition: Collision.h:42
template<typename T>
virtual Collision< T >::~Collision ( )
inlinevirtual

Definition at line 25 of file Collision.h.

References Collision< T >::ContactDetection().

25 {}

+ Here is the call graph for this function:

Member Function Documentation

template<typename T>
virtual bool Collision< T >::ContactDetection ( const Vec3< T > &  cp_pos,
T &  penetration,
Mat3< T > &  cp_frame 
)
pure virtual

virtual function for contact detection

Parameters
cp_pos: contact point in the global frame
Returns
penetration : Size of the penetration to normal direction to the collision object
cp_frame : Local frame that has normal axis (z) perpendicular the contact surface

Implemented in CollisionBox< T >, CollisionMesh< T >, and CollisionPlane< T >.

+ Here is the caller graph for this function:

template<typename T>
const T& Collision< T >::getFrictionCoeff ( )
inline

Definition at line 38 of file Collision.h.

References Collision< T >::_mu.

38 { return _mu; }
template<typename T>
const T& Collision< T >::getRestitutionCoeff ( )
inline

Definition at line 39 of file Collision.h.

References Collision< T >::_restitution_coeff.

39 { return _restitution_coeff; }
T _restitution_coeff
Definition: Collision.h:42

Member Data Documentation

template<typename T>
T Collision< T >::_mu
protected

Definition at line 42 of file Collision.h.

template<typename T>
T Collision< T >::_restitution_coeff
protected

Definition at line 42 of file Collision.h.


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