VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
SceneMenu.hpp File Reference

Utility functions for drawing the Scene Hierarchy and related object manipulation logic. More...

#include <imgui.h>
#include <string>
#include <vector>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <cxxabi.h>
#include "Engine.hpp"
#include "components/SceneManager.hpp"
#include "components/GameObjects/GameObject.hpp"
#include "components/GameComponents/BasicComponents.hpp"

Go to the source code of this file.

Classes

struct  SceneAction
 Structure to define an action to be performed on a scene object outside of the hierarchy drawing loop. More...

Functions

std::string Demangle (const char *name)
 Demangles a C++ type name into a more readable string.
void ReparentObject (vex::GameObject *child, vex::GameObject *parent)
 Reparents a GameObject to another GameObject.
void DrawEntityNode (vex::GameObject *obj, std::pair< bool, vex::GameObject * > &selectedObject, const std::unordered_map< vex::Entity, std::vector< vex::GameObject * > > &childrenMap, const std::unordered_set< vex::Entity > &runtimeSet, SceneAction &outAction, const char *filter="")
 Recursively draws a single GameObject node in the ImGUI tree hierarchy.
void DrawSceneHierarchy (vex::Engine &engine, std::pair< bool, vex::GameObject * > &selectedObject)
 Draws the full scene hierarchy tree in an ImGUI window, handling selection, context menus, and object actions.

Detailed Description

Utility functions for drawing the Scene Hierarchy and related object manipulation logic.

Author
Eryk Roszkowski

Definition in file SceneMenu.hpp.

Function Documentation

◆ Demangle()

std::string Demangle ( const char * name)
inline

Demangles a C++ type name into a more readable string.

Parameters
constchar* name - The raw type name (e.g., from typeid().name()).
Returns
std::string - The demangled class/struct name.

Definition at line 39 of file SceneMenu.hpp.

◆ DrawEntityNode()

void DrawEntityNode ( vex::GameObject * obj,
std::pair< bool, vex::GameObject * > & selectedObject,
const std::unordered_map< vex::Entity, std::vector< vex::GameObject * > > & childrenMap,
const std::unordered_set< vex::Entity > & runtimeSet,
SceneAction & outAction,
const char * filter = "" )
inline

Recursively draws a single GameObject node in the ImGUI tree hierarchy.

Parameters
vex::GameObject*obj - The GameObject to draw.
std::pair<bool,vex::GameObject*>&selectedObject - The currently selected object pair (runtime status, object pointer).
conststd::unordered_map<vex::Entity, std::vector<vex::GameObject*>>& childrenMap - Map of parent entity to its children.
conststd::unordered_set<vex::Entity>& runtimeSet - Set of entities created at runtime (won't be saved).
SceneAction&outAction - Output parameter to store any pending action triggered by the user (rename, delete, duplicate).

Definition at line 101 of file SceneMenu.hpp.

◆ DrawSceneHierarchy()

void DrawSceneHierarchy ( vex::Engine & engine,
std::pair< bool, vex::GameObject * > & selectedObject )
inline

Draws the full scene hierarchy tree in an ImGUI window, handling selection, context menus, and object actions.

Parameters
vex::Engine&engine - Reference to the core Engine instance to access scene and registry data.
std::pair<bool,vex::GameObject*>&selectedObject - The currently selected object pair (runtime status, object pointer).

Definition at line 261 of file SceneMenu.hpp.

◆ ReparentObject()

void ReparentObject ( vex::GameObject * child,
vex::GameObject * parent )
inline

Reparents a GameObject to another GameObject.

Parameters
vex::GameObject*child - The child GameObject to reparent.
vex::GameObject*parent - The parent GameObject to reparent to.

Definition at line 61 of file SceneMenu.hpp.