Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 8, 2009, 11:48:52 AM (14 years ago)
Author:
scheusso
Message:

radar working again (also focus incl. cycleNavigationFocus)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/modules/overlays/hud/HUDNavigation.cc

    r5929 r6273  
    4141#include "Scene.h"
    4242#include "Radar.h"
     43#include "controllers/HumanController.h"
     44#include "worldentities/pawns/Pawn.h"
    4345
    4446namespace orxonox
     
    253255    float HUDNavigation::getDist2Focus() const
    254256    {
    255 /*
    256         if (Radar::getInstance().getFocus())
    257             return (Radar::getInstance().getFocus()->getRVWorldPosition() - SpaceShip::getLocalShip()->getPosition()).length();
    258         else
    259 */
     257        Radar* radar = this->getOwner()->getScene()->getRadar();
     258        if (radar->getFocus() && HumanController::getLocalControllerEntityAsPawn())
     259            return (radar->getFocus()->getRVWorldPosition() - HumanController::getLocalControllerEntityAsPawn()->getWorldPosition()).length();
     260        else
    260261            return 0;
    261262    }
Note: See TracChangeset for help on using the changeset viewer.