Replaced old Shape to Geometry conversion code as new convinience methods in include/osg/Shape provide these features

This commit is contained in:
Robert Osfield
2016-08-23 11:09:24 +01:00
parent e5ab4355be
commit 1df27e4edb
3 changed files with 3 additions and 1199 deletions

View File

@@ -925,7 +925,7 @@ osg::Group* createCar( float detailRatio, const osg::Vec4& hullColor, const osg:
osg::ref_ptr<osg::Group> root = new osg::Group;
osg::ref_ptr<osg::Cylinder> wheel = new osg::Cylinder( osg::Vec3( 0.0, 0.0, 0.0 ), 1.0, 0.6 );
osg::ref_ptr<osg::Geometry> wheelGeom = convertShapeToGeometry( *wheel.get(), tessHints.get(), wheelColor );
osg::ref_ptr<osg::Geometry> wheelGeom = osg::convertShapeToGeometry( *wheel.get(), tessHints.get(), wheelColor, osg::Array::BIND_PER_VERTEX );
// one random triangle on every wheel will use black color to show that wheel is rotating
osg::Vec4Array* colorArray = dynamic_cast<osg::Vec4Array*>( wheelGeom->getColorArray() );
if(colorArray!=NULL)