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/objects/SpaceShip.cc

    r1604 r1613  
    4242#include "core/Debug.h"
    4343#include "GraphicsEngine.h"
    44 #include "core/input/InputManager.h"
     44//#include "core/input/InputManager.h"
    4545#include "tools/ParticleInterface.h"
    4646#include "RotatingProjectile.h"
     
    4949#include "core/ConsoleCommand.h"
    5050#include "network/Client.h"
    51 #include "overlays/hud/HUDRadar.h"
    5251
    5352namespace orxonox
     
    133132        this->health_ = 100;
    134133
     134        this->radarObject_ = static_cast<WorldEntity*>(this);
     135
    135136        COUT(3) << "Info: SpaceShip was loaded" << std::endl;
    136137    }
     
    144145            if (this->tt2_)
    145146                delete this->tt2_;
    146 
    147             if (setMouseEventCallback_)
    148                 InputManager::removeMouseHandler("SpaceShip");
    149 
    150147            if (this->cam_)
    151148                delete this->cam_;
    152 
    153             if (!this->myShip_)
    154                 HUDRadar::getInstance().removeRadarObject(this);
    155149        }
    156150    }
     
    161155          myShip_=true;
    162156        else
    163           HUDRadar::getInstance().addRadarObject(this, this->getProjectileColour());
     157          this->setRadarObjectColour(this->getProjectileColour());
    164158      }
    165159      if(Model::create())
Note: See TracChangeset for help on using the changeset viewer.