Rewriting old mat3 stuff with plib's sg library.
This commit is contained in:
parent
7d08a3c508
commit
ad7718ff02
5 changed files with 128 additions and 129 deletions
|
@ -160,9 +160,10 @@ static void MAT3mat_To_sgMat4( MAT3mat &in, sgMat4 &out ) {
|
|||
// Update the view parameters
|
||||
void FGView::UpdateViewMath( const FGInterface& f ) {
|
||||
Point3D p;
|
||||
MAT3vec vec, forward, v0, minus_z;
|
||||
sgVec3 v0, minus_z;
|
||||
MAT3vec vec, forward;
|
||||
MAT3mat R, TMP, UP, LOCAL, VIEW;
|
||||
double ntmp;
|
||||
sgMat4 sgTMP;
|
||||
|
||||
if ( update_fov ) {
|
||||
ssgSetFOV( current_options.get_fov(),
|
||||
|
@ -282,11 +283,10 @@ void FGView::UpdateViewMath( const FGInterface& f ) {
|
|||
MAT3print( print, stdout);
|
||||
*/
|
||||
|
||||
MAT3_SET_VEC(local_up, 1.0, 0.0, 0.0);
|
||||
MAT3mult_vec(local_up, local_up, UP);
|
||||
|
||||
// printf( "Local Up = (%.4f, %.4f, %.4f)\n",
|
||||
// local_up[0], local_up[1], local_up[2]);
|
||||
sgSetVec3( local_up, 1.0, 0.0, 0.0 );
|
||||
sgXformVec3( local_up, sgUP );
|
||||
// cout << "Local Up = " << local_up[0] << "," << local_up[1] << ","
|
||||
// << local_up[2] << endl;
|
||||
|
||||
// Alternative method to Derive local up vector based on
|
||||
// *geodetic* coordinates
|
||||
|
@ -299,7 +299,7 @@ void FGView::UpdateViewMath( const FGInterface& f ) {
|
|||
// cout << "VIEW matrix" << endl;;
|
||||
// MAT3print(VIEW, stdout);
|
||||
|
||||
sgMat4 sgTMP, sgTMP2;
|
||||
sgMat4 sgTMP2;
|
||||
sgMultMat4( sgTMP, sgLOCAL, sgUP );
|
||||
|
||||
// generate the sg view up vector
|
||||
|
@ -349,24 +349,27 @@ void FGView::UpdateViewMath( const FGInterface& f ) {
|
|||
MAT3mult_vec(view_forward, forward, TMP);
|
||||
|
||||
// make a vector to the current view position
|
||||
MAT3_SET_VEC(v0, view_pos.x(), view_pos.y(), view_pos.z());
|
||||
sgSetVec3( v0, view_pos.x(), view_pos.y(), view_pos.z() );
|
||||
|
||||
// Given a vector pointing straight down (-Z), map into onto the
|
||||
// local plane representing "horizontal". This should give us the
|
||||
// local direction for moving "south".
|
||||
MAT3_SET_VEC(minus_z, 0.0, 0.0, -1.0);
|
||||
map_vec_onto_cur_surface_plane(local_up, v0, minus_z, surface_south);
|
||||
MAT3_NORMALIZE_VEC(surface_south, ntmp);
|
||||
// printf( "Surface direction directly south %.2f %.2f %.2f\n",
|
||||
// surface_south[0], surface_south[1], surface_south[2]);
|
||||
sgSetVec3( minus_z, 0.0, 0.0, -1.0 );
|
||||
|
||||
sgmap_vec_onto_cur_surface_plane(local_up, v0, minus_z, surface_south);
|
||||
sgNormalizeVec3(surface_south);
|
||||
// cout << "Surface direction directly south " << surface_south[0] << ","
|
||||
// << surface_south[1] << "," << surface_south[2] << endl;
|
||||
|
||||
// now calculate the surface east vector
|
||||
MAT3rotate(TMP, view_up, FG_PI_2);
|
||||
MAT3mult_vec(surface_east, surface_south, TMP);
|
||||
// printf( "Surface direction directly east %.2f %.2f %.2f\n",
|
||||
// surface_east[0], surface_east[1], surface_east[2]);
|
||||
// printf( "Should be close to zero = %.2f\n",
|
||||
// MAT3_DOT_PRODUCT(surface_south, surface_east));
|
||||
sgMakeRotMat4( sgTMP, FG_PI_2 * RAD_TO_DEG, sgview_up );
|
||||
// cout << "sgMat4 sgTMP" << endl;
|
||||
// print_sgMat4( sgTMP );
|
||||
sgXformVec3(surface_east, surface_south, sgTMP);
|
||||
// cout << "Surface direction directly east" << surface_east[0] << ","
|
||||
// << surface_east[1] << "," << surface_east[2] << endl;
|
||||
// cout << "Should be close to zero = "
|
||||
// << sgScalarProductVec3(surface_south, surface_east) << endl;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -118,28 +118,28 @@ public:
|
|||
|
||||
// vector in cartesian coordinates from current position to the
|
||||
// postion on the earth's surface the sun is directly over
|
||||
MAT3vec to_sun;
|
||||
|
||||
sgVec3 to_sun;
|
||||
|
||||
// surface direction to go to head towards sun
|
||||
MAT3vec surface_to_sun;
|
||||
sgVec3 surface_to_sun;
|
||||
|
||||
// vector in cartesian coordinates from current position to the
|
||||
// postion on the earth's surface the moon is directly over
|
||||
MAT3vec to_moon;
|
||||
sgVec3 to_moon;
|
||||
|
||||
// surface direction to go to head towards moon
|
||||
MAT3vec surface_to_moon;
|
||||
sgVec3 surface_to_moon;
|
||||
|
||||
// surface vector heading south
|
||||
MAT3vec surface_south;
|
||||
sgVec3 surface_south;
|
||||
|
||||
// surface vector heading east (used to unambiguously align sky
|
||||
// with sun)
|
||||
MAT3vec surface_east;
|
||||
sgVec3 surface_east;
|
||||
|
||||
// local up vector (normal to the plane tangent to the earth's
|
||||
// surface at the spot we are directly above
|
||||
MAT3vec local_up;
|
||||
sgVec3 local_up;
|
||||
|
||||
// up vector for the view (usually point straight up through the
|
||||
// top of the aircraft
|
||||
|
@ -217,33 +217,25 @@ public:
|
|||
inline Point3D get_abs_view_pos() const { return abs_view_pos; }
|
||||
inline Point3D get_view_pos() const { return view_pos; }
|
||||
inline Point3D get_cur_zero_elev() const { return cur_zero_elev; }
|
||||
inline double *get_to_sun() { return to_sun; }
|
||||
inline void set_to_sun( double x, double y, double z) {
|
||||
to_sun[0] = x;
|
||||
to_sun[1] = y;
|
||||
to_sun[2] = z;
|
||||
inline float *get_to_sun() { return to_sun; }
|
||||
inline void set_to_sun( float x, float y, float z) {
|
||||
sgSetVec3( to_sun, x, y, z );
|
||||
}
|
||||
inline double *get_surface_to_sun() { return surface_to_sun; }
|
||||
inline void set_surface_to_sun( double x, double y, double z) {
|
||||
surface_to_sun[0] = x;
|
||||
surface_to_sun[1] = y;
|
||||
surface_to_sun[2] = z;
|
||||
inline float *get_surface_to_sun() { return surface_to_sun; }
|
||||
inline void set_surface_to_sun( float x, float y, float z) {
|
||||
sgSetVec3( surface_to_sun, x, y, z );
|
||||
}
|
||||
inline double *get_to_moon() { return to_moon; }
|
||||
inline void set_to_moon( double x, double y, double z) {
|
||||
to_moon[0] = x;
|
||||
to_moon[1] = y;
|
||||
to_moon[2] = z;
|
||||
inline float *get_to_moon() { return to_moon; }
|
||||
inline void set_to_moon( float x, float y, float z) {
|
||||
sgSetVec3( to_moon, x, y, z );
|
||||
}
|
||||
inline double *get_surface_to_moon() { return surface_to_moon; }
|
||||
inline void set_surface_to_moon( double x, double y, double z) {
|
||||
surface_to_moon[0] = x;
|
||||
surface_to_moon[1] = y;
|
||||
surface_to_moon[2] = z;
|
||||
inline float *get_surface_to_moon() { return surface_to_moon; }
|
||||
inline void set_surface_to_moon( float x, float y, float z) {
|
||||
sgSetVec3( surface_to_moon, x, y, z );
|
||||
}
|
||||
inline double *get_surface_south() { return surface_south; }
|
||||
inline double *get_surface_east() { return surface_east; }
|
||||
inline double *get_local_up() { return local_up; }
|
||||
inline float *get_surface_south() { return surface_south; }
|
||||
inline float *get_surface_east() { return surface_east; }
|
||||
inline float *get_local_up() { return local_up; }
|
||||
inline double *get_view_forward() { return view_forward; }
|
||||
inline GLfloat *get_MODEL_VIEW() { return MODEL_VIEW; }
|
||||
};
|
||||
|
|
|
@ -41,7 +41,8 @@
|
|||
#include <GL/glut.h>
|
||||
#include <XGL/xgl.h>
|
||||
|
||||
// #include <Include/fg_types.h>
|
||||
#include <sg.h> // plib include
|
||||
|
||||
#include <Math/interpolater.hxx>
|
||||
#include <Math/point3d.hxx>
|
||||
|
||||
|
@ -66,10 +67,10 @@ public:
|
|||
Point3D fg_sunpos;
|
||||
|
||||
// (in view coordinates)
|
||||
GLfloat sun_vec[4];
|
||||
sgVec4 sun_vec;
|
||||
|
||||
// inverse (in view coordinates)
|
||||
GLfloat sun_vec_inv[4];
|
||||
sgVec4 sun_vec_inv;
|
||||
|
||||
// the angle between the sun and the local horizontal (in radians)
|
||||
double sun_angle;
|
||||
|
|
|
@ -339,11 +339,10 @@ void fgUpdateMoonPos( void ) {
|
|||
fgLIGHT *l;
|
||||
FGTime *t;
|
||||
FGView *v;
|
||||
MAT3vec nup, nmoon, v0, surface_to_moon;
|
||||
sgVec3 nup, nmoon, v0, surface_to_moon;
|
||||
Point3D p, rel_moonpos;
|
||||
double dot, east_dot;
|
||||
double moon_gd_lat, sl_radius;
|
||||
double ntmp;
|
||||
|
||||
l = &cur_light_params;
|
||||
t = FGTime::cur_time_params;
|
||||
|
@ -365,31 +364,31 @@ void fgUpdateMoonPos( void ) {
|
|||
" Moon Geodetic lat = " << moon_gd_lat
|
||||
<< " Geocentric lat = " << l->moon_gc_lat );
|
||||
|
||||
// I think this will work better for generating the moon light vector
|
||||
l->moon_vec[0] = l->fg_moonpos.x();
|
||||
l->moon_vec[1] = l->fg_moonpos.y();
|
||||
l->moon_vec[2] = l->fg_moonpos.z();
|
||||
MAT3_NORMALIZE_VEC(l->moon_vec, ntmp);
|
||||
MAT3_SCALE_VEC(l->moon_vec_inv, l->moon_vec, -1.0);
|
||||
// update the sun light vector
|
||||
sgSetVec4( l->moon_vec,
|
||||
l->fg_moonpos.x(), l->fg_moonpos.y(), l->fg_moonpos.z(), 0.0 );
|
||||
sgNormalizeVec4( l->moon_vec );
|
||||
sgCopyVec4( l->moon_vec_inv, l->moon_vec );
|
||||
sgNegateVec4( l->moon_vec_inv );
|
||||
|
||||
// make sure these are directional light sources only
|
||||
l->moon_vec[3] = 0.0;
|
||||
l->moon_vec_inv[3] = 0.0;
|
||||
|
||||
// printf(" l->moon_vec = %.2f %.2f %.2f\n", l->moon_vec[0], l->moon_vec[1],
|
||||
// l->moon_vec[2]);
|
||||
l->moon_vec[3] = l->moon_vec_inv[3] = 0.0;
|
||||
// cout << " l->moon_vec = " << l->moon_vec[0] << "," << l->moon_vec[1]
|
||||
// << ","<< l->moon_vec[2] << endl;
|
||||
|
||||
// calculate the moon's relative angle to local up
|
||||
MAT3_COPY_VEC(nup, v->get_local_up());
|
||||
nmoon[0] = l->fg_moonpos.x();
|
||||
nmoon[1] = l->fg_moonpos.y();
|
||||
nmoon[2] = l->fg_moonpos.z();
|
||||
MAT3_NORMALIZE_VEC(nup, ntmp);
|
||||
MAT3_NORMALIZE_VEC(nmoon, ntmp);
|
||||
sgCopyVec3( nup, v->get_local_up() );
|
||||
sgSetVec3( nmoon, l->fg_moonpos.x(), l->fg_moonpos.y(), l->fg_moonpos.z() );
|
||||
sgNormalizeVec3(nup);
|
||||
sgNormalizeVec3(nmoon);
|
||||
// cout << "nup = " << nup[0] << "," << nup[1] << ","
|
||||
// << nup[2] << endl;
|
||||
// cout << "nmoon = " << nmoon[0] << "," << nmoon[1] << ","
|
||||
// << nmoon[2] << endl;
|
||||
|
||||
l->moon_angle = acos(MAT3_DOT_PRODUCT(nup, nmoon));
|
||||
// printf(" MOON ANGLE relative to current location = %.3f rads.\n",
|
||||
// l->moon_angle);
|
||||
l->moon_angle = acos( sgScalarProductVec3( nup, nmoon ) );
|
||||
cout << "moon angle relative to current location = "
|
||||
<< l->moon_angle << endl;
|
||||
|
||||
// calculate vector to moon's position on the earth's surface
|
||||
rel_moonpos = l->fg_moonpos - (v->get_view_pos() + scenery.center);
|
||||
|
@ -399,39 +398,43 @@ void fgUpdateMoonPos( void ) {
|
|||
|
||||
// make a vector to the current view position
|
||||
Point3D view_pos = v->get_view_pos();
|
||||
MAT3_SET_VEC(v0, view_pos.x(), view_pos.y(), view_pos.z());
|
||||
sgSetVec3( v0, view_pos.x(), view_pos.y(), view_pos.z() );
|
||||
|
||||
// Given a vector from the view position to the point on the
|
||||
// earth's surface the moon is directly over, map into onto the
|
||||
// local plane representing "horizontal".
|
||||
map_vec_onto_cur_surface_plane( v->get_local_up(), v0, v->get_to_moon(),
|
||||
surface_to_moon );
|
||||
MAT3_NORMALIZE_VEC(surface_to_moon, ntmp);
|
||||
|
||||
sgmap_vec_onto_cur_surface_plane( v->get_local_up(), v0,
|
||||
v->get_to_moon(), surface_to_moon );
|
||||
sgNormalizeVec3(surface_to_moon);
|
||||
v->set_surface_to_moon( surface_to_moon[0], surface_to_moon[1],
|
||||
surface_to_moon[2] );
|
||||
// printf("Surface direction to moon is %.2f %.2f %.2f\n",
|
||||
// v->surface_to_moon[0], v->surface_to_moon[1], v->surface_to_moon[2]);
|
||||
// printf("Should be close to zero = %.2f\n",
|
||||
// MAT3_DOT_PRODUCT(v->local_up, v->surface_to_moon));
|
||||
surface_to_moon[2] );
|
||||
// cout << "(sg) Surface direction to moon is "
|
||||
// << surface_to_moon[0] << ","
|
||||
// << surface_to_moon[1] << ","
|
||||
// << surface_to_moon[2] << endl;
|
||||
// cout << "Should be close to zero = "
|
||||
// << sgScalarProductVec3(nup, surface_to_moon) << endl;
|
||||
|
||||
// calculate the angle between v->surface_to_moon and
|
||||
// v->surface_east. We do this so we can sort out the acos()
|
||||
// ambiguity. I wish I could think of a more efficient way ... :-(
|
||||
east_dot = MAT3_DOT_PRODUCT( surface_to_moon, v->get_surface_east() );
|
||||
// printf(" East dot product = %.2f\n", east_dot);
|
||||
east_dot = sgScalarProductVec3( surface_to_moon, v->get_surface_east() );
|
||||
// cout << " East dot product = " << east_dot << endl;
|
||||
|
||||
// calculate the angle between v->surface_to_moon and
|
||||
// v->surface_south. this is how much we have to rotate the sky
|
||||
// for it to align with the moon
|
||||
dot = MAT3_DOT_PRODUCT( surface_to_moon, v->get_surface_south() );
|
||||
// printf(" Dot product = %.2f\n", dot);
|
||||
dot = sgScalarProductVec3( surface_to_moon, v->get_surface_south() );
|
||||
// cout << " Dot product = " << dot << endl;
|
||||
|
||||
if ( east_dot >= 0 ) {
|
||||
l->moon_rotation = acos(dot);
|
||||
} else {
|
||||
l->moon_rotation = -acos(dot);
|
||||
}
|
||||
// printf(" Sky needs to rotate = %.3f rads = %.1f degrees.\n",
|
||||
// angle, angle * RAD_TO_DEG); */
|
||||
// cout << " Sky needs to rotate = " << angle << " rads = "
|
||||
// << angle * RAD_TO_DEG << " degrees." << endl;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -244,11 +244,10 @@ void fgUpdateSunPos( void ) {
|
|||
fgLIGHT *l;
|
||||
FGTime *t;
|
||||
FGView *v;
|
||||
MAT3vec nup, nsun, v0, surface_to_sun;
|
||||
sgVec3 nup, nsun, v0, surface_to_sun;
|
||||
Point3D p, rel_sunpos;
|
||||
double dot, east_dot;
|
||||
double sun_gd_lat, sl_radius;
|
||||
double ntmp;
|
||||
|
||||
l = &cur_light_params;
|
||||
t = FGTime::cur_time_params;
|
||||
|
@ -256,8 +255,6 @@ void fgUpdateSunPos( void ) {
|
|||
|
||||
FG_LOG( FG_EVENT, FG_INFO, " Updating Sun position" );
|
||||
|
||||
// (not sure why there was two)
|
||||
// fgSunPosition(t->cur_time, &l->sun_lon, &sun_gd_lat);
|
||||
fgSunPositionGST(t->getGst(), &l->sun_lon, &sun_gd_lat);
|
||||
|
||||
fgGeodToGeoc(sun_gd_lat, 0.0, &sl_radius, &l->sun_gc_lat);
|
||||
|
@ -270,31 +267,30 @@ void fgUpdateSunPos( void ) {
|
|||
" Sun Geodetic lat = " << sun_gd_lat
|
||||
<< " Geocentric lat = " << l->sun_gc_lat );
|
||||
|
||||
// I think this will work better for generating the sun light vector
|
||||
l->sun_vec[0] = l->fg_sunpos.x();
|
||||
l->sun_vec[1] = l->fg_sunpos.y();
|
||||
l->sun_vec[2] = l->fg_sunpos.z();
|
||||
MAT3_NORMALIZE_VEC(l->sun_vec, ntmp);
|
||||
MAT3_SCALE_VEC(l->sun_vec_inv, l->sun_vec, -1.0);
|
||||
// update the sun light vector
|
||||
sgSetVec4( l->sun_vec,
|
||||
l->fg_sunpos.x(), l->fg_sunpos.y(), l->fg_sunpos.z(), 0.0 );
|
||||
sgNormalizeVec4( l->sun_vec );
|
||||
sgCopyVec4( l->sun_vec_inv, l->sun_vec );
|
||||
sgNegateVec4( l->sun_vec_inv );
|
||||
|
||||
// make sure these are directional light sources only
|
||||
l->sun_vec[3] = 0.0;
|
||||
l->sun_vec_inv[3] = 0.0;
|
||||
|
||||
// printf(" l->sun_vec = %.2f %.2f %.2f\n", l->sun_vec[0], l->sun_vec[1],
|
||||
// l->sun_vec[2]);
|
||||
l->sun_vec[3] = l->sun_vec_inv[3] = 0.0;
|
||||
// cout << " l->sun_vec = " << l->sun_vec[0] << "," << l->sun_vec[1]
|
||||
// << ","<< l->sun_vec[2] << endl;
|
||||
|
||||
// calculate the sun's relative angle to local up
|
||||
MAT3_COPY_VEC(nup, v->get_local_up());
|
||||
nsun[0] = l->fg_sunpos.x();
|
||||
nsun[1] = l->fg_sunpos.y();
|
||||
nsun[2] = l->fg_sunpos.z();
|
||||
MAT3_NORMALIZE_VEC(nup, ntmp);
|
||||
MAT3_NORMALIZE_VEC(nsun, ntmp);
|
||||
sgCopyVec3( nup, v->get_local_up() );
|
||||
sgSetVec3( nsun, l->fg_sunpos.x(), l->fg_sunpos.y(), l->fg_sunpos.z() );
|
||||
sgNormalizeVec3(nup);
|
||||
sgNormalizeVec3(nsun);
|
||||
// cout << "nup = " << nup[0] << "," << nup[1] << ","
|
||||
// << nup[2] << endl;
|
||||
// cout << "nsun = " << nsun[0] << "," << nsun[1] << ","
|
||||
// << nsun[2] << endl;
|
||||
|
||||
l->sun_angle = acos(MAT3_DOT_PRODUCT(nup, nsun));
|
||||
// printf(" SUN ANGLE relative to current location = %.3f rads.\n",
|
||||
// l->sun_angle);
|
||||
l->sun_angle = acos( sgScalarProductVec3 ( nup, nsun ) );
|
||||
cout << "sun angle relative to current location = " << l->sun_angle << endl;
|
||||
|
||||
// calculate vector to sun's position on the earth's surface
|
||||
rel_sunpos = l->fg_sunpos - (v->get_view_pos() + scenery.center);
|
||||
|
@ -304,39 +300,43 @@ void fgUpdateSunPos( void ) {
|
|||
|
||||
// make a vector to the current view position
|
||||
Point3D view_pos = v->get_view_pos();
|
||||
MAT3_SET_VEC(v0, view_pos.x(), view_pos.y(), view_pos.z());
|
||||
sgSetVec3( v0, view_pos.x(), view_pos.y(), view_pos.z() );
|
||||
|
||||
// Given a vector from the view position to the point on the
|
||||
// earth's surface the sun is directly over, map into onto the
|
||||
// local plane representing "horizontal".
|
||||
map_vec_onto_cur_surface_plane( v->get_local_up(), v0, v->get_to_sun(),
|
||||
surface_to_sun );
|
||||
MAT3_NORMALIZE_VEC(surface_to_sun, ntmp);
|
||||
|
||||
sgmap_vec_onto_cur_surface_plane( v->get_local_up(), v0, v->get_to_sun(),
|
||||
surface_to_sun );
|
||||
sgNormalizeVec3(surface_to_sun);
|
||||
v->set_surface_to_sun( surface_to_sun[0], surface_to_sun[1],
|
||||
surface_to_sun[2] );
|
||||
// printf("Surface direction to sun is %.2f %.2f %.2f\n",
|
||||
// v->surface_to_sun[0], v->surface_to_sun[1], v->surface_to_sun[2]);
|
||||
// printf("Should be close to zero = %.2f\n",
|
||||
// MAT3_DOT_PRODUCT(v->local_up, v->surface_to_sun));
|
||||
// cout << "(sg) Surface direction to sun is "
|
||||
// << surface_to_sun[0] << ","
|
||||
// << surface_to_sun[1] << ","
|
||||
// << surface_to_sun[2] << endl;
|
||||
// cout << "Should be close to zero = "
|
||||
// << sgScalarProductVec3(nup, surface_to_sun) << endl;
|
||||
|
||||
// calculate the angle between v->surface_to_sun and
|
||||
// v->surface_east. We do this so we can sort out the acos()
|
||||
// ambiguity. I wish I could think of a more efficient way ... :-(
|
||||
east_dot = MAT3_DOT_PRODUCT( surface_to_sun, v->get_surface_east() );
|
||||
// printf(" East dot product = %.2f\n", east_dot);
|
||||
east_dot = sgScalarProductVec3( surface_to_sun, v->get_surface_east() );
|
||||
// cout << " East dot product = " << east_dot << endl;
|
||||
|
||||
// calculate the angle between v->surface_to_sun and
|
||||
// v->surface_south. this is how much we have to rotate the sky
|
||||
// for it to align with the sun
|
||||
dot = MAT3_DOT_PRODUCT( surface_to_sun, v->get_surface_south() );
|
||||
// printf(" Dot product = %.2f\n", dot);
|
||||
dot = sgScalarProductVec3( surface_to_sun, v->get_surface_south() );
|
||||
// cout << " Dot product = " << dot << endl;
|
||||
|
||||
if ( east_dot >= 0 ) {
|
||||
l->sun_rotation = acos(dot);
|
||||
} else {
|
||||
l->sun_rotation = -acos(dot);
|
||||
}
|
||||
// printf(" Sky needs to rotate = %.3f rads = %.1f degrees.\n",
|
||||
// angle, angle * RAD_TO_DEG); */
|
||||
// cout << " Sky needs to rotate = " << angle << " rads = "
|
||||
// << angle * RAD_TO_DEG << " degrees." << endl;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue