From edc50a43a0ab064472aa7fde90f14cf456d92076 Mon Sep 17 00:00:00 2001 From: tech kaczynski Date: Mon, 19 Oct 2026 01:47:08 +1000 Subject: lots of editor work. Improved editor camera controls. --- editor.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'editor.h') diff --git a/editor.h b/editor.h index 07ad48d..808a1ee 100644 --- a/editor.h +++ b/editor.h @@ -3,6 +3,7 @@ #include "common.h" #include "ent.h" +#include "cam.h" typedef enum { ED_ACTION_TRANSFORM, @@ -10,6 +11,7 @@ typedef enum { ED_ACTION_DELETE, ED_ACTION_RENAME, ED_ACTION_MODEL, + ED_ACTION_PHYSICS, } EditorActionTag; typedef union { @@ -29,6 +31,7 @@ typedef union { } rename; ModelCmp model; + PhysicsCmp physics; } EditorActionData; typedef struct { @@ -53,9 +56,26 @@ typedef enum { ED_PNL_TYPE_PROPERTIES, ED_PNL_TYPE_SPACE, ED_PNL_TYPE_MODEL_PICKER, + ED_PNL_TYPE_PHYSICS_ELEMENTS, + ED_PNL_TYPE_PHYSICS_PROPERTIES, ED_PNL_TYPE_CMD, } EditorPanelType; +typedef enum { + ED_MODE_SCENE, + ED_MODE_ENTITY, + ED_MODE_PHYSICS, +} EditorModeTag; + +typedef enum { + ED_INTERACT_NONE, + ED_INTERACT_SELECT, + ED_INTERACT_MOVE, + ED_INTERACT_ROTATE, + ED_INTERACT_SCALE, + ED_INTERACT_CAMERA, +} EditorInteraction; + typedef struct { Vec3 sel_point; Quaternion sel_rot; @@ -63,6 +83,14 @@ typedef struct { f32 grid_sz; + u64 physics_pid; + int physics_body, physics_shape; + Vec2 physics_scroll; + CameraInfo scene_cam; + bool draw_physics; + + EditorModeTag mode, prev_mode; + EditorInteraction interact; EditorPanelContainer focus; bool focus_captured; struct { -- cgit v1.2.3