From 7ca8e45d5ddbb2cfbf28716aa297e928cde08889 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 6 Nov 2015 20:21:39 +0100 Subject: [PATCH] Terrain: remove debug code --- components/esmterrain/storage.cpp | 8 -------- components/terrain/buffercache.cpp | 3 --- components/terrain/terraingrid.cpp | 7 ++----- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/components/esmterrain/storage.cpp b/components/esmterrain/storage.cpp index e954bfec8..c36e3efe0 100644 --- a/components/esmterrain/storage.cpp +++ b/components/esmterrain/storage.cpp @@ -1,7 +1,6 @@ #include "storage.hpp" #include -#include #include #include @@ -343,13 +342,6 @@ namespace ESMTerrain // So we're always adding _land_default.dds as the base layer here, even if it's not referenced in this cell. textureIndices.insert(std::make_pair(0,0)); - /* - _________ - | | | | - | | | | - - | | | | - | | | | - - - */ - for (int y=colStart; y -#include #include @@ -209,8 +208,6 @@ namespace Terrain { unsigned int verts = mNumVerts; - std::cout << "getting index buffer for " << verts << std::endl; - if (mIndexBufferMap.find(flags) != mIndexBufferMap.end()) { return mIndexBufferMap[flags]; diff --git a/components/terrain/terraingrid.cpp b/components/terrain/terraingrid.cpp index 6414fa951..99525d0f4 100644 --- a/components/terrain/terraingrid.cpp +++ b/components/terrain/terraingrid.cpp @@ -1,8 +1,6 @@ #include "terraingrid.hpp" #include -#include -#include #include #include @@ -77,7 +75,7 @@ osg::ref_ptr TerrainGrid::buildTerrain (osg::Group* parent, float chu osg::ref_ptr group (new osg::Group); if (parent) parent->addChild(group); - std::cout << "splitting " << chunkSize << " " << std::endl; + float newChunkSize = chunkSize/2.f; buildTerrain(group, newChunkSize, chunkCenter + osg::Vec2f(newChunkSize/2.f, newChunkSize/2.f)); buildTerrain(group, newChunkSize, chunkCenter + osg::Vec2f(newChunkSize/2.f, -newChunkSize/2.f)); @@ -91,8 +89,6 @@ osg::ref_ptr TerrainGrid::buildTerrain (osg::Group* parent, float chu if (!mStorage->getMinMaxHeights(chunkSize, chunkCenter, minH, maxH)) return NULL; // no terrain defined - std::cout << "creating " << chunkSize << " " << chunkCenter << std::endl; - osg::Vec2f worldCenter = chunkCenter*mStorage->getCellWorldSize(); osg::ref_ptr transform (new osg::PositionAttitudeTransform); transform->setPosition(osg::Vec3f(worldCenter.x(), worldCenter.y(), 0.f)); @@ -194,6 +190,7 @@ void TerrainGrid::loadCell(int x, int y) element->mNode = terrainNode; mTerrainRoot->addChild(element->mNode); + // kdtree probably not needed with mNumSplits=4 /* // build a kdtree to speed up intersection tests with the terrain // Note, the build could be optimized using a custom kdtree builder, since we know that the terrain can be represented by a quadtree