32 #include <LinearMath/btQuaternion.h>
33 #include <LinearMath/btVector3.h>
43 tgStructure::tgStructure(
const std::string& space_separated_tags) :
tgTaggable(space_separated_tags)
47 tgStructure::~tgStructure()
49 for (std::size_t i = 0; i < m_children.size(); ++i)
67 addPair(m_nodes[fromNodeIdx], m_nodes[toNodeIdx], tags);
74 if (!m_pairs.contains(p))
76 m_pairs.addPair(
tgPair(from, to, tags));
80 std::ostringstream os;
81 os <<
"A pair matching " << p <<
" already exists in this structure.";
86 void tgStructure::move(
const btVector3& offset)
90 for (
size_t i = 0; i < m_children.size(); ++i)
93 assert(pStructure != NULL);
94 pStructure->move(offset);
99 const btVector3& axis,
102 const btQuaternion rotation(axis, angle);
107 const btVector3& fromOrientation,
108 const btVector3& toOrientation)
116 const btQuaternion& rotation)
118 m_nodes.addRotation(fixedPoint, rotation);
119 m_pairs.addRotation(fixedPoint, rotation);
120 for (std::size_t i = 0; i < m_children.size(); ++i)
123 assert(pStructure != NULL);
136 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="")