mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-29 02:50:26 +00:00
343e66b816
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.
33 lines
772 B
C++
33 lines
772 B
C++
/*
|
|
* Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
|
|
* Copyright (c) 2021, Mathieu Gaillard <gaillard.mathieu.39@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/RefCounted.h>
|
|
#include <AK/Vector.h>
|
|
|
|
#include "Common.h"
|
|
|
|
class Mesh : public RefCounted<Mesh> {
|
|
public:
|
|
Mesh() = delete;
|
|
|
|
Mesh(Vector<Vertex> vertices, Vector<TexCoord> tex_coords, Vector<Triangle> triangles);
|
|
|
|
size_t vertex_count() const { return m_vertex_list.size(); }
|
|
|
|
size_t triangle_count() const { return m_triangle_list.size(); }
|
|
|
|
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;
|
|
};
|