NTRT Simulator
Version: Master
|
Public Member Functions | |
tgCompoundRigidInfo () | |
tgModel * | createModel (tgWorld &world) |
virtual | ~tgCompoundRigidInfo () |
void | addRigid (tgRigidInfo &rigid) |
virtual btVector3 | getCenterOfMass () const |
btCompoundShape * | createCompoundShape (tgWorld &world) const |
virtual btCollisionShape * | getCollisionShape (tgWorld &world) const |
virtual btTransform | getTransform () const |
virtual double | getMass () const |
virtual btRigidBody * | getRigidBody () |
virtual const btRigidBody * | getRigidBody () const |
virtual void | setRigidBody (btRigidBody *const rigidBody) |
virtual btCollisionObject * | getCollisionObject () |
virtual const btCollisionObject * | getCollisionObject () const |
virtual void | setCollisionObject (btCollisionObject *collisionObject) |
virtual btVector3 | getConnectionPoint (const btVector3 &referencePoint, const btVector3 &) const |
virtual tgCompoundRigidInfo * | getCompound () |
virtual const tgCompoundRigidInfo * | getCompound () const |
virtual std::set< tgRigidInfo * > | getLeafRigids () |
virtual bool | containsNode (const btVector3 &nodeVector) const |
virtual bool | sharesNodesWith (const tgRigidInfo &other) const |
std::set< btVector3 > | getContainedNodes () const |
virtual tgRigidInfo * | createRigidInfo (const tgNode &node) |
virtual tgRigidInfo * | createRigidInfo (const tgPair &pair) |
virtual tgRigidInfo * | createRigidInfo (const tgNode &node, const tgTagSearch &tagSearch) |
virtual tgRigidInfo * | createRigidInfo (const tgPair &pair, const tgTagSearch &tagSearch) |
virtual std::vector < tgRigidInfo * > | createRigidInfos (const tgNodes &nodes, const tgTagSearch &tagSearch) |
virtual std::vector < tgRigidInfo * > | createRigidInfos (const tgPairs &pairs, const tgTagSearch &tagSearch) |
virtual void | initRigidBody (tgWorld &world) |
void | setCollisionShape (btCollisionShape *p_btCollisionShape) |
virtual tgRigidInfo * | getRigidInfoGroup () |
virtual const tgRigidInfo * | getRigidInfoGroup () const |
virtual void | setRigidInfoGroup (tgRigidInfo *rigidInfoGroup) |
virtual btVector3 | getConnectionPoint (const btVector3 &referencePoint, const btVector3 &destinationPoint, const double rotation) const |
bool | isCompound () const |
void | addTags (const std::string &space_separated_tags) |
void | addTags (const tgTags &tags) |
bool | hasTag (const std::string tag) const |
bool | hasAllTags (std::string tags) |
bool | hasAnyTags (const std::string tags) |
bool | hasNoTags () |
tgTags & | getTags () |
const tgTags & | getTags () const |
void | setTags (tgTags tags) |
std::string | getTagStr (std::string delim=" ") const |
Protected Attributes | |
std::vector< tgRigidInfo * > | m_rigids |
btCompoundShape * | m_compoundShape |
btCollisionShape * | m_collisionShape |
tgRigidInfo * | m_rigidInfoGroup |
btCollisionObject * | m_collisionObject |
Definition at line 36 of file tgCompoundRigidInfo.h.
tgCompoundRigidInfo::tgCompoundRigidInfo | ( | ) |
The null constructor is the default constructor.
Definition at line 28 of file tgCompoundRigidInfo.cpp.
|
inlinevirtual |
The destructor does not own the btRigidBody objects and must not deallocate them. Additionally, collision shapes cannot be deallocated until the world is deleted
Definition at line 56 of file tgCompoundRigidInfo.h.
void tgCompoundRigidInfo::addRigid | ( | tgRigidInfo & | rigid | ) |
Insert a pointer to the supplied tgRigidInfo into a container. The tgCompoundRigidInfo does not assume ownership of the tgRigidInfo, and must not deallocate it.
[in,out] | rigit | a tgRigidInfo |
Definition at line 42 of file tgCompoundRigidInfo.cpp.
|
virtual |
Is the given vector a node anywhere in this compound?
true | if nodeVector is a node anywhere in this compound |
false | if nodeVector is not a node anywhere in this compound |
Implements tgRigidInfo.
Definition at line 167 of file tgCompoundRigidInfo.cpp.
btCompoundShape * tgCompoundRigidInfo::createCompoundShape | ( | tgWorld & | world | ) | const |
Return a pointer to the corresponding btCollisionShape, lazily creating it if it does not exist..
Definition at line 61 of file tgCompoundRigidInfo.cpp.
|
virtual |
Return the center of mass of all the tgRigidInfo objects in the tree.
a | zero vector if the mass is zero |
Make this const here and in all base classes and derived classes.
Make rigid const when tgCompoundRigidInfo::getCenterOfMass() is const.
If all m_rigids are supplied in the constructor, this can be calculated in the constructor and cashed as a const member variable.
Implements tgRigidInfo.
Definition at line 47 of file tgCompoundRigidInfo.cpp.
|
inlinevirtual |
Return a pointer to the collisionObject without upcasting
Reimplemented from tgRigidInfo.
Definition at line 131 of file tgCompoundRigidInfo.h.
|
inlinevirtual |
Return a pointer to the collisionObject without upcasting
Reimplemented from tgRigidInfo.
Definition at line 140 of file tgCompoundRigidInfo.h.
|
virtual |
Return a pointer to the corresponding btCollisionShape.
Implements tgRigidInfo.
Definition at line 86 of file tgCompoundRigidInfo.cpp.
|
inlinevirtual |
Return a non-const pointer to this object.
Implements tgRigidInfo.
Definition at line 169 of file tgCompoundRigidInfo.h.
|
inlinevirtual |
Return a const pointer to this object.
What is the purpose? The caller must already have the object, a reference or a pointer to be able to call this.
Add this to the base classes and derived classes.
Implements tgRigidInfo.
Definition at line 177 of file tgCompoundRigidInfo.h.
|
inlinevirtual |
By default this should look for the object that has the closest connectionPoint to the destination or something. That may change, or we might provide a strategy-based object here?
Implements tgRigidInfo.
Definition at line 157 of file tgCompoundRigidInfo.h.
|
inlinevirtualinherited |
Virtual version of getConnectionPoint quietly ignores rotation information for non-rod objects
Reimplemented in tgBoxInfo, tgRodInfo, and tgSphereInfo.
Definition at line 260 of file tgRigidInfo.h.
|
virtual |
Return a set of the nodes contained anywhere in this compound.
Implements tgRigidInfo.
Definition at line 192 of file tgCompoundRigidInfo.cpp.
|
virtual |
Implements tgRigidInfo.
Definition at line 147 of file tgCompoundRigidInfo.cpp.
|
virtual |
Return the compound's mass. The mass is the sum of the masses of all the tgRigidInfo objects in the compound.
Implements tgRigidInfo.
Definition at line 103 of file tgCompoundRigidInfo.cpp.
|
virtual |
Return a pointer to the corresponding btRigidBody.
Reimplemented from tgRigidInfo.
Definition at line 114 of file tgCompoundRigidInfo.cpp.
|
virtual |
Return a const pointer to the corresponding btRigidBody.
Reimplemented from tgRigidInfo.
Definition at line 120 of file tgCompoundRigidInfo.cpp.
|
inlinevirtualinherited |
Get the tgRigidInfo that represents the compound rigid that this rigid belongs to. If it doesn't share nodes with any other rigids (determined during auto-compounding), it will point to itself.
Definition at line 149 of file tgRigidInfo.h.
|
virtual |
Return an identity btTransform with the origin being the center of mass.
Implements tgRigidInfo.
Definition at line 95 of file tgCompoundRigidInfo.cpp.
|
inlineinherited |
Is this tgRigidInfo a compound?
true | if this tgRigidInfo is a compound |
false | if this tgRigidInfo is not a compound |
Definition at line 273 of file tgRigidInfo.h.
|
virtual |
Set the collision object to a new collision object
Reimplemented from tgRigidInfo.
Definition at line 136 of file tgCompoundRigidInfo.cpp.
|
inlineinherited |
Set the corresponding btCollisionShape.
[in,out] | a | pointer to a btCollisionShape |
Definition at line 137 of file tgRigidInfo.h.
|
virtual |
Set the corresponding btRigidBody.
[in,out] | a | pointer to a btRigidBody |
Reimplemented from tgRigidInfo.
Definition at line 126 of file tgCompoundRigidInfo.cpp.
|
inlinevirtualinherited |
Set the tgRigidInfo that represents the compound rigid that this may belong to. This will be set during auto-compounding.
Definition at line 163 of file tgRigidInfo.h.
|
virtual |
Make this const in all base classes and all derived classes.
Make other const in all base classes and all derived classes.
Reimplemented from tgRigidInfo.
Definition at line 180 of file tgCompoundRigidInfo.cpp.
|
mutableprotectedinherited |
A pointer to the corresponding btCollisionObject. Typically a btRigidBody, but can also be a btGhostObject
Definition at line 347 of file tgRigidInfo.h.
|
mutableprotectedinherited |
A pointer to the corresponding btCollisionShape.
Definition at line 332 of file tgRigidInfo.h.
|
mutableprotected |
The btCompoundShape that represents this compound to Bullet.
Definition at line 216 of file tgCompoundRigidInfo.h.
|
mutableprotectedinherited |
A pointer to a group of rigids to which this rigid belongs. This is set during the rigid grouping step by a StructureInfo. If this is not set, getRigidGroup() will return a pointer to this (effectively, "I'm in my own group")
Definition at line 341 of file tgRigidInfo.h.
|
protected |
A collection of tgRigidInfo pointers, each supplied by the client.
Change this to std::set to prevent duplication.
Make this const and initialize it in the constructor.
Definition at line 211 of file tgCompoundRigidInfo.h.