Route canvas camera reset through app core

This commit is contained in:
2026-06-05 01:46:41 +02:00
parent f42a6540be
commit 9373e07d3e
9 changed files with 143 additions and 6 deletions

View File

@@ -0,0 +1,29 @@
#pragma once
#include <array>
namespace pp::app {
struct CanvasCameraState {
std::array<float, 16> rotation {};
std::array<float, 3> position {};
float field_of_view_degrees = 85.0F;
std::array<float, 2> pan {};
};
[[nodiscard]] constexpr CanvasCameraState plan_canvas_camera_reset() noexcept
{
CanvasCameraState state;
state.rotation = {
1.0F, 0.0F, 0.0F, 0.0F,
0.0F, 1.0F, 0.0F, 0.0F,
0.0F, 0.0F, 1.0F, 0.0F,
0.0F, 0.0F, 0.0F, 1.0F,
};
state.position = { 0.0F, 0.0F, 0.0F };
state.field_of_view_degrees = 85.0F;
state.pan = { 0.0F, 0.0F };
return state;
}
} // namespace pp::app