# haletas033/lsimengine architecture

> Architecture diagram of the GitHub repository haletas033/lsimengine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/haletas033/lsimengine
- Repository: https://github.com/haletas033/lsimengine

## Overview

LSIM Engine is a 3D scene editor/runtime. Its principal workflow is to create or load a scene, edit and inspect meshes and lighting, then render the scene with camera controls. The README also documents procedural terrain, model loading, picking, PBR materials, skyboxes, and scene/config persistence. The sampled main excerpt confirms scene setup, rendering-loop responsibilities, camera handling, and GUI lifecycle; several feature implementations were not sampled, so their internal connections are left unverified.

Main entry points: [`Src/main.cpp`](https://github.com/haletas033/lsimengine/blob/master/Src/main.cpp) (Runtime Loop), [`Src/geometry/mesh.cpp`](https://github.com/haletas033/lsimengine/blob/master/Src/geometry/mesh.cpp) (Mesh), [`Src/inputs/gui.cpp`](https://github.com/haletas033/lsimengine/blob/master/Src/inputs/gui.cpp) (Editor GUI), [`Src/utils/fileIO.cpp`](https://github.com/haletas033/lsimengine/blob/master/Src/utils/fileIO.cpp) (Scene File I/O)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Loop"]
  node_main["Runtime Loop<br/>[main.cpp]"]
end

subgraph group_scene["Scene Editing"]
  node_gui["Editor GUI<br/>[gui.cpp]"]
  node_input["Input Handling<br/>[inputs.cpp]"]
  node_camera["Camera Controls<br/>[camera.cpp]"]
  node_scene_data["Scene State<br/>[scene.h]"]
  node_lights["Lighting<br/>[light.h]"]
  node_imgui["ImGui UI<br/>[imgui.h]"]
end

subgraph group_geometry["Geometry"]
  node_mesh["Mesh<br/>[mesh.cpp]"]
  node_primitives["Primitives<br/>[primitives.cpp]"]
  node_terrain["Terrain<br/>[terrain.cpp]"]
  node_model["Model Loading<br/>[model.cpp]"]
  node_picking["Mesh Picking<br/>[meshPicking.h]"]
end

subgraph group_render["Rendering"]
  node_gl_objects["GL Buffers<br/>[VAO.cpp]"]
  node_shader["Shader Programs<br/>[shaderClass.cpp]"]
  node_texture["Textures and Skybox<br/>[texture.cpp]"]
  node_glfw["GLFW Windowing<br/>[glfw3.h]"]
  node_glm["GLM Math<br/>[glm.hpp]"]
end

subgraph group_support["Persistence and Utilities"]
  node_fileio["Scene File I/O<br/>[fileIO.cpp]"]
  node_config["Config Defaults<br/>[defaults.h]"]
  node_json["JSON Handling<br/>[json.cpp]"]
  node_logger["Logging<br/>[log.cpp]"]
  node_jsonlib["JSON Library<br/>[json.hpp]"]
end

node_user(("Editor User"))

node_user -->|"edits scene"| node_gui
node_main -->|"owns scene"| node_scene_data
node_main -->|"creates meshes"| node_primitives
node_main -->|"initializes and draws"| node_gui
node_main -->|"handles camera"| node_camera
node_main -->|"loads scene"| node_fileio
node_main -->|"applies transforms"| node_mesh
node_main -->|"updates lights"| node_lights
node_scene_data -->|"stores meshes"| node_mesh
node_scene_data -->|"stores lights"| node_lights
node_gui -->|"uses UI"| node_imgui
node_gui -->|"edits meshes"| node_mesh
node_gui -->|"edits lighting"| node_lights
node_fileio -->|"uses JSON"| node_json
node_model -->|"references scene"| node_scene_data
node_model -->|"uses textures"| node_texture
node_mesh -.->|"sets up buffers"| node_gl_objects
node_mesh -.->|"renders with"| node_shader
node_mesh -.->|"uses material maps"| node_texture
node_main -.->|"supports terrain"| node_terrain
node_main -.->|"supports model loading"| node_model
node_main -.->|"supports selection"| node_picking
node_main -.->|"creates window"| node_glfw
node_camera -.->|"uses math"| node_glm
node_fileio -.->|"handles texture data"| node_texture
node_fileio -.->|"uses defaults"| node_config
node_json -.->|"uses library"| node_jsonlib

click node_main "https://github.com/haletas033/lsimengine/blob/master/Src/main.cpp"
click node_gui "https://github.com/haletas033/lsimengine/blob/master/Src/inputs/gui.cpp"
click node_input "https://github.com/haletas033/lsimengine/blob/master/Src/inputs/inputs.cpp"
click node_camera "https://github.com/haletas033/lsimengine/blob/master/Src/scene/camera.cpp"
click node_scene_data "https://github.com/haletas033/lsimengine/blob/master/include/scene/scene.h"
click node_lights "https://github.com/haletas033/lsimengine/blob/master/include/scene/light.h"
click node_mesh "https://github.com/haletas033/lsimengine/blob/master/Src/geometry/mesh.cpp"
click node_primitives "https://github.com/haletas033/lsimengine/blob/master/Src/geometry/primitives.cpp"
click node_terrain "https://github.com/haletas033/lsimengine/blob/master/Src/geometry/terrain.cpp"
click node_model "https://github.com/haletas033/lsimengine/blob/master/Src/geometry/model.cpp"
click node_picking "https://github.com/haletas033/lsimengine/blob/master/include/utils/meshPicking.h"
click node_gl_objects "https://github.com/haletas033/lsimengine/blob/master/Src/gl/VAO.cpp"
click node_shader "https://github.com/haletas033/lsimengine/blob/master/Src/gl/shaderClass.cpp"
click node_texture "https://github.com/haletas033/lsimengine/blob/master/Src/utils/texture.cpp"
click node_fileio "https://github.com/haletas033/lsimengine/blob/master/Src/utils/fileIO.cpp"
click node_config "https://github.com/haletas033/lsimengine/blob/master/include/utils/defaults.h"
click node_json "https://github.com/haletas033/lsimengine/blob/master/Src/utils/json.cpp"
click node_logger "https://github.com/haletas033/lsimengine/blob/master/Src/utils/logging/log.cpp"
click node_glfw "https://github.com/haletas033/lsimengine/blob/master/external/glfw/include/GLFW/glfw3.h"
click node_glm "https://github.com/haletas033/lsimengine/blob/master/external/glm/glm.hpp"
click node_imgui "https://github.com/haletas033/lsimengine/blob/master/external/imgui/imgui.h"
click node_jsonlib "https://github.com/haletas033/lsimengine/blob/master/external/nlohmann/json.hpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_user toneBlue
class node_gui,node_input,node_camera,node_scene_data,node_lights,node_imgui toneAmber
class node_mesh,node_primitives,node_terrain,node_model,node_picking toneMint
class node_gl_objects,node_shader,node_texture,node_glfw,node_glm toneRose
class node_fileio,node_config,node_json,node_logger,node_jsonlib toneIndigo
```

## Components

### Application Loop

- [Runtime Loop](https://github.com/haletas033/lsimengine/blob/master/Src/main.cpp): `Src/main.cpp`

### Scene Editing

- [Editor GUI](https://github.com/haletas033/lsimengine/blob/master/Src/inputs/gui.cpp): `Src/inputs/gui.cpp`
- [Input Handling](https://github.com/haletas033/lsimengine/blob/master/Src/inputs/inputs.cpp): `Src/inputs/inputs.cpp`
- [Camera Controls](https://github.com/haletas033/lsimengine/blob/master/Src/scene/camera.cpp): `Src/scene/camera.cpp`
- [Scene State](https://github.com/haletas033/lsimengine/blob/master/include/scene/scene.h): `include/scene/scene.h`
- [Lighting](https://github.com/haletas033/lsimengine/blob/master/include/scene/light.h): `include/scene/light.h`
- [ImGui UI](https://github.com/haletas033/lsimengine/blob/master/external/imgui/imgui.h): `external/imgui/imgui.h`

### Geometry

- [Mesh](https://github.com/haletas033/lsimengine/blob/master/Src/geometry/mesh.cpp): `Src/geometry/mesh.cpp`
- [Primitives](https://github.com/haletas033/lsimengine/blob/master/Src/geometry/primitives.cpp): `Src/geometry/primitives.cpp`
- [Terrain](https://github.com/haletas033/lsimengine/blob/master/Src/geometry/terrain.cpp): `Src/geometry/terrain.cpp`
- [Model Loading](https://github.com/haletas033/lsimengine/blob/master/Src/geometry/model.cpp): `Src/geometry/model.cpp`
- [Mesh Picking](https://github.com/haletas033/lsimengine/blob/master/include/utils/meshPicking.h): `include/utils/meshPicking.h`

### Rendering

- [GL Buffers](https://github.com/haletas033/lsimengine/blob/master/Src/gl/VAO.cpp): `Src/gl/VAO.cpp`
- [Shader Programs](https://github.com/haletas033/lsimengine/blob/master/Src/gl/shaderClass.cpp): `Src/gl/shaderClass.cpp`
- [Textures and Skybox](https://github.com/haletas033/lsimengine/blob/master/Src/utils/texture.cpp): `Src/utils/texture.cpp`
- [GLFW Windowing](https://github.com/haletas033/lsimengine/blob/master/external/glfw/include/GLFW/glfw3.h): `external/glfw/include/GLFW/glfw3.h`
- [GLM Math](https://github.com/haletas033/lsimengine/blob/master/external/glm/glm.hpp): `external/glm/glm.hpp`

### Persistence and Utilities

- [Scene File I/O](https://github.com/haletas033/lsimengine/blob/master/Src/utils/fileIO.cpp): `Src/utils/fileIO.cpp`
- [Config Defaults](https://github.com/haletas033/lsimengine/blob/master/include/utils/defaults.h): `include/utils/defaults.h`
- [JSON Handling](https://github.com/haletas033/lsimengine/blob/master/Src/utils/json.cpp): `Src/utils/json.cpp`
- [Logging](https://github.com/haletas033/lsimengine/blob/master/Src/utils/logging/log.cpp): `Src/utils/logging/log.cpp`
- [JSON Library](https://github.com/haletas033/lsimengine/blob/master/external/nlohmann/json.hpp): `external/nlohmann/json.hpp`

### Other components

- **Editor User**

## Connections

- Editor User → Editor GUI: edits scene (evidence: `README.md`)
- Runtime Loop → Scene State: owns scene (evidence: `Src/main.cpp`)
- Runtime Loop → Primitives: creates meshes (evidence: `Src/main.cpp`)
- Runtime Loop → Editor GUI: initializes and draws (evidence: `Src/main.cpp`)
- Runtime Loop → Camera Controls: handles camera (evidence: `Src/main.cpp`)
- Runtime Loop → Scene File I/O: loads scene (evidence: `Src/main.cpp`)
- Runtime Loop → Mesh: applies transforms (evidence: `Src/main.cpp`)
- Runtime Loop → Lighting: updates lights (evidence: `Src/main.cpp`)
- Scene State → Mesh: stores meshes (evidence: `include/scene/scene.h`)
- Scene State → Lighting: stores lights (evidence: `include/scene/scene.h`)
- Editor GUI → ImGui UI: uses UI
- Editor GUI → Mesh: edits meshes
- Editor GUI → Lighting: edits lighting
- Scene File I/O → JSON Handling: uses JSON (evidence: `Src/utils/fileIO.cpp`)
- Model Loading → Scene State: references scene (evidence: `Src/geometry/model.cpp`)
- Model Loading → Textures and Skybox: uses textures (evidence: `Src/geometry/model.cpp`)
- Mesh → GL Buffers: sets up buffers
- Mesh → Shader Programs: renders with
- Mesh → Textures and Skybox: uses material maps
- Runtime Loop → Terrain: supports terrain
- Runtime Loop → Model Loading: supports model loading
- Runtime Loop → Mesh Picking: supports selection (evidence: `Src/main.cpp`)
- Runtime Loop → GLFW Windowing: creates window
- Camera Controls → GLM Math: uses math
- Scene File I/O → Textures and Skybox: handles texture data
- Scene File I/O → Config Defaults: uses defaults (evidence: `Src/utils/fileIO.cpp`)
- JSON Handling → JSON Library: uses library
