Editing the modelimporter to allow to create scene graphs
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include <glad/glad.h>
|
||||
class Buffer {
|
||||
class GpuBuffer {
|
||||
private:
|
||||
unsigned int id;
|
||||
public:
|
||||
|
@ -1,10 +1,11 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <glm/glm.hpp>
|
||||
#include "VertexArray.h"
|
||||
#include "Buffer.h"
|
||||
|
||||
namespace BarinkEngine{
|
||||
|
||||
|
||||
struct Vertex {
|
||||
glm::vec3 vertices;
|
||||
glm::vec2 uv;
|
||||
@ -13,8 +14,13 @@ namespace BarinkEngine{
|
||||
class Mesh {
|
||||
public:
|
||||
std::vector<Vertex> vertices;
|
||||
std::vector<unsigned int > elements;
|
||||
std::vector<unsigned int> elements;
|
||||
|
||||
private:
|
||||
GpuBuffer vertexBuffer;
|
||||
GpuBuffer elementBuffer;
|
||||
VertexArray VAO;
|
||||
unsigned int UV_id;
|
||||
};
|
||||
|
||||
}
|
@ -20,8 +20,8 @@ private:
|
||||
std::vector<unsigned int > indices;
|
||||
|
||||
|
||||
Buffer vertexBuffer;
|
||||
Buffer elementBuffer;
|
||||
GpuBuffer vertexBuffer;
|
||||
GpuBuffer elementBuffer;
|
||||
|
||||
VertexArray VAO;
|
||||
|
||||
|
@ -1,37 +1,23 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include "Mesh.h"
|
||||
#include "Buffer.h"
|
||||
|
||||
#include "Material.h"
|
||||
#include "Texture.h"
|
||||
#include "VertexArray.h"
|
||||
|
||||
#include "Scene.h"
|
||||
|
||||
namespace BarinkEngine {
|
||||
|
||||
class Renderable : public SceneNode {
|
||||
public:
|
||||
/*
|
||||
* NOTE: Should combine into a Mesh!!
|
||||
*/
|
||||
Buffer vertexBuffer;
|
||||
Buffer elementBuffer;
|
||||
//Buffer uv;
|
||||
VertexArray VAO;
|
||||
class Renderable {
|
||||
public:
|
||||
Mesh mesh;
|
||||
Material* material;
|
||||
Texture* texture;
|
||||
|
||||
Shader* shader;
|
||||
|
||||
GLuint UV_id;
|
||||
Material* material;
|
||||
Texture* texture;
|
||||
|
||||
|
||||
Shader* shader;
|
||||
|
||||
~Renderable();
|
||||
|
||||
static Renderable* Load();
|
||||
void Draw();
|
||||
|
||||
private:
|
||||
std::vector<BarinkEngine::Mesh> meshes;
|
||||
Renderable();
|
||||
};
|
||||
Renderable();
|
||||
~Renderable();
|
||||
};
|
||||
}
|
11
BarinkEngine/Include/Graphics/Transform.h
Normal file
11
BarinkEngine/Include/Graphics/Transform.h
Normal file
@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
#include <glm/glm.hpp>
|
||||
struct Transform {
|
||||
glm::vec3 Position;
|
||||
glm::vec3 Rotation;
|
||||
glm::vec3 Scale;
|
||||
|
||||
glm::mat4 ModelMatrix;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user