コード例 #1
0
ファイル: Dragger.cpp プロジェクト: aalex/osg
static bool readTransformUpdating( osgDB::InputStream& is, osgManipulator::Dragger& dragger )
{
    unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        std::string name; is >> name >> osgDB::BEGIN_BRACKET;
        if ( name=="DraggerTransformCallback" )
        {
            osg::MatrixTransform* transform = dynamic_cast<osg::MatrixTransform*>( is.readObject() );
            if ( transform ) dragger.addTransformUpdating( transform );
        }
        is >> osgDB::END_BRACKET;
    }
    is >> osgDB::END_BRACKET;
    return true;
}
コード例 #2
0
ファイル: Dragger.cpp プロジェクト: 151706061/OpenSceneGraph
static bool readTransformUpdating( osgDB::InputStream& is, osgManipulator::Dragger& dragger )
{
    unsigned int size = is.readSize(); is >> is.BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        std::string name; is >> name >> is.BEGIN_BRACKET;
        if ( name=="DraggerTransformCallback" )
        {
            osg::ref_ptr<osg::MatrixTransform> transform = is.readObjectOfType<osg::MatrixTransform>();
            if ( transform ) dragger.addTransformUpdating( transform.get() );
        }
        is >> is.END_BRACKET;
    }
    is >> is.END_BRACKET;
    return true;
}