Math is the backbone of any engine. But the math needed for
The GusOnGames engine needs a math module that is:
This article defines the exact math foundations required for the engine — no more, no less.
Vectors and points are the fundamental building blocks for representing positions, directions, and displacements in 3D space. In the GusOnGames engine, we distinguish between points (which represent positions) and vectors (which represent directions and magnitudes).
The math module provides:
These types must be:
We avoid operator overloading that hides cost or intent.
Vectors must behave like simple structs with clear math operations.
Matrices must be predictable and compatible with GPU expectations.
A Transform represents:
Transforms must support:
We start with:
Later articles may introduce:
Transforms define movement between:
Understanding these spaces is essential for rendering.
The object’s own coordinate system.
All objects placed together.
The world as seen from the camera.
Perspective or orthographic projection.
Normalized device coordinates → viewport.
Every rendering operation is a chain of transforms:
vertex_local
→ model_matrix
→ world_space
→ view_matrix
→ view_space
→ projection_matrix
→ clip_space
→ screen_space
The math module must make this pipeline easy to express.
Real time engines face different numerical challenges than CAE tools.
Physics simulations require:
This is why the math module must be simple and explicit.
The math module must be:
These headers define the core math types and operations for the engine.
engine/math/include
vector.h
matrix.h
projections.h
transformations.h
math_utils.hpp
We avoid:
Why?
Because the engine needs:
Matrices must be column major to match OpenGL’s expectations.
Vectors must be contiguous and trivially copyable.
This makes the math module easy to use and easy to teach.
The following is a quick reference for the math module API:
The math module provides the foundational types and operations used throughout the GusOnGames engine:
It is:
matX (mat2, mat3, mat4)
This article defined the math foundations required for the GusOnGames engine:
This math module is the foundation for both rendering and simulation. It is intentionally simple, intentionally explicit, and intentionally educational.