Working on semi proper API to build a scene
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
#define TINYGLTF_IMPLEMENTATION
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
|
||||
#define TINYGLTF_IMPLEMENTATION
|
||||
#define TINYGLTF_NO_EXTERNAL_IMAGE
|
||||
|
||||
#include "Graphics/Mesh.h"
|
||||
@ -9,6 +10,7 @@
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/postprocess.h>
|
||||
#include <string>
|
||||
#include "Scene/SceneNodeTypes.h"
|
||||
|
||||
void ProcessVertices(aiMesh* mesh, std::vector<BarinkEngine::Vertex>& out_vertices);
|
||||
void ProcessIndices(aiMesh* mesh, std::vector<unsigned int>& out_indices);
|
||||
@ -17,7 +19,9 @@ void ProcessIndices(aiMesh* mesh, std::vector<unsigned int>& out_indices);
|
||||
class ModelImporter {
|
||||
|
||||
public:
|
||||
std::vector<BarinkEngine::Mesh> Import(const std::string path);
|
||||
|
||||
SceneObject* Import(const std::string path);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
class Node {
|
||||
public:
|
||||
Node(std::string& name);
|
||||
std::string& name;
|
||||
Node* parent;
|
||||
std::vector<Node*> children;
|
||||
@ -15,7 +16,9 @@ class Node {
|
||||
|
||||
|
||||
|
||||
class Group : Node {
|
||||
class Group : public Node {
|
||||
public:
|
||||
Group(std::string& name);
|
||||
Transform& transform;
|
||||
|
||||
};
|
||||
|
@ -5,11 +5,14 @@
|
||||
static class SceneManager {
|
||||
|
||||
public:
|
||||
static Scene* CreateScene();
|
||||
static Scene& GetScene(std::string name);
|
||||
static Scene* CreateScene(const std::string& name );
|
||||
static Scene& GetScene(const std::string& name);
|
||||
|
||||
static void LoadScene(Scene& scene);
|
||||
|
||||
private:
|
||||
static std::map<std::string , Scene*>
|
||||
static Scene* CurrentScene;
|
||||
|
||||
static std::map<std::string, Scene*> Scenes;
|
||||
|
||||
};
|
@ -3,18 +3,19 @@
|
||||
#include "Graphics/Renderable.h"
|
||||
#include "Scene/Node.h"
|
||||
|
||||
class SceneCamera : Group
|
||||
class SceneCamera : public Group
|
||||
{
|
||||
public:
|
||||
Camera& camera;
|
||||
|
||||
|
||||
SceneCamera();
|
||||
};
|
||||
|
||||
|
||||
class SceneObject : Group
|
||||
class SceneObject : public Group
|
||||
{
|
||||
public:
|
||||
Renderable& renderable;
|
||||
|
||||
SceneObject();
|
||||
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user