/
redgpu
/
GDMagArchive
Обзор
Документация
Войти
/
redgpu
/
GDMagArchive
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
aug00/sharp/fluid/Calder/WaveGenerator.cpp
21 строка
645 B
Don Williamson
first commit
31 окт 2016, 17:03
31 окт 2016, 17:03
c823e7b
Код
Авторство
О чём код?
#include <fluid/calder/WaveGenerator.h> WaveGenerator::WaveGenerator(WavePlane* plane) { wavePlane = plane; } void WaveGenerator::update(PotentialPoints& points, float timePassed) { for (int x=0; x<points.size(); x++) { PhysicalPoint& pt = points.getPoint(x); // If they're on different sides, it passed through. If their product is negative // it means that one's on the top and one's on the bottom, and hence they're on different sides. if ((pt.preIntegration.loc.z - wavePlane->getBaseHeight()) * (pt.loc.z - wavePlane->getBaseHeight()) < 0) { wavePlane->createWaveImpulse(pt.loc.x, pt.loc.y); } } }