Unravel Engine C++ Reference
Loading...
Searching...
No Matches
plane_mesh.cpp
Go to the documentation of this file.
1#include "plane_mesh.hpp"
2
3using namespace generator;
4
5plane_mesh_t::plane_mesh_t(const gml::dvec2& size, const gml::ivec2& segments)
6 : parametric_mesh_{[size](const gml::dvec2& t)
7 {
8 mesh_vertex_t vertex;
9 vertex.position = gml::dvec3{-size + 2.0 * t * size, 0.0};
10 vertex.normal = gml::dvec3{0.0, 0.0, 1.0};
11 vertex.tex_coord = t;
12 return vertex;
13 },
15{
16}
gml::dvec2 tex_coord
UV texture coordinates.
gml::dvec3 normal
Unit vector perpendicular to the surface.
plane_mesh_t(const gml::dvec2 &size={1.0, 1.0}, const gml::ivec2 &segments={8, 8})
Definition plane_mesh.cpp:5
Definition math.hpp:13
const segment_list * segments