2002-07-17 04:07:32 +08:00
|
|
|
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
|
2001-10-04 23:12:57 +08:00
|
|
|
//Distributed under the terms of the GNU Library General Public License (LGPL)
|
|
|
|
//as published by the Free Software Foundation.
|
|
|
|
|
2001-09-20 05:19:47 +08:00
|
|
|
#ifndef OSGUTIL_RENDERSTAGELIGHTING
|
|
|
|
#define OSGUTIL_RENDERSTAGELIGHTING 1
|
|
|
|
|
|
|
|
#include <osg/Object>
|
|
|
|
#include <osg/Light>
|
|
|
|
#include <osg/State>
|
|
|
|
|
|
|
|
#include <osgUtil/RenderLeaf>
|
|
|
|
#include <osgUtil/RenderGraph>
|
|
|
|
|
|
|
|
namespace osgUtil {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* RenderBin base class.
|
|
|
|
*/
|
|
|
|
class OSGUTIL_EXPORT RenderStageLighting : public osg::Object
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
RenderStageLighting();
|
2002-12-16 21:40:58 +08:00
|
|
|
virtual osg::Object* cloneType() const { return new RenderStageLighting(); }
|
|
|
|
virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderStageLighting(); } // note only implements a clone of type.
|
2001-09-20 05:19:47 +08:00
|
|
|
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderStageLighting*>(obj)!=0L; }
|
2002-06-06 21:25:36 +08:00
|
|
|
virtual const char* libraryName() const { return "osgUtil"; }
|
2001-09-20 05:19:47 +08:00
|
|
|
virtual const char* className() const { return "RenderStageLighting"; }
|
|
|
|
|
|
|
|
virtual void reset();
|
|
|
|
|
2002-05-02 08:14:40 +08:00
|
|
|
typedef std::pair< const osg::StateAttribute*, osg::ref_ptr<osg::Matrix> > AttrMatrixPair;
|
|
|
|
typedef std::vector< AttrMatrixPair > AttrMatrixList;
|
2001-09-20 05:19:47 +08:00
|
|
|
|
2002-05-02 08:14:40 +08:00
|
|
|
virtual void addPositionedAttribute(osg::Matrix* matrix,const osg::StateAttribute* attr)
|
2001-09-20 05:19:47 +08:00
|
|
|
{
|
2002-05-02 08:14:40 +08:00
|
|
|
_attrList.push_back(AttrMatrixPair(attr,matrix));
|
2001-09-20 05:19:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual void draw(osg::State& state,RenderLeaf*& previous);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2002-05-02 08:14:40 +08:00
|
|
|
AttrMatrixList _attrList;
|
2001-09-20 05:19:47 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
virtual ~RenderStageLighting();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2002-02-03 20:33:41 +08:00
|
|
|
}
|
2001-09-20 05:19:47 +08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|