NTRT Simulator
v1.1
|
#include <tgBaseRigid.h>
Inherits tgModel.
Inherited by tgBox, tgRod, and tgSphere.
Public Member Functions | |
virtual | ~tgBaseRigid () |
virtual void | teardown () |
virtual void | onVisit (const tgModelVisitor &v) const |
virtual double | mass () const |
virtual btVector3 | centerOfMass () const |
virtual btRigidBody * | getPRigidBody () |
virtual btVector3 | orientation () const |
virtual void | setup (tgWorld &world) |
virtual void | step (double dt) |
void | addChild (tgModel *pChild) |
virtual std::string | toString (std::string prefix="") const |
template<typename T > | |
std::vector< T * > | find (const tgTagSearch &tagSearch) |
template<typename T > | |
std::vector< T * > | find (const std::string &tagSearch) |
std::vector< tgModel * > | getDescendants () const |
const std::vector < abstractMarker > & | getMarkers () const |
void | addMarker (abstractMarker a) |
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 Member Functions | |
tgBaseRigid (btRigidBody *pRigidBody, const tgTags &tags) | |
Protected Attributes | |
btRigidBody * | m_pRigidBody |
const double | m_mass |
A rod is a rigid body. Length is defined by nodes, radius and density are defined by config.
Definition at line 43 of file tgBaseRigid.h.
|
virtual |
A class with a virtual memeber function requires a virtual destructor.
Definition at line 57 of file tgBaseRigid.cpp.
|
inherited |
Add a sub-model to this model. The model takes ownership of the child sub-model and is responsible for deallocating it.
[in,out] | pChild | a pointer to a sub-model |
std::invalid_argument | is pChild is NULL, this object, or already a descendant |
Definition at line 124 of file tgModel.cpp.
|
virtual |
Return the center of mass of the rod, a vector in 3-space.
Definition at line 74 of file tgBaseRigid.cpp.
|
inlineinherited |
Get a vector of descendants sorted by type and a tagsearch. Useful for pulling out muscle groups, or similar.
[in] | tagSearch,a | tagSearch that contains the desired tags |
Definition at line 125 of file tgModel.h.
|
inlineinherited |
Get a vector of descendants sorted by type and a tagsearch. Useful for pulling out muscle groups, or similar.
[in] | tagSearch,a | std::string& that contains the desired tags |
Definition at line 138 of file tgModel.h.
|
inherited |
Return a std::vector of const pointers to all sub-models.
Definition at line 172 of file tgModel.cpp.
|
inlinevirtual |
Getter for rigid body
Definition at line 76 of file tgBaseRigid.h.
|
inlinevirtual |
Return the rod's mass in application-dependent units.
Definition at line 65 of file tgBaseRigid.h.
|
virtual |
Double dispatch funciton. Will pass itself and any children back to the tgModelVisitor
Reimplemented from tgModel.
Reimplemented in tgSphere, tgBox, and tgRod.
Definition at line 59 of file tgBaseRigid.cpp.
|
virtual |
Return the rod's orientation in Euler angles.
Definition at line 87 of file tgBaseRigid.cpp.
|
virtualinherited |
Setup takes a tgWorld and passes it to any children for their own setup functions. All subclasses should call this at the appropriate time (usually end of setup) within their own setup function.
[in] | world | - the tgWorld the models will exist in. |
Reimplemented in tgSpringCableActuator, tgKinematicActuator, DuCTTTestModel, NestedBoxTestModel, NestedStructureTestModel, VerticalSpineModel, tgPrismatic, T6Model, tgCraterDeep, Wall, pidTestRig, CraterDeep, PrismModel, MuscleNPCons, tgCraterShallow, SuperBallModel, tsTestRig, Crater, PrismModel, T6Model, T12SuperBallPayload, CaterpillarModel, T6SphereModel, T6Model, T6Model, Escape_T6Model, EscapeModel, SingleRibModel, SingleRibModel, T6Model, hillyMuscleNP, simpleMuscleNP, Hilbert2DModel, tgBasicActuator, ContactTestModel, RBStringTest, TetraSpineStaticModel_hf, BaseSpineModelLearning, StructureTestModel, TetraSpineCollisions, TetraSpineStaticModel, ConnectorTestModel, TetraSpineLearningModel, BuildTestModel, FlemonsSpineModelContact, FlemonsSpineModelLearningCL, FlemonsSpineModelLearning, and RibModel.
Definition at line 57 of file tgModel.cpp.
|
virtualinherited |
Advance the simulation.
[in] | dt | the number of seconds since the previous call; std::invalid_argument is thrown if dt is not positive |
std::invalid_argument | if dt is not positive |
Reimplemented in tgSpringCableActuator, NestedStructureTestModel, ConnectorTestModel, BuildTestModel, ContactTestModel, tgKinematicActuator, StructureTestModel, DuCTTTestModel, T6Model, pidTestRig, PrismModel, NestedBoxTestModel, NestedStructureTestModel, SuperBallModel, tsTestRig, PrismModel, MuscleNPCons, T6Model, T12SuperBallPayload, CaterpillarModel, T6SphereModel, T6Model, T6Model, VerticalSpineModel, Escape_T6Model, EscapeModel, T6Model, tgCraterDeep, tgBasicActuator, Wall, CraterDeep, tgPrismatic, hillyMuscleNP, simpleMuscleNP, tgCraterShallow, Crater, RBStringTest, TetraSpineStaticModel_hf, BaseSpineModelLearning, TetraSpineCollisions, TetraSpineStaticModel, TetraSpineLearningModel, FlemonsSpineModelContact, FlemonsSpineModelLearningCL, FlemonsSpineModelLearning, and RibModel.
Definition at line 84 of file tgModel.cpp.
|
virtual |
|
virtualinherited |
Returns the tag names of this model and its children
[in] | prefix | a string to append to |
Definition at line 154 of file tgModel.cpp.
|
protected |
The rod's mass. The units are application dependent.
Definition at line 105 of file tgBaseRigid.h.
|
protected |
The Bullet Physics implementation of the rod.
Definition at line 102 of file tgBaseRigid.h.