Example app adjustments to the changes, using factory in MovingCubeApp

This commit is contained in:
Vladyslav Baranovskyi
2024-06-13 23:35:02 +03:00
parent d26d6cfff3
commit a0a4c935e4
2 changed files with 74 additions and 8 deletions

View File

@@ -8,6 +8,7 @@
#include "Scene/Scene.hpp"
#include "Scene/Shader/Shader.hpp"
#include "Scene/Geometry.hpp"
#include "Scene/GeometryFactory.hpp"
#include "Scene/Material.hpp"
#include "Scene/Vertex.hpp"
#include "Scene/SimpleDrawable.hpp"
@@ -59,9 +60,8 @@ namespace OpenVulkano
drawablesPool.resize(GEOS);
for (uint32_t i = 0; i < GEOS; i++)
{
Geometry* geo = new Geometry();
geo->InitCube(std::rand() % 1000 / 1000.0f + 0.01f, std::rand() % 1000 / 1000.0f + 0.01f, std::rand() % 1000 / 1000.0f + 0.01f,
Vector4f((std::rand() % 255) / 255.0f, (std::rand() % 255) / 255.0f, (std::rand() % 255) / 255.0f, 1));
Geometry* geo = GeometryFactory::MakeCube(std::rand() % 1000 / 1000.0f + 0.01f, std::rand() % 1000 / 1000.0f + 0.01f, std::rand() % 1000 / 1000.0f + 0.01f,
Vector4f((std::rand() % 255) / 255.0f, (std::rand() % 255) / 255.0f, (std::rand() % 255) / 255.0f, 1));
drawablesPool[i].Init(&shader, geo, &mat);
}
nodesPool.resize(OBJECTS);