Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 20, 2008, 12:05:12 AM (16 years ago)
Author:
rgrieder
Message:
  • Radar now working like before
  • but more of a svn save..

There is class called Radar which takes care of the focus and all objects that can be displayed on a Radar.
The actual visual implementation is in HUDRadar.
To make a object radar viewable, simply implement RadarViewable and set the WorldEntitiy pointer in the constructor (assertation will fail otherwise!).
You can also set a camouflage value between 0 and 1 that tells how good a radar can see an object.
The HUDRadar (or another one) on the other side has a sensitivity between 0 and 1. So only if the sensitivity is higher than the camouflage value, the object gets displayed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud/src/orxonox/Orxonox.cc

    r1604 r1613  
    7676#include "GraphicsEngine.h"
    7777#include "Settings.h"
     78#include "Radar.h"
    7879
    7980// globals for the server or client
     
    99100    , startLevel_(0)
    100101    , hud_(0)
     102    , radar_(0)
    101103    //, auMan_(0)
    102104    , timer_(0)
     
    126128      delete this->hud_;
    127129
     130    if (this->radar_)
     131      delete this->radar_;
     132
    128133    Loader::close();
    129134    //if (this->auMan_)
     
    342347    // Load the HUD
    343348    COUT(3) << "Orxonox: Loading HUD" << std::endl;
    344 
    345349    hud_ = new Level(Settings::getDataPath() + "overlay/hud.oxo");
    346350    Loader::load(hud_);
     351
     352    // Start the Radar
     353    this->radar_ = new Radar();
    347354
    348355    return true;
Note: See TracChangeset for help on using the changeset viewer.