8,805
edits
(→property-multiply: property-interpolate) |
(→property-interpolate: complete documentation, use syntaxhighlighting) |
||
Line 59: | Line 59: | ||
=== property-interpolate === | === property-interpolate === | ||
Interpolates to a value with a given rate of change. | Interpolates to a value with a given rate of change (per second). | ||
<syntaxhighlight lang="xml"> | |||
<binding> | |||
<command>property-interpolate</command> | |||
<property>/controls/flight/aileron-trim</property> | |||
<value type="double">0</value> | |||
<rate>0.5</rate><!-- 2 seconds to 0 from 1 or -1 --> | |||
</binding> | |||
</syntaxhighlight> | |||
Instead of using <rate>, one could use <time>, to specify the time (in seconds) it takes to go to the new value, independent of the current value. | |||
<syntaxhighlight lang="xml"> | |||
<binding> | |||
<command>property-interpolate</command> | |||
<property>/controls/flight/aileron-trim</property> | |||
<value type="double">0</value> | |||
<time>2</time><!-- 2 seconds to 0 from 1, 0.5, -1 etc. --> | |||
</binding> | |||
</syntaxhighlight> | |||
You can also interpolate to a value given by a property. | You can also interpolate to a value given by a property. | ||
<syntaxhighlight lang="xml"> | |||
<binding> | |||
<command>property-interpolate</command> | |||
<property>/controls/flight/aileron-trim</property> | |||
<property>/controls/flight/default-aileron-trim</property><!-- the value to interpolate to, is 0 --> | |||
<rate>0.5</rate><!-- 2 seconds to 0 from 1 or -1 --> | |||
</binding> | |||
</syntaxhighlight> | |||
=== property-multiply === | === property-multiply === |