Files
TSE/TSE_Math/src/Mesh.hpp

46 lines
1.5 KiB
C++

#pragma once
#include <vector>
#include "Types.hpp"
#include "Vector3.hpp"
#include "Vector2.hpp"
namespace TSE
{
class Mesh
{
public:
string name;
std::vector<Vector3> vertecies;
std::vector<ushort> indecies;
std::vector<Vector2> uvs;
/// @brief gives you an empty mesh with the name set to an empty string
Mesh();
/// @brief constructs a mesh with custom parameters
/// @param _name name of the mesh
/// @param _vertecies the vertecies
/// @param _indecies the indecies
/// @param _uvs the uvs
Mesh(string _name,
const std::vector<Vector3>& _vertecies,
const std::vector<ushort>& _indecies,
const std::vector<Vector2>& _uvs);
/// @brief gives you the count of indecies in this mesh
/// @return the indecie count
size_t IndeciesCount() const;
/// @brief gives you the count of vertecies in this mesh
/// @return the vertex count
size_t VerteciesCount() const;
/// @brief generates a circle mesh with the defined amounts of segments
/// @param segments amount of "pizza slices" to make the mesh out of. default 16
/// @return the resulting mesh
static Mesh GetCircleMesh(ushort segments = 16);
/// @brief gives you a basic unit quad with (-0.5, -0.5) -> (0.5, 0.5)
/// @return the resulting mesh
static Mesh GetQuadMesh();
};
} // namespace TSE