Prefab Tool More-Or-Less done

This commit is contained in:
2023-03-29 20:31:08 -07:00
parent 87c1ac3710
commit 2e708bcc1d
15 changed files with 124 additions and 75 deletions

View File

@ -7,7 +7,7 @@
#include "prefab/SceneItemPrefab.hpp"
#include "display/mesh/CubeMesh.hpp"
#include "scene/components/display/MeshRenderer.hpp"
#include "scene/components/display/MeshHost.hpp"
#include "scene/components/display/CubeMeshHost.hpp"
#include "scene/components/display/material/SimpleTexturedMaterial.hpp"
#include "scene/components/example/ExampleSpin.hpp"
#include "scene/components/physics/3d/CubeCollider.hpp"
@ -17,7 +17,6 @@ namespace Dawn {
public SceneItemPrefab<SimpleSpinningCubePrefab>
{
public:
MeshHost *meshHost;
SimpleTexturedMaterial *material;
static std::vector<Asset*> prefabAssets(AssetManager *man) {
@ -31,13 +30,10 @@ namespace Dawn {
void prefabInit(AssetManager *man) override {
auto meshRenderer = this->addComponent<MeshRenderer>();
meshHost = this->addComponent<MeshHost>();
auto meshHost = this->addComponent<CubeMeshHost>();
material = this->addComponent<SimpleTexturedMaterial>();
auto spinning = this->addComponent<ExampleSpin>();
auto collider = this->addComponent<CubeCollider>();
meshHost->mesh.createBuffers(CUBE_VERTICE_COUNT, CUBE_INDICE_COUNT);
CubeMesh::buffer(&meshHost->mesh, glm::vec3(-0.5f, -0.5f, -0.5f), glm::vec3(1, 1, 1), 0, 0);
}
};
}