Skip to content

Commit

Permalink
Deactivates auto framing only when panning.
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumeblanc committed Apr 15, 2024
1 parent a4295c1 commit 83a2862
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions samples/framework/internal/camera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@

#include "camera.h"

#include "framework/application.h"
#include "framework/imgui.h"
#include "ozz/base/log.h"
#include "ozz/base/maths/box.h"
#include "ozz/base/maths/math_constant.h"
#include "ozz/base/maths/math_ex.h"
#include "ozz/base/platform.h"

#include "framework/application.h"
#include "framework/imgui.h"

#include "renderer_impl.h"

using ozz::math::Float2;
Expand Down Expand Up @@ -96,8 +94,7 @@ void Camera::Update(const math::Box& _box, float _delta_time,
const Controls controls = UpdateControls(_delta_time);

// Disable autoframing according to inputs.
auto_framing_ &=
!controls.panning && !controls.zooming && !controls.zooming_wheel;
auto_framing_ &= !controls.panning;
}

void Camera::Update(const math::Float4x4& _transform, const math::Box& _box,
Expand Down Expand Up @@ -127,8 +124,7 @@ void Camera::Update(const math::Float4x4& _transform, const math::Box& _box,
const Controls controls = UpdateControls(_delta_time);

// Disable autoframing according to inputs.
auto_framing_ &= !controls.panning && !controls.rotating &&
!controls.zooming && !controls.zooming_wheel;
auto_framing_ &= !controls.panning;

if (auto_framing_) {
view_ = Invert(_transform);
Expand Down

0 comments on commit 83a2862

Please sign in to comment.