group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
Minimap.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "hud/HudWidget.hpp"
5
6#include <vector>
7
9{
10 float mapSize = 180.f;
11 float dotSize = 6.f;
12 float borderThickness = 2.f;
13
14 Minimap();
15 void update(float dt, const HudGameState& state, HudTweenPool& tweens) override;
16 void draw(HudContext& ctx, float drawX, float drawY) override;
17
18private:
19 float localX_ = 0.f, localZ_ = 0.f;
20 float localYaw_ = 0.f;
21 float worldRange_ = 100.f;
22 struct Dot
23 {
24 float worldX, worldZ;
25 };
26 std::vector<Dot> enemies_;
27};
Base struct for all HUD widgets.
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:18
Fixed-size tween pool. No heap allocations.
Definition HudTween.hpp:35
Snapshot of game state consumed by the HUD each frame.
Definition HudTypes.hpp:148
Base class for a retained HUD element.
Definition HudWidget.hpp:16
Definition Minimap.hpp:23
float worldZ
Definition Minimap.hpp:24
float worldX
Definition Minimap.hpp:24
float mapSize
Pixel width/height of the minimap square.
Definition Minimap.hpp:10
float borderThickness
Definition Minimap.hpp:12
float localX_
Definition Minimap.hpp:19
float localZ_
Definition Minimap.hpp:19
float localYaw_
Player yaw in radians.
Definition Minimap.hpp:20
float dotSize
Definition Minimap.hpp:11
Minimap()
Definition Minimap.cpp:10
void update(float dt, const HudGameState &state, HudTweenPool &tweens) override
Called each frame before draw(). Update animation, consume events.
Definition Minimap.cpp:19
float worldRange_
Definition Minimap.hpp:21
void draw(HudContext &ctx, float drawX, float drawY) override
Emit geometry into the draw context.
Definition Minimap.cpp:30
std::vector< Dot > enemies_
Definition Minimap.hpp:26