5#include "../../PreferencesModule.h"
8class ViewportModule :
public PreferencesModule
11 DECLARE_PREFERENCES_MODULE(ViewportModule)
14 virtual ~ViewportModule();
16 virtual const char* GetName()
const override {
return GetStaticName(); }
17 virtual const char* GetParentPath()
const override {
return GetStaticParentPath(); }
18 virtual void Render()
override;
23 glm::vec4 GetBackgroundColor()
const {
return mBackgroundColor; }
24 bool GetShowGrid()
const {
return mShowGrid; }
26 float GetGridSize()
const {
return mGridSize; }
27 glm::vec4 GetSelectedColor()
const {
return mSelectedColor; }
28 float GetSelectedCheckerSize()
const {
return mSelectedCheckerSize; }
29 float GetMenuBarPadding()
const {
return mMenuBarPadding; }
30 bool GetShowGizmosInPreview()
const {
return mShowGizmosInPreview; }
31 void SetShowGizmosInPreview(
bool show);
34 int GetResolutionScaleMode()
const {
return mResolutionScaleMode; }
37 void ApplyResolutionScale()
const;
40 bool GetSnapEnabled()
const {
return mSnapEnabled; }
41 void SetSnapEnabled(
bool enabled);
42 int GetSnapMode()
const {
return mSnapMode; }
43 void SetSnapMode(
int mode);
44 float GetSnapTranslate()
const {
return mSnapTranslate; }
45 float GetSnapRotate()
const {
return mSnapRotate; }
46 float GetSnapScale()
const {
return mSnapScale; }
47 float GetSnapWidgetPixels()
const {
return mSnapWidgetPixels; }
48 float GetSnapPixelThreshold()
const {
return mSnapPixelThreshold; }
49 float GetPrecisionNormal()
const {
return mPrecisionNormal; }
50 float GetPrecisionCtrl()
const {
return mPrecisionCtrl; }
52 static ViewportModule*
Get();
53 static void HandleExternalGridToggle(
bool enabled);
56 void ApplyBackgroundColorToRenderer()
const;
57 void ApplyGridVisibility();
58 void ApplySelectedOverlay()
const;
60 int mResolutionScaleMode = 0;
61 glm::vec4 mBackgroundColor = glm::vec4(0.1f, 0.1f, 0.1f, 1.0f);
62 bool mShowGrid =
true;
63 glm::vec4 mGridColor = glm::vec4(0.3f, 0.3f, 0.3f, 1.0f);
64 float mGridSize = 1.0f;
65 glm::vec4 mSelectedColor = glm::vec4(0.2f, 0.1f, 1.0f, 0.6f);
66 float mSelectedCheckerSize = 8.0f;
67 float mMenuBarPadding = 8.0f;
68 bool mShowGizmosInPreview =
false;
70 bool mSnapEnabled =
false;
72 float mSnapTranslate = 1.0f;
73 float mSnapRotate = 15.0f;
74 float mSnapScale = 0.1f;
75 float mSnapWidgetPixels = 8.0f;
76 float mSnapPixelThreshold = 16.0f;
77 float mPrecisionNormal = 1.0f;
78 float mPrecisionCtrl = 0.1f;
80 static ViewportModule* sInstance;
81 static bool sSyncingGridState;
Definition JsonHelpers.h:15