diff options
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); |