/** constructor */ EyeMap::EyeMap( ) { // Vertices _verts = new osg::Vec3Array; for (int i=0; i<2; i++) { osg::Vec3 base_pos = osg::Vec3(i*30, 0.0f, 0.0f); _verts->push_back( base_pos ); // center _verts->push_back( base_pos + osg::Vec3( -10.0f, -10.0f, 0.0f ) ); // edge v0 _verts->push_back( base_pos + osg::Vec3( -10.0f, 10.0f, 0.0f ) ); // edge v1 _verts->push_back( base_pos + osg::Vec3( 10.0f, 10.0f, 0.0f ) ); // edge v2 _verts->push_back( base_pos + osg::Vec3( 10.0f, -10.0f, 0.0f ) ); // edge v3 _verts->push_back( base_pos + osg::Vec3( -10.0f, -10.0f, 0.0f ) ); // edge v0 } // Colours _colors = new osg::Vec4Array; _colors->push_back( osg::Vec4( 1.0f, 0.0f, 0.0f, 1.0f )); _colors->push_back( osg::Vec4( 0.0f, 1.0f, 0.0f, 1.0f )); _fan_lengths = new osg::ByteArray; _fan_lengths->push_back( 6 ); _fan_lengths->push_back( 6 ); createDrawables(); }
void EyeMap::setGeometry( osg::Vec3Array* verts, osg::ByteArray* fan_lengths ) { _verts = verts; _fan_lengths = fan_lengths; // Colours _colors = new osg::Vec4Array; for (int i=0; i<fan_lengths->getNumElements(); i++ ) { _colors->push_back( osg::Vec4( 1.0f, 1.0f, 1.0f, 1.0f )); } createDrawables(); }
void Image::updateDrawables() { if(m_upd_recreate) { destroyDrawables(); createDrawables(); } if(m_upd_geometry) { updateGeometry(); } if(m_upd_xf) { updateTransform(); } if(m_upd_texture) { updateTexture(); } if(m_upd_tile_ratio) { updateTileRatio(); } if(m_upd_smooth) { updateSmooth(); } if(m_upd_opacity) { updateOpacity(); } m_upd_recreate = false; m_upd_geometry = false; m_upd_xf = false; m_upd_texture = false; m_upd_tile_ratio = false; m_upd_smooth = false; m_upd_opacity = false; }