it was a typo in my originally posted code. I had an equal sign in in the dead-band line. I removed the equal sign and dead-band works as expected. Also, I confirmed dead-band is ignored if it is located inside of the [binding][/binding] tags, so there is no error in the documentation. Sim, you may want to move that line up if your rudder ignores dead-band.
Thanks for making me analyze my code so carefully!
-Mike
Here's the working twist-to-view code. I ended up using both dead-band and tolerance for the smoothest result. This "may not be suitable for all viewers" because it introduces some unexpected behavior, such as: if you look far left, then quickly look far right, it looks left instead until you allow it time to re-center. It also is optimized for airplane piloting, so the view increments in smaller steps first, then when looking behind you it jumps several steps at a time (the 'power' command does that):
- Code: Select all
<axis>
<desc>Twist to View (Horizontal)</desc>
<number>
<mac>2</mac>
<unix>2</unix>
<windows>3</windows>
</number>
<dead-band type="double">0.2</dead-band>
<tolerance type="double">0.2</tolerance>
<binding>
<command>property-scale</command>
<property>/sim/current-view/goal-heading-offset-deg</property>
<factor>-180.0</factor>
<offset>0.0</offset>
<power type="double">2.0</power>
</binding>
</axis>
My full custom joystick xml file (which also remaps zoom to the hat) is located here:
custom_extreme-3d-pro.xmlbeware that I may make modifications to this file at any time without warning, so ask me if you think something's hokie!