// Copyright (c) 2023 Dominic Masters // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #pragma once #include "scene/Scene.hpp" #include "scene/components/GameCamera.hpp" #include "prefabs/Player.hpp" #include "prefabs/Urchin.hpp" #include "prefabs/Crab.hpp" #include "prefabs/Wall.hpp" #include "prefabs/ui/debug/FPSLabel.hpp" #include "display/mesh/CapsuleMesh.hpp" #include "display/mesh/CubeMesh.hpp" namespace Dawn { class HelloWorldScene : public Scene { protected: Camera *camera; UICanvas *canvas; void stage() override { auto player = Player::create(this); auto urchin = Urchin::create(this); urchin->transform.setLocalPosition(glm::vec3(0, 0, -5)); // auto crab = Crab::create(this); // crab->transform.setLocalPosition(glm::vec3(3, 0, 0)); canvas = UICanvas::create(this); // auto wallBox = this->createSceneItem()->addComponent(); // wallBox->min = glm::vec2(-4, -3); // wallBox->max = glm::vec2(-3, 3); // auto wallBox2 = this->createSceneItem()->addComponent(); // wallBox2->min = glm::vec2(-3, -4); // wallBox2->max = glm::vec2(3, -3); camera = Camera::create(this); camera->fov = 0.436332f; camera->transform->lookAt(glm::vec3(10, 10, 10), glm::vec3(0, 0, 0)); auto gameCamera = camera->item->addComponent(); gameCamera->player = player->player; } std::vector getRequiredAssets() override { auto assMan = &this->game->assetManager; std::vector assets; return assets; } public: HelloWorldScene(DawnGame *game) : Scene(game) {} }; }