* Vivian Meazza -- Saturday 18 June 2005 12:22:
> void Thruster::setThrottle(float throttle)
> {
>     _throttle = Math::clamp(throttle, 0, 1);
> }
> 
> Will this prevent a negative value for:
> 
> <control-input axis="/controls/engines/engine[0]/boost-control"
> control="THROTTLE"/> 

No, but this will:

ControlMap.cpp:83:----------------------------------------------------

      map->src0 = map->dst0 = rangeMin(type);


ControlMap.cpp:222:---------------------------------------------------

float ControlMap::rangeMin(int type)
{
    // The minimum of the range for each type of control
    switch(type) {
    case FLAP0:    return -1;  // [-1:1]
    case FLAP1:    return -1;
    case STEER:    return -1;
    case CYCLICELE: return -1;
    case CYCLICAIL: return -1;
    case COLLECTIVE: return -1;
    case MAGNETOS: return 0;   // [0:3]
    default:       return 0;   // [0:1]
    }
}


There's no THROTTLE, so we get the default 0 set for map->{src,dst}0.
You can avoid that by setting {src,dst}{0,1} explicitly, for example:

   <control-input axis="/controls/engines/engine[0]/boost-control"
                  src0="-1" src1="1" dst0="-1" dst1="1" control="THROTTLE"/>

m.

_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to