Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9257 for code/trunk


Ignore:
Timestamp:
May 28, 2012, 12:28:44 PM (13 years ago)
Author:
landauf
Message:

renamed RVName to radarname
cast to RadarViewable instead of SpaceShip to set the name (in PlayerInfo)

Location:
code/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/data/levels/missionOne.oxw

    r9016 r9257  
    509509
    510510<!-- @Objects: 4 boxes (uncontrolled pawns) -->
    511     <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >
     511    <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Box 4" >
    512512        <events>
    513513          <visibility>
     
    523523    </Pawn>
    524524
    525     <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 3">
     525    <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Box 3">
    526526        <events>
    527527          <visibility>
     
    537537    </Pawn>
    538538
    539     <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 2">
     539    <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 radarname = "Box 2">
    540540        <events>
    541541          <visibility>
     
    551551    </Pawn>
    552552
    553     <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 1">
     553    <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 radarname = "Box 1">
    554554        <events>
    555555          <visibility>
     
    635635
    636636<!-- @Objects: 2 pirates moving in squares, nonlethal -->
    637                 <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" RVName="Pirate">
     637                <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" radarname="Pirate">
    638638                            <events>
    639639                                <visibility>
     
    656656                </SpaceShip>
    657657
    658                 <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget" RVName="Pirate">
     658                <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget" radarname="Pirate">
    659659                            <events>
    660660                                <visibility>
     
    977977<!-- @Objects: HYDROGEN FARMER & DOCKING -->
    978978    <SpaceShip
    979         team     = 0
    980         position = "-48900,100,0"
    981         roll     = 90   yaw=0  pitch=20
    982         mass     = 10000
    983         health   = 100000 initialhealth=100000 maxhealth="100000"
    984         name     = "HydroFarmer"
    985         RVName  = "Hydrogen Farmer" >
     979        team      = 0
     980        position  = "-48900,100,0"
     981        roll      = 90   yaw=0  pitch=20
     982        mass      = 10000
     983        health    = 100000 initialhealth=100000 maxhealth="100000"
     984        name      = "HydroFarmer"
     985        radarname = "Hydrogen Farmer" >
    986986      <attached>
    987987        <!-- Docking -->
     
    10661066        reloadwaittime      = "1"
    10671067        name                = "cruiser"
    1068         RVName              = "Spacecruiser" >
     1068        radarname           = "Spacecruiser" >
    10691069      <attached>
    10701070        <DockingTarget name="spaceShip" />
  • code/trunk/data/levels/underAttack.oxw

    r9016 r9257  
    5656      maxhealth         = 10000
    5757      initialhealth     = 10000
    58       RVName            = "Transporter"
     58      radarname         = "Transporter"
    5959    >
    6060
  • code/trunk/src/modules/overlays/hud/HUDNavigation.cc

    r9016 r9257  
    7979    this->setTextSize ( 0.05f );
    8080    this->setNavMarkerSize ( 0.05f );
    81     this->setDetectionLimit( 10000.0f ); 
     81    this->setDetectionLimit( 10000.0f );
    8282}
    8383
     
    101101    XMLPortParam ( HUDNavigation, "textSize",      setTextSize,      getTextSize,      xmlelement, mode );
    102102    XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode );
    103     XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode ); 
     103    XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode );
    104104}
    105105
     
    146146
    147147float HUDNavigation::getArrowSizeX(int dist)
    148 {   
    149     if (dist < 600) 
     148{
     149    if (dist < 600)
    150150        dist = 600;
    151151    return this->getActualSize().x * 900 * navMarkerSize_ / dist;
     
    153153
    154154float HUDNavigation::getArrowSizeY(int dist)
    155 {   
     155{
    156156    if (dist < 600)
    157         dist = 600;   
     157        dist = 600;
    158158    return this->getActualSize().y * 900 * navMarkerSize_ / dist;
    159159}
     
    184184        ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
    185185        closeEnough_ = listIt->second < detectionLimit_ ;
    186         // display radarviewables on HUD if the marker limit and max-distance is not exceeded 
    187         if ( markerCount_ < markerLimit_ && (closeEnough_ ||  detectionLimit_ < 0) ) 
     186        // display radarviewables on HUD if the marker limit and max-distance is not exceeded
     187        if ( markerCount_ < markerLimit_ && (closeEnough_ ||  detectionLimit_ < 0) )
    188188        {
    189189
     
    201201            //display name next to cursor
    202202            else{
    203             it->second.text_->setCaption(it->first->getRVName());
    204             textLength = it->first->getRVName().size() * it->second.text_->getCharHeight() * 0.3f;
     203            it->second.text_->setCaption(it->first->getRadarName());
     204            textLength = it->first->getRadarName().size() * it->second.text_->getCharHeight() * 0.3f;
    205205            }
    206206
     
    311311            it->second.text_->show();
    312312        }
    313         else // do not display on HUD 
     313        else // do not display on HUD
    314314        {
    315315            it->second.panel_->hide();
  • code/trunk/src/orxonox/infos/PlayerInfo.cc

    r9016 r9257  
    3636#include "worldentities/ControllableEntity.h"
    3737#include "controllers/Controller.h"
    38 #include "worldentities/pawns/SpaceShip.h"
     38#include "interfaces/RadarViewable.h"
    3939
    4040namespace orxonox
     
    5858
    5959        this->registerVariables();
    60        
     60
    6161    }
    6262
     
    154154        while (this->previousControllableEntity_.size() > 0)
    155155            this->stopTemporaryControl();
    156        
     156
    157157        if (this->controllableEntity_)
    158158            this->stopControl();
     
    172172
    173173        this->changedControllableEntity();
    174                 SpaceShip* spaceship = dynamic_cast<SpaceShip*>(entity);
    175         if (spaceship != NULL)
    176         {
    177             spaceship->setRVName(this->getName());
    178         }
     174
     175                RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity);
     176        if (radarviewable != NULL)
     177            radarviewable->setRadarName(this->getName());
    179178    }
    180179
     
    244243        if(this->isHumanPlayer()) // TODO: Multiplayer?
    245244            this->controllableEntity_->destroyHud(); // HACK-ish
    246        
     245
    247246//        this->controllableEntity_ = this->previousControllableEntity_.back();
    248247        do {
  • code/trunk/src/orxonox/interfaces/RadarViewable.cc

    r9016 r9257  
    5151        , radarObjectDescription_("staticObject")
    5252        , scale_(1.0f)
    53                 , RVName("")
    5453    {
    5554        RegisterRootObject(RadarViewable);
  • code/trunk/src/orxonox/interfaces/RadarViewable.h

    r9016 r9257  
    6161        virtual ~RadarViewable();
    6262
    63                 virtual void setRVName(std::string name)
     63                virtual void setRadarName(const std::string& name)
    6464                        {
    65                                 if (this->RVName != name)
     65                                if (this->radarName_ != name)
    6666                                {
    67                                         this->RVName = name;
     67                                        this->radarName_ = name;
    6868                                        this->settingsChanged();
    6969                                }
    7070                        }
    71                 std::string getRVName() const
    72                         { return this->RVName; }
     71                const std::string& getRadarName() const
     72                        { return this->radarName_; }
    7373
    7474        inline void setRadarObjectCamouflage(float camouflage)
     
    163163        ColourValue radarObjectColour_;
    164164        float scale_;
    165                 std::string RVName;
     165                std::string radarName_;
    166166    };
    167167}
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r9254 r9257  
    130130        XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f);
    131131
    132         XMLPortParam ( RadarViewable, "RVName", setRVName, getRVName, xmlelement, mode );
     132        XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
    133133    }
    134134
Note: See TracChangeset for help on using the changeset viewer.