Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 1.74 KB

File metadata and controls

32 lines (24 loc) · 1.74 KB

Velos Functionality Overview

Velos relies on a highly decoupled architecture. Below is an overview of the core sub-systems.

Engine core

The Engine class is the central orchestrator. It manages the game loop, enforces the target framerate , and processes internal timers.

Input system

Actions are the core abstraction for input. Each action binds a key to a named callback with a trigger type:

  • Press — fires once when the key is pressed
  • Hold — fires every frame while held, after an optional threshold
  • Release — fires once when the key is released
  • HoldCompleted — fires once after the hold threshold is met and the key is released

Physics system

A custom 2D physics solver that handles both collision detection and resolution.

  • Broad/Narrow Phase: Checks bounding boxes and calculates intersection depth and normal vectors (Minimum Translation Vector).
  • Colliders: Supports AABBCollider (Axis-Aligned Bounding Box) and CircleCollider.
  • Resolution: Automatically pushes dynamic entities apart based on collision manifolds, while respecting isStatic() flags.

Entity management

  • Entities act as spatial nodes.
  • Memory is strictly managed. Entities flagged via destroy() are safely swept from memory at the end of the frame, preventing dangling pointers during physics updates.

Scene graph and transforms

Transformations (Position, Rotation, Scale) are applied hierarchically. Moving an entity automatically updates the world matrices of all attached shapes and colliders.

Camera system

The Camera acts as a viewport transformation matrix.

  • It supports direct coordinate mapping: screenToWorld and worldToScreen.
  • Features built-in interpolation for smooth tracking (CameraFollowMode::Smooth).