Files
aevolution/include/evo/client/organism_inspector.hpp
T
dingoandClaude Opus 5.5 9bb147de82 Implement M9.5 biology-derived organism rendering and inspector
Add OrganismPresentation cells derived via biology::derive_phenotype with
no controller, owner or level fields (pinned by test), so identical
biology renders identically for players and NPCs. OrganismLayer reuses
the ADR-0080 ordering/freshness semantics; death is a remnant state and
removal is absence. Rendering takes an explicit rectangle budget, falls
back to body-only detail and marks truncation instead of dropping data.
An opt-in rectangle-only hover inspector shows phenotype gauges; ImGui is
not adopted. ADR-0081 records the decision; evidence in VALIDATION.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 18:21:53 -04:00

33 lines
1.6 KiB
C++

#pragma once
#include "evo/client/camera.hpp"
#include "evo/client/organism_view.hpp"
#include "evo/render/frame.hpp"
#include <array>
#include <cstddef>
#include <cstdint>
#include <expected>
#include <optional>
#include <vector>
namespace evo::client {
// Engineering debug view only: hover highlight plus a panel of normalized phenotype
// gauges. It reads biology values and nothing else; there is no ownership,
// controller or level information to show. Not final player UI.
inline constexpr std::size_t inspector_gauges = 10;
inline constexpr std::size_t inspector_rectangles = 4 + 1 + 2 * inspector_gauges;
// Gauge order: extent, total mass, membrane share, maintenance, movement speed,
// ingestion rate, conversion, realized growth, damage, thermal shortfall.
// Each is in [0, 1]; log scales are documented in ORGANISM_RENDERING.md.
[[nodiscard]] std::array<double, inspector_gauges>
inspector_gauge_values(const OrganismCell& cell) noexcept;
// Index of the topmost (last drawn) organism whose drawn body contains `pointer`.
[[nodiscard]] std::optional<std::size_t> pick_organism(const OrganismPresentation& presentation,
const Camera& camera,
ScreenPoint pointer) noexcept;
enum class InspectorError : std::uint8_t { invalid_budget };
// Appends exactly-bounded rectangles (at most inspector_rectangles, clipped).
[[nodiscard]] std::expected<void, InspectorError>
append_inspector(std::vector<render::Rectangle>& out, std::size_t budget, const OrganismCell& cell,
const Camera& camera);
} // namespace evo::client