38 #include "LinearMath/btVector3.h"
45 BaseSpineModelGoal::BaseSpineModelGoal(
int segments,
double goalAngle) :
47 m_goalAngle(goalAngle)
51 BaseSpineModelGoal::~BaseSpineModelGoal()
60 m_goalAngle = ((rand() / (double)RAND_MAX)) * 3.1415;
61 #endif // If we're resetting the simulation and want to change the angle
63 double xPos = 350 * sin(m_goalAngle);
64 double zPos = 350 * cos(m_goalAngle);
68 goalBox.
addNode(xPos, 20.0, zPos);
69 goalBox.
addNode(xPos + 5.0, 20.0, zPos);
71 std::cout <<
"Goal Position: " << xPos <<
" " << zPos << std::endl;
73 goalBox.
addPair(0, 1,
"goalBox");
79 boxSpec.addBuilder(
"goalBox",
new tgBoxInfo(boxConfig));
83 goalStructureInfo.
buildInto(*
this, world);
86 m_goalBox = (find<tgBox>(
"goalBox"))[0];
88 assert(m_goalBox != NULL);
110 btVector3 BaseSpineModelGoal::goalBoxPosition()
const
Create a box shape as an obstacle or add it to your tensegrity.
virtual void setup(tgWorld &world)
virtual void setup(tgWorld &world)
virtual btVector3 centerOfMass() const
Implementing the tetrahedral complex spine inspired by Tom Flemons.
virtual void step(double dt)
Class that interfaces with Bullet to build the boxes.
void addPair(int fromNodeIdx, int toNodeIdx, std::string tags="")
Definition of class tgStructure.
Definition of class tgStructureInfo.
Rand seeding simular to the evolution and terrain classes.
Definition of class tgBuildSpec.
virtual void step(double dt)
void buildInto(tgModel &model, tgWorld &world)
void addNode(double x, double y, double z, std::string tags="")