Доки
This commit is contained in:
51
wayland/docs/uml/diagram-activity-animation.puml
Normal file
51
wayland/docs/uml/diagram-activity-animation.puml
Normal file
@@ -0,0 +1,51 @@
|
||||
@startuml
|
||||
title Цикл анимации фигуры (aux_thread)
|
||||
|
||||
start
|
||||
|
||||
:aux_thread запущен;
|
||||
|
||||
while (окно не закрыто?) is (да)
|
||||
|
||||
:Залочить figure_mutex;
|
||||
|
||||
:figure_animation_step(draw_info);
|
||||
|
||||
partition "figure_animation_step (ASM)" {
|
||||
:Обработка коллизий;
|
||||
note right
|
||||
figure_handle_collision():
|
||||
- Расчёт точек фигуры на окружности
|
||||
- Проверка выхода за границы
|
||||
- Инверсия velocity при коллизии
|
||||
- Обновление angular_velocity
|
||||
end note
|
||||
|
||||
:Обновить позицию;
|
||||
note right
|
||||
position += (velocity * speed) / height
|
||||
end note
|
||||
|
||||
:Обновить угол поворота;
|
||||
note right
|
||||
angle += angular_velocity * speed
|
||||
end note
|
||||
|
||||
:Применить трение к вращению;
|
||||
note right
|
||||
angular_velocity *= 0.95
|
||||
end note
|
||||
}
|
||||
|
||||
:Разлочить figure_mutex;
|
||||
|
||||
:usleep(33 ms);
|
||||
note right: ~30 FPS обновление физики
|
||||
|
||||
endwhile (нет)
|
||||
|
||||
:Завершение потока;
|
||||
|
||||
stop
|
||||
|
||||
@enduml
|
||||
Reference in New Issue
Block a user