From c64f52792509fb90c98eed6063932aa13bfadcd4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 28 Feb 2006 19:46:02 +0000 Subject: [PATCH] From Brede Johansen, added missing array handling into Geometry::accept(AttributeFunctor& af) and Geometry::accept(ConstAttributeFunctor& af). --- src/osg/Geometry.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/osg/Geometry.cpp b/src/osg/Geometry.cpp index 9b2e37520..9240ce4d2 100644 --- a/src/osg/Geometry.cpp +++ b/src/osg/Geometry.cpp @@ -1804,15 +1804,22 @@ class AttributeFunctorArrayVisitor : public ArrayVisitor void Geometry::accept(AttributeFunctor& af) { AttributeFunctorArrayVisitor afav(af); - + afav.applyArray(VERTICES,_vertexData.array.get()); afav.applyArray(NORMALS,_normalData.array.get()); afav.applyArray(COLORS,_colorData.array.get()); + afav.applyArray(SECONDARY_COLORS,_secondaryColorData.array.get()); + afav.applyArray(FOG_COORDS,_fogCoordData.array.get()); for(unsigned unit=0;unit<_texCoordList.size();++unit) { afav.applyArray((AttributeType)(TEXTURE_COORDS_0+unit),_texCoordList[unit].array.get()); } + + for(unsigned int index=0; index<_vertexAttribList.size(); ++index) + { + afav.applyArray(index,_vertexAttribList[index].array.get()); + } } class ConstAttributeFunctorArrayVisitor : public ConstArrayVisitor @@ -1857,11 +1864,18 @@ void Geometry::accept(ConstAttributeFunctor& af) const afav.applyArray(VERTICES,_vertexData.array.get()); afav.applyArray(NORMALS,_normalData.array.get()); afav.applyArray(COLORS,_colorData.array.get()); - + afav.applyArray(SECONDARY_COLORS,_secondaryColorData.array.get()); + afav.applyArray(FOG_COORDS,_fogCoordData.array.get()); + for(unsigned unit=0;unit<_texCoordList.size();++unit) { afav.applyArray((AttributeType)(TEXTURE_COORDS_0+unit),_texCoordList[unit].array.get()); } + + for(unsigned int index=0; index<_vertexAttribList.size(); ++index) + { + afav.applyArray(index,_vertexAttribList[index].array.get()); + } } void Geometry::accept(PrimitiveFunctor& functor) const