Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8609 for code


Ignore:
Timestamp:
May 26, 2011, 5:08:09 PM (14 years ago)
Author:
kmaurus
Message:

endversion

Location:
code/branches/spaceboundaries2/src/orxonox/worldentities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/spaceboundaries2/src/orxonox/worldentities/SpaceBoundaries.cc

    r8604 r8609  
    5858        this->centerRadar_ = new RadarViewable(this, this);
    5959        this->centerRadar_->setRadarObjectShape(RadarViewable::Dot);
    60         this->centerRadar_->setRadarVisibility(false);\
    61        
    62         // FOLGENDER BLOCK: TO REMOVE (DEBUGGING)
    63         constBilly = new Billboard(this);
    64         Vector3 pos = Vector3(-10, -10, -10);
    65         constBilly->setPosition(pos);
    66         setBillboardOptions(constBilly, pos);
     60        this->centerRadar_->setRadarVisibility(false);
    6761    }
    6862    SpaceBoundaries::~SpaceBoundaries()
     
    8074        }
    8175        this->billboards_.clear();
    82        
    83         delete constBilly; // TO REMOVE (DEBUGGING)
    8476    }
    8577   
     
    123115            Billboard *tmp = new Billboard(this);
    124116            tmp->setPosition(position);
    125             this->setBillboardOptions( tmp, position);
     117            this->setBillboardOptions( tmp );
     118            Vector3 normalisedVec = (position - this->getPosition()).normalisedCopy(); /* Vektor von Kugelmitte nach aussen */
     119            tmp->setCommonDirection ( -1.0 * normalisedVec );
     120            tmp->setCommonUpVector( Vector3::UNIT_Z );
    126121            billboardAdministration tmp2 = { true, tmp };
    127122            this->billboards_.push_back( tmp2 );
    128            
    129123        } else {
    130124            current->billy->setPosition(position);
    131125            current->billy->setVisible(true);
    132126            current->usedYet = true;
    133         }
    134     }
    135    
    136     void SpaceBoundaries::setBillboardOptions(Billboard *billy, Vector3 position)
     127            Vector3 normalisedVec = (position - this->getPosition()).normalisedCopy(); /* Vektor von Kugelmitte nach aussen */
     128            current->billy->setCommonDirection ( -1.0 * normalisedVec );
     129            current->billy->setCommonUpVector( Vector3::UNIT_Z );
     130        }
     131    }
     132   
     133    void SpaceBoundaries::setBillboardOptions(Billboard *billy)
    137134    {
    138135        if(billy != NULL)
     
    140137            billy->setMaterial("Grid");
    141138            billy->setBillboardType(Ogre::BBT_PERPENDICULAR_COMMON);
    142             Vector3 normalisedVec = (position - this->getPosition()).normalisedCopy(); /* Vektor von Kugelmitte nach aussen */
    143             billy->setCommonDirection ( -1.0 * normalisedVec );
    144             billy->setCommonUpVector( Vector3::UNIT_Z ); // (normalisedVec.crossProduct(Vector3::UNIT_X)).normalisedCopy() );
    145139            billy->setDefaultDimensions(150, 150);
    146140            billy->setVisible(true);
     
    275269    void SpaceBoundaries::displayWarning(const std::string warnText)
    276270    {   
    277        
     271        // TODO
    278272    }
    279273   
  • code/branches/spaceboundaries2/src/orxonox/worldentities/SpaceBoundaries.h

    r8604 r8609  
    121121           
    122122            RadarViewable* centerRadar_; //!< Repraesentation von SpaceBoundaries auf dem Radar.
    123            
    124             Billboard* constBilly; // TO REMOVE (DEBUGGING)
    125123       
    126124       
    127125            // Funktionen::
    128126            float computeDistance(WorldEntity *item); //!< Auf den Mittelpunkt 'this->getPosition()' bezogen.
    129             void displayWarning(const std::string warnText); //!< Einen Warntext auf dem Bildschirm ausgeben. (noch nicht implementiert)
     127            void displayWarning(const std::string warnText); //!< Einen Warntext auf dem Bildschirm ausgeben. (noch nicht implementiert, TODO)
    130128            void displayBoundaries(Pawn *item);
    131129            void conditionalBounceBack(Pawn *item, float currentDistance, float dt);
     
    136134           
    137135            void positionBillboard(const Vector3 position); //!< Display a Billboard at the position 'position'.
    138             void setBillboardOptions(Billboard *billy, Vector3 position);
     136            void setBillboardOptions(Billboard *billy);
    139137            void removeAllBillboards(); //!< Hide all elements of '*billboard_' and set their attribute 'usedYet' to 0.
    140138           
Note: See TracChangeset for help on using the changeset viewer.