- Timestamp:
- May 23, 2011, 11:26:08 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup/src/modules/pickup/items/ShrinkPickup.cc
r8535 r8554 51 51 CreateFactory(ShrinkPickup); 52 52 53 53 /** 54 54 @brief 55 55 Constructor: Initializes the Pickup. … … 60 60 61 61 this->initialize(); 62 this->shrinkFactor_ = 5.0; 63 this->shrinkSpeed_ = 5.0; 64 this->duration_ = 5.0; 62 65 isActive_ = false; 63 66 isTerminating_ = false; … … 92 95 /** 93 96 @brief 94 Method for creating a HealthPickup object through XML.97 Method for creating a ShrinkhPickup object through XML. 95 98 */ 96 99 void ShrinkPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode) … … 143 146 } 144 147 145 148 /** 146 149 @brief 147 150 Prepares for shrinking (collecting several informations). … … 153 156 if(this->isUsed()) 154 157 { 155 this->pawn = this->carrierToPawnHelper();156 if(pawn == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed.158 this->pawn_ = this->carrierToPawnHelper(); 159 if(pawn_ == NULL) // If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 157 160 this->Pickupable::destroy(); 158 161 159 162 //Collect scaling information. 160 defaultScale_ = this->pawn ->getScale3D();161 defaultMass_ = this->pawn ->getMass();163 defaultScale_ = this->pawn_->getScale3D(); 164 defaultMass_ = this->pawn_->getMass(); 162 165 163 166 smallScale_ = defaultScale_ / shrinkFactor_; … … 167 170 actualMass_ = defaultMass_; 168 171 169 cameraPositions_ = this->pawn ->getCameraPositions();172 cameraPositions_ = this->pawn_->getCameraPositions(); 170 173 size_ = cameraPositions_.size(); 171 174 isActive_ = true; //start shrinking now. 172 durationTimer .setTimer(duration_, false, createExecutor(createFunctor(&ShrinkPickup::terminate, this))); //Set timer for termination.175 durationTimer_.setTimer(duration_, false, createExecutor(createFunctor(&ShrinkPickup::terminate, this))); //Set timer for termination. 173 176 } 174 177 } 175 178 176 179 /** 177 180 @brief 178 181 Updates the scales of the ship. … … 189 192 actualMass_ /= factor_; 190 193 191 this->pawn ->setScale3D(actualScale_);192 this->pawn ->setMass(actualMass_);194 this->pawn_->setScale3D(actualScale_); 195 this->pawn_->setMass(actualMass_); 193 196 194 197 for(int index = 0; index < size_; index++) 195 198 { 196 CameraPosition* cameraPos_ = this->pawn ->getCameraPosition(index);199 CameraPosition* cameraPos_ = this->pawn_->getCameraPosition(index); 197 200 if(cameraPos_ == NULL) 198 201 continue; … … 209 212 actualMass_ *= factor_; 210 213 211 this->pawn ->setScale3D(actualScale_);212 this->pawn ->setMass(actualMass_);214 this->pawn_->setScale3D(actualScale_); 215 this->pawn_->setMass(actualMass_); 213 216 214 217 for(int index = 0; index < size_; index++) 215 218 { 216 CameraPosition* cameraPos_ = this->pawn ->getCameraPosition(index);219 CameraPosition* cameraPos_ = this->pawn_->getCameraPosition(index); 217 220 if(cameraPos_ == NULL) 218 221 continue; … … 225 228 } 226 229 227 230 /** 228 231 @brief 229 232 Initializes the termination. … … 244 247 } 245 248 246 249 /** 247 250 @brief 248 251 Creates a duplicate of the input OrxonoxClass.
Note: See TracChangeset
for help on using the changeset viewer.