1
0
Fork 0

Dave Perry: fix the nosegear nut-cracker animation, and clean up some other files in respect of other commits by Stuart.

This commit is contained in:
jmt 2009-12-09 14:43:30 +00:00
parent d04b398e9b
commit e5c87ff77a
7 changed files with 46747 additions and 46823 deletions

View file

@ -21,21 +21,15 @@ properties' values.
<animation>
<type>material</type>
<object-name>ap-btn</object-name>
<object-name>hdg-btn</object-name>
<object-name>nav-btn</object-name>
<object-name>apr-btn</object-name>
<object-name>rev-btn</object-name>
<object-name>alt-btn</object-name>
<object-name>dn-btn</object-name>
<object-name>up-btn</object-name>
<object-name>arm-btn</object-name>
<object-name>baro-btn</object-name>
<object-name>knob-outer</object-name>
<object-name>knob-inner</object-name>
<object-name>base</object-name>
<object-name>buttons</object-name>
<emission>
<red>0.5</red>
<green>0.1</green>
<blue>0.00005</blue>
<factor-prop>sim/model/material/instruments/factor</factor-prop>
<red>0.75</red>
<green>0.25</green>
<blue>0.10</blue>
<factor-prop>/controls/lighting/panel-norm</factor-prop>
</emission>
</animation>
@ -917,20 +911,5 @@ properties' values.
</binding>
</action>
</animation>
<animation>
<type>material</type>
<object-name>knob-outer</object-name>
<object-name>knob-inner</object-name>
<object-name>base</object-name>
<object-name>buttons</object-name>
<emission>
<red>0.75</red>
<green>0.25</green>
<blue>0.10</blue>
<factor-prop>/controls/lighting/panel-norm</factor-prop>
</emission>
</animation>
</PropertyList>

View file

@ -1,5 +1,5 @@
AC3Db
MATERIAL "ac3dmat1" rgb 1 1 1 amb 0.2 0.2 0.2 emis 0 0 0 spec 0 0 0 shi 10 trans 0
MATERIAL "ac3dmat1" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0 0 0 shi 10 trans 0
MATERIAL "ac3dmat2" rgb 1 1 0.247059 amb 0.2 0.2 0.2 emis 0 0 0 spec 0 0 0 shi 10 trans 1
MATERIAL "ac3dmat2" rgb 1 1 1 amb 0.2 0.2 0.2 emis 1 1 1 spec 0 0 0 shi 10 trans 0
OBJECT world

File diff suppressed because it is too large Load diff

View file

@ -1323,28 +1323,13 @@
</axis>
</animation>
<animation>
<type>translate</type>
<object-name>fairing1</object-name>
<object-name>NoseWheel</object-name>
<object-name>NoseWheelStrut</object-name>
<object-name>Oleo</object-name>
<object-name>Axle.001</object-name>
<property>gear/gear[0]/compression-norm</property>
<factor>0.30</factor>
<axis>
<x>0.1</x>
<y>0</y>
<z>0.9</z>
</axis>
</animation>
<animation>
<type>rotate</type>
<object-name>fairing1</object-name>
<object-name>NoseWheel</object-name>
<object-name>NoseWheelStrut</object-name>
<object-name>Oleo</object-name>
<object-name>TopLink</object-name>
<object-name>BottomLink</object-name>
<object-name>Axle.001</object-name>
<property>surface-positions/rudder-pos-norm</property>
<factor>30</factor>
@ -1358,6 +1343,56 @@
</axis>
</animation>
<animation>
<type>translate</type>
<object-name>fairing1</object-name>
<object-name>NoseWheel</object-name>
<object-name>NoseWheelStrut</object-name>
<object-name>BottomLink</object-name>
<object-name>Axle.001</object-name>
<property>gear/gear[0]/compression-norm</property>
<factor>0.30</factor>
<axis>
<x>0.3</x>
<y>0</y>
<z>1.0</z>
</axis>
</animation>
<animation>
<type>rotate</type>
<object-name>TopLink</object-name>
<property>gear/gear[0]/compression-rotation-deg</property>
<factor>-1</factor>
<center>
<x-m>-0.95412</x-m>
<y-m>0.0</y-m>
<z-m>-0.72408</z-m>
</center>
<axis>
<x>0.0</x>
<y>1.0</y>
<z>0.0</z>
</axis>
</animation>
<animation>
<type>rotate</type>
<object-name>BottomLink</object-name>
<property>gear/gear[0]/compression-rotation-deg</property>
<factor>1</factor>
<center>
<x-m>-1.02349</x-m>
<y-m>0.0</y-m>
<z-m>-0.95449</z-m>
</center>
<axis>
<x>0.0</x>
<y>1.0</y>
<z>0.0</z>
</axis>
</animation>
<animation>
<type>rotate</type>
<object-name>fairing3</object-name>

View file

@ -2,6 +2,12 @@
# action-sim.nas Updates various simulated features every frame
##
# Initialize local variables
var H = nil;
var L = nil;
var phi = nil;
var C = nil;
# set up filters for these actions
var cdi0_lowpass = aircraft.lowpass.new(0.5);
@ -17,8 +23,10 @@ var navLights = props.globals.getNode("controls/lighting/nav-lights", 1);
var instrumentsNorm = props.globals.getNode("controls/lighting/instruments-norm", 1);
var instrumentLightFactor = props.globals.getNode("sim/model/material/instruments/factor", 1);
var panelLights = props.globals.getNode("controls/lighting/panel-norm", 1);
var dhN_ft = props.globals.getNode("gear/gear[0]/compression-ft", 1);
var dhR_ft = props.globals.getNode("gear/gear[2]/compression-ft", 1);
var dhL_ft = props.globals.getNode("gear/gear[1]/compression-ft", 1);
var propGear0 = props.globals.getNode("gear/gear[0]", 1);
var propGear1 = props.globals.getNode("gear/gear[1]", 1);
var propGear2 = props.globals.getNode("gear/gear[2]", 1);
@ -32,8 +40,9 @@ var filteredCDI0 = propNav0.getNode("filtered-cdiNAV0-deflection", 1);
var filteredCDI1 = propNav1.getNode("filtered-cdiNAV1-deflection", 1);
var filteredGS0 = propNav0.getNode("filtered-gsNAV0-deflection", 1);
var filteredGS1 = propNav1.getNode("filtered-gsNAV1-deflection", 1);
var right_main_rot = propGear2.getNode("compression-rotation-deg", 1);
var nose_link_rot = propGear0.getNode("compression-rotation-deg", 1);
var left_main_rot = propGear1.getNode("compression-rotation-deg", 1);
var right_main_rot = propGear2.getNode("compression-rotation-deg", 1);
var init_actions = func {
filteredCDI0.setDoubleValue(0.0);
@ -41,6 +50,9 @@ var init_actions = func {
filteredGS0.setDoubleValue(0.0);
filteredGS1.setDoubleValue(0.0);
# Make sure that init_actions is called when the sim is reset
setlistener("sim/signals/reset", init_actions);
# Request that the update fuction be called next frame
settimer(update_actions, 0);
}
@ -48,6 +60,25 @@ var init_actions = func {
var update_actions = func {
# Note: R2D and FT2M are unit conversion factors defined in $FG_ROOT/Nasal/globals.nas
# R2D (radians to degrees) FT2M (feet to meters)
##
# Compute the scissor link angles due to nose strut compression
##
var theta = 0.0;
# Compute the angle the nose gear scissor rotates due to nose gear strut compression
H = 0.240626; # Nose gear oleo strut extended length in m
L = 0.194716; # Nose gear scissor length in m
phi = 0.666058;
C = dhN_ft.getValue()*FT2M;
if (C > 0.0) {
theta = scissor_angle(H,C,L,phi)*R2D;
}
# Compute compression induced main gear rotations
#
# constants
@ -55,9 +86,6 @@ var update_actions = func {
var h0 = 0.63872;
var theta0_rad = 0.803068;
# Note: R2D and FT2M are unit conversion factors defined in $FG_ROOT/Nasal/globals.nas
# R2D (radians to degrees) FT2M (feet to meters)
# Right main
var delta_h = dhR_ft.getValue()*FT2M;
var right_alpha_deg = ( math.acos( (h0 - delta_h)/R_m ) - theta0_rad )*R2D;
@ -75,6 +103,7 @@ var update_actions = func {
filteredCDI1.setDoubleValue(cdi1_lowpass.filter(cdiNAV1.getValue()));
filteredGS0.setDoubleValue(gs0_lowpass.filter(gsNAV0.getValue()));
filteredGS1.setDoubleValue(gs1_lowpass.filter(gsNAV1.getValue()));
nose_link_rot.setDoubleValue(theta);
right_main_rot.setDoubleValue(right_alpha_deg);
left_main_rot.setDoubleValue(left_alpha_deg);
@ -82,10 +111,17 @@ var update_actions = func {
}
var scissor_angle = func(H,C,L,phi) {
var a = (H - C)/2/L;
# Use 2 iterates of Newton's method and 4th order Taylor series to
# approximate theta where sin(phi - theta) = a
var theta = phi - 2*a/3 - a/3/(1-a*a/2);
return theta;
}
# Setup listener call to start update loop once the fdm is initialized
#
setlistener("sim/signals/fdm-initialized", init_actions);
setlistener("sim/signals/reset", init_actions);

View file

@ -209,7 +209,7 @@
<yaw> 0.0 </yaw>
</orient>
<sense> 1 </sense>
<p_factor> 10 </p_factor>
<p_factor> 5 </p_factor>
</thruster>
</engine>
<tank type="FUEL"> <!-- Tank number 0 -->

View file

@ -1,12 +1,12 @@
<?xml version="1.0"?>
<initialize name="reset00">
<ubody unit="FT/SEC"> 156.556 </ubody>
<vbody unit="FT/SEC"> -12.0562 </vbody>
<wbody unit="FT/SEC"> 2.10711 </wbody>
<phi unit="DEG"> -0.00706244 </phi>
<theta unit="DEG"> 0.0117331 </theta>
<psi unit="DEG"> 0.846416 </psi>
<ubody unit="FT/SEC"> 3.76751 </ubody>
<vbody unit="FT/SEC"> 149.591 </vbody>
<wbody unit="FT/SEC"> -216.892 </wbody>
<phi unit="DEG"> -1.56812 </phi>
<theta unit="DEG"> -0.24805 </theta>
<psi unit="DEG"> 3.50617 </psi>
<longitude unit="DEG"> 0 </longitude>
<latitude unit="DEG"> 0 </latitude>
<altitude unit="FT"> -2.45347 </altitude>
<altitude unit="FT"> 1170.89 </altitude>
</initialize>