33 #include <LinearMath/btQuaternion.h>
34 #include <LinearMath/btVector3.h>
44 tgStructure::tgStructure(
const std::string& space_separated_tags) :
tgTaggable(space_separated_tags)
48 tgStructure::~tgStructure()
50 for (std::size_t i = 0; i < m_children.size(); ++i)
68 addPair(m_nodes[fromNodeIdx], m_nodes[toNodeIdx], tags);
75 if (!m_pairs.contains(p))
77 m_pairs.addPair(
tgPair(from, to, tags));
81 std::ostringstream os;
82 os <<
"A pair matching " << p <<
" already exists in this structure.";
87 void tgStructure::move(
const btVector3& offset)
91 for (
size_t i = 0; i < m_children.size(); ++i)
94 assert(pStructure != NULL);
95 pStructure->move(offset);
100 const btVector3& axis,
103 const btQuaternion rotation(axis, angle);
108 const btVector3& fromOrientation,
109 const btVector3& toOrientation)
117 const btQuaternion& rotation)
119 m_nodes.addRotation(fixedPoint, rotation);
120 m_pairs.addRotation(fixedPoint, rotation);
122 for (std::size_t i = 0; i < m_children.size(); ++i)
125 assert(pStructure != NULL);
138 m_children.push_back(pChild);
void addChild(tgStructure *child)
Definition of class tgPair.
static btQuaternion getQuaternionBetween(btVector3 a, btVector3 b)
void addPair(int fromNodeIdx, int toNodeIdx, std::string tags="")
void addRotation(const btVector3 &fixedPoint, const btVector3 &axis, double angle)
Definition of class tgNode.
Definition of class tgStructure.
void move(const btVector3 &offset)
int addNode(const btVector3 &node)
void addNode(double x, double y, double z, std::string tags="")