All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ODECollision.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2011 Nate Koenig
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 /* Desc: Collision class
18  * Author: Nate Koenig
19  * Date: 13 Feb 2006
20  */
21 
22 #ifndef ODECOLLISION_HH
23 #define ODECOLLISION_HH
24 
25 #include "ode/ode.h"
26 
27 #include "common/CommonTypes.hh"
28 
29 #include "physics/PhysicsTypes.hh"
30 #include "physics/Collision.hh"
31 
32 namespace gazebo
33 {
34  namespace physics
35  {
39 
41  class ODECollision : public Collision
42  {
44  public: ODECollision(LinkPtr link);
45 
47  public: virtual ~ODECollision();
48 
50  public: virtual void Load(sdf::ElementPtr _sdf);
51 
52  /*public: virtual void Load()
53  {
54  Base::Load();
55  }
56  */
57 
59  public: void Fini();
60 
62  public: void SetCollision(dGeomID collisionId, bool placeable);
63 
66  public: dGeomID GetCollisionId() const;
67 
69  public: int GetCollisionClass() const;
70 
71  public: virtual void OnPoseChange();
72 
75  public: virtual void SetCategoryBits(unsigned int bits);
76 
79  public: virtual void SetCollideBits(unsigned int bits);
80 
82  public: virtual math::Box GetBoundingBox() const;
83 
85  public: dSpaceID GetSpaceId() const;
86 
88  public: void SetSpaceId(dSpaceID spaceid);
89 
90  private: void OnPoseChangeGlobal();
91  private: void OnPoseChangeRelative();
92  private: void OnPoseChangeNull();
93 
94  protected: dSpaceID spaceId;
95 
97  protected: dGeomID collisionId;
98 
99  private: void (ODECollision::*onPoseChangeFunc)();
100  };
101 
103  }
104 }
105 #endif