Changeset 1834 for code/branches/network/src/orxonox
- Timestamp:
- Sep 26, 2008, 12:59:48 AM (16 years ago)
- Location:
- code/branches/network/src/orxonox/objects
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/objects/BillboardProjectile.cc
r1747 r1834 42 42 RegisterObject(BillboardProjectile); 43 43 44 if (this->owner_) 45 { 46 this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1); 47 this->attachObject(this->billboard_.getBillboardSet()); 48 this->scale(0.5); 49 } 44 this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1); 45 this->attachObject(this->billboard_.getBillboardSet()); 46 this->scale(0.5); 50 47 } 51 48 -
code/branches/network/src/orxonox/objects/ParticleProjectile.cc
r1747 r1834 42 42 RegisterObject(ParticleProjectile); 43 43 44 this->particles_ = new ParticleInterface("Orxonox/shot2", LODParticle::normal); 45 this->particles_->addToSceneNode(this->getNode()); 46 this->particles_->setKeepParticlesInLocalSpace(true); 44 47 if (this->owner_) 45 48 { 46 this->particles_ = new ParticleInterface("Orxonox/shot2", LODParticle::normal);47 this->particles_->addToSceneNode(this->getNode());48 this->particles_->getAllEmitters()->setDirection(-this->owner_->getInitialDir());49 this->particles_->setKeepParticlesInLocalSpace(true);50 49 } 51 else52 {53 this->particles_ = 0;54 }50 // else 51 // { 52 // this->particles_ = 0; 53 // } 55 54 56 55 this->setConfigValues(); … … 73 72 this->particles_->setEnabled(this->isVisible()); 74 73 } 74 75 bool ParticleProjectile::create(){ 76 if(!Projectile::create()) 77 return false; 78 this->particles_->getAllEmitters()->setDirection(-this->getOrientation()*Vector3(1,0,0)); 79 return true; 80 } 75 81 } -
code/branches/network/src/orxonox/objects/ParticleProjectile.h
r1747 r1834 45 45 virtual void changedVisibility(); 46 46 void setConfigValues(); 47 48 virtual bool create(); 47 49 48 50 private: -
code/branches/network/src/orxonox/objects/Projectile.cc
r1747 r1834 54 54 this->smokeTemplateName_ = "Orxonox/smoke4"; 55 55 56 this->setStatic(false); 57 this->translate(Vector3(55, 0, 0), Ogre::Node::TS_LOCAL); 58 56 59 if (this->owner_) 57 60 { 58 this->setStatic(false);59 61 this->setOrientation(this->owner_->getOrientation()); 60 62 this->setPosition(this->owner_->getPosition()); 61 this->translate(Vector3(55, 0, 0), Ogre::Node::TS_LOCAL);62 63 this->setVelocity(this->owner_->getInitialDir() * this->speed_); 63 64 } … … 121 122 delete this; 122 123 } 124 125 bool Projectile::create(){ 126 return WorldEntity::create(); 127 } 123 128 } -
code/branches/network/src/orxonox/objects/Projectile.h
r1747 r1834 45 45 void destroyObject(); 46 46 virtual void tick(float dt); 47 48 virtual bool create(); 47 49 48 50 static float getSpeed() -
code/branches/network/src/orxonox/objects/SpaceShip.cc
r1772 r1834 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(network::Host::running()) 174 174 // COUT(3) << "this id: " << this->objectID << " myShipID: " << network::Host::getShipID() << std::endl; 175 if(network::Host::running() && objectID== network::Host::getShipID()){175 if(network::Host::running() && getObjectID() == network::Host::getShipID()){ 176 176 if(!network::Host::isServer()) 177 177 setObjectMode(0x3); … … 375 375 if(this->isExactlyA(Class(SpaceShip))){ 376 376 getFocus(); 377 COUT(3) << "getting focus for obj id: " << objectID<< std::endl;377 COUT(3) << "getting focus for obj id: " << getObjectID() << std::endl; 378 378 }else 379 COUT(3) << "not getting focus (not exactly spaceship) for obj id: " << objectID<< std::endl;379 COUT(3) << "not getting focus (not exactly spaceship) for obj id: " << getObjectID() << std::endl; 380 380 }else 381 COUT(3) << "not getting focus (not my ship) for obj id: " << objectID<< std::endl;381 COUT(3) << "not getting focus (not my ship) for obj id: " << getObjectID() << std::endl; 382 382 } 383 383 … … 475 475 projectile->setColour(this->getProjectileColour()); 476 476 projectile->create(); 477 if (projectile-> classID== 0)477 if (projectile->getClassID() == 0) 478 478 { 479 479 COUT(3) << "generated projectile with classid 0" << std::endl; // TODO: remove this output … … 570 570 } 571 571 572 COUT(5) << "steering our ship: " << objectID<< std::endl;572 COUT(5) << "steering our ship: " << getObjectID() << std::endl; 573 573 this->acceleration_.x = 0; 574 574 this->acceleration_.y = 0;
Note: See TracChangeset
for help on using the changeset viewer.