diff options
author | hnOsmium0001 <[email protected]> | 2022-05-07 23:13:14 -0700 |
---|---|---|
committer | hnOsmium0001 <[email protected]> | 2022-05-07 23:13:14 -0700 |
commit | c2cba4424ea902f062e6af4733670f2be0494889 (patch) | |
tree | 39b1e9215a5b22a58792517bc67dcbb2b185ffa7 /source/EditorCorePrivate.hpp | |
parent | eb4e202ee8d6e32aebf252cc107f6ec8dfd75b8f (diff) |
Add more camera controls (3D mode, scroll scaling)
Diffstat (limited to 'source/EditorCorePrivate.hpp')
-rw-r--r-- | source/EditorCorePrivate.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/EditorCorePrivate.hpp b/source/EditorCorePrivate.hpp index 566131b..616ca45 100644 --- a/source/EditorCorePrivate.hpp +++ b/source/EditorCorePrivate.hpp @@ -67,6 +67,14 @@ struct GuizmoState { // TODO editor undo stack class EditorInstance : public IEditor { +public: + enum EditorCameraMode { + // "Game mode": the camera views from the side, where the forward vector is perpendicular to the world plane + ECM_2D, + // "Editor mode": equivalent to Unity's 3D mode, the camera is completely free and controlled as a 3d camera + ECM_Side3D, + }; + private: App* mApp; GameObject* mPopupCurrent_GameObject = nullptr; @@ -79,6 +87,9 @@ private: glm::vec3 mDragCam_CamInitial; ImVec2 mDragCam_CursorInitial; int mSpriteView_Frame; + float mMoveCamScrollSpeed = 1.0f; + float mMoveCamSlideSpeed = 10.0f; + EditorCameraMode mEcm = ECM_2D; bool mSpriteView_OpenNextFrame = false; bool mWindowVisible_ImGuiDemo = false; bool mWindowVisible_CommandPalette = false; @@ -88,6 +99,7 @@ private: bool mWindowVisible_WorldProperties = true; bool mDragCam_Happening = false; bool mMoveCamKeyboard = false; + bool mMoveCamScrollWheel = false; public: EditorInstance(App* app); @@ -102,6 +114,10 @@ public: void OpenSpriteViewer(SpriteDefinition* sprite) override; private: + bool IsCurrentCameraEditor() const { + return !mApp->IsGameRunning(); + } + void ShowWorldProperties(); void ShowInspector(IresObject* ires); |