2024-12-25 23:58:56 +00:00
|
|
|
// Mesh.h
|
|
|
|
#pragma once
|
2024-12-27 01:34:34 +00:00
|
|
|
|
|
|
|
#include "Component.h"
|
|
|
|
|
2024-12-25 23:58:56 +00:00
|
|
|
#include <GL/glew.h>
|
2024-12-27 01:34:34 +00:00
|
|
|
#include <glm/glm.hpp>
|
|
|
|
#include <yaml-cpp/yaml.h>
|
2024-12-30 04:25:16 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include "Engine/AssetManager.h"
|
2024-12-25 23:58:56 +00:00
|
|
|
|
2024-12-27 01:34:34 +00:00
|
|
|
class MeshComponent : public Component
|
2024-12-25 23:58:56 +00:00
|
|
|
{
|
2024-12-27 01:34:34 +00:00
|
|
|
public:
|
2024-12-30 04:25:16 +00:00
|
|
|
GLuint vao = 0; // Vertex Array Object
|
|
|
|
GLuint indexCount = 0; // Number of indices to draw
|
|
|
|
std::vector<Texture> textures; // List of textures associated with the mesh
|
2024-12-27 18:19:20 +00:00
|
|
|
|
|
|
|
std::string MeshPath;
|
|
|
|
|
2024-12-27 01:34:34 +00:00
|
|
|
MeshComponent();
|
|
|
|
virtual const std::string& GetName() const override;
|
|
|
|
static const std::string& GetStaticName();
|
|
|
|
|
2024-12-30 04:25:16 +00:00
|
|
|
virtual void Update(float deltaTime) override;
|
|
|
|
|
2024-12-27 01:34:34 +00:00
|
|
|
// Serialization methods
|
|
|
|
virtual YAML::Node Serialize() override;
|
|
|
|
virtual void Deserialize(const YAML::Node& node) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const std::string name;
|
|
|
|
};
|