void EnvironmentModule::CreateTerrain() { terrain_ = TerrainPtr(new Terrain(this)); Scene::ScenePtr scene = GetFramework()->GetDefaultWorldScene(); Scene::EntityPtr entity = scene->CreateEntity(GetFramework()->GetDefaultWorldScene()->GetNextFreeId()); entity->AddComponent(GetFramework()->GetComponentManager()->CreateComponent("EC_Terrain")); scene->EmitEntityCreated(entity); terrain_->FindCurrentlyActiveTerrain(); if ( environment_editor_ != 0 ) { environment_editor_->InitTerrainTabWindow(); environment_editor_->InitTerrainTextureTabWindow(); } }
void SceneManager::initTerrain(LoaderPtr loader) { this->terrains.push_back(TerrainPtr(new Terrain( loader, "models/objects/Pokecenter.obj", "models/textures/Pokecenter.tga", glm::vec3(30.0f, 0.0f, -50.0f), 0.0f, 180.0f, 0.0f, 20.0f, 1.0f, 50.0f ))); grassWrapper->generateGrass(glm::vec2(5.0f, 5.0f), glm::vec2(25.0f, 35.0f)); for (auto grassLoop : grassWrapper->grassParts) { this->terrains.push_back(grassLoop); } // grassWrapper->grassParts.clear(); // // grassWrapper->generateGrass(glm::vec2(55.0f, 10.0f), glm::vec2(105.0f, 100.0f)); // // for (auto grassLoop : grassWrapper->grassParts) { // this->terrains.push_back(grassLoop); // } }