24 Graph(
bool m_usePython, std::array<float, 4> bg,
bool m_useGrid) :
25 usePython(m_usePython)
27 std::copy(bg.begin(), bg.end(), backgroundColor);
29 last_showGrid = !m_useGrid;
30 _sceneIndex = SCENE_INDEX_GRAPHPLAY;
35 virtual int getNextSceneIndex()
const override;
37 virtual int getPreviousSceneIndex()
const override;
39 virtual void build()
override;
41 virtual void destroy()
override;
43 virtual void onEntry()
override;
45 virtual void onExit()
override;
47 virtual void update(
float deltaTime)
override;
55 virtual void SwapBufferDraw()
override;
57 virtual void BeginRender()
override;
58 virtual void updateUI(
float deltaTime)
override;
59 virtual void drawUI()
override;
60 virtual void EndRender()
override;
68 void clearSelectedEntities();
70 std::vector<Cell*> traversedCellsFromRay(glm::vec3 rayOrigin,
71 glm::vec3 rayDirection,
74 void selectEntityFromRay(glm::vec3 rayOrigin, glm::vec3 rayDirection,
int activateMode);
76 bool setManager(std::string m_managerName)
override;
79 void performFrustumSelection();
82 std::vector<SelectedInfo> _selectedEntities;
84 Entity* _displayedEntity =
nullptr;
85 bool _sceneManagerActive =
false;
86 Entity* _onHoverEntity =
nullptr;
88 Uint32 _holdStartTime = 0;
90 bool _isDraggingSelectionBox =
false;
92 glm::vec2 _selectionStartPos = glm::vec2(0);
93 glm::vec2 _selectionCurrentPos = glm::vec2(0);
95 glm::vec2 _selectionWindowStartPos = glm::vec2(0);
96 glm::vec2 _selectionWindowCurrentPos = glm::vec2(0);
98 int _nextSceneIndex = SCENE_INDEX_GRAPHPLAY;
99 int _prevSceneIndex = SCENE_INDEX_MAIN_MENU;
101 const float SCALE_SPEED = 0.1f;
102 bool _firstLoop =
true;
104 bool usePython =
false;
112 ImVec2 _viewportSize;
114 glm::vec2 _viewportMousePosition = { 0.f,0.f };
117 int currentX = 0, currentY = 0, currentZ = 0;
118 bool processingComplete =
false;
119 bool needsRefresh =
true;
121 template<
typename EntityType>
124 float cameraVelocityX = 0.0f;
125 float cameraVelocityY = 0.0f;
126 float cameraVelocityZ = 0.0f;
127 float cameraAcceleration = 10.0f;
128 float cameraMaxVelocity = 200.0f;
129 float cameraFriction = 0.9f;