# steetstyle/godot-stuff architecture

> Architecture diagram of the GitHub repository steetstyle/godot-stuff, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/steetstyle/godot-stuff
- Repository: https://github.com/steetstyle/godot-stuff

## Overview

a. Primary Flow
- Game Code -> DebugDraw API -> Rendering Pipeline

b. Configuration Flow
- Project Settings -> Plugin System -> Debug Drawing Features

c. Resource Management Flow
- Instance Pools <-> Drawing Systems
- Layer System <-> Drawing Calls

##### Implementation Details to Highlight

- Text Rendering System:
- Text API -> Viewport/3D Space -> Position Calculation -> Render

- Layer Management:
- Layer Configuration -> Toggle System -> Visibility Control

##### Integration Points

- Godot Engine Integration:
- Project Settings
- Scene Tree
- Physics System
- Rendering Pipeline

- User Code Integration:
- Debug API calls
- Layer configuration
- Custom settings

##### Performance Aspects

- Pool management flow
- Render optimization
- Resource cleanup

Remember to include notes about:
- C# specificity
- Godot 4.0+ compatibility
- Runtime vs Editor time behavior
- Performance considerations for debug visualization

This will provide a comprehensive view of the system while maintaining clarity about its purpose as a debugging tool.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core
        DD[DebugDraw API]:::core
        DM[Debug Meshes]:::core
        DP[Debug Plugin]:::core
    end

    subgraph Features
        direction TB
        Shapes[Shape Drawing]:::feature
        Text[Text Rendering]:::feature
        Physics[Physics Query]:::feature
    end

    subgraph UI
        direction TB
        Dock[Debug Dock]:::ui
        Menu[Debug Menu]:::ui
    end

    subgraph Resources
        direction TB
        Pool[Instance Pool]:::resource
        Layer[Layer System]:::resource
    end

    subgraph Godot
        direction TB
        Settings[Project Settings]:::godot
        Scene[Scene Tree]:::godot
        Render[Rendering Pipeline]:::godot
        PhysicsEngine[Physics System]:::godot
    end

    %% Core Relationships
    DD --> DM
    DD --> DP
    DP --> Settings

    %% Feature Relationships
    DD --> Shapes
    DD --> Text
    DD --> Physics
    Shapes --> Pool
    Text --> Pool
    Physics --> PhysicsEngine

    %% UI Flow
    Dock --> Layer
    Menu --> Layer
    Layer --> DD

    %% Resource Management
    Pool --> Render
    Layer --> Render

    %% Godot Integration
    Settings --> DP
    Scene --> DD
    PhysicsEngine --> Physics

    %% Click Events
    click DD "https://github.com/steetstyle/godot-stuff/blob/main/addons/debug_drawing/DebugDraw.cs"
    click DM "https://github.com/steetstyle/godot-stuff/blob/main/addons/debug_drawing/DebugMeshes.cs"
    click DP "https://github.com/steetstyle/godot-stuff/blob/main/addons/debug_drawing/DebugDrawingPlugin.cs"
    click Dock "https://github.com/steetstyle/godot-stuff/blob/main/addons/debug_drawing/control/DebugDock.cs"
    click Menu "https://github.com/steetstyle/godot-stuff/blob/main/addons/debug_drawing/control/debug_dock.tscn"

    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef feature fill:#2ecc71,stroke:#27ae60,color:white
    classDef ui fill:#f1c40f,stroke:#f39c12,color:black
    classDef resource fill:#e67e22,stroke:#d35400,color:white
    classDef godot fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Drawing Features]:::feature
        L3[UI Elements]:::ui
        L4[Resource Management]:::resource
        L5[Godot Systems]:::godot
    end
```
