summaryrefslogtreecommitdiff
path: root/Userland/Applications/3DFileViewer/Mesh.h
diff options
context:
space:
mode:
authorJesse Buhagiar <jooster669@gmail.com>2021-05-23 23:57:53 +1000
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-05-26 16:36:53 +0430
commit343e66b816bdbca727442cc190a18f41d93428c6 (patch)
tree09e3189c7958320fb496e4f702448d5fe2000569 /Userland/Applications/3DFileViewer/Mesh.h
parent3287709df92698f87d319e9c31a3512e0eeac0c5 (diff)
downloadserenity-343e66b816bdbca727442cc190a18f41d93428c6.zip
3DFileViewer: Support textured models
Models that contain UV co-ordinates are now supported, and will display with a texture wrapped around it, provided a `bmp` with the same name as the object is in the same directory as the 3D Model.
Diffstat (limited to 'Userland/Applications/3DFileViewer/Mesh.h')
-rw-r--r--Userland/Applications/3DFileViewer/Mesh.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Applications/3DFileViewer/Mesh.h b/Userland/Applications/3DFileViewer/Mesh.h
index 7f979cff0a..b17b0bde8e 100644
--- a/Userland/Applications/3DFileViewer/Mesh.h
+++ b/Userland/Applications/3DFileViewer/Mesh.h
@@ -16,7 +16,7 @@ class Mesh : public RefCounted<Mesh> {
public:
Mesh() = delete;
- Mesh(Vector<Vertex> vertices, Vector<Triangle> triangles);
+ Mesh(Vector<Vertex> vertices, Vector<TexCoord> tex_coords, Vector<Triangle> triangles);
size_t vertex_count() const { return m_vertex_list.size(); }
@@ -24,7 +24,10 @@ public:
void draw();
+ bool is_textured() const { return m_tex_coords.size() > 0; }
+
private:
Vector<Vertex> m_vertex_list;
+ Vector<TexCoord> m_tex_coords;
Vector<Triangle> m_triangle_list;
};