26 #include "PrismModel.h"
36 #include "LinearMath/btVector3.h"
41 #include <json/json.h>
61 double triangle_length;
62 double triangle_height;
94 tetra.
addNode(-edge / 2.0, 0, 0);
96 tetra.
addNode( edge / 2.0, 0, 0);
100 tetra.
addNode(-edge / 2.0, height, 0);
102 tetra.
addNode( edge / 2.0, height, 0);
104 tetra.
addNode(0, height, width);
147 bool parsingSuccessful = reader.parse( FileHelpers::getFileString(configPath), root );
148 if ( !parsingSuccessful )
151 std::cout <<
"Failed to parse configuration\n"
152 << reader.getFormattedErrorMessages();
157 double triangle_height = root.get(
"triangle_height",
"UTF-8").asDouble();
158 double triangle_length = root.get(
"triangle_length",
"UTF-8").asDouble();
159 double prism_height = root.get(
"prism_height",
"UTF-8").asDouble();
163 addNodes(s, triangle_length, triangle_height, prism_height);
172 s.move(btVector3(0, 10, 0));
176 spec.addBuilder(
"rod",
new tgRodInfo(rodConfig));
183 structureInfo.buildInto(*
this, world);
187 allActuators = tgCast::filter<tgModel, tgSpringCableActuator> (
getDescendants());
201 throw std::invalid_argument(
"dt is not positive");
virtual void step(double dt)
virtual void setup(tgWorld &world)
Definition of class tgRodInfo.
virtual void step(double dt)
Definition of class tgBasicActuatorInfo.
virtual void onVisit(const tgModelVisitor &r) const
void addPair(int fromNodeIdx, int toNodeIdx, std::string tags="")
A series of functions to assist with file input/output.
static std::string getResourcePath(std::string relPath)
Contains the definition of class tgBasicActuator.
virtual void onVisit(tgModelVisitor &r)
Definition of class tgStructure.
Definition of class tgStructureInfo.
Contains the definition of class tgRod.
Definition of class tgBuildSpec.
virtual void setup(tgWorld &world)
const std::vector< tgSpringCableActuator * > & getAllActuators() const
void notifyStep(double dt)
std::vector< tgModel * > getDescendants() const
void addNode(double x, double y, double z, std::string tags="")