18#define IMGUI_DEFINE_MATH_OPERATORS
19#include "../Submodules/imgui/imgui.h"
20#include "../Submodules/imgui/backends/imgui_impl_opengl3.h"
21#include "../Submodules/imgui/backends/imgui_impl_glfw.h"
22#include "../Submodules/ImGuizmo/src/ImGuizmo.h"
23#include "misc/cpp/imgui_stdlib.h"
31#define START_WITH_IMGUI true
33#define START_WITH_IMGUI false
54#pragma region static_functions
76#pragma region overridden_functions
80 return std::make_unique<Editor>(*
this);
83 auto onUpdate(
float dt) ->
void override;
90 auto load(
const Stream& stream) ->
void override;
91 auto save(
Stream& stream)
const ->
void override;
95#pragma region Editor_Functions
228#pragma region member_variables
253#pragma region helper_functions
271#pragma region static_variables
278#undef START_WITH_IMGUI
sys::Json Stream
Definition AudioObject.h:20
#define START_WITH_IMGUI
Definition Editor.h:31
friend Entity
Definition GameObject.h:84
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:23
An object that manages many of a single type of particle.
Definition ParticleEmitter.h:32
Type
Definition System.h:20
@ Editor
Definition System.h:25
System(const std::string &typeName, Type systemType)
Definition System.cpp:75
bool compactEntityView
Whether the Scene Tree should be rendered more compact.
Definition Editor.h:239
auto getSliderRatio() const -> float
Definition Editor.cpp:791
ParticleEmitter * selectedEmitter
the emitter last selected on a particleGenerator
Definition Editor.h:250
Entity * selectedEntity
The entity currently selected in the Scene Tree.
Definition Editor.h:237
auto PreRender() -> void
Definition Editor.cpp:380
auto shouldShowGui() const -> bool
Definition Editor.h:100
static void drawEditorTopBar()
draw the top bar of the editor
Definition Editor.cpp:916
auto drawEntitiesCompact() -> bool
used to determine how much spacing to give entities in the scene view
Definition Editor.cpp:456
static auto getEnum() -> Type
function required by all systems
Definition Editor.h:59
auto deselect(Entity *entity) -> void
deselects and entity if it is currently selected.
Definition Editor.cpp:776
auto operator=(Editor &&other) noexcept -> Editor &=default
ImFont * defaultFont
The default font of the Editor.
Definition Editor.h:230
auto drawSceneMenu() -> void
draw the tree of Entities that exist in a scene
Definition Editor.cpp:416
auto getSceneViewPortMousePosition() -> Vector4D &
Definition Editor.cpp:745
void calculateViewportCoords(float width, float height)
helper function to calculate the coordinates of the mouse over the viewport
Definition Editor.cpp:944
auto isPassingFilter(Entity *entity) -> bool
See if the an Entity is passing the filter and should be drawn in the Scene View Currently unimplemen...
Definition Editor.cpp:784
auto getSelectedEntity() -> Entity *
return selected entity, or nullptr if no entity is selected
Definition Editor.cpp:771
auto EntityComponentsEditor() const -> void
Definition Editor.cpp:536
auto isSelected(Entity *entity) -> bool
check whether an entity is currently selected in the editor
Definition Editor.cpp:766
auto select(Entity *selected) -> void
selects an Entity, and shows it's children in the Component view editor
Definition Editor.cpp:761
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Editor.h:85
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Editor.h:78
static auto displayTexture(const gfx::Texture *texture) -> void
show a texture in a small square
Definition Editor.cpp:629
Vector4D editorMousePos
Position of the mouse relative to the scene viewport.
Definition Editor.h:246
~Editor() override
Definition Editor.cpp:508
auto PostRender() -> void
Post render will run all the normal Render() stuff instead of old function to allow for frame bufferi...
Definition Editor.cpp:798
auto operator=(const Editor &other) -> Editor &
Definition Editor.cpp:522
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Editor.cpp:722
auto EmitterEditor() const -> void
draw editor for adjusting settings of the selected emitter
Definition Editor.cpp:548
auto toggleGuizmos() -> void
Definition Editor.cpp:823
auto receiveShowGUIKeyPressed(const Message *message) -> Message
Definition Editor.cpp:753
Editor()
Definition Editor.cpp:461
auto drawSystemMenu() -> void
Draw the window that shows all the systems in the game.
Definition Editor.cpp:390
bool showImGui
Whether the Editor should be shown.
Definition Editor.h:243
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Editor.cpp:713
float sliderRatio
The ratio of the total width a slider should take up.
Definition Editor.h:232
Editor(const Editor &other)=default
static auto showTexturePickerMenu() -> gfx::Texture *
creates a dropdown menu to select a new texture.
Definition Editor.cpp:558
ImGuiTextFilter entityFilter
IMGui filter for searching the scene tree. currently unused, as filtering a tree is non-trivial.
Definition Editor.h:235
auto getDefaultFont() -> ImFont *
Definition Editor.h:49
auto onUpdate(float dt) -> void override
called once every frame.
Definition Editor.cpp:682
auto SceneViewPort() -> void
This is the Window that activates the viewport and renders the framebuffer.
Definition Editor.cpp:968
static auto showMeshPickerMenu() -> gfx::Mesh *
shows a dropdown menu to choose meshes
Definition Editor.cpp:637
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Editor.cpp:717
the type of elements in a basic_json container
Definition GameObject.h:32