Changeset 633
- Timestamp:
- Dec 19, 2007, 1:30:47 AM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/CMakeLists.txt
r612 r633 34 34 objects/SpaceShip.cc 35 35 objects/NPC.cc 36 objects/BillboardSet.cc 37 objects/Light.cc 36 38 ) 37 39 ELSE(WIN32) -
code/branches/FICN/src/orxonox/objects/CMakeLists.txt
r608 r633 18 18 SpaceShip.cc 19 19 NPC.cc 20 BillboardSet.cc 21 Light.cc 20 22 ) 21 23 -
code/branches/FICN/src/orxonox/objects/Mesh.cc
r614 r633 17 17 std::ostringstream name; 18 18 name << (Mesh::meshCounter_s++); 19 this->entity_ = Orxonox::getSingleton()->getSceneManager()->createEntity("Mesh" + name.str() + "gugus", file);19 this->entity_ = Orxonox::getSingleton()->getSceneManager()->createEntity("Mesh" + name.str(), file); 20 20 } 21 21 -
code/branches/FICN/src/orxonox/objects/SpaceShip.cc
r626 r633 48 48 this->setMouseEventCallback_ = false; 49 49 50 this->w = NULL; 51 this->tt = NULL; 50 this->tt_ = 0; 51 this->redNode_ = 0; 52 this->greenNode_ = 0; 53 this->blinkTime_ = 0; 52 54 53 55 this->moveForward_ = 0; … … 91 93 SpaceShip::~SpaceShip() 92 94 { 93 if (w) 94 delete w; 95 if (tt) 96 delete tt; 95 if (tt_) 96 delete tt_; 97 97 } 98 98 … … 109 109 Model::loadParams(xmlElem); 110 110 111 w = new particle::ParticleInterface(Orxonox::getSingleton()->getSceneManager(),"schuss" + this->getName(),"Orxonox/schuss"); 112 w->getParticleSystem()->setParameter("local_space","true"); 113 w->newEmitter(); 111 112 // START CREATING THRUSTER 113 tt_ = new particle::ParticleInterface(Orxonox::getSingleton()->getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow"); 114 tt_->getParticleSystem()->setParameter("local_space","true"); 115 tt_->newEmitter(); 114 116 /* 115 w->setDirection(Vector3(0,0,1));116 w->setPositionOfEmitter(0, Vector3(10,10,0));117 w->setPositionOfEmitter(1, Vector3(-10,10,0));117 tt_->setDirection(Vector3(0,0,1)); 118 tt_->setPositionOfEmitter(0, Vector3(20,-1,-15)); 119 tt_->setPositionOfEmitter(1, Vector3(-20,-1,-15)); 118 120 */ 119 w->setDirection(Vector3(1,0,0)); 120 w->setPositionOfEmitter(0, Vector3(0,10,10)); 121 w->setPositionOfEmitter(1, Vector3(0,-10,10)); 122 123 emitterRate_ = w->getRate(); 124 125 Ogre::SceneNode* node1 = this->getNode()->createChildSceneNode(this->getName() + "particle1"); 126 node1->setInheritScale(false); 127 w->addToSceneNode(node1); 128 129 130 131 tt = new particle::ParticleInterface(Orxonox::getSingleton()->getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow"); 132 tt->getParticleSystem()->setParameter("local_space","true"); 133 tt->newEmitter(); 134 /* 135 tt->setDirection(Vector3(0,0,1)); 136 tt->setPositionOfEmitter(0, Vector3(20,-1,-15)); 137 tt->setPositionOfEmitter(1, Vector3(-20,-1,-15)); 138 */ 139 tt->setDirection(Vector3(-1,0,0)); 140 tt->setPositionOfEmitter(0, Vector3(-15,20,-1)); 141 tt->setPositionOfEmitter(1, Vector3(-15,-20,-1)); 142 tt->setVelocity(50); 121 tt_->setDirection(Vector3(-1,0,0)); 122 tt_->setPositionOfEmitter(0, Vector3(-15,20,-1)); 123 tt_->setPositionOfEmitter(1, Vector3(-15,-20,-1)); 124 tt_->setVelocity(50); 125 126 emitterRate_ = tt_->getRate(); 143 127 144 128 Ogre::SceneNode* node2 = this->getNode()->createChildSceneNode(this->getName() + "particle2"); 145 129 node2->setInheritScale(false); 146 tt->addToSceneNode(node2); 147 130 tt_->addToSceneNode(node2); 131 // END CREATING THRUSTER 132 133 // START CREATING BLINKING LIGHTS 134 this->redBillboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1); 135 this->greenBillboard_.setBillboardSet("Examples/Flare", ColourValue(0.0, 1.0, 0.0), 1); 136 137 this->redNode_ = this->getNode()->createChildSceneNode(this->getName() + "red", Vector3(0.1, 4.6, -0.3)); 138 this->redNode_->setInheritScale(false); 139 this->greenNode_ = this->getNode()->createChildSceneNode(this->getName() + "green", Vector3(0.1, -4.6, -0.3)); 140 this->greenNode_->setInheritScale(false); 141 142 this->redNode_->attachObject(this->redBillboard_.getBillboardSet()); 143 this->redNode_->setScale(0.3, 0.3, 0.3); 144 145 this->greenNode_->attachObject(this->greenBillboard_.getBillboardSet()); 146 this->greenNode_->setScale(0.3, 0.3, 0.3); 147 // END CREATING BLINKING LIGHTS 148 148 149 149 … … 214 214 WorldEntity::tick(dt); 215 215 216 if (this->redNode_ && this->greenNode_) 217 { 218 this->blinkTime_ += dt; 219 float redScale = 0.15 + 0.15 * sin(this->blinkTime_ * 10.0); 220 float greenScale = 0.15 - 0.15 * sin(this->blinkTime_ * 10.0); 221 this->redNode_->setScale(redScale, redScale, redScale); 222 this->greenNode_->setScale(greenScale, greenScale, greenScale); 223 } 224 216 225 OIS::Keyboard* mKeyboard = Orxonox::getSingleton()->getKeyboard(); 217 226 OIS::Mouse* mMouse = Orxonox::getSingleton()->getMouse(); … … 385 394 if (accelerationForward_ > 25.0) 386 395 { 387 this->tt->setRate(emitterRate_);388 } 389 else 390 { 391 this->tt->setRate(0);396 this->tt_->setRate(emitterRate_); 397 } 398 else 399 { 400 this->tt_->setRate(0); 392 401 } 393 402 -
code/branches/FICN/src/orxonox/objects/SpaceShip.h
r626 r633 5 5 6 6 #include "Model.h" 7 #include "BillboardSet.h" 8 #include "OgreSceneNode.h" 9 7 10 #include "../../tinyxml/tinyxml.h" 8 11 #include "../particle/ParticleInterface.h" … … 41 44 bool setMouseEventCallback_; 42 45 43 particle::ParticleInterface *w; 44 particle::ParticleInterface *tt; 46 particle::ParticleInterface *tt_; 47 48 BillboardSet redBillboard_; 49 BillboardSet greenBillboard_; 50 Ogre::SceneNode* redNode_; 51 Ogre::SceneNode* greenNode_; 52 float blinkTime_; 45 53 46 54 float moveForward_; -
code/branches/FICN/src/orxonox/objects/WorldEntity.cc
r631 r633 51 51 name << (WorldEntity::worldEntityCounter_s++); 52 52 this->setName("WorldEntity" + name.str()); 53 node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName()); 53 this->node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName()); 54 } 55 else 56 { 57 this->node_ = 0; 54 58 } 55 59
Note: See TracChangeset
for help on using the changeset viewer.