19 #ifndef TG_CONNECTOR_INFO_H
20 #define TG_CONNECTOR_INFO_H
42 #include "LinearMath/btVector3.h"
56 (void) btInfinityMask;
92 virtual std::vector<tgConnectorInfo*> createConnectorInfos(
const tgPairs& pairs,
const tgTagSearch& tagSearch);
94 virtual void initConnector(
tgWorld& world) = 0;
99 btVector3& getFrom() {
102 const btVector3& getFrom()
const
108 return m_pair.
getTo();
110 const btVector3& getTo()
const {
111 return m_pair.
getTo();
115 return m_fromRigidInfo;
118 return m_fromRigidInfo;
123 m_fromRigidInfo = rigidInfo;
127 return m_toRigidInfo;
130 return m_toRigidInfo;
135 m_toRigidInfo = rigidInfo;
139 btRigidBody* getToRigidBody();
141 btRigidBody* getFromRigidBody();
145 virtual double getMass() = 0;
149 virtual void chooseRigids(std::set<tgRigidInfo*> rigids);
152 virtual void chooseRigids(std::vector<tgRigidInfo*> rigids)
154 std::set<tgRigidInfo*> s;
155 s.insert(rigids.begin(), rigids.end());
160 tgRigidInfo* chooseRigid(std::set<tgRigidInfo*> rigids,
const btVector3& v);
164 tgRigidInfo* findClosestCenterOfMass(std::set<tgRigidInfo*> rigids,
const btVector3& v);
167 std::set<tgRigidInfo*> findRigidsContaining(std::set<tgRigidInfo*> rigids,
const btVector3& toFind);
170 bool rigidFoundIn(std::set<tgRigidInfo*> rigids,
tgRigidInfo* rigid);
193 os <<
"tgConnectorInfo(";
194 os << n.getFrom() <<
", ";
195 os << n.getTo() <<
", ";
196 os <<
"fromRigidInfo: " << n.getFromRigidInfo() <<
", ";
197 os <<
"toRigidInfo: " << n.getToRigidInfo() <<
", ";
198 os <<
"Tags: " << n.getTags();
Definition of class tgPair.
std::ostream & operator<<(std::ostream &os, const tgConnectorInfo &n)
Contains the definition of class tgTaggable.