# xpac27/littleworld architecture

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

- Interactive diagram: https://gitdiagram.com/xpac27/littleworld
- Repository: https://github.com/xpac27/littleworld

## Overview

Little World is an in-development 3D game: the application entry point initializes and drives Game, which owns the World. The world manages entities, pathfinding, and camera-facing render collections; the camera draws meshes, sprites, and lights, including the README-documented lighting and shadows capability. The graph also shows the graphics and math layers used by those subsystems. Some implementation excerpts were unavailable, so relationships are limited to visible declarations, indexed references, and README statements; uncertain runtime calls are omitted.

Main entry points: [`src/scene/World.h`](https://github.com/xpac27/littleworld/blob/master/src/scene/World.h) (World), [`src/scene/Camera.cpp`](https://github.com/xpac27/littleworld/blob/master/src/scene/Camera.cpp) (Camera), [`src/graphics/object/Mesh.cpp`](https://github.com/xpac27/littleworld/blob/master/src/graphics/object/Mesh.cpp) (Mesh), [`src/scene/entity/Dynamic.cpp`](https://github.com/xpac27/littleworld/blob/master/src/scene/entity/Dynamic.cpp) (Dynamic Entities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["Application Entry<br/>[main.cpp]"]
  node_game["Game Controller<br/>[Game.cpp]"]
end

subgraph group_world["World and Gameplay"]
  node_world["World<br/>[World.h]"]
  node_pathfinder["Pathfinder<br/>[Pathfinder.cpp]"]
  node_dynamic["Dynamic Entities<br/>[Dynamic.cpp]"]
  node_player_entity["Player Entity<br/>[Player.cpp]"]
  node_enemy["Enemy Entity<br/>[Enemy.cpp]"]
  node_static["Static Entities<br/>[Static.cpp]"]
  node_decor["Decor<br/>[Decor.h]"]
  node_emitter["Emitter<br/>[Emitter.h]"]
  node_entity["Entity Base<br/>[Entity.h]"]
end

subgraph group_render["Rendering"]
  node_camera["Camera<br/>[Camera.cpp]"]
  node_mesh["Mesh<br/>[Mesh.cpp]"]
  node_sprite["Sprite<br/>[Sprite.cpp]"]
  node_light["Light and Shadows<br/>[Light.cpp]"]
  node_object["Render Object<br/>[Object.cpp]"]
  node_vbo["Vertex Buffers<br/>[VBO.cpp]"]
end

subgraph group_math["Math and Resources"]
  node_vector["Vector Math<br/>[Vector3.cpp]"]
  node_vector_util["Vector Utilities<br/>[Vector3Util.cpp]"]
  node_matrix["Matrices<br/>[Matrix4x4f.cpp]"]
  node_frustum["View Frustum<br/>[Frustum.cpp]"]
  node_structs["Shared Graphics and Grid Data<br/>[Structs.h]"]
  node_notifications["Notifications<br/>[Notifications.h]"]
end

node_user(("Player"))

node_user -.->|"starts"| node_main
node_main -->|"runs"| node_game
node_game -->|"drives"| node_world
node_world -->|"owns"| node_camera
node_world -->|"owns"| node_pathfinder
node_world -->|"manages"| node_dynamic
node_world -->|"manages"| node_static
node_world -->|"creates"| node_player_entity
node_world -->|"creates"| node_enemy
node_world -->|"creates"| node_decor
node_world -->|"manages"| node_emitter
node_dynamic -->|"extends"| node_entity
node_static -->|"extends"| node_entity
node_player_entity -->|"extends"| node_dynamic
node_enemy -->|"extends"| node_dynamic
node_decor -->|"extends"| node_static
node_camera -->|"draws"| node_mesh
node_camera -->|"draws"| node_sprite
node_camera -->|"draws"| node_light
node_mesh -->|"uses lighting"| node_light
node_mesh -->|"extends"| node_object
node_sprite -->|"extends"| node_object
node_light -->|"extends"| node_object
node_mesh -->|"uses buffers"| node_vbo
node_sprite -->|"uses buffers"| node_vbo
node_vbo -->|"uses vertex data"| node_structs
node_pathfinder -->|"registers"| node_entity
node_pathfinder -->|"returns paths"| node_vector
node_vector_util -->|"operates on"| node_vector
node_matrix -->|"uses"| node_vector
node_frustum -->|"uses"| node_matrix
node_frustum -->|"uses"| node_vector
node_camera -->|"tests visibility"| node_frustum
node_player_entity -->|"uses events"| node_notifications

click node_main "https://github.com/xpac27/littleworld/blob/master/src/main.cpp"
click node_game "https://github.com/xpac27/littleworld/blob/master/src/game/Game.cpp"
click node_world "https://github.com/xpac27/littleworld/blob/master/src/scene/World.h"
click node_camera "https://github.com/xpac27/littleworld/blob/master/src/scene/Camera.cpp"
click node_pathfinder "https://github.com/xpac27/littleworld/blob/master/src/ai/Pathfinder.cpp"
click node_dynamic "https://github.com/xpac27/littleworld/blob/master/src/scene/entity/Dynamic.cpp"
click node_player_entity "https://github.com/xpac27/littleworld/blob/master/src/scene/entity/dynamic/Player.cpp"
click node_enemy "https://github.com/xpac27/littleworld/blob/master/src/scene/entity/dynamic/Enemy.cpp"
click node_static "https://github.com/xpac27/littleworld/blob/master/src/scene/entity/Static.cpp"
click node_decor "https://github.com/xpac27/littleworld/blob/master/src/scene/entity/static/Decor.h"
click node_emitter "https://github.com/xpac27/littleworld/blob/master/src/scene/entity/static/Emitter.h"
click node_entity "https://github.com/xpac27/littleworld/blob/master/src/scene/Entity.h"
click node_mesh "https://github.com/xpac27/littleworld/blob/master/src/graphics/object/Mesh.cpp"
click node_sprite "https://github.com/xpac27/littleworld/blob/master/src/graphics/object/Sprite.cpp"
click node_light "https://github.com/xpac27/littleworld/blob/master/src/graphics/object/Light.cpp"
click node_object "https://github.com/xpac27/littleworld/blob/master/src/graphics/Object.cpp"
click node_vbo "https://github.com/xpac27/littleworld/blob/master/src/graphics/VBO.cpp"
click node_vector "https://github.com/xpac27/littleworld/blob/master/src/math/Vector3.cpp"
click node_vector_util "https://github.com/xpac27/littleworld/blob/master/src/math/Vector3Util.cpp"
click node_matrix "https://github.com/xpac27/littleworld/blob/master/src/math/Matrix4x4f.cpp"
click node_frustum "https://github.com/xpac27/littleworld/blob/master/src/math/Frustum.cpp"
click node_structs "https://github.com/xpac27/littleworld/blob/master/src/resources/Structs.h"
click node_notifications "https://github.com/xpac27/littleworld/blob/master/src/resources/Notifications.h"

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_game toneBlue
class node_world,node_pathfinder,node_dynamic,node_player_entity,node_enemy,node_static,node_decor,node_emitter,node_entity toneAmber
class node_camera,node_mesh,node_sprite,node_light,node_object,node_vbo toneMint
class node_vector,node_vector_util,node_matrix,node_frustum,node_structs,node_notifications toneRose
class node_user toneIndigo
```

## Components

### Application

- [Application Entry](https://github.com/xpac27/littleworld/blob/master/src/main.cpp): `src/main.cpp`
- [Game Controller](https://github.com/xpac27/littleworld/blob/master/src/game/Game.cpp): `src/game/Game.cpp`

### World and Gameplay

- [World](https://github.com/xpac27/littleworld/blob/master/src/scene/World.h): `src/scene/World.h`
- [Pathfinder](https://github.com/xpac27/littleworld/blob/master/src/ai/Pathfinder.cpp): `src/ai/Pathfinder.cpp`
- [Dynamic Entities](https://github.com/xpac27/littleworld/blob/master/src/scene/entity/Dynamic.cpp): `src/scene/entity/Dynamic.cpp`
- [Player Entity](https://github.com/xpac27/littleworld/blob/master/src/scene/entity/dynamic/Player.cpp): `src/scene/entity/dynamic/Player.cpp`
- [Enemy Entity](https://github.com/xpac27/littleworld/blob/master/src/scene/entity/dynamic/Enemy.cpp): `src/scene/entity/dynamic/Enemy.cpp`
- [Static Entities](https://github.com/xpac27/littleworld/blob/master/src/scene/entity/Static.cpp): `src/scene/entity/Static.cpp`
- [Decor](https://github.com/xpac27/littleworld/blob/master/src/scene/entity/static/Decor.h): `src/scene/entity/static/Decor.h`
- [Emitter](https://github.com/xpac27/littleworld/blob/master/src/scene/entity/static/Emitter.h): `src/scene/entity/static/Emitter.h`
- [Entity Base](https://github.com/xpac27/littleworld/blob/master/src/scene/Entity.h): `src/scene/Entity.h`

### Rendering

- [Camera](https://github.com/xpac27/littleworld/blob/master/src/scene/Camera.cpp): `src/scene/Camera.cpp`
- [Mesh](https://github.com/xpac27/littleworld/blob/master/src/graphics/object/Mesh.cpp): `src/graphics/object/Mesh.cpp`
- [Sprite](https://github.com/xpac27/littleworld/blob/master/src/graphics/object/Sprite.cpp): `src/graphics/object/Sprite.cpp`
- [Light and Shadows](https://github.com/xpac27/littleworld/blob/master/src/graphics/object/Light.cpp): `src/graphics/object/Light.cpp`
- [Render Object](https://github.com/xpac27/littleworld/blob/master/src/graphics/Object.cpp): `src/graphics/Object.cpp`
- [Vertex Buffers](https://github.com/xpac27/littleworld/blob/master/src/graphics/VBO.cpp): `src/graphics/VBO.cpp`

### Math and Resources

- [Vector Math](https://github.com/xpac27/littleworld/blob/master/src/math/Vector3.cpp): `src/math/Vector3.cpp`
- [Vector Utilities](https://github.com/xpac27/littleworld/blob/master/src/math/Vector3Util.cpp): `src/math/Vector3Util.cpp`
- [Matrices](https://github.com/xpac27/littleworld/blob/master/src/math/Matrix4x4f.cpp): `src/math/Matrix4x4f.cpp`
- [View Frustum](https://github.com/xpac27/littleworld/blob/master/src/math/Frustum.cpp): `src/math/Frustum.cpp`
- [Shared Graphics and Grid Data](https://github.com/xpac27/littleworld/blob/master/src/resources/Structs.h): `src/resources/Structs.h`
- [Notifications](https://github.com/xpac27/littleworld/blob/master/src/resources/Notifications.h): `src/resources/Notifications.h`

### Other components

- **Player**

## Connections

- Player → Application Entry: starts
- Application Entry → Game Controller: runs (evidence: `src/main.cpp`)
- Game Controller → World: drives
- World → Camera: owns (evidence: `src/scene/World.h`)
- World → Pathfinder: owns (evidence: `src/scene/World.h`)
- World → Dynamic Entities: manages (evidence: `src/scene/World.h`)
- World → Static Entities: manages (evidence: `src/scene/World.h`)
- World → Player Entity: creates (evidence: `src/scene/World.h`)
- World → Enemy Entity: creates (evidence: `src/scene/World.h`)
- World → Decor: creates (evidence: `src/scene/World.h`)
- World → Emitter: manages (evidence: `src/scene/World.h`)
- Dynamic Entities → Entity Base: extends
- Static Entities → Entity Base: extends
- Player Entity → Dynamic Entities: extends
- Enemy Entity → Dynamic Entities: extends
- Decor → Static Entities: extends (evidence: `src/scene/entity/static/Decor.h`)
- Camera → Mesh: draws
- Camera → Sprite: draws
- Camera → Light and Shadows: draws
- Mesh → Light and Shadows: uses lighting
- Mesh → Render Object: extends
- Sprite → Render Object: extends
- Light and Shadows → Render Object: extends
- Mesh → Vertex Buffers: uses buffers
- Sprite → Vertex Buffers: uses buffers
- Vertex Buffers → Shared Graphics and Grid Data: uses vertex data
- Pathfinder → Entity Base: registers
- Pathfinder → Vector Math: returns paths
- Vector Utilities → Vector Math: operates on
- Matrices → Vector Math: uses
- View Frustum → Matrices: uses
- View Frustum → Vector Math: uses
- Camera → View Frustum: tests visibility
- Player Entity → Notifications: uses events
