Skip to content

Commit

Permalink
tiny bug/warning fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipPragerUrbina committed Apr 2, 2022
1 parent 4d814bc commit 9855445
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions classes/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ class Camera {
//autofocus
Vec3 focusdistance = (position - lookposition).length() + focusoffset;
//convert fov from degrees to radians
radfov = degreefov * M_PI / 180;
radfov = degreefov * M_PI / 180.0f;
float h = tan(radfov / 2);

//height and width of viewport in unitys
float viewportheight = 2.0 * h;
float viewportheight = 2.0f * h;
float viewportwidth = aspectratio * viewportheight;

//camera direction
Expand Down
2 changes: 1 addition & 1 deletion classes/loader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class Loader {
//update camera postion
settings->cam.position = Vec3(old.x, old.y, old.z);
//fov(convert to degrees)
settings->cam.degreefov = model.cameras[node.camera].perspective.yfov * (180.0 / 3.141592653589793238463);
settings->cam.degreefov = model.cameras[node.camera].perspective.yfov * (180.0f / 3.141592653589793238463);
//update camera rotation
//get rotation from transformation matrix
linalg::aliases::float4x4 rotationmatrix = linalg::identity;
Expand Down
4 changes: 2 additions & 2 deletions classes/program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ class Program {
settings.w *= settings.scale;
settings.h *= settings.scale;
if (settings.preview) {
settings.w *= 0.5;
settings.h *=0.5;
settings.w *= 0.5f;
settings.h *=0.5f;

}
//make divisble by 8 for cuda blocks
Expand Down
2 changes: 1 addition & 1 deletion classes/texture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Texture {
if (exists) {
cudaDestroyTextureObject(texture);
cudaFreeArray(device_data);
bool exists = false;
exists = false;
std::cout << "texture destroyed \n";
}
}
Expand Down
4 changes: 2 additions & 2 deletions classes/tri.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ struct vertex {
};
//bounding box struct
struct boundingbox {
Vec3 max{ 10000000000000 };
Vec3 min{ -1000000000000 };
Vec3 max{ 100000000.0f };
Vec3 min{ -100000000.0f };
Vec3 center;
};

Expand Down

0 comments on commit 9855445

Please sign in to comment.