root/OpenSceneGraph/trunk/include/osgUtil/RenderStageLighting @ 3526

Revision 3432, 2.6 kB (checked in by robert, 13 years ago)

From Geoff Michel, typos and spelling fixes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under 
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGUTIL_RENDERSTAGELIGHTING
15#define OSGUTIL_RENDERSTAGELIGHTING 1
16
17#include <osg/Object>
18#include <osg/Light>
19#include <osg/State>
20
21#include <osgUtil/RenderLeaf>
22#include <osgUtil/RenderGraph>
23
24namespace osgUtil {
25
26/**
27 * RenderStageLighting base class. Used in RenderStage class.
28 */
29class OSGUTIL_EXPORT RenderStageLighting : public osg::Object
30{
31    public:
32   
33
34        RenderStageLighting();
35        virtual osg::Object* cloneType() const { return new RenderStageLighting(); }
36        virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderStageLighting(); } // note only implements a clone of type.
37        virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderStageLighting*>(obj)!=0L; }
38        virtual const char* libraryName() const { return "osgUtil"; }
39        virtual const char* className() const { return "RenderStageLighting"; }
40
41        virtual void reset();
42       
43        typedef std::pair< osg::ref_ptr<const osg::StateAttribute> , osg::ref_ptr<osg::RefMatrix> >    AttrMatrixPair;
44        typedef std::vector< AttrMatrixPair >                                            AttrMatrixList;
45        typedef std::map< unsigned int, AttrMatrixList >                                 TexUnitAttrMatrixListMap;
46
47        virtual void addPositionedAttribute(osg::RefMatrix* matrix,const osg::StateAttribute* attr)
48        {
49            _attrList.push_back(AttrMatrixPair(attr,matrix));
50        }
51
52        virtual void addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix* matrix,const osg::StateAttribute* attr)
53        {
54            _texAttrListMap[textureUnit].push_back(AttrMatrixPair(attr,matrix));
55        }
56
57        virtual void draw(osg::State& state,RenderLeaf*& previous);
58       
59    public:
60       
61        AttrMatrixList              _attrList;
62        TexUnitAttrMatrixListMap    _texAttrListMap;
63       
64    protected:
65   
66        virtual ~RenderStageLighting();
67
68};
69
70}
71
72#endif
73
Note: See TracBrowser for help on using the browser.