#include <simgear/scene/model/animation.hxx>
#include <simgear/scene/sky/sky.hxx>
#include <simgear/structure/event_mgr.hxx>
+#include <simgear/props/AtomicChangeListener.hxx>
#include <simgear/props/props.hxx>
#include <simgear/timing/sg_time.hxx>
#include <simgear/math/sg_random.h>
// normal playback
replay_time->setDoubleValue( replay_time->getDoubleValue()
+ ( delta_time_sec
- * fgGetInt("/sim/speed-up") ) );
+ * fgGetInt("/sim/speed-up") ) );
} else if ( replay_state->getIntValue() == 2 ) {
// paused playback (don't advance replay time)
}
// probably move eventually
/* printf("Before - ground = %.2f runway = %.2f alt = %.2f\n",
- scenery.get_cur_elev(),
- cur_fdm_state->get_Runway_altitude() * SG_FEET_TO_METER,
- cur_fdm_state->get_Altitude() * SG_FEET_TO_METER); */
+ scenery.get_cur_elev(),
+ cur_fdm_state->get_Runway_altitude() * SG_FEET_TO_METER,
+ cur_fdm_state->get_Altitude() * SG_FEET_TO_METER); */
/* printf("Adjustment - ground = %.2f runway = %.2f alt = %.2f\n",
- scenery.get_cur_elev(),
- cur_fdm_state->get_Runway_altitude() * SG_FEET_TO_METER,
- cur_fdm_state->get_Altitude() * SG_FEET_TO_METER); */
+ scenery.get_cur_elev(),
+ cur_fdm_state->get_Runway_altitude() * SG_FEET_TO_METER,
+ cur_fdm_state->get_Altitude() * SG_FEET_TO_METER); */
// cout << "Warp = " << globals->get_warp() << endl;
general.set_frame_rate( frames );
fgSetInt("/sim/frame-rate", frames);
SG_LOG( SG_ALL, SG_DEBUG,
- "--> Frame rate is = " << general.get_frame_rate() );
+ "--> Frame rate is = " << general.get_frame_rate() );
frames = 0;
}
last_time = t->get_cur_time();
fgUpdateTimeDepCalcs();
} else {
SG_LOG( SG_ALL, SG_DEBUG,
- "Elapsed time is zero ... we're zinging" );
+ "Elapsed time is zero ... we're zinging" );
}
globals->get_subsystem_mgr()->update(delta_time_sec);
fgSetFloat("/sim/sound/volume", init_volume);
globals->get_soundmgr()->set_volume(init_volume);
}
-
+ simgear::AtomicChangeListener::fireChangeListeners();
fgRequestRedraw();
SG_LOG( SG_ALL, SG_DEBUG, "" );
_scene_ambient(0, 0, 0, 0),
_scene_diffuse(0, 0, 0, 0),
_scene_specular(0, 0, 0, 0),
+ _scene_chrome(0, 0, 0, 0),
_sky_color(0, 0, 0, 0),
_fog_color(0, 0, 0, 0),
_cloud_color(0, 0, 0, 0),
prop->tie("/rendering/dome/fog/red",SGRawValuePointer<float>(&_fog_color[0]));
prop->tie("/rendering/dome/fog/green",SGRawValuePointer<float>(&_fog_color[1]));
prop->tie("/rendering/dome/fog/blue",SGRawValuePointer<float>(&_fog_color[2]));
+ // Properties used directly by effects
+ _chromeProps[0] = prop->getNode("/rendering/scene/chrome-light/red", true);
+ _chromeProps[1] = prop->getNode("/rendering/scene/chrome-light/green",
+ true);
+ _chromeProps[2] = prop->getNode("/rendering/scene/chrome-light/blue", true);
+ _chromeProps[3] = prop->getNode("/rendering/scene/chrome-light/alpha",
+ true);
+ for (int i = 0; i < 4; ++i)
+ _chromeProps[i]->setValue(0.0);
}
void FGLight::unbind () {
_scene_diffuse[3] = 1.0;
gamma_correct_rgb( _scene_diffuse.data() );
+ SGVec4f chrome = _scene_ambient * .4f + _scene_diffuse;
+ chrome[3] = 1.0f;
+ if (chrome != _scene_chrome) {
+ _scene_chrome = chrome;
+ for (int i = 0; i < 4; ++i)
+ _chromeProps[i]->setValue(static_cast<double>(_scene_chrome[i]));
+ }
+
color = thesky->get_sun_color();
_scene_specular[0] = color[0] * specular;
_scene_specular[1] = color[1] * specular;
#include <simgear/compiler.h>
+#include <simgear/props/props.hxx>
#include <simgear/structure/subsystem_mgr.hxx>
#include <simgear/math/interpolater.hxx>
SGVec4f _scene_ambient;
SGVec4f _scene_diffuse;
SGVec4f _scene_specular;
+ SGVec4f _scene_chrome;
// clear sky, fog and cloud color
SGVec4f _sky_color;
void update_sky_color ();
void update_adj_fog_color ();
+ // properties for chrome light; not a tie because I want to fire
+ // property listeners when the values change.
+ SGPropertyNode_ptr _chromeProps[4];
public:
FGLight ();
inline const SGVec4f& scene_ambient () const { return _scene_ambient; }
inline const SGVec4f& scene_diffuse () const { return _scene_diffuse; }
inline const SGVec4f& scene_specular () const { return _scene_specular; }
+ inline const SGVec4f& scene_chrome () const { return _scene_chrome; }
inline const SGVec4f& sky_color () const { return _sky_color; }
inline const SGVec4f& cloud_color () const { return _cloud_color; }