fix cameras loading
This commit is contained in:
parent
9a18476437
commit
24ecb94942
@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user