Skip to content

Save/restore camera views#782

Merged
davreev merged 4 commits intomainfrom
david/camera-view-state-standalone
Mar 6, 2025
Merged

Save/restore camera views#782
davreev merged 4 commits intomainfrom
david/camera-view-state-standalone

Conversation

@davreev
Copy link
Contributor

@davreev davreev commented Feb 28, 2025

Adds commands for getting/setting the default camera view. Required by engine PR 3121.

@codecov
Copy link

codecov bot commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@c8ba999). Learn more about missing BASE report.

Files with missing lines Patch % Lines
modeling-cmds/src/shared.rs 0.00% 14 Missing ⚠️
modeling-cmds/src/def_enum.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #782   +/-   ##
=======================================
  Coverage        ?   24.64%           
=======================================
  Files           ?       36           
  Lines           ?     2155           
  Branches        ?        0           
=======================================
  Hits            ?      531           
  Misses          ?     1624           
  Partials        ?        0           
Flag Coverage Δ
unittests 24.64% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@davreev davreev marked this pull request as ready for review February 28, 2025 15:44
@davreev davreev self-assigned this Feb 28, 2025
@davreev davreev requested review from adamchalmers, mlfarrell and nadr0 and removed request for mlfarrell March 3, 2025 17:45
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
pub struct CameraViewState {
pub pivot_rotation: [f32; 4],
pub pivot_position: [f32; 3],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should use our dedicated Point type, because it's not just 3 arbitrary number, it represents a specific point in space, right?

Suggested change
pub pivot_position: [f32; 3],
pub pivot_position: Point3d<f32>,

Copy link
Contributor Author

@davreev davreev Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was avoiding it here since this type passes through an FFI boundary and Point3d isn't repr(C).

I might be erring on the side of caution unnecessarily though - is it ok to have non repr(C) fields in a repr(C) struct? Will follow up with another PR if so.

Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
@davreev davreev merged commit e96c408 into main Mar 6, 2025
11 checks passed
@davreev davreev deleted the david/camera-view-state-standalone branch March 6, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants