Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Leo <[email protected]>
  • Loading branch information
thomascent and Yuki-cpp authored May 19, 2022
1 parent e9810c1 commit 4946cdb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gl_depth_sim/include/gl_depth_sim/camera_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace gl_depth_sim

struct CameraProperties
{
enum ProjectionType { Perspective = 0, Orthographic = 1 };
enum class ProjectionType { Perspective, Orthographic };

ProjectionType projection = Perspective;
ProjectionType projection = ProjectionType::Perspective;
int width, height;

float fx, fy;
Expand Down
4 changes: 2 additions & 2 deletions gl_depth_sim/src/gl_depth_sim/sim_depth_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static Eigen::Matrix4d createProjectionMatrix(const gl_depth_sim::CameraProperti
{
Eigen::Matrix4d m (Eigen::Matrix4d::Identity());
// Organized by column
if(camera.projection == gl_depth_sim::CameraProperties::Perspective)
if(camera.projection == gl_depth_sim::CameraProperties::ProjectionType::Perspective)
{
m(0,0) = 2.0 * camera.fx / camera.width;
m(1,1) = 2.0 * camera.fy / camera.height;
Expand Down Expand Up @@ -130,7 +130,7 @@ gl_depth_sim::DepthImage gl_depth_sim::SimDepthCamera::render(const Eigen::Isome
{
if (depth != 0.0f)
{
if(camera_.projection == gl_depth_sim::CameraProperties::Perspective)
if(camera_.projection == gl_depth_sim::CameraProperties::ProjectionType::Perspective)
{
depth = zf_zn / (depth * (zf_minus_zn) + camera_.z_near);
}
Expand Down

0 comments on commit 4946cdb

Please sign in to comment.