Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061//// Created by kam on 17.6.2024.//
#pragma once
#include <vector>#include <string>
#include "types.h"
namespace Snail {
class Mesh { public: class Instance { friend Mesh;
isize size{}; u32 id{}; u32 vertices{}; u32 indices{}; u32 tex_coords{}; u32 normals{};
Instance(isize size, u32 id, u32 indices, u32 vertices, u32 normals, u32 tex_coords);
public: void render() const; };
private: std::vector<f32> vertices; std::vector<u32> indices; std::vector<f32> normals; std::vector<f32> tex_coords;
public: Mesh() = default; Mesh(std::vector<f32> vertices, std::vector<u32> indices, std::vector<f32> normals, std::vector<f32> tex_coords); explicit Mesh(const std::string& filename); explicit Mesh(const char* filename);
vec3 get_centroid() const;
std::vector<f32>& get_vertices(); std::vector<u32>& get_indices(); std::vector<f32>& get_normals(); std::vector<f32>& get_tex_coords();
void set_vertices(std::vector<f32> vertices); void set_indices(std::vector<u32> indices); void set_tex_coords(std::vector<f32> tex_coords); void set_normals(std::vector<f32> normals);
Instance to_gpu();
void update(Instance instance); };
}