36 #include "LinearMath/btVector3.h"
67 double targetVelocity;
105 const double half_length = c.rod_length / 2;
107 s.
addNode(-c.rod_space, -half_length, 0);
108 s.
addNode(-c.rod_space, half_length, 0);
109 s.
addNode( c.rod_space, -half_length, 0);
110 s.
addNode( c.rod_space, half_length, 0);
111 s.
addNode(0, -c.rod_space, -half_length);
112 s.
addNode(0, -c.rod_space, half_length);
113 s.
addNode(0, c.rod_space, -half_length);
114 s.
addNode(0, c.rod_space, half_length);
115 s.
addNode(-half_length, 0, c.rod_space);
116 s.
addNode( half_length, 0, c.rod_space);
117 s.
addNode(-half_length, 0, -c.rod_space);
118 s.
addNode( half_length, 0, -c.rod_space);
171 const tgRod::Config rodConfig(c.radius, c.density, c.friction,
172 c.rollFriction, c.restitution);
175 c.maxTens, c.targetVelocity,
183 s.move(btVector3(0, 10, 0));
187 btVector3 rotationPoint = btVector3(0, 0, 0);
188 btVector3 rotationAxis = btVector3(0, 1, 0);
189 double rotationAngle = M_PI/2;
190 s.
addRotation(rotationPoint, rotationAxis, rotationAngle);
194 spec.addBuilder(
"rod",
new tgRodInfo(rodConfig));
201 structureInfo.buildInto(*
this, world);
205 allMuscles = tgCast::filter<tgModel, tgLinearString> (
getDescendants());
219 throw std::invalid_argument(
"dt is not positive");
virtual void setup(tgWorld &world)
Definition of class tgRodInfo.
Contains the definition of class T6Model. $Id$.
virtual void step(double dt)
virtual void onVisit(tgModelVisitor &r)
virtual void onVisit(const tgModelVisitor &r) const
virtual void setup(tgWorld &world)
void addPair(int fromNodeIdx, int toNodeIdx, std::string tags="")
void addRotation(const btVector3 &fixedPoint, const btVector3 &axis, double angle)
virtual void step(double dt)
Contains the definition of class tgLinearString.
Definition of class tgStructure.
Definition of class tgStructureInfo.
Definition of class tgLinearStringInfo.
const std::vector< tgLinearString * > & getAllMuscles() const
Contains the definition of class tgRod $Id$.
Definition of class tgBuildSpec.
void notifyStep(double dt)
std::vector< tgModel * > getDescendants() const
void addNode(double x, double y, double z, std::string tags="")