All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimbodySphereShape.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2013 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 
18 #ifndef _SIMBODY_SPHERE_SHAPE_HH_
19 #define _SIMBODY_SPHERE_SHAPE_HH_
20 
22 
23 namespace gazebo
24 {
25  namespace physics
26  {
30 
33  {
36  public: SimbodySphereShape(CollisionPtr _parent) : SphereShape(_parent) {}
37 
39  public: virtual ~SimbodySphereShape() {}
40 
41  // Documentation inherited.
42  public: virtual void SetRadius(double _radius)
43  {
44  if (_radius < 0)
45  {
46  gzerr << "Sphere shape does not support negative radius\n";
47  return;
48  }
49  if (math::equal(_radius, 0.0))
50  {
51  // Warn user, but still create shape with very small value
52  // otherwise later resize operations using setLocalScaling
53  // will not be possible
54  gzwarn << "Setting sphere shape's radius to zero \n";
55  _radius = 1e-4;
56  }
57 
58  SphereShape::SetRadius(_radius);
59  SimbodyCollisionPtr bParent;
60  bParent = boost::dynamic_pointer_cast<SimbodyCollision>(
61  this->collisionParent);
62 
63  // set collision shape
64  }
65  };
67  }
68 }
69 #endif