NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgBox.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_BOX_H
20 #define TG_BOX_H
21 
29 // This application
30 #include "tgBaseRigid.h"
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 tgBox : public tgBaseRigid
44 {
45 public:
46 
52  struct Config
53  {
59  Config(double w = 1.0,
60  double h = 1.0,
61  double d = 1.0,
62  double f = 1.0,
63  double rf = 0.0,
64  double res = 0.2);
65 
66 
68  const double width;
69 
71  const double height;
72 
74  const double density;
75 
78  const double friction;
79 
82  const double rollFriction;
83 
86  const double restitution;
87  };
88 
89  tgBox(btRigidBody* pRigidBody,
90  const tgTags& tags,
91  const double length);
92 
94  virtual ~tgBox();
95 
96  virtual void teardown();
97 
98  virtual void onVisit(const tgModelVisitor& v) const;
99 
104  double length() const { return m_length; }
105 
106 
107 private:
108 
110  bool invariant() const;
111 
112 private:
113 
115  const double m_length;
116 };
117 
118 #endif
const double restitution
Definition: tgBox.h:86
const double height
Definition: tgBox.h:71
const double rollFriction
Definition: tgBox.h:82
virtual void teardown()
Definition: tgBox.cpp:85
Create a box shape as an obstacle or add it to your tensegrity.
double length() const
Definition: tgBox.h:104
const double density
Definition: tgBox.h:74
virtual ~tgBox()
Definition: tgBox.cpp:77
Definition: tgBox.h:43
Config(double w=1.0, double h=1.0, double d=1.0, double f=1.0, double rf=0.0, double res=0.2)
Definition: tgBox.cpp:36
const double width
Definition: tgBox.h:68
virtual void onVisit(const tgModelVisitor &v) const
Definition: tgBox.cpp:79
Definition: tgTags.h:44
const double friction
Definition: tgBox.h:78