📄 ogrepaginglandscapescenemanager.cpp
字号:
Vector3 currpoint ((X + Xcurr),
0.0f,
(Z + Zcurr));
PagingLandScapeTile * p = mPageManager->getTileUnscaled (currpoint);
if (p && p->isLoaded ())
{
// Calculate the new theoretical height for the current point on the circle
Real dY = Math::Sqrt ((Real)(Precalc - (Zcurr * Zcurr))) * 10.0f;//* 0.01f
mImpactInfo = p->getInfo ();
mData2DManager->DeformHeight (currpoint, dY, p->getInfo());
p->getRenderable ()->setNeedUpdate ();
}
}
}
}
}
return true;
}
//-----------------------------------------------------------------------
bool PagingLandScapeSceneManager::setOption( const String& strKey, const void* pValue )
{
if ( strKey == "AddNewHeight" )
{
return mData2DManager->addNewHeight( * static_cast < const Sphere * > ( pValue ) );
}
if ( strKey == "RemoveNewHeight" )
{
return mData2DManager->removeNewHeight( * static_cast < const Sphere * > ( pValue ) );
}
mNeedOptionsUpdate = mOptions.setOption( strKey, pValue );
return mNeedOptionsUpdate;
}
//-----------------------------------------------------------------------
bool PagingLandScapeSceneManager::getOption( const String& strKey, void* pDestValue )
{
// PAGEINFO
if ( strKey == "CurrentCameraPageX" )
{
* static_cast < int * > ( pDestValue ) = mPageManager->getCurrentCameraPageX();
return true;
}
if ( strKey == "CurrentCameraPageZ" )
{
* static_cast < int * > ( pDestValue ) = mPageManager->getCurrentCameraPageZ();
return true;
}
if ( strKey == "PagePreloadQueue" )
{
* static_cast < int * > ( pDestValue ) = mPageManager->getPagePreloadQueueSize();
return true;
}
if ( strKey == "PageLoadQueue" )
{
* static_cast < int * > ( pDestValue ) = mPageManager->getPageLoadQueueSize();
return true;
}
if ( strKey == "PageUnloadQueue" )
{
* static_cast < int * > ( pDestValue ) = mPageManager->getPageUnloadQueueSize();
return true;
}
if ( strKey == "PagePostUnloadQueue" )
{
* static_cast < int * > ( pDestValue ) = mPageManager->getPagePostUnloadQueueSize();
return true;
}
if ( strKey == "PagePostUnloadQueue" )
{
* static_cast < int * > ( pDestValue ) = mPageManager->getPagePostUnloadQueueSize();
return true;
}
//TILES INFO
if ( strKey == "MaxNumTiles" )
{
* static_cast < int * > ( pDestValue ) = mTileManager->numTiles();
return true;
}
if ( strKey == "TileFree" )
{
* static_cast < int * > ( pDestValue ) = mTileManager->numFree();
return true;
}
if ( strKey == "CurrentCameraTileX" )
{
* static_cast < int * > ( pDestValue ) = mPageManager->getCurrentCameraTileX();
return true;
}
if ( strKey == "CurrentCameraTileZ" )
{
* static_cast < int * > ( pDestValue ) = mPageManager->getCurrentCameraTileZ();
return true;
}
//RENDERABLES INFO
if ( strKey == "MaxNumRenderables" )
{
* static_cast < int * > ( pDestValue ) = mRenderableManager->numRenderables();
return true;
}
if ( strKey == "RenderableFree" )
{
* static_cast < int * > ( pDestValue ) = mRenderableManager->numFree();
return true;
}
if ( strKey == "RenderableLoading" )
{
* static_cast < int * > ( pDestValue ) = mRenderableManager->numLoading();
return true;
}
if ( strKey == "VisibleRenderables" )
{
* static_cast < int * > ( pDestValue ) = mRenderableManager->numVisibles();
return true;
}
// IMPACT INFO
if ( strKey == "Impact" )
{
* static_cast < Vector3 * > ( pDestValue ) = mImpact;
return true;
}
if ( strKey == "ImpactPageX" )
{
* static_cast < int * > ( pDestValue ) = mImpactInfo->pageX;
return true;
}
if ( strKey == "ImpactPageZ" )
{
* static_cast < int * > ( pDestValue ) = mImpactInfo->pageZ;
return true;
}
if ( strKey == "ImpactTileX" )
{
* static_cast < int * > ( pDestValue ) = mImpactInfo->tileZ;
return true;
}
if ( strKey == "ImpactTileZ" )
{
* static_cast < int * > ( pDestValue ) = mImpactInfo->tileZ;
return true;
}
if ( strKey == "numModifiedTile" )
{
* static_cast < int * > ( pDestValue ) = mRenderableManager->numRenderables();
return true;
}
return mOptions.getOption( strKey, pDestValue );
}
//-----------------------------------------------------------------------
bool PagingLandScapeSceneManager::hasOption( const String& strKey )
{
if ( strKey == "AddNewHeight" )
{
return true;
}
if ( strKey == "RemoveNewHeight" )
{
return true;
}
if ( strKey == "CurrentCameraPageX" )
{
return true;
}
if ( strKey == "CurrentCameraPageZ" )
{
return true;
}
if ( strKey == "MaxNumTiles" )
{
return true;
}
if ( strKey == "TileFree" )
{
return true;
}
if ( strKey == "MaxNumRenderables" )
{
return true;
}
if ( strKey == "RenderableFree" )
{
return true;
}
if ( strKey == "RenderableLoading" )
{
return true;
}
if ( strKey == "PagePreloadQueue" )
{
return true;
}
if ( strKey == "PageLoadQueue" )
{
return true;
}
if ( strKey == "PageUnloadQueue" )
{
return true;
}
if ( strKey == "PagePostUnloadQueue" )
{
return true;
}
return mOptions.hasOption( strKey );
}
//-----------------------------------------------------------------------
bool PagingLandScapeSceneManager::getOptionValues( const String& strKey, std::list<SDDataChunk>& refValueList )
{
if ( strKey == "CurrentCameraPageX" )
{
refValueList.push_back(SDDataChunk());
return true;
}
if ( strKey == "CurrentCameraPageZ" )
{
refValueList.push_back(SDDataChunk());
return true;
}
if ( strKey == "MaxNumTiles" )
{
refValueList.push_back(SDDataChunk());
return true;
}
if ( strKey == "TileFree" )
{
refValueList.push_back(SDDataChunk());
return true;
}
if ( strKey == "MaxNumRenderables" )
{
refValueList.push_back(SDDataChunk());
return true;
}
if ( strKey == "RenderableFree" )
{
refValueList.push_back(SDDataChunk());
return true;
}
if ( strKey == "RenderableLoading" )
{
refValueList.push_back(SDDataChunk());
return true;
}
if ( strKey == "PagePreloadQueue" )
{
refValueList.push_back(SDDataChunk());
return true;
}
if ( strKey == "PageLoadQueue" )
{
refValueList.push_back(SDDataChunk());
return true;
}
if ( strKey == "PageUnloadQueue" )
{
refValueList.push_back(SDDataChunk());
return true;
}
if ( strKey == "PagePostUnloadQueue" )
{
refValueList.push_back(SDDataChunk());
return true;
}
return mOptions.getOptionValues( strKey, refValueList );
}
//-----------------------------------------------------------------------
bool PagingLandScapeSceneManager::getOptionKeys( std::list<String>& refKeys )
{
refKeys.clear();
refKeys.push_back( "AddNewHeight" );
refKeys.push_back( "RemoveNewHeight" );
refKeys.push_back( "CurrentCameraPageX" );
refKeys.push_back( "CurrentCameraPageZ" );
refKeys.push_back( "MaxNumTiles" );
refKeys.push_back( "TileFree" );
refKeys.push_back( "MaxNumRenderables" );
refKeys.push_back( "RenderableFree" );
refKeys.push_back( "RenderableLoading" );
refKeys.push_back( "PagePreloadQueue" );
refKeys.push_back( "PageLoadQueue" );
refKeys.push_back( "PageUnloadQueue" );
refKeys.push_back( "PagePostUnloadQueue" );
return mOptions.getOptionKeys( refKeys );
}
} //namespace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -