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

View File

@@ -14,6 +14,7 @@ using namespace osg;
#define DEG2RAD(x) ((x)*M_PI/180.0)
#define RAD2DEG(x) ((x)*180.0/M_PI)
// temporary #define's for warning that deprecated methods are being
// used which should be replaced by the new variants.
#define WARN_DEPRECATED
@@ -33,8 +34,6 @@ using namespace osg;
#define DEPRECATED(message)
#endif
#define ANGLES_IN_DEGREES
#define SET_ROW(row, v1, v2, v3, v4 ) \
_mat[(row)][0] = (v1); \
@@ -168,11 +167,8 @@ void Matrix::makeRot( const Vec3& from, const Vec3& to )
double d = from * to; // dot product == cos( angle between from & to )
if( d < 0.9999 ) {
double angle = acos(d);
#ifdef ANGLES_IN_DEGREES
angle = RAD2DEG(angle);
#endif
Vec3 axis = to ^ from; //we know ((to) x (from)) is perpendicular to both
makeRot( angle, axis );
makeRot( inRadians(angle) , axis );
}
else
makeIdent();
@@ -188,7 +184,7 @@ void Matrix::makeRot( float angle, float x, float y, float z ) {
if( d == 0 )
return;
#ifdef ANGLES_IN_DEGREES
#ifdef USE_DEGREES_INTERNALLY
angle = DEG2RAD(angle);
#endif
@@ -230,7 +226,7 @@ void Matrix::makeRot( const Quat& q ) {
void Matrix::makeRot( float yaw, float pitch, float roll)
{
#ifdef ANGLES_IN_DEGREES
#ifdef USE_DEGREES_INTERNALLY
yaw = DEG2RAD(yaw);
pitch = DEG2RAD(pitch);
roll = DEG2RAD(roll);