/
redgpu
/
GDMagArchive
Обзор
Документация
Войти
/
redgpu
/
GDMagArchive
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
aug00/sharp/fluid/ParticleSys/CompositeFunctor.cpp
32 строки
917 B
Don Williamson
first commit
31 окт 2016, 17:03
31 окт 2016, 17:03
c823e7b
Код
Авторство
О чём код?
#include <fluid/ParticleSys/CompositeFunctor.h> #include <assert.h> CompositeFunctor::~CompositeFunctor() { for (int x=0; x<functors.size(); x++) { delete functors[x]; } functors.clear(); } // This takes an allocated functor, and WILL delete it upon program termination. A reference-counted // pointer is what's really called for here, I suppose... void CompositeFunctor::addFunctor(ParticleFunctor* functor) { // Don't let them put different-typed functors into us, to make sure that the sorting mechanism isn't // preempted accidentally. if (functors.size() != 0 && functors[0]->getType() != functor->getType()) { assert(false); } functors.push_back(functor); } void CompositeFunctor::update(PotentialPoints& points, float timePassed) { for (std::vector<ParticleFunctor*>::iterator it = functors.begin(); it != functors.end(); it++) { (*it)->update(points, timePassed); } }