38 #include "LinearMath/btVector3.h"
70 double targetVelocity;
109 const double half_length = c.rod_length / 2;
111 s.
addNode(-c.rod_space, -half_length, 0,
"sphere1");
112 s.
addNode(-c.rod_space, half_length, 0,
"sphere2");
113 s.
addNode( c.rod_space, -half_length, 0,
"sphere1");
114 s.
addNode( c.rod_space, half_length, 0,
"sphere2");
115 s.
addNode(0, -c.rod_space, -half_length,
"sphere1");
116 s.
addNode(0, -c.rod_space, half_length,
"sphere1");
117 s.
addNode(0, c.rod_space, -half_length,
"sphere2");
118 s.
addNode(0, c.rod_space, half_length,
"sphere1");
119 s.
addNode(-half_length, 0, c.rod_space,
"sphere2");
120 s.
addNode( half_length, 0, c.rod_space,
"sphere1");
121 s.
addNode(-half_length, 0, -c.rod_space,
"sphere2");
122 s.
addNode( half_length, 0, -c.rod_space,
"sphere2");
175 const tgRod::Config rodConfig(c.radius, c.density, c.friction,
176 c.rollFriction, c.restitution);
179 c.maxTens, c.targetVelocity,
191 s.move(btVector3(0, 10, 0));
195 btVector3 rotationPoint = btVector3(0, 0, 0);
196 btVector3 rotationAxis = btVector3(0, 1, 0);
197 double rotationAngle = M_PI/2;
198 s.
addRotation(rotationPoint, rotationAxis, rotationAngle);
202 spec.addBuilder(
"rod",
new tgRodInfo(rodConfig));
212 structureInfo.buildInto(*
this, world);
216 allMuscles = tgCast::filter<tgModel, tgSpringCableActuator> (
getDescendants());
230 throw std::invalid_argument(
"dt is not positive");
virtual void setup(tgWorld &world)
Definition of class tgRodInfo.
Definition of class tgSphereInfo.
Contains the definition of class T6SphereModel. $Id$.
virtual void onVisit(tgModelVisitor &r)
Contains the definition of class tgSphere.
virtual void step(double dt)
const std::vector< tgSpringCableActuator * > & getAllMuscles() const
virtual void onVisit(const tgModelVisitor &r) const
void addPair(int fromNodeIdx, int toNodeIdx, std::string tags="")
Contains the definition of abstract base class tgSpringCableActuator. Assumes that the string is line...
void addRotation(const btVector3 &fixedPoint, const btVector3 &axis, double angle)
Definition of class tgStructure.
virtual void setup(tgWorld &world)
virtual void step(double dt)
Definition of class tgStructureInfo.
Contains the definition of class tgRod.
Definition of class tgBuildSpec.
void notifyStep(double dt)
std::vector< tgModel * > getDescendants() const
void addNode(double x, double y, double z, std::string tags="")