Replaced deprecated osg::Geometry::set*Binding() usage

This commit is contained in:
Robert Osfield 2013-06-27 08:44:15 +00:00
parent 38bb71460a
commit c1ebc3ac0c
5 changed files with 10 additions and 16 deletions

View File

@ -581,7 +581,7 @@ protected:
if (isGouraud())
{
// Color per vertex
geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
if (geometry->getColorArray()) geometry->getColorArray()->setBinding(osg::Array::BIND_PER_VERTEX);
}
else
{
@ -597,7 +597,7 @@ protected:
// Normal binding
if (isLit())
{
geometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX );
if (geometry->getNormalArray()) geometry->getNormalArray()->setBinding(osg::Array::BIND_PER_VERTEX);
}
else
{
@ -1411,7 +1411,7 @@ protected:
if (mesh->isGouraud())
{
// Color per vertex
geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
if (geometry->getColorArray()) geometry->getColorArray()->setBinding(osg::Array::BIND_PER_VERTEX);
}
else
{
@ -1428,7 +1428,7 @@ protected:
// Normal binding
if (mesh->isLit())
{
geometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX );
if (geometry->getNormalArray()) geometry->getNormalArray()->setBinding(osg::Array::BIND_PER_VERTEX);
}
else
{

View File

@ -289,8 +289,7 @@ ref_ptr<Geometry> VTXReader::processStripGroup(int lodNum, std::istream * str,
// Create the geometry and add the vertex data to it
geom = new Geometry();
geom->setVertexArray(vertexArray.get());
geom->setNormalArray(normalArray.get());
geom->setNormalBinding(Geometry::BIND_PER_VERTEX);
geom->setNormalArray(normalArray.get(), Array::BIND_PER_VERTEX);
geom->setTexCoordArray(0, texcoordArray.get());
// Create and fill the index array

View File

@ -495,8 +495,7 @@ osg::Geometry* ReaderWriterOBJ::convertElementListToGeometry(obj::Model& model,
if (vertices) geometry->setVertexArray(vertices);
if (normals)
{
geometry->setNormalArray(normals);
geometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX);
geometry->setNormalArray(normals, osg::Array::BIND_PER_VERTEX);
}
if (texcoords)
{

View File

@ -564,8 +564,7 @@ void ESRIShapeParser::_process( const std::vector<ESRIShape::MultiPatch> &mpatch
// Lets mark poorly supported primitives with red, otherwise white
osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array;
geometry->setColorArray(colors.get());
geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX );
geometry->setColorArray(colors.get(), osg::Array::BIND_PER_VERTEX );
for( i = 0; i < p->numParts; i++ )
{

View File

@ -1192,13 +1192,11 @@ void* labelRead::Parse(trpgToken /*tok*/,trpgReadBuffer &buf)
osg::Vec4Array* colors = new osg::Vec4Array;
colors->push_back(supLineColor);
linesGeom->setColorArray(colors);
linesGeom->setColorBinding(osg::Geometry::BIND_OVERALL);
linesGeom->setColorArray(colors, osg::Array::BIND_OVERALL);
osg::Vec3Array* normals = new osg::Vec3Array;
normals->push_back(osg::Vec3(0.0f,-1.0f,0.0f));
linesGeom->setNormalArray(normals);
linesGeom->setNormalBinding(osg::Geometry::BIND_OVERALL);
linesGeom->setNormalArray(normals, osg::Array::BIND_OVERALL);
linesGeom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,supports->size()*2));
@ -1441,8 +1439,7 @@ void* geomRead::Parse(trpgToken /*tok*/,trpgReadBuffer &buf)
geometry->setVertexArray(vertices.get());
if (normals.valid())
{
geometry->setNormalArray(normals.get());
geometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX);
geometry->setNormalArray(normals.get(), osg::Array::BIND_PER_VERTEX);
}
bool local;