fix cameras loading

This commit is contained in:
MihailRis 2024-07-12 00:20:22 +03:00
parent 9a18476437
commit 24ecb94942
3 changed files with 3 additions and 3 deletions

View File

@ -145,7 +145,7 @@ static void read_resources_data(
if (index == ResourceIndices::MISSING) {
logger.warning() << "discard " << name;
} else {
indices.saveData(index, map);
indices.saveData(index, map->map("saved"));
}
}
}

View File

@ -4,7 +4,6 @@
#include <glm/glm.hpp>
class Camera {
void updateVectors();
float fov = 1.0f;
public:
glm::vec3 front {};
@ -25,6 +24,7 @@ public:
}
Camera(glm::vec3 position, float fov);
void updateVectors();
void rotate(float x, float y, float z);
glm::mat4 getProjection();

View File

@ -29,7 +29,6 @@ Level::Level(
settings(settings)
{
auto& cameraIndices = content->getIndices(ResourceType::CAMERA);
std::cout << cameraIndices.size() << std::endl;
for (size_t i = 0; i < cameraIndices.size(); i++) {
auto camera = std::make_shared<Camera>();
if (auto map = cameraIndices.getSavedData(i)) {
@ -42,6 +41,7 @@ Level::Level(
map->num("fov", fov);
camera->setFov(fov);
}
camera->updateVectors();
cameras.push_back(std::move(camera));
}