All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ODECylinderShape.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 #ifndef _ODECYLINDERSHAPE_HH_
18 #define _ODECYLINDERSHAPE_HH_
19 
20 #include "physics/CylinderShape.hh"
22 
23 namespace gazebo
24 {
25  namespace physics
26  {
30 
33  {
35  public: ODECylinderShape(CollisionPtr _parent) : CylinderShape(_parent) {}
36 
38  public: virtual ~ODECylinderShape() {}
39 
41  public: void SetSize(double _radius, double _length)
42  {
43  CylinderShape::SetSize(_radius, _length);
44  ODECollisionPtr oParent;
45  oParent =
46  boost::shared_dynamic_cast<ODECollision>(this->collisionParent);
47 
48  if (oParent->GetCollisionId() == NULL)
49  oParent->SetCollision(dCreateCylinder(0, _radius, _length), true);
50  else
51  dGeomCylinderSetParams(oParent->GetCollisionId(), _radius, _length);
52  }
53  };
54 
56  }
57 }
58 #endif
59 
60 
61 
62 
63 
64