NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgBaseRigid.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012, United States Government, as represented by the
3  * Administrator of the National Aeronautics and Space Administration.
4  * All rights reserved.
5  *
6  * The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed
7  * under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * http://www.apache.org/licenses/LICENSE-2.0.
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15  * either express or implied. See the License for the specific language
16  * governing permissions and limitations under the License.
17 */
18 
19 #ifndef TG_BASE_RIGID_H
20 #define TG_BASE_RIGID_H
21 
29 // This application
30 #include "tgModel.h" // @todo: forward declare and move to tgRod.cpp (to be created)
31 // The Bullet Physics library
32 #include "LinearMath/btVector3.h"
33 // The C++ Standard Library
34 #include <vector>
35 
36 // Forward declarations
37 class btRigidBody;
38 
43 class tgBaseRigid : public tgModel
44 {
45 public:
46 
48  virtual ~tgBaseRigid();
49 
53  virtual void teardown();
54 
59  virtual void onVisit(const tgModelVisitor& v) const;
60 
65  virtual double mass() const { return m_mass; }
66 
71  virtual btVector3 centerOfMass() const;
72 
76  virtual btRigidBody* getPRigidBody()
77  {
78  return m_pRigidBody;
79  }
80 
85  virtual btVector3 orientation() const;
86 
87 protected:
88  // Virtual base class
89  tgBaseRigid(btRigidBody* pRigidBody,
90  const tgTags& tags);
91 
92 private:
93 
95  bool invariant() const;
96 
97 protected:
98 
102  btRigidBody* m_pRigidBody;
103 
105  const double m_mass;
106 
107 };
108 
109 #endif
btRigidBody * m_pRigidBody
Definition: tgBaseRigid.h:102
virtual void onVisit(const tgModelVisitor &v) const
Definition: tgBaseRigid.cpp:59
virtual ~tgBaseRigid()
Definition: tgBaseRigid.cpp:57
virtual btVector3 centerOfMass() const
Definition: tgBaseRigid.cpp:74
Contains the definition of class tgModel.
const double m_mass
Definition: tgBaseRigid.h:105
virtual btVector3 orientation() const
Definition: tgBaseRigid.cpp:87
virtual btRigidBody * getPRigidBody()
Definition: tgBaseRigid.h:76
virtual double mass() const
Definition: tgBaseRigid.h:65
virtual void teardown()
Definition: tgBaseRigid.cpp:65
Definition: tgTags.h:44