add 'modelviewer' ui element

This commit is contained in:
MihailRis
2025-05-24 19:28:24 +03:00
parent 761afe51a5
commit 7a25560bc0
7 changed files with 261 additions and 11 deletions
+4 -1
View File
@@ -3,6 +3,7 @@
#include "typedefs.hpp"
#include "commons.hpp"
#include "MeshData.hpp"
#include "maths/UVRegion.hpp"
#include <memory>
#include <cstdlib>
@@ -32,8 +33,8 @@ class Batch3D : public Flushable {
std::unique_ptr<Texture> blank;
size_t index;
glm::vec4 tint {1.0f};
const Texture* currentTexture;
UVRegion region {0.0f, 0.0f, 1.0f, 1.0f};
void vertex(
float x, float y, float z,
@@ -102,6 +103,8 @@ public:
const glm::vec4& tint,
bool shading = true
);
void setRegion(UVRegion region);
void vertex(const glm::vec3& pos, const glm::vec2& uv, const glm::vec3& norm);
void vertex(const glm::vec3& pos, const glm::vec2& uv, const glm::vec4& tint);
void point(const glm::vec3& pos, const glm::vec4& tint);
void flush() override;