sculpto
grid.cpp
Go to the documentation of this file.
1/*!****************************************************************//*!*
2 * \file grid.cpp
3 * \brief Topology grid object class definition module.
4 *
5 * \author Sabitov Kirill
6 * \date 29 June 2022
7 *********************************************************************/
8
9#include "sclpch.h"
10#include "grid.h"
11
12scl::topology::grid::grid(int Width, int Height) :
13 basis(mesh_type::TRIANGLES), Width(Width), Height(Height)
14{
15 for (int i = 0; i < Height; ++i)
16 for (int j = 0; j < Width; ++j)
17 {
18 Indices.push_back((i + 1) * (Width + 1) + j + 1);
19 Indices.push_back((i + 0) * (Width + 1) + j + 1);
20 Indices.push_back((i + 0) * (Width + 1) + j + 0);
21 Indices.push_back((i + 0) * (Width + 1) + j + 0);
22 Indices.push_back((i + 1) * (Width + 1) + j + 0);
23 Indices.push_back((i + 1) * (Width + 1) + j + 1);
24 }
25
26 Min = vec3(0), Max = vec3((float)Width, 0, (float)Height);
27}
std::vector< u32 > Indices
Definition: basis.h:23
grid(int Width, int Height)
Definition: grid.cpp:12
Topology grid object class definition module.
mesh_type
Definition: vertex_array.h:18
math::vec3< float > vec3
Definition: base.h:38
Sculpto library prehompiled header. Defines common definitions, includes commonly used modules.