![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Singleton that maintains normalised minimap state. More...
#include <MinimapWidget.h>
Collaboration diagram for Olympe::MinimapWidget:Public Member Functions | |
| void | UpdateNodes (const std::vector< MinimapNode > &nodes, float graphMinX, float graphMinY, float graphMaxX, float graphMaxY) |
| Recomputes normalised node positions from graph-space coordinates. | |
| void | UpdateViewport (float viewX, float viewY, float viewW, float viewH, float graphMinX, float graphMinY, float graphMaxX, float graphMaxY) |
| Recomputes the normalised viewport rectangle. | |
| const std::vector< MinimapNode > & | GetMinimapNodes () const |
| Returns the last computed set of normalised minimap node positions. | |
| const MinimapViewport & | GetViewport () const |
| Returns the last computed normalised viewport rectangle. | |
| void | OnDrag (float deltaX, float deltaY, float graphW, float graphH, float &outGraphDeltaX, float &outGraphDeltaY) |
| Converts a drag delta on the minimap into a graph-space delta. | |
Static Public Member Functions | |
| static MinimapWidget & | Get () |
| Returns the single shared instance. | |
Static Public Attributes | |
| static constexpr float | WIDTH = 200.0f |
| Width of the minimap panel in screen pixels. | |
| static constexpr float | HEIGHT = 150.0f |
| Height of the minimap panel in screen pixels. | |
Private Member Functions | |
| MinimapWidget () | |
Private Attributes | |
| std::vector< MinimapNode > | m_MinimapNodes |
| MinimapViewport | m_Viewport |
Singleton that maintains normalised minimap state.
Typical usage:
Definition at line 68 of file MinimapWidget.h.
|
private |
Definition at line 28 of file MinimapWidget.cpp.
References Olympe::MinimapViewport::h, m_Viewport, Olympe::MinimapViewport::w, Olympe::MinimapViewport::x, and Olympe::MinimapViewport::y.
|
static |
Returns the single shared instance.
Definition at line 18 of file MinimapWidget.cpp.
| const std::vector< MinimapNode > & Olympe::MinimapWidget::GetMinimapNodes | ( | ) | const |
Returns the last computed set of normalised minimap node positions.
Definition at line 103 of file MinimapWidget.cpp.
References m_MinimapNodes.
| const MinimapViewport & Olympe::MinimapWidget::GetViewport | ( | ) | const |
Returns the last computed normalised viewport rectangle.
Definition at line 108 of file MinimapWidget.cpp.
References m_Viewport.
| void Olympe::MinimapWidget::OnDrag | ( | float | deltaX, |
| float | deltaY, | ||
| float | graphW, | ||
| float | graphH, | ||
| float & | outGraphDeltaX, | ||
| float & | outGraphDeltaY | ||
| ) |
Converts a drag delta on the minimap into a graph-space delta.
| deltaX | Drag delta in minimap pixel space (x). |
| deltaY | Drag delta in minimap pixel space (y). |
| graphW | Full graph width in graph space. |
| graphH | Full graph height in graph space. |
| outGraphDeltaX | Resulting graph-space x delta. |
| outGraphDeltaY | Resulting graph-space y delta. |
Definition at line 117 of file MinimapWidget.cpp.
References GetComponentTypeID_Static(), HEIGHT, and WIDTH.
Here is the call graph for this function:| void Olympe::MinimapWidget::UpdateNodes | ( | const std::vector< MinimapNode > & | nodes, |
| float | graphMinX, | ||
| float | graphMinY, | ||
| float | graphMaxX, | ||
| float | graphMaxY | ||
| ) |
Recomputes normalised node positions from graph-space coordinates.
| nodes | Nodes to display (absolute graph-space positions). |
| graphMinX | Leftmost graph boundary. |
| graphMinY | Topmost graph boundary. |
| graphMaxX | Rightmost graph boundary. |
| graphMaxY | Bottommost graph boundary. |
Definition at line 60 of file MinimapWidget.cpp.
References GetComponentTypeID_Static(), Olympe::MinimapNode::id, and m_MinimapNodes.
Here is the call graph for this function:| void Olympe::MinimapWidget::UpdateViewport | ( | float | viewX, |
| float | viewY, | ||
| float | viewW, | ||
| float | viewH, | ||
| float | graphMinX, | ||
| float | graphMinY, | ||
| float | graphMaxX, | ||
| float | graphMaxY | ||
| ) |
Recomputes the normalised viewport rectangle.
| viewX | Current scroll / pan X in graph space. |
| viewY | Current scroll / pan Y in graph space. |
| viewW | Viewport width in graph space. |
| viewH | Viewport height in graph space. |
| graphMinX | Leftmost graph boundary. |
| graphMinY | Topmost graph boundary. |
| graphMaxX | Rightmost graph boundary. |
| graphMaxY | Bottommost graph boundary. |
Definition at line 81 of file MinimapWidget.cpp.
References GetComponentTypeID_Static(), Olympe::MinimapViewport::h, m_Viewport, Olympe::MinimapViewport::w, Olympe::MinimapViewport::x, and Olympe::MinimapViewport::y.
Here is the call graph for this function:Height of the minimap panel in screen pixels.
Definition at line 74 of file MinimapWidget.h.
Referenced by OnDrag().
|
private |
Definition at line 155 of file MinimapWidget.h.
Referenced by GetMinimapNodes(), and UpdateNodes().
|
private |
Definition at line 156 of file MinimapWidget.h.
Referenced by GetViewport(), MinimapWidget(), and UpdateViewport().
Width of the minimap panel in screen pixels.
Definition at line 72 of file MinimapWidget.h.
Referenced by OnDrag().