diff --git a/components/terrain/cellborder.cpp b/components/terrain/cellborder.cpp index e391036902..280a55faca 100644 --- a/components/terrain/cellborder.cpp +++ b/components/terrain/cellborder.cpp @@ -22,11 +22,11 @@ CellBorder::CellBorder(Terrain::World *world, osg::Group *root, int borderMask, { } -osg::ref_ptr CellBorder::createBorderGeometry(float x, float y, float size, Terrain::Storage* terrain, Resource::SceneManager* sceneManager, int mask) +osg::ref_ptr CellBorder::createBorderGeometry(float x, float y, float size, Terrain::Storage* terrain, Resource::SceneManager* sceneManager, int mask, + float offset, osg::Vec4f color) { const int cellSize = ESM::Land::REAL_SIZE; const int borderSegments = 40; - const float offset = 10.0; osg::Vec3 cellCorner = osg::Vec3(x * cellSize,y * cellSize,0); size *= cellSize; @@ -52,7 +52,7 @@ osg::ref_ptr CellBorder::createBorderGeometry(float x, float y, floa osg::Vec4f col = i % 2 == 0 ? osg::Vec4f(0,0,0,1) : - osg::Vec4f(1,1,0,1); + color; colors->push_back(col); } diff --git a/components/terrain/cellborder.hpp b/components/terrain/cellborder.hpp index d72241e3dc..785c441b86 100644 --- a/components/terrain/cellborder.hpp +++ b/components/terrain/cellborder.hpp @@ -32,7 +32,7 @@ namespace Terrain */ void destroyCellBorderGeometry(); - static osg::ref_ptr createBorderGeometry(float x, float y, float size, Storage* terrain, Resource::SceneManager* sceneManager, int mask); + static osg::ref_ptr createBorderGeometry(float x, float y, float size, Storage* terrain, Resource::SceneManager* sceneManager, int mask, float offset = 10.0, osg::Vec4f color = { 1,1,0,0 }); protected: Terrain::World *mWorld; diff --git a/components/terrain/chunkmanager.cpp b/components/terrain/chunkmanager.cpp index 1f3279e5c5..7a6d4fdb0a 100644 --- a/components/terrain/chunkmanager.cpp +++ b/components/terrain/chunkmanager.cpp @@ -242,7 +242,7 @@ osg::ref_ptr ChunkManager::createChunk(float chunkSize, const osg::Ve { osg::ref_ptr result(new osg::Group); result->addChild(geometry); - auto chunkBorder = CellBorder::createBorderGeometry(chunkCenter.x() - chunkSize / 2.f, chunkCenter.y() - chunkSize / 2.f, chunkSize, mStorage, mSceneManager, getNodeMask()); + auto chunkBorder = CellBorder::createBorderGeometry(chunkCenter.x() - chunkSize / 2.f, chunkCenter.y() - chunkSize / 2.f, chunkSize, mStorage, mSceneManager, getNodeMask(), 5.f, { 1, 0, 0, 0 }); osg::Vec3f center = { chunkCenter.x(), chunkCenter.y(), 0 }; osg::ref_ptr trans = new osg::MatrixTransform(osg::Matrixf::translate(-center*Constants::CellSizeInUnits)); trans->setDataVariance(osg::Object::STATIC);