Definition at line 41 of file tgLinearString.h.
Same as other constructor, just a different type of tags
Definition at line 79 of file tgLinearString.cpp.
tgLinearString::~tgLinearString |
( |
| ) |
|
|
virtual |
void tgModel::addChild |
( |
tgModel * |
pChild | ) |
|
|
inherited |
Add a sub-model to this model. The model takes ownership of the child sub-model and is responsible for deallocating it.
- Parameters
-
[in,out] | pChild | a pointer to a sub-model |
- Exceptions
-
std::invalid_argument | is pChild is NULL, this object, or already a descendant |
- Todo:
- Make sure that every child appears no more than once in the tree.
Definition at line 126 of file tgModel.cpp.
Attach an observer to the subject of the observer.
- Parameters
-
[in,out] | pObserver | a pointer to an observer for the subject; do nothing if the pointer is NULL |
template<typename T >
std::vector<T*> tgModel::find |
( |
const tgTagSearch & |
tagSearch | ) |
|
|
inlineinherited |
Get a vector of descendants sorted by type and a tagsearch. Useful for pulling out muscle groups, or similar.
- Parameters
-
[in] | tagSearch,a | tagSearch that contains the desired tags |
- Returns
- a std::vector of pointers to members that match the tag search and typename T
Definition at line 129 of file tgModel.h.
template<typename T >
std::vector<T*> tgModel::find |
( |
const std::string & |
tagSearch | ) |
|
|
inlineinherited |
Get a vector of descendants sorted by type and a tagsearch. Useful for pulling out muscle groups, or similar.
- Parameters
-
[in] | tagSearch,a | std::string& that contains the desired tags |
- Returns
- a std::vector of pointers to members that match the tag search and typename T
Definition at line 142 of file tgModel.h.
std::vector< tgModel * > tgModel::getDescendants |
( |
| ) |
const |
|
inherited |
Return a std::vector of const pointers to all sub-models.
- Todo:
- examine whether this should be public, and perhaps create a read only version
- Returns
- a std::vector of const pointers all sub-models.
- Todo:
- Unnecessary copying can be avoided by pasing the result collection in the recursive step.
Definition at line 174 of file tgModel.cpp.
const Muscle2P* tgLinearString::getMuscle |
( |
| ) |
const |
|
inline |
const double tgLinearString::getStartLength |
( |
| ) |
const |
|
virtual |
void tgLinearString::moveMotors |
( |
double |
dt | ) |
|
|
protectedvirtual |
Called from public functions, it makes the restLength get closer to preferredlength, according to config constraints.
Implements tgBaseString.
Definition at line 196 of file tgLinearString.cpp.
Call tgObserver<T>::onStep() on all observers in the order in which they were attached.
- Parameters
-
[in] | dt | the number of seconds since the previous call; do nothing if not positive |
Double dispatch function for a tgModelVisitor. This object will pass itself back to the visitor. Used for rendering and data logging as of May 2014.
- Parameters
-
Reimplemented from tgModel.
Definition at line 131 of file tgLinearString.cpp.
void tgLinearString::setRestLength |
( |
double |
newLength, |
|
|
float |
dt |
|
) |
| |
|
virtual |
void tgLinearString::setup |
( |
tgWorld & |
world | ) |
|
|
virtual |
Notifies observers of setup, calls setup on children
- Parameters
-
[in] | world,the | tgWorld the models are being built into |
Reimplemented from tgBaseString.
Definition at line 103 of file tgLinearString.cpp.
void tgLinearString::step |
( |
double |
dt | ) |
|
|
virtual |
Step dt forward with the simulation. Notifies observers of step, applies forces to rigid bodies via Muscle2P, logs history if desired, steps children.
- Parameters
-
Reimplemented from tgBaseString.
Definition at line 115 of file tgLinearString.cpp.
void tgLinearString::teardown |
( |
| ) |
|
|
virtual |
void tgLinearString::tensionMinLengthController |
( |
const double |
targetTension, |
|
|
float |
dt |
|
) |
| |
|
virtual |
Functions for interfacing with muscle2P, and higher level controllers Set the desired tension of the string. Will change m_preferredLength (see base class tgBaseString) to reach targetTension, subject to the constraints in the kinematic motor model. Calls moveMotors(dt) upon completion of calculations
Implements tgBaseString.
Definition at line 278 of file tgLinearString.cpp.
std::string tgModel::toString |
( |
std::string |
prefix = "" | ) |
const |
|
virtualinherited |
Returns the tag names of this model and its children
- Parameters
-
[in] | prefix | a string to append to |
- Returns
- the original string with this model and its children's tags appended
Definition at line 156 of file tgModel.cpp.
A copy of the configuration POD supplied at constuction. This is not const.
Definition at line 223 of file tgBaseString.h.
double tgBaseString::m_prevVelocity |
|
protectedinherited |
Tracking the most recent velocity to avoid using deques.
Definition at line 245 of file tgBaseString.h.
double tgBaseString::m_restLength |
|
protectedinherited |
double tgBaseString::m_startLength |
|
protectedinherited |
Tracking the start length to avoid using deques.
Definition at line 240 of file tgBaseString.h.
The documentation for this class was generated from the following files: