gwaldron / osgearth

3D Maps for OpenSceneGraph / C++14
https://www.pelicanmapping.com/home-1/opensource
Other
1.47k stars 772 forks source link

how to use osgEarthCesium as an static lib? #2546

Closed yanzixiang closed 3 months ago

yanzixiang commented 3 months ago

i build cesium-native as static libs, and build osgEarthCesium as an static lib with an prebuild osgEarth version, which is included in SIMDIS SDK,

after that, i add this method to my exe,

void MyMainWindow::test_CesiumCreditsNode()
{
    auto creditsNode = new osgEarth::Cesium::CesiumCreditsNode(main_view);
    m_mapNode->addChild(creditsNode);
}

it runs with no errer, but nothing shows.

i also test the earth file,

<map name="CesiumNatives 3DTiles">
    <libraries>osgEarthCesium</libraries>
    <CesiumNative3DTiles name="agi">
        <url>https://pelican-public.s3.amazonaws.com/3dtiles/agi-hq/tileset.json</url>
    </CesiumNative3DTiles>
</map>

nothings shows

so i want ask ,is it supported to use osgEarthCesium as an static lib

jasonbeverage commented 3 months ago

I doubt you can use osgEarthCesium as a static library out of the box especially when building against simdis sdk. With a static build your viewer application needs to link against all the known plugins that osg want's to load explicitly. We can talk with the simdis team about including cesium native in their builds in the future though as we migrate over to using cesium native for 3d tiles support throughout osgEarth.

yanzixiang commented 3 months ago

your viewer application needs to link against all the known plugins that osg want's to load explicitly

can you explain how to do this?

We can talk with the simdis team about including cesium native in their builds in the future

that is great.