Menu

Getting information about the track barriers

Help
Anonymous
2013-03-08
2013-04-13
  • Anonymous

    Anonymous - 2013-03-08

    Hi,
    actually I want to get the position information of the barriers (as global or local coordinates).
    But I don't know how to get this information.

    I use the track information in racesituation.cpp (pCurrReInfo->track…).
    I build up a loop, so that every change in s->cars->pub.trkpos.seg->id make an output of  current_segment->style, but the output only delivers 0 and 1 (TR_PLAN, TR_CURB) but no information about TR_WALL or any other barriers.

    How can I get this information?
    Why is there no segment of type TR_WALL or any other barrier?

    Here is the code in function  void ReSituationUpdater::runOneStep

    tTrackSeg* trk = current->side[0];  
    if(trk->style == TR_WALL)
            do_anything();
    if(s->cars[ego]->pub.trkPos.seg->id!=id_old)
    {
        GfOut("ID: %d\n",s->cars[human]->pub.trkPos.seg->id);
        GfOut("Style: %d\n",trk->style);
        current=current->next;
        id_old=s->cars[ego]->pub.trkPos.seg->id;
    }
    

    And current is initialized in void ReSituationUpdater::start()

    current=ReSituation::self().data()->track->seg;
    

    I hope that anyone can help me, I spend already a lot of time to this problem…

     
  • Jean-Philippe Meuret

    From Wolf-Dieter :

    This depends on the track!

    Well I assume that the first side does not contain walls .

    There are more sides at each side of the track. The sides are handled as linked list.
    See simplix code

    unittrack.cpp - TTrackDescription::InitTrack(…)

    for (int S = 0; S  < 2; S++)
    {

       (Have a look at TR_WALL in this loop)

    Cheers

    Wolf-Dieter

     

Log in to post a comment.