Changeset 8301
- Timestamp:
- 05/10/08 19:25:42
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/FltExportVisitor.cpp
r8286 r8301 29 29 #include <osgDB/FileUtils> 30 30 #include <osgDB/WriteFile> 31 #include <osg/Billboard>32 31 #include <osg/Geode> 33 32 #include <osg/Geometry> … … 337 336 } 338 337 338 // Billboards also go through this code. The Geode is passed 339 // to writeFace and writeMesh. If those methods successfully cast 340 // the Geode to a Billboard, then they set the template mode 341 // bit accordingly. 339 342 void 340 343 FltExportVisitor::apply( osg::Geode& node ) … … 438 441 439 442 void 440 FltExportVisitor::apply( osg::Billboard& node )441 {442 _firstNode = false;443 ScopedStatePushPop guard( this, node.getStateSet() );444 445 // TBD -- Not yet implemented, but HIGH priority.446 // Face record -- HIGH447 // Mesh record -- HIGH448 449 writeMatrix( node.getUserData() );450 writeComment( node );451 writePushTraverseWritePop( node );452 }453 454 void455 443 FltExportVisitor::apply( osg::Node& node ) 456 444 { OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/FltExportVisitor.h
r8286 r8301 78 78 virtual void apply( osg::LightSource& node ); 79 79 virtual void apply( osg::Geode& node ); 80 virtual void apply( osg::Billboard& node );81 80 virtual void apply( osg::Node& node ); 82 81 virtual void apply( osg::ProxyNode& node ); OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/expGeometryRecords.cpp
r8286 r8301 25 25 #include <osg/Geometry> 26 26 #include <osg/Geode> 27 #include <osg/Billboard> 27 28 #include <osg/io_utils> 28 29 #include <osg/Material> … … 250 251 } 251 252 252 // Check for blending. We're not a Billboard (TBD?)253 // so use either FIXED_NO_ALPHA_BLENDING or FIXED_ALPHA_BLENDING.253 // Set the appropriate template mode based 254 // on blending or Billboarding. 254 255 TemplateMode templateMode( FIXED_NO_ALPHA_BLENDING ); 255 if ( ss->getMode( GL_BLEND ) & osg::StateAttribute::ON ) 256 const osg::Billboard* bb = dynamic_cast< const osg::Billboard* >( &geode ); 257 if (bb != NULL) 258 { 259 if( bb->getMode() == osg::Billboard::AXIAL_ROT ) 260 templateMode = AXIAL_ROTATE_WITH_ALPHA_BLENDING; 261 else 262 templateMode = POINT_ROTATE_WITH_ALPHA_BLENDING; 263 } 264 else if ( ss->getMode( GL_BLEND ) & osg::StateAttribute::ON ) 256 265 { 257 266 const osg::BlendFunc* bf = static_cast<const osg::BlendFunc*>( … … 417 426 } 418 427 419 // Check for blending. We're not a Billboard (TBD?)420 // so use either FIXED_NO_ALPHA_BLENDING or FIXED_ALPHA_BLENDING.428 // Set the appropriate template mode based 429 // on blending or Billboarding. 421 430 TemplateMode templateMode( FIXED_NO_ALPHA_BLENDING ); 422 if ( ss->getMode( GL_BLEND ) & osg::StateAttribute::ON ) 431 const osg::Billboard* bb = dynamic_cast< const osg::Billboard* >( &geode ); 432 if (bb != NULL) 433 { 434 if( bb->getMode() == osg::Billboard::AXIAL_ROT ) 435 templateMode = AXIAL_ROTATE_WITH_ALPHA_BLENDING; 436 else 437 templateMode = POINT_ROTATE_WITH_ALPHA_BLENDING; 438 } 439 else if ( ss->getMode( GL_BLEND ) & osg::StateAttribute::ON ) 423 440 { 424 441 const osg::BlendFunc* bf = static_cast<const osg::BlendFunc*>(
