SceneEditor3D.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  2. // Please see LICENSE.md in repository root for license information
  3. // https://github.com/AtomicGameEngine/AtomicGameEngine
  4. #pragma once
  5. #include <TurboBadger/tb_widgets_common.h>
  6. #include "../ResourceEditor.h"
  7. #include "SceneView3D.h"
  8. #include "Gizmo3D.h"
  9. using namespace Atomic;
  10. using namespace tb;
  11. namespace Atomic
  12. {
  13. class Scene;
  14. class Node;
  15. class View3D;
  16. class Camera;
  17. class DebugRenderer;
  18. class Octree;
  19. }
  20. namespace AtomicEditor
  21. {
  22. class SceneEditor3D: public ResourceEditor
  23. {
  24. OBJECT(SceneEditor3D);
  25. public:
  26. SceneEditor3D(Context* context, const String& fullpath, UITabContainer* container);
  27. virtual ~SceneEditor3D();
  28. bool OnEvent(const TBWidgetEvent &ev);
  29. void SelectNode(Node* node);
  30. Scene* GetScene() { return scene_; }
  31. Gizmo3D* GetGizmo() { return gizmo3D_; }
  32. void SetFocus();
  33. virtual bool RequiresInspector() { return true; }
  34. bool Save();
  35. private:
  36. void HandleUpdate(StringHash eventType, VariantMap& eventData);
  37. void HandleEditorActiveNodeChange(StringHash eventType, VariantMap& eventData);
  38. void HandlePlayStarted(StringHash eventType, VariantMap& eventData);
  39. void HandlePlayStopped(StringHash eventType, VariantMap& eventData);
  40. SharedPtr<Scene> scene_;
  41. // TODO: multiple views
  42. SharedPtr<SceneView3D> sceneView_;
  43. SharedPtr<Gizmo3D> gizmo3D_;
  44. WeakPtr<Node> selectedNode_;
  45. };
  46. }