3#include "../../include/AppGui.hpp"
4#include "../../include/State/State.hpp"
29 State(
"Normal View State") {}
39 unsigned int cameraId;
41 Shared<Camera> camera;
43 glm::vec3 cameraSize = glm::vec3(1);
47 int tbBorderTolerance = 20;
61 bool trackState =
false;
64 bool skipCursorPos =
false;
68 double inputWalltime{};
70 double inputCputime{};
72 double updateWalltime{};
74 double updateCputime{};
76 double renderWalltime{};
78 double renderCputime{};
80 std::array<std::reference_wrapper<double>, 3> walltimes{inputWalltime, updateWalltime, renderWalltime};
82 std::array<std::reference_wrapper<double>, 3> cputimes{inputCputime, updateCputime, renderCputime};
84 std::array<std::string, 3> names{
"Input",
"Update",
"Render"};
87 const Event INPUT_NORMAL_VIEW_OPEN = Event(
"Input in Normal View Start");
89 const Event INPUT_NORMAL_VIEW_CLOSE = Event(
"Input in Normal View Stop");
91 const Event ENTITY_SELECTED_CHANGED = Event(
"Entity Selected Changed");
92 const glm::vec3 CAMERA_START_POSITION = glm::vec3{0, 1, 12};
100 bool renderBB =
false;
103 Unique<UniformBuffer> ub;
106 void enableDefaultCameraMovement();
114 glm::vec3 getTrackballPoint(
const Pair<float> &viewpSize,
const glm::vec2 &pos);
123 glm::vec3 getRayFromMouse(
const Pair<float> &size,
int mouse_x,
int mouse_y);
136 bool isRayInSphere(
const glm::vec3 &ray,
const glm::vec3 &sphere_pos,
const float &sphere_radius,
float *dist);
157 void changeInputState(Window *w,
const InputState &state);
164 void defaultKeyCallback(Window *w);
This State render an interactive scene with rendered meshes and lights. The user can modify their int...
Definition NormalViewState.hpp:15
virtual void onUpdate() override
This methods contains all the operations executed at every event::loop::LOOP_UPDATE if there are any.
Definition NormalViewState.cpp:530
virtual bool isCurrentStateEnd() override
Retrieves the current binary state of the current State
Definition NormalViewState.cpp:536
virtual void onAttach() override
This method is called after using StateManager::sync() (read StateMnaager::sync() documentation for m...
Definition NormalViewState.cpp:338
virtual void onDetach() override
This method is called while using sync() (read sync() documentation for more info)....
Definition NormalViewState.cpp:518
NormalViewState()
Instances the normal view state.
Definition NormalViewState.hpp:28
virtual void onRender() override
This methods contains all the operations executed at every event::loop::LOOP_RENDER if there are any.
Definition NormalViewState.cpp:533
State(const std::string &name="State")
Instances a state with the given name.
Definition State.hpp:85