All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BulletMotionState.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 /* Desc: Bullet motion state class.
18  * Author: Nate Koenig
19  * Date: 25 May 2009
20  */
21 
22 #ifndef _BULLETMOTIONSTATE_HH_
23 #define _BULLETMOTIONSTATE_HH_
24 
26 #include "math/MathTypes.hh"
27 #include "physics/PhysicsTypes.hh"
28 #include "math/Pose.hh"
29 
30 namespace gazebo
31 {
32  namespace physics
33  {
34  class Link;
35 
39 
41  class BulletMotionState : public btMotionState
42  {
44  public: BulletMotionState(Link *_link);
45 
47  // public: BulletMotionState(const math::Pose &initPose);
48 
50  public: virtual ~BulletMotionState();
51 
53  public: math::Pose GetWorldPose() const;
54 
57  public: virtual void SetWorldPosition(const math::Vector3 &_pos);
58 
61  public: virtual void SetWorldRotation(const math::Quaternion &_rot);
62 
64  public: void SetWorldPose(const math::Pose &_pose);
65 
67  public: void SetCoG(const math::Vector3 &_cog);
68 
70  public: virtual void getWorldTransform(btTransform &_worldTrans) const;
71 
73  public: virtual void setWorldTransform(const btTransform &_worldTrans);
74 
75  private: math::Pose worldPose;
76  private: math::Vector3 cog;
77  private: Link *link;
78  };
80  }
81 }
82 #endif