NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgRod.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_ROD_H
20 #define TG_ROD_H
21 
29 // This application
30 #include "tgBaseRigid.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 tgRod : public tgBaseRigid
44 {
45 public:
46 
52  struct Config
53  {
59  Config(double r = 0.5,
60  double d = 1.0,
61  double f = 1.0,
62  double rf = 0.0,
63  double res = 0.2);
64 
65 
66 
68  const double radius;
69 
71  const double density;
72 
75  const double friction;
77 
80  const double rollFriction;
81 
84  const double restitution;
85  };
86 
87  tgRod(btRigidBody* pRigidBody,
88  const tgTags& tags,
89  const double length);
90 
92  virtual ~tgRod();
93 
94  virtual void teardown();
95 
96  virtual void onVisit(const tgModelVisitor& v) const;
97 
102  double length() const { return m_length; }
103 
104 private:
105 
107  bool invariant() const;
108 
109 private:
110 
112  const double m_length;
113 };
114 
115 #endif
Config(double r=0.5, double d=1.0, double f=1.0, double rf=0.0, double res=0.2)
Definition: tgRod.cpp:38
const double rollFriction
Definition: tgRod.h:80
Create a box shape as an obstacle or add it to your tensegrity.
const double density
Definition: tgRod.h:71
const double radius
Definition: tgRod.h:68
double length() const
Definition: tgRod.h:102
virtual void teardown()
Definition: tgRod.cpp:84
const double friction
Definition: tgRod.h:76
const double restitution
Definition: tgRod.h:84
virtual ~tgRod()
Definition: tgRod.cpp:76
Definition: tgRod.h:43
Definition: tgTags.h:44
virtual void onVisit(const tgModelVisitor &v) const
Definition: tgRod.cpp:78