Skip to content

Commit

Permalink
Fix center_camera
Browse files Browse the repository at this point in the history
Zoom distance was being calculated incorrectly
  • Loading branch information
davreev committed Sep 22, 2024
1 parent 08aa009 commit 1894561
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void center_camera(Vec3<f32> const& point, f32 const radius)
{
constexpr f32 pad_scale{1.2f};
state.camera.pivot.position = point;
state.zoom.target.distance = radius * pad_scale / std::asin(state.view.fov_y * 0.5);
state.zoom.target.distance = radius * pad_scale / std::sin(state.view.fov_y * 0.5);
state.pan.target.offset = {};
}

Expand Down

0 comments on commit 1894561

Please sign in to comment.