BulletPlaneShape.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 #ifndef GAZEBO_PHYSICS_BULLET_BULLETPLANESHAPE_HH_
18 #define GAZEBO_PHYSICS_BULLET_BULLETPLANESHAPE_HH_
19 
20 #include <iostream>
21 
25 #include "gazebo/util/system.hh"
26 
27 namespace gazebo
28 {
29  namespace physics
30  {
34 
36  class GZ_PHYSICS_VISIBLE BulletPlaneShape : public PlaneShape
37  {
39  public: BulletPlaneShape(CollisionPtr _parent) : PlaneShape(_parent) {}
40 
42  public: virtual ~BulletPlaneShape() {}
43 
45  public: void SetAltitude(const ignition::math::Vector3d &pos)
46  {
48  }
49 
51  public: void CreatePlane()
52  {
54  BulletCollisionPtr bParent;
55  bParent = boost::dynamic_pointer_cast<BulletCollision>(
56  this->collisionParent);
57 
58  ignition::math::Vector3d n = this->Normal();
59  btVector3 vec(n.X(), n.Y(), n.Z());
60 
61  bParent->SetCollisionShape(new btStaticPlaneShape(vec, 0.0),
62  false);
63  }
64  };
66  }
67 }
68 #endif
Bullet collisions.
Definition: BulletCollision.hh:43
virtual void SetAltitude(const math::Vector3 &_pos) GAZEBO_DEPRECATED(8.0)
Set the altitude of the plane.
boost::shared_ptr< BulletCollision > BulletCollisionPtr
Definition: BulletTypes.hh:42
virtual void CreatePlane()
Create the plane.
Bullet collision for an infinite plane.
Definition: BulletPlaneShape.hh:36
BulletPlaneShape(CollisionPtr _parent)
Constructor.
Definition: BulletPlaneShape.hh:39
void CreatePlane()
Create the plane.
Definition: BulletPlaneShape.hh:51
Collision for an infinite plane.
Definition: PlaneShape.hh:38
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:113
void SetAltitude(const ignition::math::Vector3d &pos)
Set the altitude of the plane.
Definition: BulletPlaneShape.hh:45
virtual ~BulletPlaneShape()
Destructor.
Definition: BulletPlaneShape.hh:42