Added include/osg/EarthSky and src/osg/EarthSky to cvs.

Also move osg across to using radians for angular paramters by default.
By defining USE_DEGREES_INTERNALLY you can get the OSG to revert to
the old style degrees. This later feature is deprecated and only meant
for helping comptability in the interim.
This commit is contained in:
Robert Osfield
2001-10-02 15:59:49 +00:00
parent 430c8606e9
commit 7a7a26c2ea
13 changed files with 112 additions and 24 deletions

49
include/osg/EarthSky Normal file
View File

@@ -0,0 +1,49 @@
#ifndef OSG_EARTHSKY
#define OSG_EARTHSKY 1
#include <osg/Group>
#include <osg/Vec4>
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();
META_Node(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;
};
};
#endif

View File

@@ -22,6 +22,18 @@ typedef uchar ubyte;
#define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880
#define M_SQRT1_2 0.70710678118654752440
#else
#include <math.h>
#endif
#define USE_DEGREES_INTERNALLY
#ifdef USE_DEGREES_INTERNALLY
inline double inDegrees(float angle) { return angle; }
inline double inRadians(float angle) { return angle*180.0/M_PI; }
#else
inline double inDegrees(float angle) { return angle*M_PI/180.0; }
inline double inRadians(float angle) { return angle; }
#endif
};