Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eye spin after eye reset #1652

Merged
merged 5 commits into from
Mar 21, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/re_viewer/src/ui/view_spatial/ui_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ impl View3DState {
} else {
self.eye_interpolation = None;
}

if 1.0 <= t {
// We have arrived at our target
self.eye_interpolation = None;
}
}

orbit_camera
Expand All @@ -151,6 +156,7 @@ impl View3DState {
fn interpolate_to_eye(&mut self, target: Eye) {
if let Some(start) = self.orbit_eye {
let target_time = EyeInterpolation::target_time(&start.to_eye(), &target);
self.spin = false;
emilk marked this conversation as resolved.
Show resolved Hide resolved
self.eye_interpolation = Some(EyeInterpolation {
elapsed_time: 0.0,
target_time,
Expand All @@ -166,6 +172,7 @@ impl View3DState {
fn interpolate_to_orbit_eye(&mut self, target: OrbitEye) {
if let Some(start) = self.orbit_eye {
let target_time = EyeInterpolation::target_time(&start.to_eye(), &target.to_eye());
self.spin = false;
emilk marked this conversation as resolved.
Show resolved Hide resolved
self.eye_interpolation = Some(EyeInterpolation {
elapsed_time: 0.0,
target_time,
Expand Down