Added osg::Drawable::PrimitiveFunctor and TriangleFunctor subclass for
querrying the primitive data inside Drawables. Moved various support classes over from being osg::GeoSet based to osg::Geometry based.
This commit is contained in:
@@ -73,6 +73,8 @@ void Geometry::setTexCoordArray(unsigned int unit,AttributeArray* array)
|
||||
_texCoordList.resize(unit+1,0);
|
||||
|
||||
_texCoordList[unit] = array;
|
||||
|
||||
dirtyDisplayList();
|
||||
}
|
||||
|
||||
AttributeArray* Geometry::getTexCoordArray(unsigned int unit)
|
||||
@@ -245,6 +247,22 @@ Drawable::AttributeBitMask Geometry::applyAttributeOperation(AttributeFunctor& )
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Geometry::applyPrimitiveOperation(PrimitiveFunctor& functor)
|
||||
{
|
||||
if (!_vertexArray.valid() || _vertexArray->empty()) return;
|
||||
|
||||
functor.setVertexArray(_vertexArray->size(),&(_vertexArray->front()));
|
||||
|
||||
for(PrimitiveList::iterator itr=_primitives.begin();
|
||||
itr!=_primitives.end();
|
||||
++itr)
|
||||
{
|
||||
(*itr)->applyPrimitiveOperation(functor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
const bool Geometry::computeBound() const
|
||||
{
|
||||
_bbox.init();
|
||||
|
||||
Reference in New Issue
Block a user