[EMAIL PROTECTED] wrote:
> 
> Is anyone working with the fgEVENT in Time/event.hxx and related classes?
> Since our project is a particular simulated space mission, I've been
> looking at how to cause certain events (text displays and sounds, mainly)
> based on conditions in the property tree. I didn't find anything to do
> exactly that, but with fgEVENT and FGConditional, it should be pretty
> simple to implement. Here's a diagram, with the new parts shaded and
> blue:
> 
> http://genesis.cs.utc.edu/~mpaschal/work/gems/conditionalEvents06.png
> 
> Is this reasonable? Since these conditional events are necessary for how
> we're working our mission, I intend to write this for our use even if
> it's not useful generally.
> 
> One implementation worry is that passing a parameter as part of an
> fgCallback appears only partially implemented. This feature would be
> greatly useful so that we could call a 'play sound' function with a
> particular sound as a parameter rather than having separate 'play sound
> x' and 'play sound y' functions--but I would have to whip out the C++
> books for a while to be able to fix it myself without breaking the
> existing events, assuming it's possible at all.
> 
> Your advice is greatly appreciated.
> 
An fgEVENT is a function that is executed every X milliseconds.  Once
per frame the event queue is scanned and any events whose interval has
passed is executed.  FWIW the current implementation is fairly old and
crufty.  I have a newer version that replaces fgCallback with
boost::function.  Boost::bind can also be used which allows arbitrary
parameters to be passed to the function when it is executed.

FGConditional, I believe, is part of the property sub-system but until
now no one has suggested combining them with the event sub-system.

Cheers,
Bernie

PS see http://www.boost.org for more details on boost::function and
boost::bind

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to