Help with GAP time

Discussion in 'Plugins' started by korrea, Mar 11, 2012.

  1. korrea

    korrea Registered

    Joined:
    Feb 29, 2012
    Messages:
    8
    Likes Received:
    0
    Hi!

    I would like make an application for get GAP time. For this task, I think know the position pilot car in the track. Rfactor/Rfactor2 set X/Y/Z world position but I would get % lap traveled. Is there any way to get this information?

    Thanks!
     
  2. vyrush

    vyrush Registered

    Joined:
    Jan 9, 2012
    Messages:
    210
    Likes Received:
    3
    I dont know wat exactly you mean..rfactor already has gap/difference parameters..
    but probably you could use the dist variable, you can easily get the % of a given lap..
     
  3. korrea

    korrea Registered

    Joined:
    Feb 29, 2012
    Messages:
    8
    Likes Received:
    0
    I need GAP in real time, no GAP un sectors.

    Thanx!
     
  4. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    I think those values can be found in the plugin?

    Code:
    struct VehicleScoringInfoV01
    {
      // ....
    
      // Dash Indicators
      double mTimeBehindNext;        // time behind vehicle in next higher place
      long mLapsBehindNext;          // laps behind vehicle in next higher place
      double mTimeBehindLeader;      // time behind leader
      long mLapsBehindLeader;        // laps behind leader
      double mLapStartET;            // time this lap was started
    };
    
     
  5. vyrush

    vyrush Registered

    Joined:
    Jan 9, 2012
    Messages:
    210
    Likes Received:
    3
    yup that's wat actually i was telling.. its already in real-time..
     
  6. korrea

    korrea Registered

    Joined:
    Feb 29, 2012
    Messages:
    8
    Likes Received:
    0
    Mmmmm I didn't find this variable... is mlapdist??

    Thanx!
     
  7. Frank Geyer

    Frank Geyer Registered

    Joined:
    Oct 5, 2010
    Messages:
    222
    Likes Received:
    3
    You will find this in a file called "Example.cpp" ...
     
  8. korrea

    korrea Registered

    Joined:
    Feb 29, 2012
    Messages:
    8
    Likes Received:
    0

    But this is the GAP between my car and Next or Leader car, no GAP time between my actual lap time and my best lap time. For this task, I need the actual position in meters or % of a given lap.

    Sorry if I explain it wrong...
     
    Last edited by a moderator: Mar 12, 2012
  9. Frank Geyer

    Frank Geyer Registered

    Joined:
    Oct 5, 2010
    Messages:
    222
    Likes Received:
    3
    You have to "cache" to current absolute top lap time(s) taken from best lap values and then calculate it accordingly ... if I get you right this time !?!?
     
  10. korrea

    korrea Registered

    Joined:
    Feb 29, 2012
    Messages:
    8
    Likes Received:
    0
    Yes Frank. In other sims, like iRacing, SDK send you a % of a given lap. From this variable, I set two hastables: one with the best lap time and another with the current time. The GAP is, for the same % of a given lap, the diference between two times.

    For this reason, I'm looking for the % or something similar to use the same code.

    Thanks!
     
  11. Frank Geyer

    Frank Geyer Registered

    Joined:
    Oct 5, 2010
    Messages:
    222
    Likes Received:
    3
    ... I don't know much about iRacing regarding its SDK, but you have to do the calculation with the values available by the plugin. As far as I know there is no direct %-value giving you this gap you are looking for ...
     

Share This Page