目标:(五十五)中的问题135
EngineContext的作用,主要是用来记录RexTerrainEngineNode方方面面的信息的。
在rex引擎构建时,创建该上下文,并将引擎的四梁八柱信息都存放在该上下文环境中。
osgEarthDrivers/engine_rex/RexTerrainEngineNode
class RexTerrainEngineNode : public TerrainEngineNode
{
osg::ref_ptr< EngineContext > _engineContext;
}
osgEarthDrivers/engine_rex/RexTerrainEngineNode.cpp
void
RexTerrainEngineNode::setMap(const Map* map, const TerrainOptions& options)
{
_engineContext = new EngineContext(
getMap(),
this, // engine
_geometryPool.get(),
_loader.get(),
_unloader.get(),
_rasterizer,
_liveTiles.get(),
_renderBindings,
_terrainOptions,
_selectionInfo,
_modifyBBoxCallback.get());
}
osgEarthDrivers/engine_rex/EngineContext
class EngineContext : public osg::Referenced
{
public:
EngineContext(
const Map* map,
TerrainEngineNode* engine,
GeometryPool* geometryPool,
Loader* loader,
Unloader* unloader,
TileRasterizer* rasterizer,
TileNodeRegistry* liveTiles,
const RenderBindings& renderBindings,
const RexTerrainEngineOptions& options,
const SelectionInfo& selectionInfo,
ModifyBoundingBoxCallback* modifyBBoxCallback);
Loader* getLoader() const { return _loader; }
Unloader* getUnloader() const { return _unloader; }
const RenderBindings& getRenderBindings() const { return _renderBindings; }
GeometryPool* getGeometryPool() const { return _geometryPool; }
// Raw pointer to the Map. Only call this from the MAIN thread. DO NOT access this
// from a pager thread. Instead, create a MapFrame from it in the MAIN thread and
// use THAT from the pager thread.
const Map* getMap() const;
// only call this variant when it's safe to do s
osgEarth的Rex引擎EngineContext作用分析

EngineContext在osgEarth的Rex引擎中扮演关键角色,它用于存储RexTerrainEngineNode的各种信息,包括地形引擎的核心组件。此博客将详细探讨EngineContext在构建引擎上下文时的作用,以及它如何影响 RexTerrainEngineNode 的功能。
最低0.47元/天 解锁文章
1424

被折叠的 条评论
为什么被折叠?



