void LinkedStructure::update() { // Performs an update to the position of the // linked structure. Performs a tip move by the // step that has been specified if(isTargetResolved()) return; float x = (mTargetPosition(0) - mPosition(0) > 1) ? mStep : -mStep; float y = (mTargetPosition(1) + mPosition(1) > 1) ? mStep : -mStep; moveBy(x, y); }
void IKSolver::update() { if (!isTargetResolved()) { float x = (_targetPos.x - _endEffPos.x > 1) ? _step : -_step; float y = (_targetPos.y - _endEffPos.y > 1) ? _step : -_step; solve(x, y); calcEndEffectorPos(); } }