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 
27 
31 #include "gazebo/util/system.hh"
32 
33 namespace gazebo
34 {
35  namespace physics
36  {
39 
41  class GZ_PHYSICS_VISIBLE ODECollision : public Collision
42  {
45  public: explicit ODECollision(LinkPtr _parent);
46 
48  public: virtual ~ODECollision();
49 
50  // Documentation inherited.
51  public: virtual void Load(sdf::ElementPtr _sdf);
52 
53  // Documentation inherited.
54  public: virtual void Fini();
55 
59  public: void SetCollision(dGeomID _collisionId, bool _placeable);
60 
63  public: dGeomID GetCollisionId() const;
64 
67  public: int GetCollisionClass() const;
68 
69  // Documentation inherited.
70  public: virtual void OnPoseChange();
71 
72  // Documentation inherited.
73  public: virtual void SetCategoryBits(unsigned int bits);
74 
75  // Documentation inherited.
76  public: virtual void SetCollideBits(unsigned int bits);
77 
78  // Documentation inherited.
79  public: virtual math::Box GetBoundingBox() const;
80 
83  public: dSpaceID GetSpaceId() const;
84 
87  public: void SetSpaceId(dSpaceID _spaceid);
88 
92  public: ODESurfaceParamsPtr GetODESurface() const;
93 
95  private: void OnPoseChangeGlobal();
96 
98  private: void OnPoseChangeRelative();
99 
101  private: void OnPoseChangeNull();
102 
104  protected: dSpaceID spaceId;
105 
107  protected: dGeomID collisionId;
108 
110  private: void (ODECollision::*onPoseChangeFunc)();
111  };
113  }
114 }
115 #endif
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:109
Base class for all collision entities.
Definition: Collision.hh:44
Base class for all ODE collisions.
Definition: ODECollision.hh:41
Mathematical representation of a box and related functions.
Definition: Box.hh:35
dSpaceID spaceId
Collision space for this.
Definition: ODECollision.hh:104
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:107