ODECollision.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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 
26 
30 #include "gazebo/util/system.hh"
31 
32 namespace gazebo
33 {
34  namespace physics
35  {
38 
40  class GZ_PHYSICS_VISIBLE ODECollision : public Collision
41  {
44  public: explicit ODECollision(LinkPtr _parent);
45 
47  public: virtual ~ODECollision();
48 
49  // Documentation inherited.
50  public: virtual void Load(sdf::ElementPtr _sdf);
51 
52  // Documentation inherited.
53  public: virtual void Fini();
54 
58  public: void SetCollision(dGeomID _collisionId, bool _placeable);
59 
62  public: dGeomID GetCollisionId() const;
63 
66  public: int GetCollisionClass() const;
67 
68  // Documentation inherited.
69  public: virtual void OnPoseChange();
70 
71  // Documentation inherited.
72  public: virtual void SetCategoryBits(unsigned int bits);
73 
74  // Documentation inherited.
75  public: virtual void SetCollideBits(unsigned int bits);
76 
77  // Documentation inherited.
78  public: virtual ignition::math::AxisAlignedBox BoundingBox() const;
79 
82  public: dSpaceID GetSpaceId() const;
83 
86  public: void SetSpaceId(dSpaceID _spaceid);
87 
91  public: ODESurfaceParamsPtr GetODESurface() const;
92 
94  private: void OnPoseChangeGlobal();
95 
97  private: void OnPoseChangeRelative();
98 
100  private: void OnPoseChangeNull();
101 
103  protected: dSpaceID spaceId;
104 
106  protected: dGeomID collisionId;
107 
109  private: void (ODECollision::*onPoseChangeFunc)();
110  };
112  }
113 }
114 #endif
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:110
Forward declarations for the common classes.
Definition: Animation.hh:26
Base class for all collision entities.
Definition: Collision.hh:38
Base class for all ODE collisions.
Definition: ODECollision.hh:40
dSpaceID spaceId
Collision space for this.
Definition: ODECollision.hh:103
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:106