BulletPlaneShape.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: Plane shape
18  * Author: Nate Koenig
19  * Date: 14 Oct 2009
20  */
21 
22 #ifndef _BULLETPLANESHAPE_HH_
23 #define _BULLETPLANESHAPE_HH_
24 
25 #include <iostream>
26 
30 #include "gazebo/util/system.hh"
31 
32 namespace gazebo
33 {
34  namespace physics
35  {
39 
41  class GZ_PHYSICS_VISIBLE BulletPlaneShape : public PlaneShape
42  {
44  public: BulletPlaneShape(CollisionPtr _parent) : PlaneShape(_parent) {}
45 
47  public: virtual ~BulletPlaneShape() {}
48 
50  public: void SetAltitude(const math::Vector3 &pos)
51  {
53  }
54 
56  public: void CreatePlane()
57  {
59  BulletCollisionPtr bParent;
60  bParent = boost::dynamic_pointer_cast<BulletCollision>(
61  this->collisionParent);
62 
63  math::Vector3 n = this->GetNormal();
64  btVector3 vec(n.x, n.y, n.z);
65 
66  bParent->SetCollisionShape(new btStaticPlaneShape(vec, 0.0),
67  false);
68  }
69  };
71  }
72 }
73 #endif
Bullet collisions.
Definition: BulletCollision.hh:53
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
boost::shared_ptr< BulletCollision > BulletCollisionPtr
Definition: BulletTypes.hh:40
virtual void CreatePlane()
Create the plane.
Bullet collision for an infinite plane.
Definition: BulletPlaneShape.hh:41
void SetAltitude(const math::Vector3 &pos)
Set the altitude of the plane.
Definition: BulletPlaneShape.hh:50
BulletPlaneShape(CollisionPtr _parent)
Constructor.
Definition: BulletPlaneShape.hh:44
void CreatePlane()
Create the plane.
Definition: BulletPlaneShape.hh:56
virtual void SetAltitude(const math::Vector3 &_pos)
Set the altitude of the plane.
Collision for an infinite plane.
Definition: PlaneShape.hh:41
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:113
virtual ~BulletPlaneShape()
Destructor.
Definition: BulletPlaneShape.hh:47