SOLVED Need help calculating relativ time to cars around me

Discussion in 'Plugins' started by Martin Vindis, Nov 21, 2016.

  1. Martin Vindis

    Martin Vindis Registered

    Joined:
    Apr 15, 2014
    Messages:
    146
    Likes Received:
    98
    As the title says I'm trying to calculate the relative time to the cars around me but I just can't figure it out. Everything I've tried gives me big fluctuations when one car hits a brake zone etc.

    mTimeBehindNext and mTimeBehindLeader in the VehicleScoringInfoV01 struct does it nicely but that only gives me time as long as we're on the same lap. Would love to know the equation behind it tho.

    Any math heads around here willing to help out?
     
  2. Martin Vindis

    Martin Vindis Registered

    Joined:
    Apr 15, 2014
    Messages:
    146
    Likes Received:
    98
    Solved by reading the comment off mTimeIntoLap, it actually returns an estimation of your time in to lap instead of the exact time in to the lap. Thanks ISI.
     
  3. Ozzy

    Ozzy Registered

    Joined:
    Dec 18, 2013
    Messages:
    277
    Likes Received:
    26
    If the fluctuations are your only problem, I would remember the last n values and calculate the mean between them. Or did I misunderstood something here?
     

Share This Page