diff --git a/src/game/debug_vars.c b/src/game/debug_vars.c index 3d2e12b..ed92f7b 100755 --- a/src/game/debug_vars.c +++ b/src/game/debug_vars.c @@ -10,7 +10,7 @@ static void debug_vars_clear(struct Debug_Vars* debug_vars); void debug_vars_init(struct Debug_Vars* debug_vars) { - debug_vars->visible = true; + debug_vars->visible = false; debug_vars->location = DVL_TOP_RIGHT; debug_vars->window_width = 300; debug_vars->window_height = 500; diff --git a/src/game/editor.c b/src/game/editor.c index 96ac038..f16eb8f 100755 --- a/src/game/editor.c +++ b/src/game/editor.c @@ -86,7 +86,7 @@ static bool editor_widget_v3(struct nk_context* context, float inc_per_pixel, int row_height); -static void editor_window_scene_heirarchy(struct nk_context* context, struct Editor* editor, struct Game_State* game_state); +static void editor_window_scene_hierarchy(struct nk_context* context, struct Editor* editor, struct Game_State* game_state); static void editor_window_property_inspector(struct nk_context* context, struct Editor* editor, struct Game_State* game_state); static void editor_window_renderer_settings(struct nk_context* context, struct Editor* editor, struct Game_State* game_state); static void editor_window_settings_editor(struct nk_context* context, struct Editor* editor, struct Game_State* game_state); @@ -566,7 +566,7 @@ void editor_update(struct Editor* editor, float dt) } nk_end(context); - if(editor->window_scene_heirarchy) editor_window_scene_heirarchy(context, editor, game_state); + if(editor->window_scene_heirarchy) editor_window_scene_hierarchy(context, editor, game_state); if(editor->window_property_inspector) editor_window_property_inspector(context, editor, game_state); if(editor->window_settings_renderer) editor_window_renderer_settings(context, editor, game_state); if(editor->window_settings_editor) editor_window_settings_editor(context, editor, game_state); @@ -1455,7 +1455,7 @@ void editor_show_entity_in_list(struct Editor* editor, struct nk_context* contex } } -void editor_window_scene_heirarchy(struct nk_context* context, struct Editor* editor, struct Game_State* game_state) +void editor_window_scene_hierarchy(struct nk_context* context, struct Editor* editor, struct Game_State* game_state) { if(nk_begin(context, "Scene Heirarchy", nk_recti(0, editor->top_panel_height, 300, 400), window_flags)) { @@ -1501,6 +1501,18 @@ void editor_window_property_inspector(struct nk_context* context, struct Editor* /* Transform */ { + if(nk_widget_is_hovered(context)) + nk_tooltip(context, "Resets the local transformations for this entity without changing the entity's parent"); + + nk_layout_row_dynamic(context, row_height, 1); + if(nk_button_label(context, "Reset Transform")) + { + vec3_fill(&entity->transform.position, 0.f, 0.f, 0.f); + vec3_fill(&entity->transform.scale, 1.f, 1.f, 1.f); + quat_fill(&entity->transform.rotation, 0.f, 0.f, 0.f, 1.f); + transform_update_transmat(entity); + } + nk_layout_row_dynamic(context, row_height, 1); nk_label(context, "Position", NK_TEXT_ALIGN_CENTERED); vec3 abs_pos = { 0.f, 0.f, 0.f }; transform_get_absolute_position(entity, &abs_pos); diff --git a/todo.txt b/todo.txt index 740c51a..c092279 100644 --- a/todo.txt +++ b/todo.txt @@ -366,4 +366,5 @@ Done: * Brought back debug variable display in editor and allow showing colours, textures etc * Shortcut key to toggle debug variable display and cycle locations * Move debug vars display settings to debug_vars struct - * Command history in console \ No newline at end of file + * Command history in console + * Added button to reset local transformations for selected entity in property inspector \ No newline at end of file