Easy3D::CubeMesh

CPU-side vertex/index builder — turns a CubeBatch into GPU-ready arrays.

Overview

Lives in the sibling ../easy-3d repository (namespace Easy3D), not in galaxy-eggbert itself — added under task E3D-MIG-051 specifically because this is generic 3D-batching plumbing with zero Eggbert-specific knowledge, matching Easy3D's stated role as a small helper library beside CNA.

Header: include/Easy3D/CubeMesh.hpp. Implementation: src/CubeMesh.cpp (in ../easy-3d).

API (as used by GalaxyEggbertCNA)

namespace Easy3D {

struct CubeVertex { /* position, normal, UV */ };

// Converts a CubeBatch (CPU-side queue of cube placements + UVs)
// into flat vertex/index arrays: 24 vertices + 36 indices per cube.
struct CubeMeshData {
    std::vector<CubeVertex> vertices;
    std::vector<uint32_t>   indices;
};
CubeMeshData BuildCubeMesh(const CubeBatch& batch);

}

Used By

GETerrainRenderer builds a CubeBatch from non-air world blocks and calls BuildCubeMesh, then hands the result to CubeMeshRenderer for upload/draw.

Modification Policy

Requires approval Modifying ../easy-3d (including this class) requires explicit, per-change user approval — it is not blanket-authorized just because galaxy-eggbert depends on it.