Changeset 8609 for code/branches/spaceboundaries2/src/orxonox
- Timestamp:
- May 26, 2011, 5:08:09 PM (14 years ago)
- Location:
- code/branches/spaceboundaries2/src/orxonox/worldentities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spaceboundaries2/src/orxonox/worldentities/SpaceBoundaries.cc
r8604 r8609 58 58 this->centerRadar_ = new RadarViewable(this, this); 59 59 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); 67 61 } 68 62 SpaceBoundaries::~SpaceBoundaries() … … 80 74 } 81 75 this->billboards_.clear(); 82 83 delete constBilly; // TO REMOVE (DEBUGGING)84 76 } 85 77 … … 123 115 Billboard *tmp = new Billboard(this); 124 116 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 ); 126 121 billboardAdministration tmp2 = { true, tmp }; 127 122 this->billboards_.push_back( tmp2 ); 128 129 123 } else { 130 124 current->billy->setPosition(position); 131 125 current->billy->setVisible(true); 132 126 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) 137 134 { 138 135 if(billy != NULL) … … 140 137 billy->setMaterial("Grid"); 141 138 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() );145 139 billy->setDefaultDimensions(150, 150); 146 140 billy->setVisible(true); … … 275 269 void SpaceBoundaries::displayWarning(const std::string warnText) 276 270 { 277 271 // TODO 278 272 } 279 273 -
code/branches/spaceboundaries2/src/orxonox/worldentities/SpaceBoundaries.h
r8604 r8609 121 121 122 122 RadarViewable* centerRadar_; //!< Repraesentation von SpaceBoundaries auf dem Radar. 123 124 Billboard* constBilly; // TO REMOVE (DEBUGGING)125 123 126 124 127 125 // Funktionen:: 128 126 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) 130 128 void displayBoundaries(Pawn *item); 131 129 void conditionalBounceBack(Pawn *item, float currentDistance, float dt); … … 136 134 137 135 void positionBillboard(const Vector3 position); //!< Display a Billboard at the position 'position'. 138 void setBillboardOptions(Billboard *billy , Vector3 position);136 void setBillboardOptions(Billboard *billy); 139 137 void removeAllBillboards(); //!< Hide all elements of '*billboard_' and set their attribute 'usedYet' to 0. 140 138
Note: See TracChangeset
for help on using the changeset viewer.