Added Meshbuilder + new RMesh type

This commit is contained in:
Anemunt
2025-12-10 16:40:44 -05:00
parent 7831bea4e2
commit cdb781262f
8 changed files with 1306 additions and 153 deletions

22
src/MeshBuilder.h Normal file
View File

@@ -0,0 +1,22 @@
#pragma once
#include "Common.h"
#include "ModelLoader.h"
// Lightweight mesh editing state used by the MeshBuilder panel.
class MeshBuilder {
public:
bool hasMesh = false;
RawMeshAsset mesh;
std::string loadedPath;
bool dirty = false;
int selectedVertex = -1;
bool load(const std::string& path, std::string& error);
bool save(const std::string& path, std::string& error);
void clear();
void recomputeNormals();
// Add a new face defined by vertex indices (3 = triangle, 4 = quad fan).
bool addFace(const std::vector<uint32_t>& indices, std::string& error);
};