42 throw std::invalid_argument(
"Negative tension");
48 std::size_t n = m_controllers.size();
49 for(std::size_t i = 0; i < n; i++)
51 delete m_controllers[i];
53 m_controllers.clear();
58 const std::vector<tgBasicActuator*> actuators = subject.
getAllActuators();
59 for (
size_t i = 0; i < actuators.size(); ++i)
62 assert(pActuator != NULL);
64 m_controllers.push_back(m_tensController);
73 throw std::invalid_argument(
"dt is not positive");
77 std::size_t n = m_controllers.size();
78 for(std::size_t i = 0; i < n; i++)
80 m_controllers[i]->control(dt, m_tension);
virtual ~T6TensionController()
virtual void onStep(T6Model &subject, double dt)
virtual void onSetup(T6Model &subject)
Contains the definition of class tgBasicActuator.
Contains the definition of class T6TensionController.
const std::vector< tgBasicActuator * > & getAllActuators() const
T6TensionController(const double tension=.01)