NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgBulletSpringCable.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 SRC_CORE_TG_BULLET_SPRING_CABLE_H_
20 #define SRC_CORE_TG_BULLET_SPRING_CABLE_H_
21 
28 // NTRT
29 #include "tgSpringCable.h"
30 
31 // The Bullet Physics library
32 #include "LinearMath/btVector3.h"
33 // The C++ Standard Library
34 
35 #include <vector>
36 
37 // Forward references
38 class btRigidBody;
41 
48 {
49 public:
59  tgBulletSpringCable( const std::vector<tgBulletSpringCableAnchor*>& anchors,
60  double coefK,
61  double dampingCoefficient,
62  double pretension = 0.0);
63 
67  virtual ~tgBulletSpringCable();
68 
73  virtual void step(double dt);
74 
79  virtual const double getActualLength() const;
80 
86  virtual const double getTension() const;
87 
94  virtual const std::vector<const tgSpringCableAnchor*> getAnchors() const;
95 
96 protected:
97 
105  std::vector<tgBulletSpringCableAnchor*> m_anchors;
106 
112 
117 
118 private:
119 
125  virtual void calculateAndApplyForce(double dt);
126 
127 private:
129  bool invariant(void) const;
130 };
131 
132 #endif // SRC_CORE_TG_BULLET_SPRING_CABLE_H_
virtual const double getActualLength() const
virtual void step(double dt)
Definitions of class tgSpringCable.
tgBulletSpringCable(const std::vector< tgBulletSpringCableAnchor * > &anchors, double coefK, double dampingCoefficient, double pretension=0.0)
virtual const std::vector< const tgSpringCableAnchor * > getAnchors() const
tgBulletSpringCableAnchor *const anchor2
virtual const double getTension() const
std::vector< tgBulletSpringCableAnchor * > m_anchors
tgBulletSpringCableAnchor *const anchor1