Changeset 592 for code/branches/FICN/src/orxonox
- Timestamp:
- Dec 17, 2007, 8:59:31 PM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/core/ConfigValueContainer.cc
r513 r592 654 654 655 655 /** 656 657 658 */656 * @param Writes the content of the list, containing all lines of the config-file, into the config-file. 657 * @param filename The name of the config-file 658 */ 659 659 void ConfigValueContainer::writeConfigFile(const std::string& filename) 660 660 { -
code/branches/FICN/src/orxonox/core/Identifier.h
r496 r592 67 67 68 68 public: 69 /** @brief Sets the Factory. @param facotry The factory to assign */ 69 /** @brief Sets the Factory. 70 * @param factory The factory to assign 71 */ 70 72 inline void addFactory(BaseFactory* factory) { this->factory_ = factory; } 71 73 -
code/branches/FICN/src/orxonox/orxonox.cc
r588 r592 467 467 particle::ParticleInterface *e = new particle::ParticleInterface(mgr,"engine","Orxonox/strahl"); 468 468 e->particleSystem_->setParameter("local_space","true"); 469 e->setPositionOfEmitter(0, Vector3(0,-10, 200));469 e->setPositionOfEmitter(0, Vector3(0,-10,0)); 470 470 e->setDirection(Vector3(0,0,-1)); 471 471 e->addToSceneNode(node); … … 480 480 w->addToSceneNode(node); 481 481 482 particle::ParticleInterface *tt = new particle::ParticleInterface(mgr,"t hrusters","Orxonox/treibwerk");482 particle::ParticleInterface *tt = new particle::ParticleInterface(mgr,"twinthruster","Orxonox/engineglow"); 483 483 tt->particleSystem_->setParameter("local_space","true"); 484 484 tt->newEmitter(); 485 tt->setDirection(Vector3(0,0, 1));486 tt->setPositionOfEmitter(0, Vector3( 15,0,-60));487 tt->setPositionOfEmitter(1, Vector3(- 15,0,-60));485 tt->setDirection(Vector3(0,0,-1)); 486 tt->setPositionOfEmitter(0, Vector3(20,-1,-15)); 487 tt->setPositionOfEmitter(1, Vector3(-20,-1,-15)); 488 488 tt->addToSceneNode(node); 489 490 489 491 490 } -
code/branches/FICN/src/orxonox/orxonox_ship.h
r346 r592 41 41 public: 42 42 OrxonoxShip(Ogre::SceneNode*); 43 43 virtual ~OrxonoxShip(); 44 44 45 45 virtual bool initialise(); 46 46 47 48 47 void setMainThrust(const Ogre::Real); 48 void setSideThrust(const Ogre::Real); 49 49 void setYThrust(const Ogre::Real); 50 51 50 void turnUpAndDown(const Ogre::Radian&); 51 void turnLeftAndRight(const Ogre::Radian&); 52 52 53 53 InertialNode* getRootNode(); … … 58 58 int getAmmoStock(); 59 59 60 60 bool tick(unsigned long, Ogre::Real); 61 61 62 62 protected: 63 63 64 64 protected: 65 66 65 Ogre::SceneManager *sceneMgr_; 66 //Ogre::SceneNode *rootNode_; 67 67 InertialNode *rootNode_; 68 68 Ogre::Entity *shipEntity_; 69 69 70 71 70 //Ogre::Vector3 currentSpeed_; // relative to space 71 Ogre::Vector3 currentThrust_; // relative to the ship 72 72 Ogre::Real baseThrust_; 73 73 int objectCounter_; 74 74 75 75 weapon::BulletManager *bulletManager_; 76 76 //Ogre::Vector3 bulletSpeed_; 77 77 78 78 weapon::BaseWeapon *mainWeapon_; -
code/branches/FICN/src/orxonox/particle/ParticleInterface.cc
r544 r592 37 37 namespace particle { 38 38 39 40 41 39 ParticleInterface::~ParticleInterface(void) 40 { 41 sceneManager_->destroyParticleSystem(particleSystem_); 42 42 43 44 45 46 43 delete sceneNode_; 44 delete particleSystem_; 45 delete sceneManager_; 46 } 47 47 48 49 50 51 48 ParticleInterface::ParticleInterface( SceneManager *sceneManager, String name, String templateName ) 49 { 50 sceneManager_ = sceneManager; 51 particleSystem_ = sceneManager->createParticleSystem(name, templateName); 52 52 53 54 55 56 57 53 //Variabeln einlesen, Emitter1_ ist Referenz-Emitter 54 velocity_ = particleSystem_->getSpeedFactor(); 55 colour_ = particleSystem_->getEmitter(0)->getColour(); 56 rate_ = particleSystem_->getEmitter(0)->getEmissionRate(); 57 distance_ = particleSystem_->getEmitter(0)->getTimeToLive(); 58 58 59 60 61 62 59 //Anzahl der Emitter 60 numberOfEmitters_ = particleSystem_->getNumEmitters(); 61 standardizeEmitters(); 62 } 63 63 64 65 66 67 68 69 70 71 64 void ParticleInterface::standardizeEmitters(void) 65 { 66 //Abgleichen der anderen Emitter an die Variabeln 67 for (int i=1; i<numberOfEmitters_; i++) { 68 particleSystem_->getEmitter(i)->setColour( colour_ ); 69 particleSystem_->getEmitter(i)->setTimeToLive( distance_ ); 70 particleSystem_->getEmitter(i)->setEmissionRate( rate_ ); 71 } 72 72 73 73 } 74 74 75 76 77 78 79 75 void ParticleInterface::addToSceneNode( SceneNode* sceneNode ) 76 { 77 sceneNode_ = sceneNode; 78 sceneNode_->attachObject(particleSystem_); 79 } 80 80 81 82 83 84 85 81 void ParticleInterface::dettachFromSceneNode ( void ) 82 { 83 sceneNode_->detachObject(particleSystem_); 84 sceneNode_ = NULL; 85 } 86 86 87 88 89 90 87 Real ParticleInterface::getVelocity() 88 { 89 return velocity_; 90 } 91 91 92 93 94 95 96 97 92 void ParticleInterface::setVelocity(Real v) 93 { 94 velocity_ = v; 95 //partikel anpassen 96 particleSystem_->setSpeedFactor(v); 97 } 98 98 99 100 101 102 103 104 105 106 107 108 109 110 99 int ParticleInterface::getRate() 100 { 101 return rate_; 102 } 103 void ParticleInterface::setRate(int r) 104 { 105 rate_ = r; 106 //partikel anpassen 107 for (int i=0; i<numberOfEmitters_; i++) { 108 particleSystem_->getEmitter(i)->setEmissionRate(rate_); 109 } 110 } 111 111 112 113 114 115 112 Real ParticleInterface::getDistance() 113 { 114 return distance_; 115 } 116 116 117 118 119 120 121 122 123 124 125 126 127 128 117 void ParticleInterface::setDistance(Real d) 118 { 119 distance_ = d; 120 //partikel anpassen 121 for (int i=0; i<numberOfEmitters_; i++) { 122 particleSystem_->getEmitter(i)->setTimeToLive(distance_); 123 } 124 } 125 ColourValue ParticleInterface::getColour() 126 { 127 return colour_; 128 } 129 129 130 131 132 133 134 135 136 137 130 void ParticleInterface::setColour(ColourValue colour) 131 { 132 colour_ = colour; 133 //partikel anpassen 134 for (int i=0; i<numberOfEmitters_; i++) { 135 particleSystem_->getEmitter(i)->setColour(colour_); 136 } 137 } 138 138 139 140 141 142 143 139 ParticleEmitter* ParticleInterface::getEmitter( int emitterNr ) 140 { 141 if (!(emitterNr<numberOfEmitters_)) return NULL; 142 return particleSystem_->getEmitter(emitterNr); 143 } 144 144 145 146 147 148 149 150 145 void ParticleInterface::newEmitter ( void ) 146 { 147 particleSystem_->addEmitter(particleSystem_->getEmitter(0)->getType()); 148 numberOfEmitters_=numberOfEmitters_+1; 149 particleSystem_->getEmitter(0)->copyParametersTo( particleSystem_->getEmitter(numberOfEmitters_-1) ); 150 } 151 151 152 153 154 155 152 void ParticleInterface::setPositionOfEmitter ( int emitterNr, Vector3 position ) 153 { 154 particleSystem_->getEmitter(emitterNr)->setPosition(position); 155 } 156 156 157 158 159 160 157 Vector3 ParticleInterface::getPositionOfEmitter ( int emitterNr ) 158 { 159 return particleSystem_->getEmitter(0)->getPosition(); 160 } 161 161 162 163 164 165 166 167 162 void ParticleInterface::setDirection ( Vector3 direction ) 163 { 164 for(int i=0; i<numberOfEmitters_; i++) { 165 particleSystem_->getEmitter(i)->setDirection(direction); 166 } 167 } 168 168 169 169 170 171 172 173 170 Vector3 ParticleInterface::getDirection ( void ) 171 { 172 return particleSystem_->getEmitter(0)->getDirection(); 173 } 174 174 175 176 177 178 179 180 175 void ParticleInterface::switchEnable(){ 176 bool enable=(!(particleSystem_->getEmitter(0)->getEnabled())); 177 for(int i=0; i<numberOfEmitters_; i++) { 178 particleSystem_->getEmitter(i)->setEnabled(enable); 179 } 180 } 181 181 182 182 } -
code/branches/FICN/src/orxonox/run_manager.cc
r588 r592 94 94 95 95 /** 96 * @param ogre_The OgreControl object holding the render window and the Root96 * @param *ogre The OgreControl object holding the render window and the Root 97 97 */ 98 98 void RunManager::initialise(OgreControl *ogre)
Note: See TracChangeset
for help on using the changeset viewer.