Re: [xmoto-dev] change of engine speed counter algorithm

[ Thread Index | Date Index | More lists.tuxfamily.org/xmoto-dev Archives ]


Hum,
you changed my function float PlayerBiker::getBikeEngineSpeed()
which really compute getBikeEngineSpeed(), you should create a new one for your
computing.
Moreover,

/* protection against invalid values */
if (speed > 400)
return 0;

please don't put it in this function, but over in the code at the draw level. It
must not appear here, it's not logic (i suppose it's to protect the drawing ?).

Nicolas

Quoting Janek Polak <benetnash@xxxxxxxxxxxxxx>:

> Hi!
>
> I've changed algorithm of engine speed counter. Currently speed it's
> computed using wheels angular velocity. IMO it's rather poor method so
> I've changed it to measuring linear velocity by substracting last bike
> position from current position. Now speed counter behaves slightly
> better (I hope ;) )
> Enjoy!
>
>
>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/