Renamed the osg::EarthSky to osg::ClearNode to make it more obvious what

role it has play and make it more relevant to non vis-sim applications.
This commit is contained in:
Robert Osfield
2002-08-19 11:42:37 +00:00
parent c72953d94b
commit b23a48a763
15 changed files with 71 additions and 96 deletions

View File

@@ -5,54 +5,13 @@
#ifndef OSG_EARTHSKY
#define OSG_EARTHSKY 1
#include <osg/Group>
#include <osg/Vec4>
#include <osg/ClearNode>
namespace osg {
/** EarthSky is a Group node which controls the clearing of the color and depth
* buffers at the start of each frame.
* The earth sky by default is empty and simply holds the clear color of
* the background. However, if the uses wants to add their own clearing of
* the color and depth buffers then the children can be added, and the
* background clear turned off. The EarthSky by default has StateSet attached
* to it which sets the default EarthSky bin number to -1, so that all drawables
* below it are placed in a separate bin from the rest of the scene graph, and
* are rendered prior to standard opaque and transparent drawables.
*/
class SG_EXPORT EarthSky : public Group
{
public :
EarthSky();
EarthSky(const EarthSky& es, const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Group(es,copyop),
_requiresClear(es._requiresClear),
_clearColor(es._clearColor) {}
META_Node(osg, EarthSky);
/** Sets the flag which control whether a glClear is required at the beginning of each frame. */
inline void setRequiresClear(const bool requiresClear) { _requiresClear = requiresClear; }
/** Gets the flag which control whether a glClear is required at the beginning of each frame. */
inline const bool getRequiresClear() const { return _requiresClear; }
/** Sets the clear color. */
inline void setClearColor(const Vec4& color) { _clearColor = color; }
/** Returns the clear color. */
inline const Vec4& getClearColor() const { return _clearColor; }
protected :
virtual ~EarthSky() {}
bool _requiresClear;
Vec4 _clearColor;
};
#ifdef USE_DEPRECATED_API
typedef ClearNode EarthSky;
#endif
}

View File

@@ -24,7 +24,7 @@ class Projection;
class LOD;
class Switch;
class Impostor;
class EarthSky;
class ClearNode;
class OccluderNode;
class Sequence;
@@ -210,7 +210,7 @@ class SG_EXPORT NodeVisitor : public Referenced
virtual void apply(Sequence& node) { apply((Switch&)node); }
virtual void apply(LOD& node) { apply((Group&)node); }
virtual void apply(Impostor& node) { apply((LOD&)node); }
virtual void apply(EarthSky& node) { apply((Group&)node); }
virtual void apply(ClearNode& node) { apply((Group&)node); }
virtual void apply(OccluderNode& node) { apply((Group&)node); }

View File

@@ -12,6 +12,7 @@ namespace osg {
#ifdef USE_DEPRECATED_API
typedef BlendFunc Transparency;
#endif
}
#endif

View File

@@ -13,7 +13,7 @@
#include <osg/StateSet>
#include <osg/State>
#include <osg/Impostor>
#include <osg/EarthSky>
#include <osg/ClearNode>
#include <osg/Notify>
#include <osg/Notify>
@@ -59,12 +59,12 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
virtual void apply(osg::Projection& node);
virtual void apply(osg::Switch& node);
virtual void apply(osg::LOD& node);
virtual void apply(osg::EarthSky& node);
virtual void apply(osg::ClearNode& node);
virtual void apply(osg::OccluderNode& node);
virtual void apply(osg::Impostor& node);
void setEarthSky(const osg::EarthSky* earthSky) { _earthSky = earthSky; }
const osg::EarthSky* getEarthSky() const { return _earthSky.get(); }
void setClearNode(const osg::ClearNode* earthSky) { _clearNode = earthSky; }
const osg::ClearNode* getClearNode() const { return _clearNode.get(); }
/** Switch the creation of Impostors on or off.
@@ -243,7 +243,7 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
float _computed_znear;
float _computed_zfar;
osg::ref_ptr<const osg::EarthSky> _earthSky;
osg::ref_ptr<const osg::ClearNode> _clearNode;
TransparencySortMode _tsm;