From 3ab90bdbcf4cef7fc259a8df8f8549f96eceefe5 Mon Sep 17 00:00:00 2001 From: Anselme Date: Sun, 30 Jul 2017 14:54:48 +0200 Subject: [PATCH] added sandbox map for player control testing --- deploy/data/sandbox.mtl | 3 +++ deploy/data/sandbox.obj | 3 +++ src/test/main.cpp | 18 +++++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 deploy/data/sandbox.mtl create mode 100644 deploy/data/sandbox.obj diff --git a/deploy/data/sandbox.mtl b/deploy/data/sandbox.mtl new file mode 100644 index 0000000..2324019 --- /dev/null +++ b/deploy/data/sandbox.mtl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5952d768c5e6d96a52c4029d441c87cd2fb84141958eadd569ec9f582813e229 +size 74 diff --git a/deploy/data/sandbox.obj b/deploy/data/sandbox.obj new file mode 100644 index 0000000..579657e --- /dev/null +++ b/deploy/data/sandbox.obj @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84dd7a98e4102ce03cd8067bca5b395f63129ab68fd21f6e5114bb4ba7e085c8 +size 365831 diff --git a/src/test/main.cpp b/src/test/main.cpp index 4a59b10..51e8c57 100644 --- a/src/test/main.cpp +++ b/src/test/main.cpp @@ -148,7 +148,7 @@ struct Config : public Serializable Config() { mode = "windowed"; - scene = "none"; + scene = "sandbox"; vsync = false; width = 800; height = 600; @@ -228,6 +228,22 @@ public: m_player->setPosition(0.f, 15.f, 0.f); sun->setShadowView(glm::vec3(130, 130, 70)); } + else if(m_config->scene == "sandbox") + { + sun->initShadowMap(4096); + GraphicalContainerNode* sandboxContainer = new GraphicalContainerNode(); + scene->getRootObject()->addChild(sandboxContainer); + std::vector meshes = Loader::loadMesh("sandbox.obj"); + for(Mesh* m : meshes) + { + m->initGL(); + MeshNode *node = new MeshNode(m); + sandboxContainer->addChild(node); + m_engine->getPhysics()->addRigidBody(node->buildStaticCollider()); + } + m_player->setPosition(0.f, 3.f, 0.f); + sun->setShadowView(glm::vec3(80)); + } }