Hi Maik,

Am Donnerstag, den 21.12.2006, 02:14 +0100 schrieb Maik Justus:
> Hi
> 
> here is a patch that YASim gears make use of the ground properties 
> (friction, bumpiness, etc).
> It enhances the gears, that you can define different gears for "on 
> water" and for "not on water".
> And you can define "inverse-speed-spring-is-doubled", with this the gear 
> extends with increasing speed which can be used for lifting the airplane 
> out of the water with increasing speed. The friction at this speed is 
> reduced by "reduce-friction-by-speed" to simulate (fake?) the reduced drag.
> 
That's great news! I will continue to work on the Albatros Model and the
JU-52 on floats is also within reach.

Thanks a lot!

Detlef


> This patch is tested only a very bit on default scenery with only one 
> aircraft. It is probably not ready for cvs. (all enhancements for water 
> aircrafts are fully untested...) I hope I find the time to test the 
> beaver in the next days.
> 
> Maik
> 
> Maik Justus schrieb am 20.12.2006 01:19:
> > Hi Melchior,
> >
> > thanks for the info. I will try to make use of this with the yasim gears.
> >
> > Maik
> >
> >
> > Melchior FRANZ schrieb am 20.12.2006 00:56:
> >   
> >> * Maik Justus -- Wednesday 20 December 2006 00:47:
> >>   
> >>     
> >>> does anyone know, how to access the ground properties by the FDM?
> >>>     
> >>>       
> >> Looks like the groundcache provides this:
> >>
> >> bool
> >> FGGroundCache::get_agl(double t, const SGVec3d& dpt, double max_altoff,
> >>                        SGVec3d& contact, SGVec3d& normal, SGVec3d& vel,
> >>                        int *type, const SGMaterial** material, double *agl)
> >>
> >>
> >> The ground cache is already used by JSBSim and YASim for gear contact.
> >> See simgear/scene/material/mat.hxx for SGMaterial. It has methods to
> >> read friction/bumpiness/...
> >>
> >> m.
> >>   
> >>     
> >
> >
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share your
> > opinions on IT & business topics through brief surveys - and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Flightgear-devel mailing list
> > Flightgear-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/flightgear-devel
> >
> >   
> 
> einfaches Textdokument-Anlage (README.yasim.diff)
> Index: README.yasim
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/data/Docs/README.yasim,v
> retrieving revision 1.17
> diff -u -p -r1.17 README.yasim
> --- README.yasim      10 Nov 2006 18:06:24 -0000      1.17
> +++ README.yasim      21 Dec 2006 00:58:14 -0000
> @@ -44,6 +44,15 @@ fuselage: This defines a tubelike struct
>                      expressed as a fraction (0-1) of the width value.
>            midpoint: The location of the widest part of the fuselage,
>                      expressed as a fraction of the distance between A and B.
> +          idrag:    Multiplier for the "induced drag" generated by this
> +                    object. Default is one. With idrag=0 the fuselage 
> +                    generates only drag.
> +          cx,cy,cz: Factors for the generated drag in the fuselages "local
> +                    coordinate system" with x pointing from end to front,
> +                    z perpendicular to x with y=0 in the aircraft coordinate
> +                    system. E.g. for a fuselage of a height of 2 times the
> +                    width you can define cy=2 and (due to the doubled front
> +                    surface) cx=2.
>  
>  wing:     This defines the main wing of the aircraft.  You can have
>            only one (but see below about using vstab objects for extra
> @@ -312,6 +321,23 @@ gear:     Defines a landing gear.  Accep
>                          unstable.  If you can't make the gear stop
>                          bouncing with this number, try increasing the
>                          compression length instead.
> +          only-on-water: if ths set to "1" the gear will be ignored if
> +                        not on water. Defaults to "0"
> +          not-on-water:  if ths set to "0" the gear will be ignored if
> +                        on water. Defaults to "1"
> +          inverse-speed-spring-is-doubled: At this speed (the inverse of 
> +                        the speed must be given) the spring constant
> +                        is doubled. The idea is, to use this on water to
> +                        simulate the speed dependend lift of a float.
> +                        Defaults to "0"
> +          reduce-friction-by-speed: at the speed given by the last tag the
> +                        friction is reduced by this relative value. Can be 
> +                        used for simulating (fakeing) the reduced drag of 
> +                        a lifted float. E.g. if you secifiy this value to 
> +                        "0.2" the friction is reduced by 20% at the speed
> +                        defined by the last tag and by 40% at the double
> +                        speed. Defaults to "0"
> +                        
>  
>  launchbar: Defines a catapult launchbar or strop.
>             x,y,z:      The location of the mount point of the launch bar or
> @@ -481,7 +507,6 @@ rotor:    A rotor. Used for simulating h
>                     A value stall gives the fraction of the rotor in stall
>                     (weighted by the fraction the have on lift and drag
>                     without stall). Use this for modifying the rotor-sound.
> -                   The torque property has a bug.
>            x,y,z:   The position of the rotor center
>            nx,ny,nz: The normal of the rotor (pointing upwards, will be
>                     normalized by the computer)
> @@ -555,11 +580,6 @@ rotor:    A rotor. Used for simulating h
>                     is stall. In the range between this incidences it is
>                     interpolated linear.
>  
> -          The airfoil of the rotor can be described in two ways. First you
> -          can define the needed power for different pitch values and the
> -          total lift force at a user-defined pitch value. Don't use pitch
> -          values greater than the stall incidence. You could get strange
> -          results.
>  
>            pitch-a: 
>            pitch-b: collective incidence angles, If you start flightgear 
> @@ -573,6 +593,7 @@ rotor:    A rotor. Used for simulating h
>                     coefficients instead (see below) and adjust the lift with
>                     rotor-correction-factor.
>  
> +          The airfoil of the rotor is described as follows:
>            The way is to define the lift and drag coefficients directly.
>            Without stall the c-lift of the profile is assumed to be
>                     sin(incidence-"airfoil-incidence-no-lift")*liftcoef;
> @@ -688,7 +709,11 @@ rotorgear: If you are using one ore more
>            yasimliftfactor: the solver is not working with rotor-aircrafts.
>                     Therefore you have to specify the results yourself.
>                     10 for drag and 140 for lift seem to be good starting
> -                   values.
> +                   values. Although the solve is not invoked for aircrafts
> +                   with at least one rotor, you need to specifiy the cruise
> +                   and the approach seetings. The approach speed is needed to
> +                   calculate the gear springs. Use a speed of approx. 
> 50knots.
> +                   They do not need to match any real value.
>  
>            The rotorgear needs a <control> subelement for the engine
>            (ROTORGEARENGINEON) and can have a <control> subelement for the
> einfaches Textdokument-Anlage (gear.diff)
> Index: flight.cxx
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/flight.cxx,v
> retrieving revision 1.28
> diff -u -p -r1.28 flight.cxx
> --- flight.cxx        26 Jul 2006 14:18:06 -0000      1.28
> +++ flight.cxx        21 Dec 2006 01:04:11 -0000
> @@ -870,6 +870,34 @@ FGInterface::get_agl_m(double t, const d
>    return ret;
>  }
>  
> +bool
> +FGInterface::get_agl_m(double t, const double pt[3],
> +                       double contact[3], double normal[3], double vel[3],
> +                       int *type, double *loadCapacity,
> +                       double *frictionFactor, double *agl,
> +                       double *rollingFritction, double *loadResistance,
> +                       double *bumpiness, bool *isSolid)
> +{
> +  const SGMaterial* material;
> +  bool ret = ground_cache.get_agl(t, pt, 2.0, contact, normal, vel, type,
> +                                  &material, agl);
> +  if (material) {
> +    *loadCapacity = material->get_load_resistence();
> +    *frictionFactor = material->get_friction_factor();
> +    *rollingFritction = material->get_rolling_friction();
> +    *loadResistance = material->get_load_resistence();
> +    *bumpiness = material->get_bumpiness();
> +    *isSolid = material->get_solid();
> +  } else {
> +    *loadCapacity = DBL_MAX;
> +    *frictionFactor = 1.0;
> +    *rollingFritction = 0.02;
> +    *loadResistance = DBL_MAX;
> +    *bumpiness = 0.0;
> +  }
> +  return ret;
> +}
> +
>  // Legacy interface just kept because of JSBSim
>  bool
>  FGInterface::get_agl_ft(double t, const double pt[3],
> Index: flight.hxx
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/flight.hxx,v
> retrieving revision 1.13
> diff -u -p -r1.13 flight.hxx
> --- flight.hxx        11 Jun 2006 13:34:19 -0000      1.13
> +++ flight.hxx        21 Dec 2006 01:04:16 -0000
> @@ -1128,6 +1128,12 @@ public:
>                     double contact[3], double normal[3], double vel[3],
>                     int *type, double *loadCapacity,
>                     double *frictionFactor, double *agl);
> +    bool get_agl_m(double t, const double pt[3],
> +                       double contact[3], double normal[3], double vel[3],
> +                       int *type, double *loadCapacity,
> +                       double *frictionFactor, double *agl,
> +                       double *rollingFritction, double *loadResistance,
> +                       double *bumpiness,bool *isSolid);
>      bool get_agl_ft(double t, const double pt[3],
>                      double contact[3], double normal[3], double vel[3],
>                      int *type, double *loadCapacity,
> Index: YASim/FGFDM.cpp
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/YASim/FGFDM.cpp,v
> retrieving revision 1.44.2.1
> diff -u -p -r1.44.2.1 FGFDM.cpp
> --- YASim/FGFDM.cpp   18 Dec 2006 21:32:56 -0000      1.44.2.1
> +++ YASim/FGFDM.cpp   21 Dec 2006 01:04:32 -0000
> @@ -273,6 +273,10 @@ void FGFDM::startElement(const char* nam
>       g->setDynamicFriction(attrf(a, "dfric", 0.7));
>          g->setSpring(attrf(a, "spring", 1));
>          g->setDamping(attrf(a, "damp", 1));
> +        if(attrb(a,"only-on-water"))g->setOnlyOnWater(1);
> +        if(attrb(a,"not-on-water"))g->setNotOnWater(1);
> +        g->setInverseSpeedSpringIsDoubled(attrf(a, 
> "inverse-speed-spring-is-doubled", 0));
> +        g->setReduceFrictionBySpeed(attrf(a, "reduce-friction-by-speed", 0));
>       _airplane.addGear(g);
>      } else if(eq(name, "hook")) {
>       Hook* h = new Hook();
> Index: YASim/FGGround.cpp
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/YASim/FGGround.cpp,v
> retrieving revision 1.2
> diff -u -p -r1.2 FGGround.cpp
> --- YASim/FGGround.cpp        18 Feb 2005 12:40:39 -0000      1.2
> +++ YASim/FGGround.cpp        21 Dec 2006 01:04:32 -0000
> @@ -35,6 +35,29 @@ void FGGround::getGroundPlane(const doub
>      for(int i=0; i<3; i++) vel[i] = dvel[i];
>  }
>  
> +void FGGround::getGroundPlane(const double pos[3],
> +                              double plane[4], float vel[3],
> +                              int *type,
> +                              double *frictionFactor, 
> +                              double *rollingFriction,
> +                              double *loadCapacity,
> +                              double *loadResistance,
> +                              double *bumpiness,
> +                              bool *isSolid)
> +{
> +    // Return values for the callback.
> +    double agl;
> +    double cp[3], dvel[3];
> +    _iface->get_agl_m(_toff, pos, cp, plane, dvel,
> +                      type, loadCapacity, frictionFactor, &agl,
> +                      rollingFriction,loadResistance,bumpiness,isSolid);
> +
> +    // The plane below the actual contact point.
> +    plane[3] = plane[0]*cp[0] + plane[1]*cp[1] + plane[2]*cp[2];
> +
> +    for(int i=0; i<3; i++) vel[i] = dvel[i];
> +}
> +
>  bool FGGround::caughtWire(const double pos[4][3])
>  {
>      return _iface->caught_wire_m(_toff, pos);
> Index: YASim/FGGround.hpp
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/YASim/FGGround.hpp,v
> retrieving revision 1.1
> diff -u -p -r1.1 FGGround.hpp
> --- YASim/FGGround.hpp        17 Feb 2005 10:37:26 -0000      1.1
> +++ YASim/FGGround.hpp        21 Dec 2006 01:04:32 -0000
> @@ -18,6 +18,16 @@ public:
>      virtual void getGroundPlane(const double pos[3],
>                                  double plane[4], float vel[3]);
>  
> +    virtual void FGGround::getGroundPlane(const double pos[3],
> +                              double plane[4], float vel[3],
> +                              int *type,
> +                              double *frictionFactor, 
> +                              double *rollingFriction,
> +                              double *loadCapacity,
> +                              double *loadResistance,
> +                              double *bumpiness,
> +                              bool *isSolid);
> +
>      virtual bool caughtWire(const double pos[4][3]);
>  
>      virtual bool getWire(double end[2][3], float vel[2][3]);
> Index: YASim/Gear.cpp
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/YASim/Gear.cpp,v
> retrieving revision 1.7
> diff -u -p -r1.7 Gear.cpp
> --- YASim/Gear.cpp    24 Nov 2005 17:35:42 -0000      1.7
> +++ YASim/Gear.cpp    21 Dec 2006 01:04:33 -0000
> @@ -4,6 +4,9 @@
>  
>  #include "Gear.hpp"
>  namespace yasim {
> +static const float YASIM_PI = 3.14159265358979323846;
> +static const float maxGroundBumpAmplitude=0.5; 
> +        //Amplitude can be positive and negative
>  
>  Gear::Gear()
>  {
> @@ -19,6 +22,19 @@ Gear::Gear()
>      _extension = 1;
>      _castering = false;
>      _frac = 0;
> +    _ground_type = 0;
> +    _ground_frictionFactor = 1;
> +    _ground_rollingFriction = 0.02;
> +    _ground_loadCapacity = 1e30;
> +    _ground_loadResistance = 1e30;
> +    _ground_isSolid=1;
> +    _ground_bumpiness = 0;
> +    _onlyOnWater=0;
> +    _notOnWater=1;
> +    _global_x=0.0;
> +    _global_y=0.0;
> +    _inverseSpeedSpringIsDoubled=0;
> +    _reduceFrictionBySpeed=0;
>  
>      for(i=0; i<3; i++)
>       _global_ground[i] = _global_vel[i] = 0;
> @@ -78,11 +94,46 @@ void Gear::setCastering(bool c)
>      _castering = c;
>  }
>  
> -void Gear::setGlobalGround(double *global_ground, float* global_vel)
> +void Gear::setOnlyOnWater(bool c)
> +{
> +    _onlyOnWater = c;
> +}
> +
> +void Gear::setNotOnWater(bool c)
> +{
> +    _notOnWater = c;
> +}
> +
> +void Gear::setInverseSpeedSpringIsDoubled(float s)
> +{
> +    _inverseSpeedSpringIsDoubled=s;
> +}
> +
> +void Gear::setReduceFrictionBySpeed(float s)
> +{
> +    _reduceFrictionBySpeed=s;
> +}
> +
> +void Gear::setGlobalGround(double *global_ground, float* global_vel,
> +                           double globalX, double globalY,
> +                           int type, double frictionFactor,
> +                           double rollingFriction, double loadCapacity,
> +                           double loadResistance, double bumpiness, 
> +                           bool isSolid)
>  {
>      int i;
>      for(i=0; i<4; i++) _global_ground[i] = global_ground[i];
>      for(i=0; i<3; i++) _global_vel[i] = global_vel[i];
> +    _ground_type = type;
> +    _ground_frictionFactor=frictionFactor;
> +    _ground_rollingFriction=rollingFriction;
> +    _ground_loadCapacity=loadCapacity;
> +    _ground_loadResistance=loadResistance;
> +    _ground_bumpiness=bumpiness;
> +    _ground_isSolid=isSolid;
> +    _global_x=globalX;
> +    _global_y=globalY;
> +
>  }
>  
>  void Gear::getPosition(float* out)
> @@ -159,6 +210,26 @@ bool Gear::getCastering()
>      return _castering;
>  }
>  
> +float Gear::getBumbAltitude()
> +{
> +    if (_ground_bumpiness<0.001) return 0.0;
> +    double x = _global_x*10;
> +    double y = _global_y*10;
> +    x-=Math::floor(x);
> +    y-=Math::floor(y);
> +    x*=2*YASIM_PI;
> +    y*=2*YASIM_PI;
> +    //now x and y are in the range of 0..2pi
> +    //we need a function, that is periodically on 2pi and gives some
> +    //height. This is not very fast, but for a beginning.
> +    //maybe this should be done by interpolating between some precalculated
> +    //values
> +    float h= Math::sin(x)+Math::sin(7*x)+Math::sin(8*x)+Math::sin(13*x);
> +    h+= Math::sin(2*y)+Math::sin(5*y)+Math::sin(9*y*x)+Math::sin(17*y);
> +    
> +    return h *(1/8.)*_ground_bumpiness*maxGroundBumpAmplitude;
> +}
> +
>  void Gear::calcForce(RigidBody* body, State *s, float* v, float* rot)
>  {
>      // Init the return values
> @@ -169,6 +240,15 @@ void Gear::calcForce(RigidBody* body, St
>      if(_extension < 1)
>       return;
>  
> +    if ((_onlyOnWater&&_ground_isSolid)||(_notOnWater&&!_ground_isSolid))  {
> +     _wow = 0;
> +     _frac = 0;
> +        _compressDist = 0;
> +        _rollSpeed = 0;
> +        _casterAngle = 0;
> +     return;
> +    }
> +
>      // The ground plane transformed to the local frame.
>      float ground[4];
>      s->planeGlobalToLocal(_global_ground, ground);
> @@ -180,6 +260,12 @@ void Gear::calcForce(RigidBody* body, St
>      // First off, make sure that the gear "tip" is below the ground.
>      // If it's not, there's no force.
>      float a = ground[3] - Math::dot3(_pos, ground);
> +    float BumbAltitude=0;
> +    if (a<maxGroundBumpAmplitude)
> +    {
> +        BumbAltitude=getBumbAltitude();
> +        a+=BumbAltitude;
> +    }
>      _compressDist = -a;
>      if(a > 0) {
>       _wow = 0;
> @@ -196,7 +282,7 @@ void Gear::calcForce(RigidBody* body, St
>      // above ground is negative.
>      float tmp[3];
>      Math::add3(_cmpr, _pos, tmp);
> -    float b = ground[3] - Math::dot3(tmp, ground);
> +    float b = ground[3] - Math::dot3(tmp, ground)+BumbAltitude;
>  
>      // Calculate the point of ground _contact.
>      _frac = a/(a-b);
> @@ -219,7 +305,11 @@ void Gear::calcForce(RigidBody* body, St
>      // compression.   (note the clamping of _frac to 1):
>      _frac = (_frac > 1) ? 1 : _frac;
>      float fmag = _frac*clen*_spring;
> -
> +    float inversespeed_multiplied_by_speed=0;
> +    if (_inverseSpeedSpringIsDoubled>0.0000001) {
> +        
> inversespeed_multiplied_by_speed=Math::mag3(cv)*_inverseSpeedSpringIsDoubled;
> +        fmag*=1+inversespeed_multiplied_by_speed;
> +    }
>      // Then the damping.  Use the only the velocity into the ground
>      // (projection along "ground") projected along the compression
>      // axis.  So Vdamp = ground*(ground dot cv) dot cmpr
> @@ -285,10 +375,18 @@ void Gear::calcForce(RigidBody* body, St
>          _casterAngle = _rot;
>      }
>  
> -    float fsteer = _brake * calcFriction(wgt, vsteer);
> -    float fskid  = calcFriction(wgt, vskid);
> +    float fsteer = (_brake * _ground_frictionFactor 
> +                    +(1-_brake)*_ground_rollingFriction
> +                   )*calcFriction(wgt, vsteer);
> +    float fskid  = calcFriction(wgt, vskid)*_ground_frictionFactor;
>      if(vsteer > 0) fsteer = -fsteer;
>      if(vskid > 0) fskid = -fskid;
> +    
> +    //reduce friction if wanted by _reduceFrictionBySpeed
> +    float factor = 1-inversespeed_multiplied_by_speed*_reduceFrictionBySpeed;
> +    factor=Math::clamp(factor,0,1);
> +    fsteer*=factor;
> +    fskid*=factor;
>  
>      // Phoo!  All done.  Add it up and get out of here.
>      Math::mul3(fsteer, steer, tmp);
> Index: YASim/Gear.hpp
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/YASim/Gear.hpp,v
> retrieving revision 1.5
> diff -u -p -r1.5 Gear.hpp
> --- YASim/Gear.hpp    24 Nov 2005 17:35:42 -0000      1.5
> +++ YASim/Gear.hpp    21 Dec 2006 01:04:33 -0000
> @@ -39,8 +39,15 @@ public:
>      void setRotation(float rotation);
>      void setExtension(float extension);
>      void setCastering(bool castering);
> -    void setGlobalGround(double* global_ground, float* global_vel);
> -
> +    void setOnlyOnWater(bool c);
> +    void setNotOnWater(bool c);
> +    void setInverseSpeedSpringIsDoubled(float s);
> +    void setReduceFrictionBySpeed(float s);
> +    void setGlobalGround(double* global_ground, float* global_vel,
> +        double globalX, double globalY,
> +        int type, double frictionFactor,double rollingFriction,
> +        double loadCapacity, double loadResistance, double bumpiness,
> +        bool isSolid);
>      void getPosition(float* out);
>      void getCompression(float* out);
>      void getGlobalGround(double* global_ground);
> @@ -54,6 +61,8 @@ public:
>      bool getCastering();
>      float getCasterAngle() { return _casterAngle; }
>      float getRollSpeed() { return _rollSpeed; }
> +    float getBumbAltitude();
> +
>  
>      // Takes a velocity of the aircraft relative to ground, a rotation
>      // vector, and a ground plane (all specified in local coordinates)
> @@ -90,6 +99,19 @@ private:
>      float _global_vel[3];
>      float _casterAngle;
>      float _rollSpeed;
> +    int _ground_type;
> +    double _ground_frictionFactor;
> +    double _ground_rollingFriction;
> +    double _ground_loadCapacity;
> +    double _ground_loadResistance;
> +    double _ground_bumpiness;
> +    bool _ground_isSolid;
> +    bool _onlyOnWater;
> +    bool _notOnWater;
> +    float _inverseSpeedSpringIsDoubled;
> +    float _reduceFrictionBySpeed;
> +    double _global_x;
> +    double _global_y;
>  };
>  
>  }; // namespace yasim
> Index: YASim/Ground.cpp
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/YASim/Ground.cpp,v
> retrieving revision 1.1
> diff -u -p -r1.1 Ground.cpp
> --- YASim/Ground.cpp  17 Feb 2005 10:37:26 -0000      1.1
> +++ YASim/Ground.cpp  21 Dec 2006 01:04:34 -0000
> @@ -28,6 +28,19 @@ void Ground::getGroundPlane(const double
>      vel[2] = 0.0;
>  }
>  
> +void Ground::getGroundPlane(const double pos[3],
> +                              double plane[4], float vel[3],
> +                              int *type,
> +                              double *frictionFactor, 
> +                              double *rollingFriction,
> +                              double *loadCapacity,
> +                              double *loadResistance,
> +                              double *bumpiness,
> +                              bool *isSolid)
> +{
> +    getGroundPlane(pos,plane,vel);
> +}
> +
>  bool Ground::caughtWire(const double pos[4][3])
>  {
>      return false;
> Index: YASim/Ground.hpp
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/YASim/Ground.hpp,v
> retrieving revision 1.1
> diff -u -p -r1.1 Ground.hpp
> --- YASim/Ground.hpp  17 Feb 2005 10:37:26 -0000      1.1
> +++ YASim/Ground.hpp  21 Dec 2006 01:04:34 -0000
> @@ -11,6 +11,16 @@ public:
>      virtual void getGroundPlane(const double pos[3],
>                                  double plane[4], float vel[3]);
>  
> +    virtual void getGroundPlane(const double pos[3],
> +                              double plane[4], float vel[3],
> +                              int *type,
> +                              double *frictionFactor, 
> +                              double *rollingFriction,
> +                              double *loadCapacity,
> +                              double *loadResistance,
> +                              double *bumpiness,
> +                              bool *isSolid);
> +
>      virtual bool caughtWire(const double pos[4][3]);
>  
>      virtual bool getWire(double end[2][3], float vel[2][3]);
> Index: YASim/Model.cpp
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/YASim/Model.cpp,v
> retrieving revision 1.13
> diff -u -p -r1.13 Model.cpp
> --- YASim/Model.cpp   14 Sep 2006 18:18:33 -0000      1.13
> +++ YASim/Model.cpp   21 Dec 2006 01:04:36 -0000
> @@ -307,8 +307,26 @@ void Model::updateGround(State* s)
>          // Ask for the ground plane in the global coordinate system
>          double global_ground[4];
>          float global_vel[3];
> -        _ground_cb->getGroundPlane(pt, global_ground, global_vel);
> -        g->setGlobalGround(global_ground, global_vel);
> +        int type;
> +        double frictionFactor, rollingFriction, loadCapacity,
> +               loadResistance, bumpiness;
> +        bool isSolid;
> +        //_ground_cb->getGroundPlane(pt, global_ground, global_vel);
> +        _ground_cb->getGroundPlane(pt, global_ground, global_vel,
> +                              &type,&frictionFactor, &rollingFriction,
> +                              &loadCapacity, 
> &loadResistance,&bumpiness,&isSolid);
> +        static int h=0;
> +        /*
> +        if (h++>100)
> +        {
> +            cout<<"t:"<<type<<"fF:"<<frictionFactor<<"rF:"<<rollingFriction
> +            <<"lC:"<<loadCapacity<<"lR"<<loadResistance<<"b:"<<bumpiness<<"  
>   \r";
> +            h=0;
> +        }
> +        */
> +        g->setGlobalGround(global_ground, global_vel, pt[0], pt[1],type,
> +            frictionFactor, rollingFriction, loadCapacity, loadResistance,
> +            bumpiness,isSolid);
>      }
>      for(i=0; i<_rotorgear.getRotors()->size(); i++) {
>          Rotor* r = (Rotor*)_rotorgear.getRotors()->get(i);
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________ Flightgear-devel mailing list 
> Flightgear-devel@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to