Cleaned up usage of BIND_PER_PRIMITIVE where possible.

This commit is contained in:
Robert Osfield
2013-06-19 16:24:59 +00:00
parent 9c127c2bca
commit df075ef9bb
16 changed files with 97 additions and 96 deletions

View File

@@ -268,6 +268,8 @@ void ToVRML::apply(osg::Drawable* drawable) {
/////////////////////////////////////////////////////////////////////////
void ToVRML::apply(osg::Geometry* geom) {
if (geom->containsDeprecatedData()) geom->fixDeprecatedData();
// are all primitives faces or line ?
GLenum mode;
osg::PrimitiveSet::Type type;
@@ -1128,12 +1130,6 @@ void ToVRML::writeNormal(osg::Geometry* geom, std::vector<int>& primitiveSetFace
_fout << indent() << n[0] << " " << n[1] << " " << n[2] << ",\n";
}
} else if (geom->getNormalBinding() == osg::Geometry::BIND_PER_PRIMITIVE) {
for (unsigned int j = 0; j < (*nArray).size(); j++) {
n = (*nArray)[j];
_fout << indent() << n[0] << " " << n[1] << " " << n[2] << ",\n";
}
} else if (geom->getNormalBinding() == osg::Geometry::BIND_PER_PRIMITIVE_SET) {
for (unsigned int j = 0; j < (*nArray).size(); j++) {
n = (*nArray)[j];
@@ -1282,12 +1278,6 @@ void ToVRML::writeColor(osg::Geometry* geom, std::vector<int>& primitiveSetFaces
_fout << indent() << c[0] << " " << c[1] << " " << c[2] << ",\n";
}
} else if (geom->getColorBinding() == osg::Geometry::BIND_PER_PRIMITIVE) {
for (unsigned int j = 0; j < (*cArray).size(); j++) {
c = (*cArray)[j];
_fout << indent() << c[0] << " " << c[1] << " " << c[2] << ",\n";
}
} else if (geom->getColorBinding() == osg::Geometry::BIND_PER_PRIMITIVE_SET) {
for (unsigned int j = 0; j < (*cArray).size(); j++) {
c = (*cArray)[j];