NTRT Simulator
v1.1
|
#include <tgRigidInfo.h>
Inherits tgTaggable.
Inherited by tgBoxInfo, tgCompoundRigidInfo, tgRodInfo, and tgSphereInfo.
Public Member Functions | |
tgRigidInfo (tgTags tags) | |
tgRigidInfo (const std::string &space_separated_tags) | |
virtual | ~tgRigidInfo () |
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) |
virtual tgModel * | createModel (tgWorld &world)=0 |
virtual btCollisionShape * | getCollisionShape (tgWorld &world) const =0 |
void | setCollisionShape (btCollisionShape *p_btCollisionShape) |
virtual tgRigidInfo * | getRigidInfoGroup () |
virtual const tgRigidInfo * | getRigidInfoGroup () const |
virtual void | setRigidInfoGroup (tgRigidInfo *rigidInfoGroup) |
virtual btRigidBody * | getRigidBody () |
virtual const btRigidBody * | getRigidBody () const |
virtual void | setRigidBody (btRigidBody *rigidBody) |
virtual btCollisionObject * | getCollisionObject () |
virtual const btCollisionObject * | getCollisionObject () const |
virtual void | setCollisionObject (btCollisionObject *collisionObject) |
virtual btTransform | getTransform () const =0 |
virtual double | getMass () const =0 |
virtual btVector3 | getCenterOfMass () const =0 |
virtual btVector3 | getConnectionPoint (const btVector3 &referencePoint, const btVector3 &destinationPoint) const =0 |
virtual btVector3 | getConnectionPoint (const btVector3 &referencePoint, const btVector3 &destinationPoint, const double rotation) const |
bool | isCompound () const |
virtual tgCompoundRigidInfo * | getCompound ()=0 |
virtual const tgCompoundRigidInfo * | getCompound () const =0 |
virtual std::set< tgRigidInfo * > | getLeafRigids ()=0 |
virtual bool | containsNode (const btVector3 &nodeVector) const =0 |
virtual std::set< btVector3 > | getContainedNodes () const =0 |
virtual bool | sharesNodesWith (const tgRigidInfo &other) 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 | |
btCollisionShape * | m_collisionShape |
tgRigidInfo * | m_rigidInfoGroup |
btCollisionObject * | m_collisionObject |
A collector for keeping track of all of the necessary components of a rigid model during the build process. Information is filled in in the following order:
Note: A tgRigidInfo is a tree. If it is not compound, the tree has one node.
Definition at line 75 of file tgRigidInfo.h.
|
inlinevirtual |
The destructor has nothing to do.
Definition at line 100 of file tgRigidInfo.h.
|
pure virtual |
Is the given vector a node anywhere in this rigid body?
true | if nodeVector is a node anywhere in this rigid body |
false | if nodeVector is not a node anywhere in this rigid body |
Implemented in tgBoxInfo, tgRodInfo, tgSphereInfo, and tgCompoundRigidInfo.
|
pure virtual |
Return the rigid body's center of mass.
Implemented in tgBoxInfo, tgRodInfo, tgSphereInfo, and tgCompoundRigidInfo.
|
inlinevirtual |
Return a pointer to the collisionObject without upcasting
Reimplemented in tgCompoundRigidInfo.
Definition at line 190 of file tgRigidInfo.h.
|
inlinevirtual |
Return a pointer to the collisionObject without upcasting
Reimplemented in tgCompoundRigidInfo.
Definition at line 199 of file tgRigidInfo.h.
|
pure virtual |
Return a pointer to the corresponding btCollisionShape.
Implemented in tgBoxInfo, tgRodInfo, tgSphereInfo, and tgCompoundRigidInfo.
|
pure virtual |
If this tgRigidInfo is a tgCompoundRigidInfo, return a pointer to it; otherwise return NULL.
NULL | if this tgRigidInfo is not a tgCompoundRigidInfo |
the | this pointer if this tgRigidInfo is a tgCompoundRigidInfo |
Implemented in tgBoxInfo, tgRodInfo, tgSphereInfo, and tgCompoundRigidInfo.
|
pure virtual |
If this tgRigidInfo is a tgCompoundRigidInfo, return a pointer to it; otherwise return NULL.
NULL | if this tgRigidInfo is not a tgCompoundRigidInfo |
the | this pointer if this tgRigidInfo is a tgCompoundRigidInfo |
Implemented in tgBoxInfo, tgRodInfo, tgSphereInfo, and tgCompoundRigidInfo.
|
pure virtual |
Add this (for determining, for instance, an edge connection point for a cylinder, a surface point on a ball, etc.) Usually the referencePoint is something like the node at the end of a cylinder or the center point of a sphere, and the destinationPoint is a point on the other object that we'll be connecting to. In the case of a cylinder, this function might return the edge point closest to the destinationPoint.
Or for an irregular surface (or any shape for that matter), you could keep a list of surface points and have this function select the closest one to the destination.
: For the generic tgRigidInfo implementation, allow people to provide a delegate object to find the connection point.
: Should this return a reference instead of a value? Possibility of change indicates a reference, but do we want to allow this to be changeable?
Implemented in tgCompoundRigidInfo, tgBoxInfo, tgRodInfo, and tgSphereInfo.
|
inlinevirtual |
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.
|
pure virtual |
Return the set of nodes contained anywhere in the rigid body. For instance, a tgRod would return a set containing its 'from' and 'to' points.
Implemented in tgBoxInfo, tgRodInfo, tgSphereInfo, and tgCompoundRigidInfo.
|
pure virtual |
Return a set of all non-compound tgRigidInfo objects in the tgRigidInfo tree.
Implemented in tgBoxInfo, tgRodInfo, tgSphereInfo, and tgCompoundRigidInfo.
|
pure virtual |
Return the rigid body's mass.
Implemented in tgBoxInfo, tgRodInfo, tgSphereInfo, and tgCompoundRigidInfo.
|
virtual |
Return a pointer to the corresponding btRigidBody.
Reimplemented in tgCompoundRigidInfo.
Definition at line 124 of file tgRigidInfo.cpp.
|
virtual |
Return a const pointer to the corresponding btRigidBody.
Reimplemented in tgCompoundRigidInfo.
Definition at line 130 of file tgRigidInfo.cpp.
|
inlinevirtual |
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.
|
pure virtual |
Return a btTransform.
Implemented in tgBoxInfo, tgRodInfo, tgSphereInfo, and tgCompoundRigidInfo.
|
inline |
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.
|
inlinevirtual |
Set the collision object to a new collision object
Reimplemented in tgCompoundRigidInfo.
Definition at line 208 of file tgRigidInfo.h.
|
inline |
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 in tgCompoundRigidInfo.
Definition at line 135 of file tgRigidInfo.cpp.
|
inlinevirtual |
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 |
Does this rigid have any nodes in common with the given tgRigidInfo object?
in] | other a reference to a tgRigidInfo object |
true | if any node in this sphere is also in other |
false | if no node in this sphere is also in other |
Reimplemented in tgCompoundRigidInfo.
Definition at line 141 of file tgRigidInfo.cpp.
|
mutableprotected |
A pointer to the corresponding btCollisionObject. Typically a btRigidBody, but can also be a btGhostObject
Definition at line 347 of file tgRigidInfo.h.
|
mutableprotected |
A pointer to the corresponding btCollisionShape.
Definition at line 332 of file tgRigidInfo.h.
|
mutableprotected |
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.