Choreonoid  1.8
CollisionLinkPair.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_COLLISION_LINK_PAIR_H
7 #define CNOID_BODY_COLLISION_LINK_PAIR_H
8 
9 #include "Body.h"
10 #include <cnoid/CollisionDetector>
11 #include <memory>
12 
13 namespace cnoid {
14 
16 {
18  link[0] = 0;
19  link[1] = 0;
20  }
21 
22  CollisionLinkPair(Body* body1, Link* link1, Body* body2, Link* link2, const CollisionPair& collisionPair)
23  : collisions(collisionPair.collisions())
24  {
25  body[0] = body1;
26  body[1] = body2;
27  link[0] = link1;
28  link[1] = link2;
29  }
30 
31  bool isSelfCollision() const {
32  return (body[0] == body[1]);
33  }
34 
36  Link* link[2];
37  std::vector<Collision> collisions;
38 };
39 
40 typedef std::shared_ptr<CollisionLinkPair> CollisionLinkPairPtr;
41 
42 }
43 
44 #endif
cnoid::CollisionLinkPair::body
BodyPtr body[2]
Definition: CollisionLinkPair.h:35
cnoid::CollisionLinkPairPtr
std::shared_ptr< CollisionLinkPair > CollisionLinkPairPtr
Definition: CollisionLinkPair.h:40
cnoid::CollisionLinkPair::isSelfCollision
bool isSelfCollision() const
Definition: CollisionLinkPair.h:31
cnoid::CollisionLinkPair
Definition: CollisionLinkPair.h:15
cnoid::CollisionLinkPair::link
Link * link[2]
Definition: CollisionLinkPair.h:36
cnoid::ref_ptr< Body >
cnoid::CollisionLinkPair::collisions
std::vector< Collision > collisions
Definition: CollisionLinkPair.h:37
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::CollisionPair
Definition: CollisionDetector.h:72
Body.h
cnoid::Body
Definition: Body.h:28
cnoid::CollisionLinkPair::CollisionLinkPair
CollisionLinkPair(Body *body1, Link *link1, Body *body2, Link *link2, const CollisionPair &collisionPair)
Definition: CollisionLinkPair.h:22
cnoid::CollisionLinkPair::CollisionLinkPair
CollisionLinkPair()
Definition: CollisionLinkPair.h:17