1
0
Fork 0

Add a pre/post draw call back to strobe lights so we can make them bigger

so they will stand out from everything else.
This commit is contained in:
curt 2002-10-18 18:43:50 +00:00
parent 89ede45989
commit 9c561ab860
2 changed files with 25 additions and 0 deletions

View file

@ -319,6 +319,8 @@ void FGSteam::_CatchUp()
occasionally due to some dirt in the tube or on the ball.
*/
// cout << current_aircraft.fdm_state->get_A_Z_pilot() << endl;
// cout << "Ay = " << current_aircraft.fdm_state->get_A_Y_pilot()
// << " Az = " << current_aircraft.fdm_state->get_A_Z_pilot() << endl;
d = -current_aircraft.fdm_state->get_A_Z_pilot();
if ( d < 1 ) d = 1;
set_lowpass ( & the_TC_rad,

View file

@ -29,6 +29,23 @@
#include "pt_lights.hxx"
// strobe pre-draw (we want a larger point size)
static int StrobePreDraw( ssgEntity *e ) {
glPushAttrib( GL_POINT_BIT );
glPointSize(4.0);
glEnable(GL_POINT_SMOOTH);
return true;
}
// strobe post-draw (we want a larger point size)
static int StrobePostDraw( ssgEntity *e ) {
glPopAttrib();
return true;
}
// Generate a directional light
ssgLeaf *gen_directional_light( sgVec3 pt, sgVec3 dir, sgVec3 up,
const string &material ) {
@ -243,6 +260,9 @@ ssgTimedSelector *gen_reil_lights( const point_list &nodes,
<< material );
}
leaf->setCallback( SSG_CALLBACK_PREDRAW, StrobePreDraw );
leaf->setCallback( SSG_CALLBACK_POSTDRAW, StrobePostDraw );
ssgTimedSelector *reil = new ssgTimedSelector;
// need to add this twice to work around an ssg bug
@ -326,6 +346,9 @@ ssgTimedSelector *gen_rabbit_lights( const point_list &nodes,
<< material );
}
leaf->setCallback( SSG_CALLBACK_PREDRAW, StrobePreDraw );
leaf->setCallback( SSG_CALLBACK_POSTDRAW, StrobePostDraw );
rabbit->addKid( leaf );
if ( first ) {
// ssg bug where first entry in animation is ignored.