/
wmigor
/
z-plane
Обзор
Документация
Войти
/
wmigor
/
z-plane
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
app/src/Simulation.cpp
25 строк
605 B
wmigor
Добавлена простая физика жесткого тела RigidBody для отладки полета
27 май 2026, 09:43
Верифицирован
27 май 2026, 09:43
3b37c0b
Код
Авторство
О чём код?
#include "Simulation.h" #include <osg/Node> #include <osg/NodeVisitor> #include <osg/Timer> Simulation::Simulation(int ticksPerSecond): _ticksPerSecond(ticksPerSecond) { _startTime = (int) osg::Timer::instance()->time_m(); } void Simulation::operator()(osg::Node *node, osg::NodeVisitor *nv) { // auto time = (int) osg::Timer::instance()->time_m(); // auto targetTick = (int) ((time - _startTime) / 1000.0 * _ticksPerSecond); auto delta = 1.0 / _ticksPerSecond; // for (; _tick < targetTick; _tick ++) { for (auto aircraft : _aircrafts) aircraft->update(delta); } traverse(node, nv); }