Loading...
Searching...
No Matches
Vertex.h
Go to the documentation of this file.
1#pragma once
2#include <glm/glm.hpp>
3
4struct Vertex
5{
12};
std::shared_ptr< Texture > get_texture(AssetID id)
size_t get_loaded_mesh_count() const
std::unordered_map< AssetID, std::shared_ptr< Texture > > texture_cache_
AssetManager(AssetRegistry &registry)
std::shared_ptr< Mesh > get_mesh(AssetID id)
size_t get_loaded_material_count() const
void unload(AssetID id)
AssetRegistry & registry_
std::unordered_map< AssetID, std::shared_ptr< Material > > material_cache_
size_t get_loaded_texture_count() const
std::shared_ptr< Material > get_material(AssetID id)
std::unordered_map< AssetID, std::shared_ptr< Mesh > > mesh_cache_
Registry for storing assets.
const std::filesystem::path & get_project_root()
std::optional< AssetID > get_uuid_by_path(const std::filesystem::path &filepath)
AssetID generate_uuid(const std::filesystem::path &filepath)
void unregister_asset(AssetID uuid)
bool has_asset_changed(AssetID uuid) const
void set_project_root(const std::filesystem::path &project_root)
std::filesystem::path get_absolute_path(AssetID uuid)
std::unordered_map< std::filesystem::path, AssetID > path_to_uuid_
std::filesystem::path registry_file_
AssetID register_asset(const std::filesystem::path &filepath, AssetType type)
std::unordered_map< AssetID, AssetMetadata > assets_
std::filesystem::path to_absolute_path(const std::filesystem::path &relative_path) const
static AssetType get_type_from_extension(const std::filesystem::path &filepath)
std::filesystem::path to_relative_path(const std::filesystem::path &absolute_path) const
AssetID register_asset(const std::filesystem::path &filepath)
std::vector< AssetID > register_directory(const std::filesystem::path &directory_path, bool recursive)
std::vector< AssetMetadata > get_assets_by_type(AssetType type)
std::filesystem::path get_relative_path(AssetID uuid)
bool asset_exists(AssetID uuid) const
size_t get_asset_count() const
std::vector< AssetID > get_modified_assets() const
AssetRegistry(const std::filesystem::path &registry_file, const std::filesystem::path &project_root)
std::optional< AssetMetadata > get_asset(AssetID uuid) const
std::filesystem::path project_root_
std::vector< AssetMetadata > get_all_assets() const
uint64_t get_file_last_modified(const std::filesystem::path &filepath) const
static std::optional< MaterialData > load(const std::filesystem::path &filepath)
static std::shared_ptr< Mesh > load(const std::filesystem::path &filepath)
bool is_wireframe
Definition Mesh.h:32
Mesh(const std::vector< Vertex > &vertices, const std::vector< unsigned int > &indices)
Definition Mesh.cpp:11
int get_index_count() const
Definition Mesh.cpp:96
void bind() const
Definition Mesh.cpp:22
std::unique_ptr< VA > vao_
Definition Mesh.h:41
void build()
Definition Mesh.cpp:30
std::unique_ptr< IB > ibo_
Definition Mesh.h:43
void create_mesh()
Definition Mesh.cpp:34
std::vector< Vertex > vertices
Definition Mesh.h:29
bool is_built() const
Definition Mesh.h:26
void draw() const
Definition Mesh.cpp:83
void unbind() const
Definition Mesh.cpp:26
Mesh(const std::vector< Vertex > &vertices, const std::vector< unsigned int > &indices, bool defer_build)
Definition Mesh.cpp:16
std::unique_ptr< VB > vbo_
Definition Mesh.h:42
std::vector< unsigned int > indices
Definition Mesh.h:30
void draw_instanced(size_t amount) const
Definition Mesh.cpp:89
int index_count_
Definition Mesh.h:45
constexpr AssetID INVALID_ASSET_ID
Definition Vertex.h:5
glm::vec3 position
Definition Vertex.h:6
glm::vec3 color
Definition Vertex.h:8
glm::vec3 normal
Definition Vertex.h:7
glm::vec3 tangent
Definition Vertex.h:10
glm::vec3 bitangent
Definition Vertex.h:11
glm::vec2 texCoords
Definition Vertex.h:9
std::filesystem::path filepath