Hi, i have recently added a new internal command: property-interpolate. This exposes the SGInterpolator subsystem to bindings in xml animation files. The SGInterpolator allows the interpolation of property values over time and has so far been used via Nasal in aircraft.door.
For an example, start the Hansajet from git (fgfs --aircraft=Hansajet) and zoom to the gyrosyn heading indicator left of the HSI. Locate the black/white knob with "VOR" and "ADF" written on it. Click it (it swaps the assignment of the needle-driving sources) and notice that it does rotate smoothly to its new position (it's a 2-position toggle knob). Now, look at the overhead panel, either by paning the view up and right or by pressing shift-v on the keyboard. Locate the six rotary buttons GEN.1, GEN.2, ALT.1, ALT.2 and the two between the AC and DC instruments. Move them by clicking their left/right edges. Notice they move smoothly instead of jumping to the new position. Thats done completely without Nasal but from just a few lines in the animation files. Basically, you have to add two bindings to the <pick> animation: 1. property-assing the target value describing the state of the button (that's what you are used to do) 2. property-interpolate the position of the model to it's new state's value (that's the new binding to add) 3. Animate the model's rotation from the position property, not the state property (that's what you have to change) 4. done. (see the animations for the object SyncKnob and SyncKnobPick.[LR] in Aircraft/Hansajet/Models/Sperry-C-6d.xml as an example). The use of the property-interpolate may be: Change the value of /some/target/property to the constant value of 100.0 over 3 seconds. <binding> <command>property-interpolate</command> <property>/some/target/property</property> <value>100.0</value> <time>3</time> </binding> Change the value of /some/target/property to the value of /some/source/property over 0.5 seconds. <binding> <command>property-interpolate</command> <property>/some/target/property</property> <property>/some/source/property</property> <time>0.5</time> </binding> I hope you like it as much as I do - comments are welcome! Torsten ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel