NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgSphere.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_SPHERE_H
20 #define TG_SPHERE_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 tgSphere : 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;
76 
79  const double rollFriction;
80 
83  const double restitution;
84  };
85 
91  tgSphere(btRigidBody* pRigidBody,
92  const tgTags& tags);
93 
95  virtual ~tgSphere();
96 
101  virtual void teardown();
102 
103  virtual void onVisit(const tgModelVisitor& v) const;
104 
105 private:
106 
108  bool invariant() const;
109 
110 };
111 
112 #endif
const double density
Definition: tgSphere.h:71
Create a box shape as an obstacle or add it to your tensegrity.
const double friction
Definition: tgSphere.h:75
virtual ~tgSphere()
Definition: tgSphere.cpp:72
Config(double r=0.5, double d=1.0, double f=1.0, double rf=0.0, double res=0.2)
Definition: tgSphere.cpp:36
const double rollFriction
Definition: tgSphere.h:79
virtual void onVisit(const tgModelVisitor &v) const
Definition: tgSphere.cpp:74
const double radius
Definition: tgSphere.h:68
tgSphere(btRigidBody *pRigidBody, const tgTags &tags)
Definition: tgSphere.cpp:58
virtual void teardown()
Definition: tgSphere.cpp:80
const double restitution
Definition: tgSphere.h:83
Definition: tgTags.h:44