Brunot
Loading...
Searching...
No Matches
Vertex.h
Go to the documentation of this file.
1
10// ____ __ __ __
11// /\__ _\/\ \ /\ \/\ \
12// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
13// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
14// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
15// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
16// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
17
18
19#pragma once
21
22namespace gfx
23{
24
25
26struct Vertex
27{
28 Eigen::Vector2f position; // The position of the vertex relative to the mesh
29 Eigen::Vector2f textureCoord; // the texture coordinate associated with this vertex
30 Eigen::Vector4f color; // the color applied to this vertex
31
32 // Constructor for ease of use
33 Vertex(Eigen::Vector2f pos, Eigen::Vector2f uv_, Eigen::Vector4f colr)
34 : position(std::move(pos)), textureCoord(std::move(uv_)), color(std::move(colr))
35 {
36 }
37
38 Vertex(const Vector4D& pos, const Vector4D& uv_, const Vector4D& colr)
39 : position({pos.x(), pos.y()})
40 , textureCoord({uv_.x(), uv_.y()})
41 , color({colr.x(), colr.y(), colr.z(), colr.w()})
42 {
43
44 }
45};
46
47}
static int pos[2]
Definition Editor.cpp:69
Definition VAO.h:23
Definition Vector4D.h:23
Eigen::Vector4f color
Definition Vertex.h:30
Vertex(const Vector4D &pos, const Vector4D &uv_, const Vector4D &colr)
Definition Vertex.h:38
Eigen::Vector2f textureCoord
Definition Vertex.h:29
Eigen::Vector2f position
Definition Vertex.h:28
Vertex(Eigen::Vector2f pos, Eigen::Vector2f uv_, Eigen::Vector4f colr)
Definition Vertex.h:33