Changeset 592
- Timestamp:
- Dec 17, 2007, 8:59:31 PM (17 years ago)
- Location:
- code/branches/FICN
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/bin/levels/sample.oxw
r591 r592 9 9 <bar top="200" left="50" width="300" height="20" image="textures/load_screens/ambush-loadbar.png" /> 10 10 </loading> 11 11 12 12 13 … … 29 30 <Skybox src="Orxonox/StarfieldSkyBox" /> 30 31 32 31 33 <SceneNode name="ShipNode" pos="0,0,0" node="OgreHeadNode" scale="10,10,10" yaw="-90" pitch="-90" /> 32 34 <BaseEntity name="TheShip" src="assf2.mesh" node="ShipNode" /> … … 38 40 <BaseEntity name="TheShip3" src="assf2.mesh" node="ShipNode3" /> 39 41 42 <<<<<<< .mine 43 44 <SceneNode name="node1" pos="0,2000,0" scale="40,40,40" /> 45 <Entity name="asteroid1" src="ast1.mesh" node="node1" /> 46 47 <SceneNode name="node2" pos="2000,0,0" scale="20,20,20"/> 48 <Entity name="asteroid2" src="ast2.mesh" node="node2" /> 49 ======= 40 50 <Model position="0,2000,0" scale="40" mesh="ast1.mesh" /> 41 51 <Model position="2000,0,0" scale="20" mesh="ast2.mesh" /> … … 45 55 <Model position="0,0,-2000" scale="20" mesh="ast6.mesh" /> 46 56 <Model position="1000,1500,0" scale="50" mesh="ast1.mesh" /> 57 >>>>>>> .r591 47 58 59 <<<<<<< .mine 60 <SceneNode name="node3" pos="0,0,2000" scale="20,20,20"/> 61 <Entity name="aststeroid3" src="ast3.mesh" node="node3"/> 62 63 <SceneNode name="node4" pos="0,-2000,0" scale="20,20,20"/> 64 <Entity name="asteroid4" src="ast4.mesh" node="node4" /> 65 66 <SceneNode name="node5" pos="-2000,0,0" scale="20,20,20"/> 67 <Entity name="asteroid5" src="ast5.mesh" node="node5" /> 68 69 <SceneNode name="node6" pos="0,0,-2000" scale="20,20,20"/> 70 <Entity name="asteroid6" src="ast6.mesh" node="node6" /> 71 72 <SceneNode name="node7" pos="1000,1500,0" scale="50,50,50" /> 73 <Entity name="asteroid7" src="ast1.mesh" node="node7" /> 74 75 76 ======= 77 >>>>>>> .r591 48 78 </world> 49 79 -
code/branches/FICN/src/misc/String2Number.h
r560 r592 15 15 * Number in string can be decimal, hexadecimal or octal 16 16 * 17 * @aut or Nicolas Perrenoud<nicolape@ee.ethz.ch>17 * @author Nicolas Perrenoud<nicolape@ee.ethz.ch> 18 18 * 19 19 * @example -
code/branches/FICN/src/misc/Tokenizer.h
r507 r592 12 12 * Returns the result as a vector<string> object 13 13 * 14 * @aut or Nicolas Perrenoud<nicolape@ee.ethz.ch>14 * @author Nicolas Perrenoud<nicolape@ee.ethz.ch> 15 15 */ 16 16 … … 18 18 { 19 19 vector<std::string> tokens; 20 20 21 21 // Skip delimiters at beginning. 22 22 std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); … … 32 32 // Find next "non-delimiter" 33 33 pos = str.find_first_of(delimiters, lastPos); 34 } 35 return tokens; 34 } 35 return tokens; 36 36 } 37 37 -
code/branches/FICN/src/network/CMakeLists.txt
r555 r592 71 71 #objects 72 72 ${ENet_LIBRARY} 73 ${Z lib_LIBRARY}73 ${ZLIB_LIBRARY} 74 74 ${WINDOWS_ENET_DEPENDENCIES} 75 75 ) … … 82 82 #objects 83 83 ${ENet_LIBRARY} 84 ${Z lib_LIBRARY}84 ${ZLIB_LIBRARY} 85 85 ${WINDOWS_ENET_DEPENDENCIES} 86 86 ) -
code/branches/FICN/src/network/PacketTypes.h
r436 r592 2 2 // C++ Interface: PacketTypes 3 3 // 4 // Description: 4 // Description: 5 5 // 6 6 // … … 25 25 26 26 27 /**28 * This struct defines a gamestate:29 * size: total size of the data in *data30 * data: pointer to the data allocated in the memory31 */27 /** 28 * This struct defines a gamestate: 29 * size: total size of the data in *data 30 * data: pointer to the data allocated in the memory 31 */ 32 32 struct GameState{ 33 33 int id; 34 int size; 34 int size; //!< total size of data 35 35 // new ---- change functions 36 36 bool diffed; 37 unsigned char *data; 37 unsigned char *data; //!< pointer to data 38 38 }; 39 39 40 /**41 * this struct defines a gamestate:40 /** 41 * this struct defines a gamestate: 42 42 * compsize is the size of the compressed data 43 43 * normsize is the size of the uncompressed data 44 44 * data are the gamestates 45 */45 */ 46 46 struct GameStateCompressed{ 47 int id; 48 int compsize; 49 int normsize; 47 int id; 48 int compsize; //!< size of compressed data 49 int normsize; //!< size of uncompressed data 50 50 // new ----- change functions 51 51 bool diffed; 52 unsigned char *data; 52 unsigned char *data; //!< gamestate data 53 53 }; 54 54 … … 59 59 const char *message; 60 60 }; 61 62 61 62 63 63 struct ack { 64 64 int id; -
code/branches/FICN/src/network/Synchronisable.cc
r573 r592 116 116 for(i=syncList.begin(); n<datasize && i!=syncList.end(); ++i){ 117 117 COUT(2) << "size of variable: " << i->size << std::endl; 118 COUT(2) << "size of variable: " << i->size << std::endl; 118 119 //COUT(2) << "size of variable: " << i->size << std::endl; 119 120 //(std::memcpy(retVal.data+n, (const void*)(&(i->size)), sizeof(int)); -
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.