Skip to content

Commit

Permalink
Corrected some initial values
Browse files Browse the repository at this point in the history
  • Loading branch information
tstullich committed Nov 3, 2020
1 parent a555118 commit 7ff250e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/buffer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <cstring>
#include <stdexcept>
#include <vector>

#include <vulkan/vulkan.h>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ void blitz::Renderer::keyCallback(GLFWwindow *window, int key, int scancode, int
}

void blitz::Renderer::loadScene() {
scene = Scene("models/helmet-2.0/helmet.gltf", static_cast<float>(windowWidth) / windowHeight);
scene = Scene("models/helmet/helmet.gltf", static_cast<float>(windowWidth) / windowHeight);
}

VkFormat blitz::Renderer::pickDepthFormat() {
Expand Down
6 changes: 4 additions & 2 deletions src/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ void blitz::Scene::loadMeshMaterial(tinygltf::Model &model, tinygltf::Primitive

void blitz::Scene::loadScene(const std::string &filePath, float aspectRatio) {
auto model = GLTFLoader::load(filePath);
auto scene = model.scenes[model.defaultScene];
auto loadedScene = model.scenes[model.defaultScene];
camera = Camera(aspectRatio); // Set default values for the camera
for (int nodeId : scene.nodes) {
light = Light { glm::vec3(3.0f), glm::vec3(1.0f) };
camAspectRatio = aspectRatio;
for (int nodeId : loadedScene.nodes) {
glm::mat4 transform(1.0f);
loadNode(model, model.nodes[nodeId], transform);
}
Expand Down
6 changes: 3 additions & 3 deletions src/scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ struct Scene {

// TODO Figure out a better way to store these values
Camera camera;
float camYFov;
float camYFov = glm::radians(60.0f);
float camAspectRatio;
float camZNear;
float camZFar;
float camZNear = 0.1f;
float camZFar = 100.0f;

Light light;
};
Expand Down

0 comments on commit 7ff250e

Please sign in to comment.