Cheetah Software  1.0
CollisionPlane< T > Class Template Reference

#include <CollisionPlane.h>

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

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW CollisionPlane (const T &mu, const T &restitution, const T &height)
 
virtual ~CollisionPlane ()
 
virtual bool ContactDetection (const Vec3< T > &cp_pos, T &penetration, Mat3< T > &cp_frame)
 
- Public Member Functions inherited from Collision< T >
 Collision (const T &mu, const T &resti)
 
virtual ~Collision ()
 
const T & getFrictionCoeff ()
 
const T & getRestitutionCoeff ()
 

Private Attributes

_height
 

Additional Inherited Members

- Protected Attributes inherited from Collision< T >
_mu
 
_restitution_coeff
 

Detailed Description

template<typename T>
class CollisionPlane< T >

Class to represent infinite collision planes (like a flat ground).

Definition at line 18 of file CollisionPlane.h.

Constructor & Destructor Documentation

template<typename T>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW CollisionPlane< T >::CollisionPlane ( const T &  mu,
const T &  restitution,
const T &  height 
)
inline

Construct a new collision plane

Parameters
location: coordinate transformation to collision plane (collision surface is the xy-plane)
nContactPoints: number of contact points this collision plane will need to handle.
mu: coefficient of friction
restitution: rebounding ratio (v+/v-)
height: height of this plane

Definition at line 32 of file CollisionPlane.h.

33  : Collision<T>(mu, restitution), _height(height) {}
template<typename T>
virtual CollisionPlane< T >::~CollisionPlane ( )
inlinevirtual

Definition at line 35 of file CollisionPlane.h.

References CollisionPlane< T >::ContactDetection().

35 {}

+ Here is the call graph for this function:

Member Function Documentation

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

check whether the contact happens or not cp_frame let you know which direction is normal (z) and which directions are x and y w.r.t global frame. In the case of plane collition, the cp_frame is always an identity matrix.

Implements Collision< T >.

Definition at line 10 of file CollisionPlane.cpp.

11  {
12  if (cp_pos[2] < _height) {
13  penetration = cp_pos[2] - _height;
14  cp_frame.setIdentity();
15  return true;
16  } else {
17  return false;
18  }
19 }

+ Here is the caller graph for this function:

Member Data Documentation

template<typename T>
T CollisionPlane< T >::_height
private

Definition at line 41 of file CollisionPlane.h.


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