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-31 08:40:23 +00:00
|
|
|
// In MeshComponent.h
|
|
|
|
|
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-31 08:40:23 +00:00
|
|
|
std::vector<Submesh> submeshes; // List of submeshes
|
2024-12-27 18:19:20 +00:00
|
|
|
std::string MeshPath;
|
|
|
|
|
2024-12-31 08:40:23 +00:00
|
|
|
static const std::string name;
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2024-12-31 08:40:23 +00:00
|
|
|
// Render the mesh
|
|
|
|
void Draw(Shader* shader);
|
|
|
|
|
|
|
|
|
2024-12-27 01:34:34 +00:00
|
|
|
};
|
2024-12-31 08:40:23 +00:00
|
|
|
|