On Sun, 2009-11-22 at 16:06 -0600, James Turner wrote:
> Update of /var/cvs/FlightGear-0.9/data/Aircraft/c172p/Nasal
> In directory baron.flightgear.org:/tmp/cvs-serv24918/Nasal
> 
> Modified Files:
>       action-sim.nas 
> Log Message:
> Dave Perry: 
> 
> This patch adds main gear rotations about the fuselage attach points
> that keep the wheels in contact with the ground as the compression
> increases and decreases.  I also rotated the main fairings and wheels
> 4 degrees so the wheel axles are horizontal sitting on the ground.
> The left and right main gear struts, wheels, and fairings were
> adjusted to be mirrored (symetric) in the c172p.ac.  I also increased
> the rpm boundary between the Propeller and Propeller.slow selects. 
> 
> 
> Index: action-sim.nas
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/data/Aircraft/c172p/Nasal/action-sim.nas,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -r1.1 -r1.2
> --- action-sim.nas    18 Nov 2009 20:36:13 -0000      1.1
> +++ action-sim.nas    22 Nov 2009 22:06:31 -0000      1.2
> @@ -43,6 +49,25 @@
>  
>  var update_actions = func {
>  
> +#  Compute compression induced main gear rotations
> +#
> +#  constants
> +   var R_m = 0.919679;
> +   var h0 = 0.63872;
> +   var theta0_rad = 0.803068;
> +   var radTOdeg = 57.295779;
> +
> +#  Right main
> +   var delta_h = dhR_ft.getValue()*12/39.4;
> +   var right_alpha_deg = ( math.acos( (h0 - delta_h)/R_m ) - theta0_rad 
> )*57.295779;
> +
> +#  Left main
> +   var delta_h = dhL_ft.getValue()*12/39.4;
> +   var left_alpha_deg = ( math.acos( (h0 - delta_h)/R_m ) - theta0_rad 
> )*57.295779;
> +   
> +    
> +
> +  # outputs
>      if ( navLights.getValue() ) {
>         instrumentLightFactor.setDoubleValue(1.0);
>         #  Used double in case one wants to later add the ability to dim the 
> instrument lights

The relationship between feet and meters is exactly 0.3048 feet per
meter.  Your conversion value of 12/39.4 is approximately 0.30456...  It
would be better to do:

 #  constants
...
   var radTOdeg = 57.295779;
   var ftTOmeter = 0.3048;
...
#  Right main
   var delta_h = dhR_ft.getValue()*ftTOmeter;
   var right_alpha_deg = ( math.acos( (h0 - delta_h)/R_m ) - theta0_rad 
)*radTOdeg;

#  Left main
   var delta_h = dhL_ft.getValue()*ftTOmeter;
   var left_alpha_deg = ( math.acos( (h0 - delta_h)/R_m ) - theta0_rad 
)*radTOdeg;

This is more exact and also avoids two divisions per frame.

Thanks,
Ron



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to