19 #ifndef CONNECTOR_TEST_MODEL_H
20 #define CONNECTOR_TEST_MODEL_H
28 #include "btBulletDynamicsCommon.h"
55 const double density = 0.9;
56 const double radius = 0.3;
73 pairs.addPair(nodes.
pair(0, 1),
"rod");
74 pairs.addPair(nodes.
pair(1, 2),
"rod");
75 pairs.addPair(nodes.
pair(1, 3),
"rod");
77 pairs.addPair(nodes.
pair(4, 5),
"rod");
78 pairs.addPair(nodes.
pair(5, 6),
"rod");
79 pairs.addPair(nodes.
pair(5, 7),
"rod");
83 musclePairs.addPair(nodes.
pair(2, 6),
"muscle");
84 musclePairs.addPair(nodes.
pair(3, 7),
"muscle");
85 musclePairs.addPair(nodes.
pair(2, 7),
"muscle");
86 musclePairs.addPair(nodes.
pair(3, 6),
"muscle");
92 std::vector<tgRigidInfo*> rigids;
93 for(
int i = 0; i < pairs.size(); i++) {
94 rigids.push_back(
new tgRodInfo(rodConfig, pairs[i]));
99 autoCompound.execute();
102 std::vector<tgRigidInfo*>::iterator it;
103 for(it = rigids.begin(); it != rigids.end(); it++) {
104 (*it)->initRigidBody(world);
114 std::set<tgConnectorInfo*> muscles;
115 for(
int i = 0; i < musclePairs.size(); i++) {
118 std::cout <<
"tgConnectorInfo: " << std::endl;
119 std::cout << *s << std::endl;
122 s->chooseRigids(rigids);
123 }
catch(std::exception e) {
124 std::cout <<
"caught exception " << e.what() << std::endl;
127 s->initConnector(world);
134 for(it = rigids.begin(); it != rigids.end(); it++) {
135 (*it)->createModel(world);
163 void changeMuscle (
double length)
Definition of class tgRodInfo.
void addChild(tgModel *pChild)
virtual void step(double dt)
Definition of tgSubject class.
tgPair pair(int from, int to, std::string tags="")
virtual void step(double dt)
Definition of class tgBasicActuatorInfo.
virtual void onVisit(const tgModelVisitor &r) const
Contains the definition of class tgModel.
Definition of class tgNodes.
Contains the definition of interface class tgModelVisitor.
Contains the definition of class tgBasicActuator.
virtual void setup(tgWorld &world)
virtual void onVisit(const tgModelVisitor &r) const
int addNode(const btVector3 &node)
Definition of class tgRigidAutoCompound.
void notifyStep(double dt)