NTRT Simulator
Version: Master
|
#include <tgSpringCable.h>
Public Member Functions | |
tgSpringCable (const std::vector< tgSpringCableAnchor * > &anchors, double coefK, double dampingCoefficient, double pretension=0.0) | |
virtual | ~tgSpringCable () |
virtual void | step (double dt)=0 |
virtual const double | getRestLength () const |
virtual void | setRestLength (const double newRestLength) |
virtual const double | getActualLength () const =0 |
virtual const double | getTension () const =0 |
virtual const double | getCoefK () const |
virtual const double | getCoefD () const |
virtual const double | getVelocity () const |
virtual const double | getDamping () const |
virtual const std::vector < const tgSpringCableAnchor * > | getAnchors () const =0 |
Protected Attributes | |
double | m_damping |
double | m_velocity |
const double | m_coefK |
const double | m_dampingCoefficient |
double | m_restLength |
double | m_prevLength |
An abstract base class defining the interface for a spring cable model. This either represents a long elastic member, or a stiff cable connected to a more flexible spring.
Definition at line 40 of file tgSpringCable.h.
tgSpringCable::tgSpringCable | ( | const std::vector< tgSpringCableAnchor * > & | anchors, |
double | coefK, | ||
double | dampingCoefficient, | ||
double | pretension = 0.0 |
||
) |
The only constructor. Takes a list of anchors, a coefficient of stiffness, a coefficent of damping, and optionally the amount of pretension in the cable
[in] | anchors | - a list of this spring cable's attachements |
[in] | coefK | - the stiffness of the spring. Must be positive |
[in] | dampingCoefficient | - the damping in the spring. Must be non-negative |
[in] | pretension | - must be small enough to keep the rest length positive |
Definition at line 33 of file tgSpringCable.cpp.
|
virtual |
The virtual destructor. Does nothing
Definition at line 62 of file tgSpringCable.cpp.
|
pure virtual |
Pure virtual funciton, returns the actual length of the spring cable
Implemented in tgBulletContactSpringCable, and tgBulletSpringCable.
|
pure virtual |
Child classes will store their type of anchors, but should always define a way to return a vector of base anchors
Implemented in tgBulletSpringCable.
|
inlinevirtual |
Get the coefficent of damping
Definition at line 103 of file tgSpringCable.h.
|
inlinevirtual |
Get the coefficent of stiffness
Definition at line 95 of file tgSpringCable.h.
|
inlinevirtual |
Get the last value of the damping force
Definition at line 119 of file tgSpringCable.h.
|
virtual |
Returns m_restLength
Definition at line 66 of file tgSpringCable.cpp.
|
pure virtual |
Pure virtual function, returns the current tension
Implemented in tgBulletSpringCable.
|
inlinevirtual |
Get the last change in length / time
Definition at line 111 of file tgSpringCable.h.
|
virtual |
Sets m_restLength to newRestLength.
[in] | newRestLength,must | be non-negative |
Definition at line 71 of file tgSpringCable.cpp.
|
pure virtual |
The function called by model classes to update this class for a given step
[in] | dt | - elapsed time since the last step |
Implemented in tgBulletContactSpringCable, and tgBulletSpringCable.
|
protected |
The stiffness coefficient Units of mass / sec ^2 Must be positive
Definition at line 149 of file tgSpringCable.h.
|
protected |
The previous value of the damping force. Stored so we can get it without passing a dt
Definition at line 136 of file tgSpringCable.h.
|
protected |
The damping coefficient. Units of mass / sec. Must be non-negative
Definition at line 156 of file tgSpringCable.h.
|
protected |
The previous actual length of the string. Used when calculating force and velocity
Definition at line 168 of file tgSpringCable.h.
|
protected |
The rest length of the string. Must be non negative
Definition at line 162 of file tgSpringCable.h.
|
protected |
The velocity of the string at the last update step. Stored so we can get it without passing a dt
Definition at line 142 of file tgSpringCable.h.