aboutsummaryrefslogtreecommitdiff
path: root/src/o3d/mesh.h
diff options
context:
space:
mode:
authorvimene <vincent.menegaux@gmail.com>2025-01-02 13:25:14 +0100
committervimene <vincent.menegaux@gmail.com>2025-01-02 13:25:14 +0100
commit26b4b82a7be2c029491f3009b66b3cbf8db5d93c (patch)
treeddc247a0600b5933185677212f158ebea5a87530 /src/o3d/mesh.h
parent9fdb5881d46f5d80626f961f9c9f133cc25dab70 (diff)
downloadengine-26b4b82a7be2c029491f3009b66b3cbf8db5d93c.tar.gz
various improvements
- cleaned up the computation of the camera's matrix - changed VertexData to being a struct which transmit data between the "vertex shader" and the "fragment shader" - started working on keyboard and mouse controls - added fov (field of view) - changed quaternion to euler angles conversion, from zyx to zxy - fixed computations of z coordinates in triangle rendering - improved naming in the triangle rasterizer
Diffstat (limited to 'src/o3d/mesh.h')
-rw-r--r--src/o3d/mesh.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/o3d/mesh.h b/src/o3d/mesh.h
index 1c70ca4..acc48b5 100644
--- a/src/o3d/mesh.h
+++ b/src/o3d/mesh.h
@@ -6,19 +6,17 @@
#include <iterator>
#include <cstddef>
#include "math/vector.h"
-#include "o3d/vertex_data.h"
namespace engine::o3d {
using engine::math::Vector3, engine::math::Vector4;
struct Mesh {
- static Mesh plane();
+ static Mesh plane(float width, float height);
std::vector<Vector4> vertices;
std::vector<Vector3> normals;
- std::vector<VertexData> vertices_data;
- std::vector<std::array<std::array<std::size_t, 3>, 3>> indices;
+ std::vector<std::array<std::array<std::size_t, 2>, 3>> indices;
};
}