Changeset 1907 for code/trunk/src/orxonox/objects/SpaceShip.cc
- Timestamp:
- Oct 12, 2008, 7:40:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/SpaceShip.cc
r1789 r1907 78 78 for(it = ObjectList<SpaceShip>::begin(); it; ++it){ 79 79 assert(it->isA(Class(SpaceShip))); 80 if( (it)->myShip_ || (network::Host::running() && network::Host::getShipID()==(it)-> objectID) ){80 if( (it)->myShip_ || (network::Host::running() && network::Host::getShipID()==(it)->getObjectID()) ){ 81 81 // COUT(1) << "^^^^^^^^^^ myShip_:" << *it << " classname: " << (*it)->getIdentifier()->getName() << " objectid: " << (*it)->objectID << std::endl; 82 82 return *it; … … 173 173 if (!myShip_) 174 174 { 175 if (network::Host::running()) 176 //COUT(3) << "this id: " << this->objectID << " myShipID: " << network::Host::getShipID() << std::endl; 177 if (network::Host::running() && objectID == network::Host::getShipID()) 178 { 179 if (!network::Host::isServer()) 180 setObjectMode(0x3); 181 myShip_ = true; 182 } 183 } 184 else 185 this->setRadarObjectColour(this->getProjectileColour()); 186 assert(Model::create()); 187 this->init(); 188 return true; 175 if (network::Host::running() && getObjectID() == network::Host::getShipID()) 176 { 177 if (!network::Host::isServer()) 178 setObjectMode(0x3); 179 myShip_ = true; 180 } 181 else 182 this->setRadarObjectColour(this->getProjectileColour()); 183 } 184 Model::create(); 185 this->init(); 186 return true; 189 187 } 190 188 … … 258 256 259 257 // START CREATING ADDITIONAL EFFECTS 260 /*this->backlight_ = new Backlight(this->maxSpeed_, 0.8); 261 this->attachObject(this->backlight_); 262 this->backlight_->setPosition(-2.35, 0, 0.2); 263 this->backlight_->setColour(this->getProjectileColour()); 264 265 this->smoke_ = new ParticleSpawner(); 266 this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3); 267 this->attachObject(this->smoke_); 268 269 this->fire_ = new ParticleSpawner(); 270 this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1); 271 this->attachObject(this->fire_); 272 */ 258 if(!network::Host::running()){ 259 this->backlight_ = new Backlight(this->maxSpeed_, 0.8); 260 this->backlight_->create(); 261 this->attachObject(this->backlight_); 262 this->backlight_->setPosition(-2.35, 0, 0.2); 263 this->backlight_->setColour(this->getProjectileColour()); 264 265 this->smoke_ = new ParticleSpawner(); 266 this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3); 267 this->attachObject(this->smoke_); 268 269 this->fire_ = new ParticleSpawner(); 270 this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1); 271 this->attachObject(this->fire_); 272 } 273 273 274 // END CREATING ADDITIONAL EFFECTS 274 275 … … 374 375 //if(!network::Host::running() || network::Host::getShipID()==objectID){ //TODO: check this 375 376 if(myShip_){ 376 COUT( 4) << "requesting focus for camera" << std::endl;377 COUT(5) << "requesting focus for camera" << std::endl; 377 378 //CameraHandler::getInstance()->requestFocus(cam_); 378 379 if(this->isExactlyA(Class(SpaceShip))){ 379 380 getFocus(); 380 COUT(4) << "getting focus for obj id: " << objectID<< std::endl;381 COUT(4) << "getting focus for obj id: " << getObjectID() << std::endl; 381 382 }else 382 COUT( 4) << "not getting focus (not exactly spaceship) for obj id: " << objectID<< std::endl;383 COUT(5) << "not getting focus (not exactly spaceship) for obj id: " << getObjectID() << std::endl; 383 384 }else 384 COUT( 4) << "not getting focus (not my ship) for obj id: " << objectID<< std::endl;385 COUT(5) << "not getting focus (not my ship) for obj id: " << getObjectID() << std::endl; 385 386 } 386 387 … … 478 479 projectile->setColour(this->getProjectileColour()); 479 480 projectile->create(); 480 if (projectile-> classID== 0)481 if (projectile->getClassID() == 0) 481 482 { 482 483 COUT(3) << "generated projectile with classid 0" << std::endl; // TODO: remove this output … … 573 574 } 574 575 575 COUT(5) << "steering our ship: " << objectID<< std::endl;576 COUT(5) << "steering our ship: " << getObjectID() << std::endl; 576 577 this->acceleration_.x = 0; 577 578 this->acceleration_.y = 0;
Note: See TracChangeset
for help on using the changeset viewer.