NTRT Simulator
|
#include <tgRod.h>
Classes | |
struct | Config |
Public Member Functions | |
tgRod (btRigidBody *pRigidBody, const tgTags &tags, const double length) | |
virtual | ~tgRod () |
virtual void | teardown () |
virtual void | onVisit (const tgModelVisitor &v) const |
double | mass () const |
double | length () const |
btVector3 | centerOfMass () 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 |
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 |
A rod is a rigid body. Length is defined by nodes, radius and density are defined by config.
|
virtual |
|
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 126 of file tgModel.cpp.
btVector3 tgRod::centerOfMass | ( | ) | const |
|
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 129 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 142 of file tgModel.h.
|
inherited |
Return a std::vector of const pointers to all sub-models.
Definition at line 174 of file tgModel.cpp.
|
inline |
|
inline |
|
virtual |
Call tgModelVisitor::render() on self and all descendants.
[in,out] | r | a reference to a tgModelVisitor |
Reimplemented from tgModel.
Definition at line 81 of file tgRod.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 tgBaseString, NestedStructureTestModel, tgRBString, tgLinearString, PrismModel, SingleRibModel, SingleRibModel, T6Model, Hilbert2DModel, RBStringTest, ContactTestModel, StructureTestModel, BaseSpineModelLearning, ConnectorTestModel, TetraSpineLearningModel, BuildTestModel, FlemonsSpineModelLearningCL, FlemonsSpineModelLearning, RibModel, and FlemonsSpineModel.
Definition at line 62 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 NestedStructureTestModel, tgBaseString, ConnectorTestModel, BuildTestModel, ContactTestModel, StructureTestModel, tgLinearString, PrismModel, NestedStructureTestModel, tgRBString, T6Model, RBStringTest, BaseSpineModelLearning, TetraSpineLearningModel, FlemonsSpineModelLearningCL, FlemonsSpineModelLearning, RibModel, and FlemonsSpineModel.
Definition at line 86 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 156 of file tgModel.cpp.