NTRT Simulator
|
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 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 |
btRigidBody * | m_rigidBody |
btCollisionShape * | m_collisionShape |
tgRigidInfo * | m_rigidInfoGroup |
Definition at line 35 of file tgCompoundRigidInfo.h.
tgCompoundRigidInfo::tgCompoundRigidInfo | ( | ) |
The null constructor is the default constructor.
Definition at line 27 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 55 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 41 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 143 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 60 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 46 of file tgCompoundRigidInfo.cpp.
|
virtual |
Return a pointer to the corresponding btCollisionShape.
Implements tgRigidInfo.
Definition at line 85 of file tgCompoundRigidInfo.cpp.
|
inlinevirtual |
Return a non-const pointer to this object.
Implements tgRigidInfo.
Definition at line 151 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 159 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 139 of file tgCompoundRigidInfo.h.
|
inlinevirtualinherited |
Virtual version of getConnectionPoint quietly ignores rotation information for non-rod objects
Reimplemented in tgRodInfo.
Definition at line 243 of file tgRigidInfo.h.
|
virtual |
Return a set of the nodes contained anywhere in this compound.
Implements tgRigidInfo.
Definition at line 168 of file tgCompoundRigidInfo.cpp.
|
virtual |
Implements tgRigidInfo.
Definition at line 123 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 102 of file tgCompoundRigidInfo.cpp.
|
inlinevirtual |
Return a pointer to the corresponding btRigidBody.
Reimplemented from tgRigidInfo.
Definition at line 112 of file tgCompoundRigidInfo.h.
|
inlinevirtual |
Return a const pointer to the corresponding btRigidBody.
Reimplemented from tgRigidInfo.
Definition at line 121 of file tgCompoundRigidInfo.h.
|
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 151 of file tgRigidInfo.h.
|
virtual |
Return an identity btTransform with the origin being the center of mass.
Implements tgRigidInfo.
Definition at line 94 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 256 of file tgRigidInfo.h.
|
inlineinherited |
Set the corresponding btCollisionShape.
[in,out] | a | pointer to a btCollisionShape |
Definition at line 139 of file tgRigidInfo.h.
|
virtual |
Set the corresponding btRigidBody.
[in,out] | a | pointer to a btRigidBody |
Reimplemented from tgRigidInfo.
Definition at line 113 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 165 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.
Implements tgRigidInfo.
Definition at line 156 of file tgCompoundRigidInfo.cpp.
|
mutableprotectedinherited |
A pointer to the corresponding btCollisionShape.
Definition at line 316 of file tgRigidInfo.h.
|
mutableprotected |
The btCompoundShape that represents this compound to Bullet.
Definition at line 198 of file tgCompoundRigidInfo.h.
|
protected |
The btRididBody that represents this object to Bullet.
Definition at line 203 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 325 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 193 of file tgCompoundRigidInfo.h.