Hi Torsten , i have one little request , could you invert the y
acceleration before updating the property ? I had it inverted
originally , otherwise you get negative values pushing the mouse
forward , positive pulling back. It could be inverted with nasal for
use , but it feels more natural with positive /forward , negative /
back . Thanks
Heiko , this patch just exposes the mouses x,y movement to
/devices/status/mice/mouse/accel-x and accel-y. These values can be
added to controls/engines/engine[]/throttle , via nasal . They need to
be scaled down considerably , and is affected by the pick animations
repeatable <interval-sec> value . It takes a bit of testing to get a
good lever movement , but definately worth the work.
This is my current nasal function I use , called from a pick animation with
<animation>
<type>pick</type>
<object-name>Throttle0</object-name>
<action>
<button>0</button>
<repeatable>true</repeatable>
<interval-sec>0.01</interval-sec>
<binding>
<command>nasal</command>
<script>aerostar.engControl(0.005,0,"throttle")</script>
</binding>
</action>
</animation>
and in a nasal file I have:
var engControl = func(scale,eng,ctrl) {
var shft = getprop("devices/status/keyboard/shift");
var amt = getprop("/devices/status/mice/mouse/accel-y");
var eng2 =1-eng;
var prop1="controls/engines/engine["~eng~"]/"~ctrl;
var prop2="controls/engines/engine["~eng2~"]/"~ctrl;
var val1=getprop(prop1) + (amt * scale);
if(val1 >1.0) val1 = 1.0;
if(val1 < 0.0) val1 = 0.0;
setprop(prop1,val1);
if(!shft){
var val2=getprop(prop2) + (amt * scale);
if(val2 >1.0) val2 = 1.0;
if(val2 < 0.0) val2 = 0.0;
setprop(prop2,val2);
}
}
Hope that eplains it a bit better ....
Now , since I got an ipod touch for Christmas , Im hoping for a Flightgear app !
Cheers
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web. Learn how to
best implement a security strategy that keeps consumers' information secure
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel