|
发表于 2008-3-20 12:19:17
|
显示全部楼层
不是那个问题,继承得不对~~~~~你看一下osgteapot的例子好了~~~~~~
class Teapot : public osg:rawable
{
public:
Teapot() {}
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Teapot(const Teapot& teapot,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osg::Drawable(teapot,copyop) {}
META_Object(myTeapotApp,Teapot)
//
the draw immediate mode method is where the OSG wraps up the drawing of
// of OpenGL primitives.
virtual void drawImplementation(osg::RenderInfo&) const
{
// teapot(..) doens't use vertex arrays at all so we don't need to toggle their state
// if we did we'd need to something like following call
// state.disableAllVertexArrays(), see src/osg/Geometry.cpp for the low down.
// just call the OpenGL code.
teapot(14,GL_FILL);
}
// we need to set up the bounding box of the data too, so that the scene graph knows where this
// objects is, for both positioning the camera at start up, and most importantly for culling.
virtual osg::BoundingBox computeBound() const
{
}
protected:
virtual ~Teapot() {}
}; |
|