Cheetah Software  1.0
CollisionBox.h
Go to the documentation of this file.
1 
5 #ifndef COLLISION_BOX_H
6 #define COLLISION_BOX_H
7 
8 #include <vector>
9 #include "Collision/Collision.h"
10 #include "Utilities/utilities.h"
11 #include "cppTypes.h"
12 
16 template <typename T>
17 class CollisionBox : public Collision<T> {
18  public:
19  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
20 
31  CollisionBox(const T& mu, const T& restitution, const T& depth,
32  const T& width, const T& height, const Vec3<T>& position,
33  const Mat3<T>& ori)
34  : Collision<T>(mu, restitution), _position(position), _orientation(ori) {
35  _size[0] = depth;
36  _size[1] = width;
37  _size[2] = height;
38  }
39 
40  virtual ~CollisionBox() {}
41  virtual bool ContactDetection(const Vec3<T>& cp_pos, T& penetration,
42  Mat3<T>& cp_frame);
43 
44  private:
45  T _size[3];
46 
49 };
50 
51 #endif // COLLISION_BOX_H
Vec3< T > _position
Definition: CollisionBox.h:47
EIGEN_MAKE_ALIGNED_OPERATOR_NEW CollisionBox(const T &mu, const T &restitution, const T &depth, const T &width, const T &height, const Vec3< T > &position, const Mat3< T > &ori)
Definition: CollisionBox.h:31
typename Eigen::Matrix< T, 3, 3 > Mat3
Definition: cppTypes.h:54
typename Eigen::Matrix< T, 3, 1 > Vec3
Definition: cppTypes.h:26
virtual bool ContactDetection(const Vec3< T > &cp_pos, T &penetration, Mat3< T > &cp_frame)
Virtual class of Collision logic.
Mat3< T > _orientation
Definition: CollisionBox.h:48
virtual ~CollisionBox()
Definition: CollisionBox.h:40