Added a osg::DegreesToRadians() and osg::RadiansToDegrees() method to osg/Math,

updated the ReaderWriterBMP.cpp (mods sent in my Geoff Michel) and
moved the osgUtil::Statistics to osg::Statistics in preperation to adding it
to the the Drawable base class.
This commit is contained in:
Robert Osfield
2001-10-06 20:29:42 +00:00
parent c56a1b8c31
commit 3da57d6d22
10 changed files with 55 additions and 39 deletions

View File

@@ -64,13 +64,16 @@
namespace osg {
#ifdef USE_DEGREES_INTERNALLY
inline double inDegrees(float angle) { return angle; }
inline double inRadians(float angle) { return angle*180.0/M_PI; }
inline double inDegrees(double angle) { return angle; }
inline double inRadians(double 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; }
inline double inDegrees(double angle) { return angle*M_PI/180.0; }
inline double inRadians(double angle) { return angle; }
#endif
inline double DegreesToRadians(double angle) { return angle*M_PI/180.0; }
inline double RadiansToDegrees(double angle) { return angle*180.0/M_PI; }
};
#endif // __OSG_MATH

View File

@@ -2,19 +2,18 @@
//Distributed under the terms of the GNU Library General Public License (LGPL)
//as published by the Free Software Foundation.
#ifndef OSGUTIL_STATISTICS
#define OSGUTIL_STATISTICS 1
#ifndef OSG_STATISTICS
#define OSG_STATISTICS 1
#include <osg/GeoSet>
namespace osgUtil {
namespace osg {
/**
* Statistics base class. Used to extract primitive information from
* the renderBin(s).
*/
class OSGUTIL_EXPORT Statistics : public osg::Object
class SG_EXPORT Statistics : public Object
{
public:
@@ -23,7 +22,9 @@ class OSGUTIL_EXPORT Statistics : public osg::Object
nprims=0, nlights=0; nbins=0;
reset();
};
~Statistics() {}; // no dynamic allocations, so no need to free
void reset() {
for (int i=0; i<20; i++) primverts[i]=numprimtypes[i]=primlens[i]=primtypes[i]=0;
}

View File

@@ -6,7 +6,7 @@
#define OSGUTIL_RENDERBIN 1
#include <osgUtil/RenderGraph>
#include <osgUtil/Statistics>
#include <osg/Statistics>
#include <map>
#include <vector>
@@ -58,7 +58,7 @@ class OSGUTIL_EXPORT RenderBin : public osg::Object
virtual void draw_local(osg::State& state,RenderLeaf*& previous);
/** extract stats for current draw list. */
void getPrims(Statistics *primStats);
void getPrims(osg::Statistics *primStats);
public:

View File

@@ -116,7 +116,7 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
void addToDependencyList(RenderStage* rs);
/** extract stats for current draw list. */
void getPrims(Statistics *primStats);
void getPrims(osg::Statistics *primStats);
public: