47 for(std::size_t i = 0; i < pairs.size(); i++) {
54 std::vector<tgPair>& getPairs()
59 const std::vector<tgPair>& getPairs()
const
64 int addPair(
const tgPair& pair) {
66 return addElement(pair);
75 int addPair(
tgPair pair,
const std::string& space_separated_tags)
77 pair.addTags(space_separated_tags);
86 void removePair(
const tgPair& pair) {
90 void setPair(
int key,
tgPair pair) {
91 setElement(key, pair);
94 void move(
const btVector3& offset)
96 std::vector<tgPair>& pairs = getPairs();
97 for(std::size_t i = 0; i < pairs.size(); i++) {
98 pairs[i].move(offset);
102 void addRotation(
const btVector3& fixedPoint,
103 const btVector3& axis,
106 btQuaternion rotation(axis, angle);
107 addRotation(fixedPoint, rotation);
110 void addRotation(
const btVector3& fixedPoint,
111 const btVector3& fromOrientation,
112 const btVector3& toOrientation)
116 addRotation(fixedPoint, rotation);
119 void addRotation(
const btVector3& fixedPoint,
120 const btQuaternion& rotation)
122 std::vector<tgPair>& pairs = getPairs();
123 for(std::size_t i = 0; i < pairs.size(); i++) {
124 pairs[i].addRotation(fixedPoint, rotation);
133 void scale(
const btVector3& referencePoint,
double scaleFactor) {
134 std::vector<tgPair>& pairs = getPairs();
135 for(
int i = 0; i < pairs.size(); i++) {
136 pairs[i].scale(referencePoint, scaleFactor);
145 this->removeElements(other.getElements());
150 this->removeElements(other);
163 inline tgPairs operator-(
tgPairs lhs,
const std::vector<tgPair*>& rhs)
181 os <<
"tgPairs(" << std::endl;
182 const std::vector<tgPair>& pairs = p.getPairs();
183 for(std::size_t i = 0; i < pairs.size(); i++) {
184 os <<
" " << pairs[i] << std::endl;
198 std::stringstream os;
199 std::string indent = std::string(2 * (indentLevel),
' ');
201 if (pairs.size() == 0) {
202 os << indent <<
"pairs: []" << std::endl;
206 os << indent <<
"pairs:" << std::endl;
207 for(
size_t i = 0; i < pairs.size(); i++)
static btQuaternion getQuaternionBetween(btVector3 a, btVector3 b, const btVector3 &fallbackAxis=btVector3(0, 0, 0))
std::string asYamlItems(const tgPairs &pairs, int indentLevel=0)
tgPairs & operator-=(const tgPairs &other)
Definition of class tgPair.
Contains the definition of class tgTaggables.
std::ostream & operator<<(std::ostream &os, const tgPairs &p)
std::string asYamlItem(const tgNode &node, int indentLevel=0)
Rand seeding simular to the evolution and terrain classes.