Inspect cells by hovering them in the microscope view
Foundation / checks (ecs) (push) Successful in 4m39s
Foundation / checks (tsan) (push) Successful in 11m8s
Foundation / checks (deploy) (push) Failing after 16m14s
Foundation / checks (checks) (push) Failing after 16m15s
Foundation / checks (network) (push) Successful in 19m51s
Foundation / checks (client) (push) Successful in 20m58s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 39m38s
Foundation / checks (ecs) (push) Successful in 4m39s
Foundation / checks (tsan) (push) Successful in 11m8s
Foundation / checks (deploy) (push) Failing after 16m14s
Foundation / checks (checks) (push) Failing after 16m15s
Foundation / checks (network) (push) Successful in 19m51s
Foundation / checks (client) (push) Successful in 20m58s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 39m38s
Hovering a cell outside the HUD rings it in amber and shows a card from its replicated phenotype: size across and mass, how grown, swimming speed, membrane share of the body, intake rate and energy conversion. A dead cell is labelled as food. Only what the replication view already carries is shown; nothing hidden is revealed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -791,6 +791,13 @@ int main(int argc, char** argv) try {
|
||||
static_cast<double>(cell.x.value) / 1000,
|
||||
static_cast<double>(cell.voxel.y) * pitch +
|
||||
static_cast<double>(cell.y.value) / 1000};
|
||||
c.extent_um = ph.extent;
|
||||
c.speed_um_s = ph.movement_speed;
|
||||
c.conversion_per_thousand = ph.conversion_per_thousand;
|
||||
c.grown_per_thousand = cell.growth.realized_per_thousand;
|
||||
c.mass_fg = ph.total_mass;
|
||||
c.membrane_fg = ph.membrane_mass;
|
||||
c.ingestion_fg_s = ph.ingestion_rate;
|
||||
if (const auto heading = headings.update(cell.id, at, *camera)) {
|
||||
c.facing = true;
|
||||
c.heading = *heading;
|
||||
|
||||
@@ -793,6 +793,29 @@ void draw_eyepiece(ImDrawList& list, ImVec2 size) {
|
||||
IM_COL32(0, 0, 0, alpha / 3), std::max(0.0F, rounding - d), 0, step + 0.5F);
|
||||
}
|
||||
}
|
||||
// Hovering a cell (not over the HUD) rings it and shows what its phenotype says.
|
||||
void inspect_cell(ImDrawList& list, const SceneCell& c) {
|
||||
const float r = std::max(c.radius, 5.0F);
|
||||
list.AddCircle({c.x, c.y}, r * 1.6F + 6.0F, IM_COL32(245, 181, 68, 200), 0, 2.0F);
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::TextColored(lavender, "%s",
|
||||
c.own ? "YOUR CELL"
|
||||
: c.dead ? "DEAD CELL - FOOD"
|
||||
: "ANOTHER CELL");
|
||||
ImGui::Text("Size %u µm across, %s", c.extent_um, mass_text(c.mass_fg).c_str());
|
||||
if (!c.dead) {
|
||||
ImGui::Text("Grown %u%%", c.grown_per_thousand / 10);
|
||||
if (c.speed_um_s == 0)
|
||||
ImGui::TextUnformatted("Speed cannot swim");
|
||||
else
|
||||
ImGui::Text("Speed %u µm/s", c.speed_um_s);
|
||||
ImGui::Text("Membrane %s (%u%% of body)", mass_text(c.membrane_fg).c_str(),
|
||||
c.mass_fg == 0 ? 0U : static_cast<unsigned>(c.membrane_fg * 100 / c.mass_fg));
|
||||
ImGui::Text("Intake %s/s", mass_text(c.ingestion_fg_s).c_str());
|
||||
ImGui::Text("Converts %u%% of food energy", c.conversion_per_thousand / 10);
|
||||
}
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
void draw_scene(const PanelView& v) {
|
||||
if (!v.cellular_scene)
|
||||
return;
|
||||
@@ -803,6 +826,22 @@ void draw_scene(const PanelView& v) {
|
||||
for (const auto& cell : v.cellular_scene->cells)
|
||||
draw_cell(list, cell, time);
|
||||
draw_eyepiece(list, ImGui::GetIO().DisplaySize);
|
||||
const auto& io = ImGui::GetIO();
|
||||
if (io.WantCaptureMouse || !ImGui::IsMousePosValid())
|
||||
return;
|
||||
const SceneCell* hovered = nullptr;
|
||||
float best = 0;
|
||||
for (const auto& cell : v.cellular_scene->cells) {
|
||||
const float dx = io.MousePos.x - cell.x, dy = io.MousePos.y - cell.y;
|
||||
const float reach = std::max(cell.radius, 5.0F) * 1.4F + 6.0F;
|
||||
const float distance = dx * dx + dy * dy;
|
||||
if (distance <= reach * reach && (!hovered || distance < best)) {
|
||||
hovered = &cell;
|
||||
best = distance;
|
||||
}
|
||||
}
|
||||
if (hovered)
|
||||
inspect_cell(list, *hovered);
|
||||
}
|
||||
// The eyepiece corner radius in logical units: HUD windows keep clear of it.
|
||||
float eyepiece_clearance() {
|
||||
|
||||
@@ -32,6 +32,9 @@ struct SceneCell {
|
||||
std::uint64_t seed{}; // Stable per organism: organelle layout (and orientation at rest).
|
||||
bool facing{}; // Heading is known: the cell faces it, flagella trailing.
|
||||
float heading{}; // Screen radians.
|
||||
// What hovering the cell shows (its replicated phenotype; no hidden state).
|
||||
std::uint32_t extent_um{}, speed_um_s{}, conversion_per_thousand{}, grown_per_thousand{};
|
||||
std::uint64_t mass_fg{}, membrane_fg{}, ingestion_fg_s{};
|
||||
};
|
||||
struct ScenePatch {
|
||||
float x{}, y{}, half{}; // Centre and half side of the 1 mm contact footprint.
|
||||
|
||||
@@ -12,7 +12,7 @@ spec:
|
||||
env:
|
||||
- {name: REGION_SESSION, value: "dev"}
|
||||
- {name: REGION_SESSION_LISTEN, value: "0.0.0.0:7400"}
|
||||
- {name: REGION_SESSION_WINDOW, value: "dev-20261017T015347-29526:1792212827"}
|
||||
- {name: REGION_SESSION_WINDOW, value: "dev-20261017T020216-38024:1792213336"}
|
||||
- {name: REGION_M10_MAX_GRANT_LIFETIME, value: "14400"}
|
||||
ports:
|
||||
# QUIC (ADR-0090): UDP only; nothing listens on TCP 7400.
|
||||
|
||||
@@ -495,6 +495,14 @@ void cellular_panels(const std::filesystem::path& review) {
|
||||
}
|
||||
if (width != 960)
|
||||
continue;
|
||||
// Hovering a cell outside the HUD shows its inspection card.
|
||||
mouse(id, SDL_EVENT_MOUSE_MOTION, 500, 220);
|
||||
for (int i = 0; i < 3; ++i)
|
||||
draw();
|
||||
const auto* card = ImGui::FindWindowByName("##Tooltip_00");
|
||||
CHECK(card && card->Active);
|
||||
mouse(id, SDL_EVENT_MOUSE_MOTION, 5, 5);
|
||||
draw();
|
||||
// E opens the mutation window over the world.
|
||||
SDL_Event e_key{};
|
||||
e_key.type = SDL_EVENT_KEY_DOWN;
|
||||
|
||||
Reference in New Issue
Block a user