2023-08-14 06:36:02 +00:00
|
|
|
#ifndef GAME_EDITOR_MAP_VIEW_H
|
|
|
|
#define GAME_EDITOR_MAP_VIEW_H
|
|
|
|
|
|
|
|
#include <base/vmath.h>
|
|
|
|
|
|
|
|
#include "component.h"
|
2023-08-14 06:53:59 +00:00
|
|
|
#include "smooth_value.h"
|
2023-08-14 06:36:02 +00:00
|
|
|
|
|
|
|
class CMapView : public CEditorComponent
|
|
|
|
{
|
|
|
|
public:
|
2023-08-14 06:53:59 +00:00
|
|
|
void Init(CEditor *pEditor) override;
|
2023-08-14 06:36:02 +00:00
|
|
|
|
2023-08-14 06:53:59 +00:00
|
|
|
/**
|
|
|
|
* Reset zoom and editor offset.
|
|
|
|
*/
|
|
|
|
void ResetZoom();
|
2023-08-14 06:36:02 +00:00
|
|
|
|
2023-08-14 06:53:59 +00:00
|
|
|
/**
|
|
|
|
* Scale length according to zoom value.
|
|
|
|
*/
|
|
|
|
float ScaleLength(float Value);
|
2023-08-14 06:36:02 +00:00
|
|
|
|
2023-08-14 06:53:59 +00:00
|
|
|
void ZoomMouseTarget(float ZoomFactor);
|
|
|
|
void UpdateZoom();
|
2023-08-14 06:36:02 +00:00
|
|
|
|
2023-08-14 06:53:59 +00:00
|
|
|
vec2 m_WorldOffset;
|
|
|
|
vec2 m_EditorOffset;
|
2023-08-14 06:36:02 +00:00
|
|
|
|
2023-08-14 06:53:59 +00:00
|
|
|
CSmoothValue m_Zoom = CSmoothValue(200.0f, 10.0f, 2000.0f);
|
2023-08-14 06:36:02 +00:00
|
|
|
float m_WorldZoom = 1.0f;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|