OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ShadowedScene.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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 OSGSHADOW_SHADOWEDSCENE
15 #define OSGSHADOW_SHADOWEDSCENE 1
16 
17 #include <osg/buffered_value>
18 #include <osg/Camera>
19 #include <osg/Texture2D>
20 #include <osg/TexGenNode>
21 
22 #include <osgShadow/ShadowTechnique>
23 #include <osgShadow/ShadowSettings>
24 
25 namespace osgShadow {
26 
29 {
30  public:
31 
33 
35 
37 
38  virtual void traverse(osg::NodeVisitor& nv);
39 
40  void setShadowSettings(ShadowSettings* ss);
41  ShadowSettings* getShadowSettings() { return _shadowSettings.get(); }
42  const ShadowSettings* getShadowSettings() const { return _shadowSettings.get(); }
43 
44  void setShadowTechnique(ShadowTechnique* technique);
45  ShadowTechnique* getShadowTechnique() { return _shadowTechnique.get(); }
46  const ShadowTechnique* getShadowTechnique() const { return _shadowTechnique.get(); }
47 
49  void cleanSceneGraph();
50 
52  void dirty();
53 
55  virtual void resizeGLObjectBuffers(unsigned int maxSize);
56 
60  virtual void releaseGLObjects(osg::State* = 0) const;
61 
62  public:
63 
65  void setReceivesShadowTraversalMask(unsigned int mask) { if (_shadowSettings.valid()) _shadowSettings->setReceivesShadowTraversalMask(mask); }
67  unsigned int getReceivesShadowTraversalMask() const { return _shadowSettings.valid() ? _shadowSettings->getReceivesShadowTraversalMask() : 0xffffffff; }
68 
70  void setCastsShadowTraversalMask(unsigned int mask) { if (_shadowSettings.valid()) _shadowSettings->setCastsShadowTraversalMask(mask); }
72  unsigned int getCastsShadowTraversalMask() const { return _shadowSettings.valid() ? _shadowSettings->getCastsShadowTraversalMask() : 0xffffffff; }
73 
74 protected:
75 
76  virtual ~ShadowedScene();
77 
80 
81 };
82 
83 }
84 
85 #endif
unsigned int getReceivesShadowTraversalMask() const
Definition: ShadowedScene.h:67
ShadowSettings * getShadowSettings()
Definition: ShadowedScene.h:41
#define META_Node(library, name)
Definition: Node.h:59
const ShadowTechnique * getShadowTechnique() const
Definition: ShadowedScene.h:46
osg::ref_ptr< ShadowTechnique > _shadowTechnique
Definition: ShadowedScene.h:79
#define OSGSHADOW_EXPORT
Definition: Export.h:39
void setReceivesShadowTraversalMask(unsigned int mask)
Definition: ShadowedScene.h:65
unsigned int getCastsShadowTraversalMask() const
Definition: ShadowedScene.h:72
const ShadowSettings * getShadowSettings() const
Definition: ShadowedScene.h:42
ShadowTechnique * getShadowTechnique()
Definition: ShadowedScene.h:45
void setCastsShadowTraversalMask(unsigned int mask)
Definition: ShadowedScene.h:70
osg::ref_ptr< ShadowSettings > _shadowSettings
Definition: ShadowedScene.h:78