Use scene module in editor

This commit is contained in:
IlyaShurupov 2024-06-18 17:26:44 +03:00 committed by Ilya Shurupov
parent 5c90192c9f
commit 3bc43612ef
7 changed files with 78 additions and 140 deletions

View file

@ -5,18 +5,17 @@
using namespace tp;
bool loadMeshes(tp::Scene& scene, const std::string& objetsPath);
class EditorGUI : public Application {
public:
EditorGUI() {
Vec2F renderResolution = { 1000, 1000 };
auto canvas = this->mGraphics->getCanvas();
mGui = new EditorWidget<EventHandler, Canvas>(canvas, &geometry, renderResolution);
mGui = new EditorWidget<EventHandler, Canvas>(canvas, &mScene, renderResolution);
loadMeshes(geometry, "rsc/scene.obj");
mScene.load("rsc/scene.obj");
geometry.mCamera.lookAtPoint({ 0, 0, 0 }, { 3, 3, 2 }, { 0, 0, 1 });
mScene.mCamera.lookAtPoint({ 0, 0, 0 }, { 3, 3, 2 }, { 0, 0, 1 });
}
~EditorGUI() override { delete mGui; }
@ -33,7 +32,7 @@ public:
void drawFrame(Canvas* canvas) override { mGui->drawWrapper(*canvas); }
private:
Scene geometry;
Scene mScene;
WidgetManager mWidgetManager;
EditorWidget<EventHandler, Canvas>* mGui;
};