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  {
43  public: explicit ODECollision(LinkPtr _parent);
44 
46  public: virtual ~ODECollision();
47 
48  // Documentation inherited.
49  public: virtual void Load(sdf::ElementPtr _sdf);
50 
51  // Documentation inherited.
52  public: virtual void Fini();
53 
57  public: void SetCollision(dGeomID _collisionId, bool _placeable);
58 
61  public: dGeomID GetCollisionId() const;
62 
65  public: int GetCollisionClass() const;
66 
67  // Documentation inherited.
68  public: virtual void OnPoseChange();
69 
70  // Documentation inherited.
71  public: virtual void SetCategoryBits(unsigned int bits);
72 
73  // Documentation inherited.
74  public: virtual void SetCollideBits(unsigned int bits);
75 
76  // Documentation inherited.
77  public: virtual math::Box GetBoundingBox() const;
78 
81  public: dSpaceID GetSpaceId() const;
82 
85  public: void SetSpaceId(dSpaceID _spaceid);
86 
90  public: ODESurfaceParamsPtr GetODESurface() const;
91 
93  private: void OnPoseChangeGlobal();
94 
96  private: void OnPoseChangeRelative();
97 
99  private: void OnPoseChangeNull();
100 
102  protected: dSpaceID spaceId;
103 
105  protected: dGeomID collisionId;
106 
108  private: void (ODECollision::*onPoseChangeFunc)();
109  };
110  }
111 }
112 #endif
#define GZ_PHYSICS_VISIBLE
Definition: system.hh:259
Base class for all collision entities.
Definition: Collision.hh:44
Base class for all ODE collisions.
Definition: ODECollision.hh:39
Mathematical representation of a box and related functions.
Definition: Box.hh:35
boost::shared_ptr< ODESurfaceParams > ODESurfaceParamsPtr
Definition: ODETypes.hh:52
default namespace for gazebo
ODE wrapper forward declarations and typedefs.
dSpaceID spaceId
Collision space for this.
Definition: ODECollision.hh:102
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:100
dGeomID collisionId
ID for the collision.
Definition: ODECollision.hh:105