|
|
@ -23,7 +23,6 @@ namespace Terrain
|
|
|
|
, mParent(parent)
|
|
|
|
, mParent(parent)
|
|
|
|
, mResourceSystem(resourceSystem)
|
|
|
|
, mResourceSystem(resourceSystem)
|
|
|
|
, mBorderVisible(false)
|
|
|
|
, mBorderVisible(false)
|
|
|
|
, mHeightCullCallback(new HeightCullCallback)
|
|
|
|
|
|
|
|
, mWorldspace(worldspace)
|
|
|
|
, mWorldspace(worldspace)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mTerrainRoot = new osg::Group;
|
|
|
|
mTerrainRoot = new osg::Group;
|
|
|
@ -67,7 +66,6 @@ namespace Terrain
|
|
|
|
, mChunkManager(nullptr)
|
|
|
|
, mChunkManager(nullptr)
|
|
|
|
, mCellBorder(nullptr)
|
|
|
|
, mCellBorder(nullptr)
|
|
|
|
, mBorderVisible(false)
|
|
|
|
, mBorderVisible(false)
|
|
|
|
, mHeightCullCallback(nullptr)
|
|
|
|
|
|
|
|
, mWorldspace(worldspace)
|
|
|
|
, mWorldspace(worldspace)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mTerrainRoot = new osg::Group;
|
|
|
|
mTerrainRoot = new osg::Group;
|
|
|
@ -143,6 +141,14 @@ namespace Terrain
|
|
|
|
mChunkManager->clearCache();
|
|
|
|
mChunkManager->clearCache();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void World::enableHeightCullCallback(bool enable)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (enable)
|
|
|
|
|
|
|
|
mHeightCullCallback = new HeightCullCallback;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
mHeightCullCallback = nullptr;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
osg::Callback* World::getHeightCullCallback(float highz, unsigned int mask)
|
|
|
|
osg::Callback* World::getHeightCullCallback(float highz, unsigned int mask)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!mHeightCullCallback || mTerrainRoot->getNumChildren() == 0)
|
|
|
|
if (!mHeightCullCallback || mTerrainRoot->getNumChildren() == 0)
|
|
|
|