3 #include "core/az_el.h" 5 #include "utilities/event.h" 9 #include <experimental/optional> 20 explicit view_state(
const glm::vec3& origin = {0, 0, 0},
21 float eye_distance = 1,
24 void set_origin(
const glm::vec3 & origin);
25 glm::vec3 get_origin()
const;
27 void set_eye_distance(
float distance);
28 float get_eye_distance()
const;
34 glm::vec3 origin_{0, 0, 0};
35 float eye_distance_ = 1;
42 constexpr
auto ease(
const T& from,
const T& to,
float speed) {
43 return from + (to - from) * speed;
46 view_state ease(
const view_state& from,
const view_state& to,
float speed);
55 void set_visible_surface(std::experimental::optional<size_t> visible);
56 std::experimental::optional<size_t> get_visible_surface()
const;
58 void set_visualise(
bool visualise);
59 bool get_visualise()
const;
63 void set_origin(
const glm::vec3& origin);
64 glm::vec3 get_origin()
const;
66 void set_eye_distance(
float distance);
67 float get_eye_distance()
const;
72 view_state get_view_state()
const;
76 void set_viewport(
const glm::vec2& viewport);
77 glm::vec2 get_viewport()
const;
78 float get_aspect()
const;
80 float get_item_radius()
const;
84 glm::mat4 get_projection_matrix()
const;
85 glm::mat4 get_inverse_projection_matrix()
const;
87 glm::vec3 compute_world_camera_position()
const;
88 glm::vec3 compute_world_camera_direction()
const;
89 glm::vec3 compute_world_mouse_direction(
const glm::vec2& pos)
const;
94 visible_surface_changed::callback_type callback);
97 visualise_changed::connection connect_visualise_changed(
98 visualise_changed::callback_type callback);
101 view_state_changed::connection connect_view_state_changed(
102 view_state_changed::callback_type callback);
105 projection_matrix_changed::connection connect_projection_matrix_changed(
106 projection_matrix_changed::callback_type callback);
109 static constexpr
float item_radius = 0.4;
111 glm::mat4 compute_projection_matrix()
const;
113 void recompute_view_matrices();
117 std::experimental::optional<size_t> visible_surface_;
119 bool visualise_ =
true;
121 view_state view_state_;
125 glm::mat4 view_matrix_;
126 glm::mat4 inverse_view_matrix_;
128 glm::mat4 projection_matrix_;
129 glm::mat4 inverse_projection_matrix_;
This stuff won't get sent to file, so it's fine to keep it here I think.
Definition: scene.h:51
Definition: capsule_base.h:9