void Enemy::update(TimeDuration dt) { if (_pathPoint.reachedEnd()) { if (_listener != nullptr) _listener->onReachedEnd(*this); } _pathPoint.advance(dt.toSecs() * _speed); for (auto& polygon : _polygons) { auto& model = _scene.model(polygon.polygon.modelId()); model.transform().translation() = _pathPoint.currentPosition(); polygon.update(_scene, dt); } }
void Enemy::NormalAnimator::update(TimeDuration dt, gr::Model<gr::Transform2>& model) { model.transform().rotation() += angularVelocity * dt.toSecs(); }