Cells face where they move; a click outside closes the evolution window
Foundation / checks (checks) (push) Successful in 45m19s
Foundation / checks (deploy) (push) Successful in 3m45s
Foundation / checks (ecs) (push) Successful in 2m16s
Foundation / checks (network) (push) Successful in 19m17s
Foundation / checks (postgres) (push) Successful in 43m23s
Foundation / checks (tsan) (push) Successful in 11m39s
Foundation / checks (client) (push) Successful in 17m3s
Foundation / postgres-tools (push) Successful in 29s
Foundation / server-image (push) Successful in 3m8s
Foundation / image (push) Successful in 3m25s
Foundation / checks (checks) (push) Successful in 45m19s
Foundation / checks (deploy) (push) Successful in 3m45s
Foundation / checks (ecs) (push) Successful in 2m16s
Foundation / checks (network) (push) Successful in 19m17s
Foundation / checks (postgres) (push) Successful in 43m23s
Foundation / checks (tsan) (push) Successful in 11m39s
Foundation / checks (client) (push) Successful in 17m3s
Foundation / postgres-tools (push) Successful in 29s
Foundation / server-image (push) Successful in 3m8s
Foundation / image (push) Successful in 3m25s
The microscope view orients each cell along its last movement of at least 20 um, with the flagella trailing, easing into turns. The heading is projected with the current camera, so panning never turns a cell; a cell that has not moved keeps its seeded orientation. A left click outside the evolution window closes it (the offer stays; E or the callout reopens it), except on the frame it opens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "evo/client/session_host.hpp"
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
@@ -511,6 +512,38 @@ void cellular_energy_and_birth_wait() {
|
||||
}
|
||||
} // namespace
|
||||
|
||||
// A cell faces the way it moved (y up in the world is up on screen), eases into a turn,
|
||||
// ignores sub-step jitter and camera panning, and is forgotten once it is not drawn.
|
||||
void cell_headings() {
|
||||
using namespace evo::client_app;
|
||||
auto camera = Camera::create({800, 600, 800, 600}, {5, 5}, 100);
|
||||
CHECK(camera);
|
||||
CellHeadings headings;
|
||||
CHECK(!headings.update(1, {5, 5}, *camera));
|
||||
headings.end_frame();
|
||||
CHECK(!headings.update(1, {5.001, 5}, *camera)); // Below the step: still unknown.
|
||||
headings.end_frame();
|
||||
const auto east = headings.update(1, {5.1, 5}, *camera);
|
||||
CHECK(east && std::abs(*east) < 1e-4F);
|
||||
headings.end_frame();
|
||||
auto panned = Camera::create({800, 600, 800, 600}, {9, 2}, 100);
|
||||
CHECK(panned);
|
||||
const auto still = headings.update(1, {5.1, 5}, *panned);
|
||||
CHECK(still && std::abs(*still) < 1e-4F);
|
||||
headings.end_frame();
|
||||
// Moving north is screen up (negative y): the heading eases toward -pi/2.
|
||||
const auto turning = headings.update(1, {5.1, 5.2}, *camera);
|
||||
CHECK(turning && *turning < 0 && *turning > -1.5707F);
|
||||
headings.end_frame();
|
||||
float heading = turning.value_or(0);
|
||||
for (int i = 0; i < 60; ++i) {
|
||||
heading = headings.update(1, {5.1, 5.2}, *camera).value_or(0);
|
||||
headings.end_frame();
|
||||
}
|
||||
CHECK(std::abs(heading + 1.5708F) < 1e-3F);
|
||||
headings.end_frame(); // Not drawn this frame: forgotten.
|
||||
CHECK(!headings.update(1, {6, 6}, *camera));
|
||||
}
|
||||
int main() try {
|
||||
labels();
|
||||
selection();
|
||||
@@ -520,6 +553,7 @@ int main() try {
|
||||
cellular_play();
|
||||
cellular_energy_and_birth_wait();
|
||||
cellular_assistance();
|
||||
cell_headings();
|
||||
std::puts("client UI model tests passed");
|
||||
return 0;
|
||||
} catch (const std::exception& e) {
|
||||
|
||||
Reference in New Issue
Block a user