35 #include "LinearMath/btVector3.h"
41 tgStairs::Config::Config(btVector3 origin,
51 m_restitution(restitution),
58 assert(m_friction >= 0.0);
59 assert(m_restitution >= 0.0);
60 assert(m_nBlocks >= 0.0);
61 assert(m_length >= 0.0);
62 assert(m_width >= 0.0);
63 assert(m_height >= 0.0);
90 spec.addBuilder(
"box",
new tgBoxInfo(boxConfig));
105 throw std::invalid_argument(
"dt is not positive");
123 tgNode position1(0.0, 0.0, 0.0);
127 for(
size_t i = 0; i < 2 * m_config.
m_nBlocks; i += 2) {
137 btVector3 point(0.0, 0.0, 0.0);
138 btVector3 axis(0.0, 1.0, 0.0);
Create a box shape as an obstacle or add it to your tensegrity.
virtual void setup(tgWorld &world)
virtual void step(double dt)
Contains the definition of class tgStairs. A random field of blocks used to test tensegrities.
virtual void onVisit(const tgModelVisitor &r) const
Class that interfaces with Bullet to build the boxes.
void addPair(int fromNodeIdx, int toNodeIdx, std::string tags="")
virtual void onVisit(tgModelVisitor &r)
void addRotation(const btVector3 &fixedPoint, const btVector3 &axis, double angle)
Definition of class tgNode.
Definition of class tgStructure.
Definition of class tgStructureInfo.
virtual void step(double dt)
Definition of class tgBuildSpec.
virtual void setup(tgWorld &world)
void buildInto(tgModel &model, tgWorld &world)
void addNode(double x, double y, double z, std::string tags="")