All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BulletPlaneShape.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 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 
29 #include "gazebo/util/system.hh"
30 
31 namespace gazebo
32 {
33  namespace physics
34  {
38 
41  {
43  public: BulletPlaneShape(CollisionPtr _parent) : PlaneShape(_parent) {}
44 
46  public: virtual ~BulletPlaneShape() {}
47 
49  public: void SetAltitude(const math::Vector3 &pos)
50  {
52  }
53 
55  public: void CreatePlane()
56  {
58  BulletCollisionPtr bParent;
59  bParent = boost::dynamic_pointer_cast<BulletCollision>(
60  this->collisionParent);
61 
62  math::Vector3 n = this->GetNormal();
63  btVector3 vec(n.x, n.y, n.z);
64 
65  bParent->SetCollisionShape(new btStaticPlaneShape(vec, 0.0),
66  false);
67  }
68  };
70  }
71 }
72 #endif
Bullet collisions.
Definition: BulletCollision.hh:53
void CreatePlane()
Create the plane.
Definition: BulletPlaneShape.hh:55
virtual void SetAltitude(const math::Vector3 &_pos)
Set the altitude of the plane.
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
BulletPlaneShape(CollisionPtr _parent)
Constructor.
Definition: BulletPlaneShape.hh:43
Bullet collision for an infinite plane.
Definition: BulletPlaneShape.hh:40
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:94
virtual ~BulletPlaneShape()
Destructor.
Definition: BulletPlaneShape.hh:46
void SetAltitude(const math::Vector3 &pos)
Set the altitude of the plane.
Definition: BulletPlaneShape.hh:49
virtual void CreatePlane()
Create the plane.
boost::shared_ptr< BulletCollision > BulletCollisionPtr
Definition: BulletTypes.hh:41
Collision for an infinite plane.
Definition: PlaneShape.hh:41
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48