Animate items emerging from building output ports

This commit is contained in:
2026-07-14 20:18:47 +02:00
parent af8a2224c0
commit 6a8c456aa1
13 changed files with 282 additions and 122 deletions

View File

@@ -10,6 +10,7 @@
#include <QPointF>
#include <QRect>
#include "BeltSlot.h"
#include "Item.h"
#include "ItemType.h"
#include "Port.h"
@@ -88,6 +89,11 @@ public:
// Returns nullopt if tile is not a belt, direction mismatches, or tile empty.
std::optional<ItemType> peekItem(Port port) const;
// Progress advanced per tick at the configured belt speed (tile fraction per
// tick). Shared with building output belts so emerging items travel at exactly
// the same speed as real belts (REQ-MAT-OUTPUT-EMERGE).
double getProgressPerTick_tpt() const { return m_progressPerTick_tpt; }
// -- Maintenance ---------------------------------------------------------
void clearTiles(const std::vector<QPoint>& tiles); // REQ-UI-BELT-CLEAR
void tick();
@@ -126,15 +132,6 @@ private:
// refused). Returns false if no transport tile occupies `tile`.
bool entersThroughOutputEdge(QPoint tile, Rotation travelDir) const;
// Returns the world-space centre of a slot given tile origin and progress.
static QPointF slotWorldPos(QPoint tile, Rotation dir, double progress);
struct BeltItemSlot
{
Item item;
double progress; // [0.0, 1.0]: 0 = just entered, 1 = at output edge
};
struct BeltTile
{
Rotation direction;