fix cameras loading
This commit is contained in:
@@ -145,7 +145,7 @@ static void read_resources_data(
|
|||||||
if (index == ResourceIndices::MISSING) {
|
if (index == ResourceIndices::MISSING) {
|
||||||
logger.warning() << "discard " << name;
|
logger.warning() << "discard " << name;
|
||||||
} else {
|
} else {
|
||||||
indices.saveData(index, map);
|
indices.saveData(index, map->map("saved"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
class Camera {
|
class Camera {
|
||||||
void updateVectors();
|
|
||||||
float fov = 1.0f;
|
float fov = 1.0f;
|
||||||
public:
|
public:
|
||||||
glm::vec3 front {};
|
glm::vec3 front {};
|
||||||
@@ -25,6 +24,7 @@ public:
|
|||||||
}
|
}
|
||||||
Camera(glm::vec3 position, float fov);
|
Camera(glm::vec3 position, float fov);
|
||||||
|
|
||||||
|
void updateVectors();
|
||||||
void rotate(float x, float y, float z);
|
void rotate(float x, float y, float z);
|
||||||
|
|
||||||
glm::mat4 getProjection();
|
glm::mat4 getProjection();
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,6 @@ Level::Level(
|
|||||||
settings(settings)
|
settings(settings)
|
||||||
{
|
{
|
||||||
auto& cameraIndices = content->getIndices(ResourceType::CAMERA);
|
auto& cameraIndices = content->getIndices(ResourceType::CAMERA);
|
||||||
std::cout << cameraIndices.size() << std::endl;
|
|
||||||
for (size_t i = 0; i < cameraIndices.size(); i++) {
|
for (size_t i = 0; i < cameraIndices.size(); i++) {
|
||||||
auto camera = std::make_shared<Camera>();
|
auto camera = std::make_shared<Camera>();
|
||||||
if (auto map = cameraIndices.getSavedData(i)) {
|
if (auto map = cameraIndices.getSavedData(i)) {
|
||||||
@@ -42,6 +41,7 @@ Level::Level(
|
|||||||
map->num("fov", fov);
|
map->num("fov", fov);
|
||||||
camera->setFov(fov);
|
camera->setFov(fov);
|
||||||
}
|
}
|
||||||
|
camera->updateVectors();
|
||||||
cameras.push_back(std::move(camera));
|
cameras.push_back(std::move(camera));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user