ODECollision.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 Open Source Robotics Foundation
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 
28 
32 #include "gazebo/util/system.hh"
33 
34 namespace gazebo
35 {
36  namespace physics
37  {
40 
42  class GZ_PHYSICS_VISIBLE ODECollision : public Collision
43  {
46  public: explicit ODECollision(LinkPtr _parent);
47 
49  public: virtual ~ODECollision();
50 
51  // Documentation inherited.
52  public: virtual void Load(sdf::ElementPtr _sdf);
53 
54  // Documentation inherited.
55  public: virtual void Fini();
56 
60  public: void SetCollision(dGeomID _collisionId, bool _placeable);
61 
64  public: dGeomID GetCollisionId() const;
65 
68  public: int GetCollisionClass() const;
69 
70  // Documentation inherited.
71  public: virtual void OnPoseChange();
72 
73  // Documentation inherited.
74  public: virtual void SetCategoryBits(unsigned int bits);
75 
76  // Documentation inherited.
77  public: virtual void SetCollideBits(unsigned int bits);
78 
79  // Documentation inherited.
80  public: virtual math::Box GetBoundingBox() const;
81 
84  public: dSpaceID GetSpaceId() const;
85 
88  public: void SetSpaceId(dSpaceID _spaceid);
89 
93  public: ODESurfaceParamsPtr GetODESurface() const;
94 
96  private: void OnPoseChangeGlobal();
97 
99  private: void OnPoseChangeRelative();
100 
102  private: void OnPoseChangeNull();
103 
105  protected: dSpaceID spaceId;
106 
108  protected: dGeomID collisionId;
109 
111  private: void (ODECollision::*onPoseChangeFunc)();
112  };
114  }
115 }
116 #endif
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:100
Forward declarations for the common classes.
Definition: Animation.hh:33
Base class for all collision entities.
Definition: Collision.hh:44
Base class for all ODE collisions.
Definition: ODECollision.hh:42
Mathematical representation of a box and related functions.
Definition: Box.hh:35
dSpaceID spaceId
Collision space for this.
Definition: ODECollision.hh:105
default namespace for gazebo
ODE wrapper forward declarations and typedefs.
boost::shared_ptr< ODESurfaceParams > ODESurfaceParamsPtr
Definition: ODETypes.hh:55
dGeomID collisionId
ID for the collision.
Definition: ODECollision.hh:108