Added missing copy ops in the copy constructor.

Added computeInternalOptimziedGeometry() and associated methods to Geometry
to support alternate versions of a geometry to be used to optimize rendering,
such as flattening indexed attributes to straight attribute arrays.
This commit is contained in:
Robert Osfield
2003-08-08 00:21:30 +00:00
parent ca3f824410
commit a11395feec
2 changed files with 251 additions and 4 deletions

View File

@@ -23,6 +23,7 @@
namespace osg {
class SG_EXPORT Geometry : public Drawable
{
public:
@@ -260,6 +261,21 @@ class SG_EXPORT Geometry : public Drawable
void computeCorrectBindingsAndArraySizes();
bool suitableForOptimization() const;
void copyToAndOptimize(Geometry& target);
void computeInternalOptimizedGeometry();
void removeInternalOptimizedGeometry() { _internalOptimizedGeometry = 0; }
void setInternalOptimizedGeometry(osg::Geometry* geometry) { _internalOptimizedGeometry = geometry; }
osg::Geometry* getInternalOptimizedGeometry() { return _internalOptimizedGeometry.get(); }
const osg::Geometry* getInternalOptimizedGeometry() const { return _internalOptimizedGeometry.get(); }
/** draw Geometry directly ignoring an OpenGL display list which could be attached.
* This is the internal draw method which does the drawing itself,
* and is the method to override when deriving from Geometry for user-drawn objects.
@@ -327,7 +343,8 @@ class SG_EXPORT Geometry : public Drawable
mutable VertexAttribBindingList _vertexAttribBindingList;
mutable bool _fastPath;
ref_ptr<Geometry> _internalOptimizedGeometry;
};
/** Convenience function to be used for creating quad geometry with texture coords.
@@ -335,7 +352,6 @@ class SG_EXPORT Geometry : public Drawable
extern SG_EXPORT Geometry* createTexturedQuadGeometry(const Vec3& corner,const Vec3& widthVec,const Vec3& heightVec);
}
#endif