added sandbox map for player control testing

This commit is contained in:
Anselme 2017-07-30 14:54:48 +02:00
parent f57d722251
commit 3ab90bdbcf
3 changed files with 23 additions and 1 deletions

3
deploy/data/sandbox.mtl Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5952d768c5e6d96a52c4029d441c87cd2fb84141958eadd569ec9f582813e229
size 74

3
deploy/data/sandbox.obj Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:84dd7a98e4102ce03cd8067bca5b395f63129ab68fd21f6e5114bb4ba7e085c8
size 365831

View File

@ -148,7 +148,7 @@ struct Config : public Serializable
Config() Config()
{ {
mode = "windowed"; mode = "windowed";
scene = "none"; scene = "sandbox";
vsync = false; vsync = false;
width = 800; width = 800;
height = 600; height = 600;
@ -228,6 +228,22 @@ public:
m_player->setPosition(0.f, 15.f, 0.f); m_player->setPosition(0.f, 15.f, 0.f);
sun->setShadowView(glm::vec3(130, 130, 70)); 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<Mesh*> 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));
}
} }