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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user