Changeset 1755 for code/trunk/src/orxonox/objects
- Timestamp:
- Sep 10, 2008, 1:37:36 AM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/gui (added) merged: 1636,1638,1640-1647,1649-1654,1656,1659-1665,1670,1672-1674,1686,1688-1692,1694-1697,1704 /code/branches/input (added) merged: 1629-1630
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/Ambient.cc
r1747 r1755 43 43 #include "core/XMLPort.h" 44 44 #include "core/ConsoleCommand.h" 45 #include "Settings.h" 45 46 #include "GraphicsEngine.h" 46 47 … … 66 67 bool Ambient::create() 67 68 { 68 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_); 69 if (Settings::showsGraphics()) 70 GraphicsEngine::getInstance().getLevelSceneManager()->setAmbientLight(ambientLight_); 69 71 return Synchronisable::create(); 70 72 } … … 77 79 void Ambient::setAmbientLight(const ColourValue& colour) 78 80 { 79 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour); 80 ambientLight_=colour; 81 if (Settings::showsGraphics()) 82 GraphicsEngine::getInstance().getLevelSceneManager()->setAmbientLight(colour); 83 ambientLight_ = colour; 81 84 } 82 85 83 86 /** 84 @brief XML loading and saving. 85 @param xmlelement The XML-element 86 @param loading Loading (true) or saving (false) 87 @return The XML-element 87 @brief 88 XML loading and saving. 89 @param 90 xmlelement The XML-element 91 @param 92 loading Loading (true) or saving (false) 93 @return 94 The XML-element 88 95 */ 89 96 void Ambient::XMLPort(Element& xmlelement, XMLPort::Mode mode) -
code/trunk/src/orxonox/objects/Backlight.cc
r1747 r1755 32 32 #include <OgreBillboard.h> 33 33 #include <OgreRibbonTrail.h> 34 #include <OgreSceneManager.h> 34 35 35 36 #include "core/CoreIncludes.h" … … 38 39 #include "util/Math.h" 39 40 #include "GraphicsEngine.h" 40 #include "Orxonox.h"41 41 42 42 namespace orxonox … … 58 58 this->attachObject(this->billboard_.getBillboardSet()); 59 59 60 this->ribbonTrail_ = GraphicsEngine::get Singleton().getSceneManager()->createRibbonTrail(this->getName() + "RibbonTrail");61 this->ribbonTrailNode_ = GraphicsEngine::get Singleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName() + "RibbonTrailNode");60 this->ribbonTrail_ = GraphicsEngine::getInstance().getLevelSceneManager()->createRibbonTrail(this->getName() + "RibbonTrail"); 61 this->ribbonTrailNode_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName() + "RibbonTrailNode"); 62 62 this->ribbonTrailNode_->attachObject(this->ribbonTrail_); 63 63 this->ribbonTrail_->addNode(this->getNode()); … … 68 68 this->ribbonTrail_->setMaterialName("Trail/backlighttrail"); 69 69 70 this->setTimeFactor(Orxonox::getSingleton()->getTimeFactor()); 70 //this->setTimeFactor(Orxonox::getInstance().getTimeFactor()); 71 this->setTimeFactor(1.0f); 71 72 } 72 73 … … 76 77 { 77 78 this->detachObject(this->billboard_.getBillboardSet()); 78 GraphicsEngine::get Singleton().getSceneManager()->destroySceneNode(this->getName() + "RibbonTrailNode");79 GraphicsEngine::get Singleton().getSceneManager()->destroyRibbonTrail(this->ribbonTrail_);79 GraphicsEngine::getInstance().getLevelSceneManager()->destroySceneNode(this->getName() + "RibbonTrailNode"); 80 GraphicsEngine::getInstance().getLevelSceneManager()->destroyRibbonTrail(this->ribbonTrail_); 80 81 } 81 82 } -
code/trunk/src/orxonox/objects/Camera.cc
r1747 r1755 52 52 { 53 53 this->bHasFocus_ = false; 54 this->cameraNode_ = GraphicsEngine::get Singleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(node->getName() + "Camera");54 this->cameraNode_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(node->getName() + "Camera"); 55 55 if( node != NULL ) 56 56 this->setPositionNode(node); … … 60 60 { 61 61 CameraHandler::getInstance()->releaseFocus(this); 62 GraphicsEngine::get Singleton().getSceneManager()->getRootSceneNode()->removeAndDestroyChild(cameraNode_->getName());62 GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->removeAndDestroyChild(cameraNode_->getName()); 63 63 } 64 64 -
code/trunk/src/orxonox/objects/CameraHandler.cc
r1505 r1755 44 44 CameraHandler::CameraHandler() 45 45 { 46 this->cam_ = GraphicsEngine::getSingleton().getSceneManager()->createCamera("Cam"); 47 GraphicsEngine::getSingleton().getRenderWindow()->addViewport(this->cam_); 46 this->cam_ = GraphicsEngine::getInstance().getLevelSceneManager()->createCamera("Cam"); 47 GraphicsEngine::getInstance().getViewport()->setCamera(this->cam_); 48 //GraphicsEngine::getInstance().getRenderWindow()->addViewport(this->cam_, 2, 0.4, 0.4, 0.2, 0.2); 48 49 /*this->activeCamera_ = *ObjectList<Camera>::begin(); 49 50 this->activeCamera_->cam_ = this->cam_;*/ -
code/trunk/src/orxonox/objects/ParticleSpawner.cc
r1608 r1755 30 30 #include "ParticleSpawner.h" 31 31 32 #include <OgreSceneManager.h> 32 33 #include "core/CoreIncludes.h" 33 34 #include "core/Executor.h" … … 79 80 this->setPosition(this->getNode()->getParent()->getPosition()); 80 81 this->getNode()->getParent()->removeChild(this->getNode()); 81 GraphicsEngine::get Singleton().getSceneManager()->getRootSceneNode()->addChild(this->getNode());82 GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->addChild(this->getNode()); 82 83 if (this->particle_) 83 84 this->particle_->setEnabled(false); -
code/trunk/src/orxonox/objects/Skybox.cc
r1747 r1755 39 39 #include "core/XMLPort.h" 40 40 #include "util/Debug.h" 41 #include "Settings.h" 41 42 42 43 namespace orxonox … … 56 57 void Skybox::setSkybox(const std::string& skyboxname) 57 58 { 58 GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(true, skyboxname); 59 if (Settings::showsGraphics()) 60 GraphicsEngine::getInstance().getLevelSceneManager()->setSkyBox(true, skyboxname); 59 61 } 60 62 … … 87 89 { 88 90 SUPER(Skybox, changedVisibility); 89 GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(this->isVisible(), this->skyboxSrc_); 91 if (Settings::showsGraphics()) 92 GraphicsEngine::getInstance().getLevelSceneManager()->setSkyBox(this->isVisible(), this->skyboxSrc_); 90 93 } 91 94 } -
code/trunk/src/orxonox/objects/SpaceShip.cc
r1751 r1755 49 49 #include "CameraHandler.h" 50 50 #include "ParticleSpawner.h" 51 #include "Settings.h" 51 52 #include "RotatingProjectile.h" 52 53 #include "ParticleProjectile.h" … … 79 80 } 80 81 assert(0); 82 return 0; 81 83 } 82 84 … … 194 196 void SpaceShip::init() 195 197 { 196 // START CREATING THRUSTERS 197 this->tt1_ = new ParticleInterface("Orxonox/thruster1", LODParticle::low); 198 this->tt1_->createNewEmitter(); 199 this->tt1_->getAllEmitters()->setDirection(-this->getInitialDir()); 200 this->tt1_->getEmitter(0)->setPosition(Vector3(-15, 20, -1)); 201 this->tt1_->getEmitter(1)->setPosition(Vector3(-15, -20, -1)); 202 this->tt1_->setSpeedFactor(3.0); 203 204 Ogre::SceneNode* node2a = this->getNode()->createChildSceneNode(this->getName() + "particle2a"); 205 node2a->setInheritScale(false); 206 node2a->setScale(1, 1, 1); 207 tt1_->addToSceneNode(node2a); 208 209 this->tt2_ = new ParticleInterface("Orxonox/thruster2", LODParticle::normal); 210 this->tt2_->createNewEmitter(); 211 this->tt2_->getAllEmitters()->setDirection(Vector3(-1, 0, 0)); 212 this->tt2_->getEmitter(0)->setPosition(Vector3(-30, 40, -2)); 213 this->tt2_->getEmitter(1)->setPosition(Vector3(-30, -40, -2)); 214 215 Ogre::SceneNode* node2b = this->getNode()->createChildSceneNode(this->getName() + "particle2b"); 216 node2b->setInheritScale(false); 217 node2b->setScale(0.5, 0.5, 0.5); 218 tt2_->addToSceneNode(node2b); 219 220 this->leftThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, -10, -0.5)); 221 this->rightThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, 10, -0.5)); 222 223 Ogre::SceneNode* node2c = this->getNode()->createChildSceneNode(this->getName() + "particle2c"); 224 node2c->setInheritScale(false); 225 node2c->setScale(2, 2, 2); 226 node2c->attachObject(this->leftThrusterFlare_.getBillboardSet()); 227 node2c->attachObject(this->rightThrusterFlare_.getBillboardSet()); 228 // END CREATING THRUSTERS 229 230 // START CREATING BLINKING LIGHTS 231 this->redBillboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1); 232 this->greenBillboard_.setBillboardSet("Examples/Flare", ColourValue(0.0, 1.0, 0.0), 1); 233 234 this->redNode_ = this->getNode()->createChildSceneNode(this->getName() + "red", Vector3(0.3, 4.0, -0.3)); 235 this->redNode_->setInheritScale(false); 236 this->greenNode_ = this->getNode()->createChildSceneNode(this->getName() + "green", Vector3(0.3, -4.0, -0.3)); 237 this->greenNode_->setInheritScale(false); 238 239 this->redNode_->attachObject(this->redBillboard_.getBillboardSet()); 240 this->redNode_->setScale(0.3, 0.3, 0.3); 241 242 this->greenNode_->attachObject(this->greenBillboard_.getBillboardSet()); 243 this->greenNode_->setScale(0.3, 0.3, 0.3); 244 // END CREATING BLINKING LIGHTS 245 246 // START CREATING ADDITIONAL EFFECTS 247 /*if(!network::Host::running() || network::Host::isServer()){ 248 this->backlight_ = new Backlight(this->maxSpeed_, 0.8); 249 this->attachObject(this->backlight_); 250 this->backlight_->setPosition(-2.35, 0, 0.2); 251 this->backlight_->setColour(this->getProjectileColour()); 252 253 this->smoke_ = new ParticleSpawner(); 254 this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3); 255 this->attachObject(this->smoke_); 256 257 this->fire_ = new ParticleSpawner(); 258 this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1); 259 this->attachObject(this->fire_); 260 }*/ 261 // END CREATING ADDITIONAL EFFECTS 262 263 if (this->isExactlyA(Class(SpaceShip))) 264 { 265 // START of testing crosshair 266 this->crosshairNear_.setBillboardSet("Orxonox/Crosshair", ColourValue(1.0, 1.0, 0.0), 1); 267 this->crosshairFar_.setBillboardSet("Orxonox/Crosshair", ColourValue(1.0, 1.0, 0.0), 1); 268 269 this->chNearNode_ = this->getNode()->createChildSceneNode(this->getName() + "near", Vector3(50.0, 0.0, 0.0)); 270 this->chNearNode_->setInheritScale(false); 271 this->chFarNode_ = this->getNode()->createChildSceneNode(this->getName() + "far", Vector3(200.0, 0.0, 0.0)); 272 this->chFarNode_->setInheritScale(false); 273 274 this->chNearNode_->attachObject(this->crosshairNear_.getBillboardSet()); 275 this->chNearNode_->setScale(0.2, 0.2, 0.2); 276 277 this->chFarNode_->attachObject(this->crosshairFar_.getBillboardSet()); 278 this->chFarNode_->setScale(0.4, 0.4, 0.4); 279 // END of testing crosshair 198 if (Settings::showsGraphics()) 199 { 200 // START CREATING THRUSTERS 201 this->tt1_ = new ParticleInterface("Orxonox/thruster1", LODParticle::low); 202 this->tt1_->createNewEmitter(); 203 this->tt1_->getAllEmitters()->setDirection(-this->getInitialDir()); 204 this->tt1_->getEmitter(0)->setPosition(Vector3(-15, 20, -1)); 205 this->tt1_->getEmitter(1)->setPosition(Vector3(-15, -20, -1)); 206 this->tt1_->setSpeedFactor(3.0); 207 208 Ogre::SceneNode* node2a = this->getNode()->createChildSceneNode(this->getName() + "particle2a"); 209 node2a->setInheritScale(false); 210 node2a->setScale(1, 1, 1); 211 tt1_->addToSceneNode(node2a); 212 213 this->tt2_ = new ParticleInterface("Orxonox/thruster2", LODParticle::normal); 214 this->tt2_->createNewEmitter(); 215 this->tt2_->getAllEmitters()->setDirection(Vector3(-1, 0, 0)); 216 this->tt2_->getEmitter(0)->setPosition(Vector3(-30, 40, -2)); 217 this->tt2_->getEmitter(1)->setPosition(Vector3(-30, -40, -2)); 218 219 Ogre::SceneNode* node2b = this->getNode()->createChildSceneNode(this->getName() + "particle2b"); 220 node2b->setInheritScale(false); 221 node2b->setScale(0.5, 0.5, 0.5); 222 tt2_->addToSceneNode(node2b); 223 224 this->leftThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, -10, -0.5)); 225 this->rightThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, 10, -0.5)); 226 227 Ogre::SceneNode* node2c = this->getNode()->createChildSceneNode(this->getName() + "particle2c"); 228 node2c->setInheritScale(false); 229 node2c->setScale(2, 2, 2); 230 node2c->attachObject(this->leftThrusterFlare_.getBillboardSet()); 231 node2c->attachObject(this->rightThrusterFlare_.getBillboardSet()); 232 // END CREATING THRUSTERS 233 234 // START CREATING BLINKING LIGHTS 235 this->redBillboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1); 236 this->greenBillboard_.setBillboardSet("Examples/Flare", ColourValue(0.0, 1.0, 0.0), 1); 237 238 this->redNode_ = this->getNode()->createChildSceneNode(this->getName() + "red", Vector3(0.3, 4.0, -0.3)); 239 this->redNode_->setInheritScale(false); 240 this->greenNode_ = this->getNode()->createChildSceneNode(this->getName() + "green", Vector3(0.3, -4.0, -0.3)); 241 this->greenNode_->setInheritScale(false); 242 243 this->redNode_->attachObject(this->redBillboard_.getBillboardSet()); 244 this->redNode_->setScale(0.3, 0.3, 0.3); 245 246 this->greenNode_->attachObject(this->greenBillboard_.getBillboardSet()); 247 this->greenNode_->setScale(0.3, 0.3, 0.3); 248 // END CREATING BLINKING LIGHTS 249 250 // START CREATING ADDITIONAL EFFECTS 251 /*this->backlight_ = new Backlight(this->maxSpeed_, 0.8); 252 this->attachObject(this->backlight_); 253 this->backlight_->setPosition(-2.35, 0, 0.2); 254 this->backlight_->setColour(this->getProjectileColour()); 255 256 this->smoke_ = new ParticleSpawner(); 257 this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3); 258 this->attachObject(this->smoke_); 259 260 this->fire_ = new ParticleSpawner(); 261 this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1); 262 this->attachObject(this->fire_); 263 */ 264 // END CREATING ADDITIONAL EFFECTS 265 266 if (this->isExactlyA(Class(SpaceShip))) 267 { 268 // START of testing crosshair 269 this->crosshairNear_.setBillboardSet("Orxonox/Crosshair", ColourValue(1.0, 1.0, 0.0), 1); 270 this->crosshairFar_.setBillboardSet("Orxonox/Crosshair", ColourValue(1.0, 1.0, 0.0), 1); 271 272 this->chNearNode_ = this->getNode()->createChildSceneNode(this->getName() + "near", Vector3(50.0, 0.0, 0.0)); 273 this->chNearNode_->setInheritScale(false); 274 this->chFarNode_ = this->getNode()->createChildSceneNode(this->getName() + "far", Vector3(200.0, 0.0, 0.0)); 275 this->chFarNode_->setInheritScale(false); 276 277 this->chNearNode_->attachObject(this->crosshairNear_.getBillboardSet()); 278 this->chNearNode_->setScale(0.2, 0.2, 0.2); 279 280 this->chFarNode_->attachObject(this->crosshairFar_.getBillboardSet()); 281 this->chFarNode_->setScale(0.4, 0.4, 0.4); 282 // END of testing crosshair 283 } 280 284 } 281 285 // END of testing crosshair … … 429 433 this->cam_->tick(dt); 430 434 431 if (this->smoke_) 432 this->smoke_->setVisible(this->isVisible() && this->health_ < 40); 433 if (this->fire_) 434 this->fire_->setVisible(this->isVisible() && this->health_ < 20); 435 436 if (this->backlight_) 437 { // (there's already fire || we're to slow || we're moving backwards ) 438 if (this->health_ < 20 || this->getVelocity().squaredLength() < 150*150 || this->getVelocity().dotProduct(this->getInitialDir()) < 0) 439 this->backlight_->setActive(false); 440 else 441 this->backlight_->setActive(true); 442 } 443 444 if (this->redNode_ && this->greenNode_) 445 { 446 this->blinkTime_ += dt; 447 float redScale = 0.15 + 0.15 * sin(this->blinkTime_ * 10.0); 448 float greenScale = 0.15 - 0.15 * sin(this->blinkTime_ * 10.0); 449 this->redNode_->setScale(redScale, redScale, redScale); 450 this->greenNode_->setScale(greenScale, greenScale, greenScale); 435 if (Settings::showsGraphics()) 436 { 437 if (this->smoke_) 438 this->smoke_->setVisible(this->isVisible() && this->health_ < 40); 439 if (this->fire_) 440 this->fire_->setVisible(this->isVisible() && this->health_ < 20); 441 442 if (this->backlight_) 443 { // (there's already fire || we're to slow || we're moving backwards ) 444 if (this->health_ < 20 || this->getVelocity().squaredLength() < 150*150 || this->getVelocity().dotProduct(this->getInitialDir()) < 0) 445 this->backlight_->setActive(false); 446 else 447 this->backlight_->setActive(true); 448 } 449 450 if (this->redNode_ && this->greenNode_) 451 { 452 this->blinkTime_ += dt; 453 float redScale = 0.15 + 0.15 * sin(this->blinkTime_ * 10.0); 454 float greenScale = 0.15 - 0.15 * sin(this->blinkTime_ * 10.0); 455 this->redNode_->setScale(redScale, redScale, redScale); 456 this->greenNode_->setScale(greenScale, greenScale, greenScale); 457 } 451 458 } 452 459 -
code/trunk/src/orxonox/objects/SpaceShipAI.cc
r1747 r1755 39 39 #include "core/XMLPort.h" 40 40 #include "tools/ParticleInterface.h" 41 #include "Settings.h" 41 42 42 43 #define ACTION_INTERVAL 1.0f … … 102 103 newenemy->XMLPort(xmlelement, XMLPort::LoadObject); 103 104 104 ParticleSpawner* spawneffect = new ParticleSpawner("Orxonox/fairytwirl", LODParticle::normal, 2.0, 0, 0, newenemy->getOrth()); 105 spawneffect->setPosition(newenemy->getPosition() - newenemy->getOrth() * 50); 106 spawneffect->create(); 105 if (Settings::showsGraphics()) 106 { 107 ParticleSpawner* spawneffect = new ParticleSpawner("Orxonox/fairytwirl", LODParticle::normal, 2.0, 0, 0, newenemy->getOrth()); 108 spawneffect->setPosition(newenemy->getPosition() - newenemy->getOrth() * 50); 109 spawneffect->create(); 110 } 107 111 } 108 112 } … … 182 186 void SpaceShipAI::kill() 183 187 { 184 ParticleSpawner* explosion = new ParticleSpawner("Orxonox/BigExplosion1part1", LODParticle::low, 3.0); 185 explosion->setPosition(this->getPosition()); 186 explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true); 187 explosion->setScale(4); 188 explosion->create(); 189 190 explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::normal, 3.0); 191 explosion->setPosition(this->getPosition()); 192 explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true); 193 explosion->setScale(4); 194 explosion->create(); 195 explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::high, 3.0); 196 explosion->setPosition(this->getPosition()); 197 explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true); 198 explosion->setScale(4); 199 explosion->create(); 200 201 Vector3 ringdirection = Vector3(rnd(), rnd(), rnd()); 202 ringdirection.normalise(); 203 explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::normal, 3.0, 0.5, 0, ringdirection); 204 explosion->setPosition(this->getPosition()); 205 explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true); 206 explosion->setScale(4); 207 explosion->create(); 208 explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::high, 3.0, 0.5, 0, ringdirection); 209 explosion->setPosition(this->getPosition()); 210 explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true); 211 explosion->setScale(4); 212 explosion->create(); 188 if (Settings::showsGraphics()) 189 { 190 ParticleSpawner* explosion = new ParticleSpawner("Orxonox/BigExplosion1part1", LODParticle::low, 3.0); 191 explosion->setPosition(this->getPosition()); 192 explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true); 193 explosion->setScale(4); 194 explosion->create(); 195 196 explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::normal, 3.0); 197 explosion->setPosition(this->getPosition()); 198 explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true); 199 explosion->setScale(4); 200 explosion->create(); 201 explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::high, 3.0); 202 explosion->setPosition(this->getPosition()); 203 explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true); 204 explosion->setScale(4); 205 explosion->create(); 206 207 Vector3 ringdirection = Vector3(rnd(), rnd(), rnd()); 208 ringdirection.normalise(); 209 explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::normal, 3.0, 0.5, 0, ringdirection); 210 explosion->setPosition(this->getPosition()); 211 explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true); 212 explosion->setScale(4); 213 explosion->create(); 214 explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::high, 3.0, 0.5, 0, ringdirection); 215 explosion->setPosition(this->getPosition()); 216 explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true); 217 explosion->setScale(4); 218 explosion->create(); 219 } 213 220 214 221 delete this; -
code/trunk/src/orxonox/objects/Tickable.h
r1747 r1755 29 29 /*! 30 30 @file Tickable.h 31 @brief De finition of the Tickable interface.31 @brief Declaration of the Tickable interface. 32 32 33 33 The Tickable interface provides a tick(dt) function, that gets called every frame. -
code/trunk/src/orxonox/objects/WorldEntity.cc
r1747 r1755 32 32 #include <string> 33 33 #include <sstream> 34 #include <OgreSceneManager.h> 34 35 35 36 #include "tinyxml/tinyxml.h" … … 49 50 RegisterObject(WorldEntity); 50 51 51 if (GraphicsEngine::get Singleton().getSceneManager())52 if (GraphicsEngine::getInstance().getLevelSceneManager()) 52 53 { 53 54 std::ostringstream name; 54 55 name << (WorldEntity::worldEntityCounter_s++); 55 56 this->setName("WorldEntity" + name.str()); 56 this->node_ = GraphicsEngine::get Singleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());57 this->node_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName()); 57 58 58 59 registerAllVariables(); … … 77 78 { 78 79 this->getNode()->removeAndDestroyAllChildren(); 79 GraphicsEngine::get Singleton().getSceneManager()->destroySceneNode(this->getName());80 GraphicsEngine::getInstance().getLevelSceneManager()->destroySceneNode(this->getName()); 80 81 } 81 82 } … … 177 178 void WorldEntity::attachObject(const WorldEntity& obj) const 178 179 { 179 GraphicsEngine::get Singleton().getSceneManager()->getRootSceneNode()->removeChild(obj.getNode());180 GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->removeChild(obj.getNode()); 180 181 this->getNode()->addChild(obj.getNode()); 181 182 } … … 183 184 void WorldEntity::attachObject(WorldEntity* obj) const 184 185 { 185 GraphicsEngine::get Singleton().getSceneManager()->getRootSceneNode()->removeChild(obj->getNode());186 GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->removeChild(obj->getNode()); 186 187 this->getNode()->addChild(obj->getNode()); 187 188 } -
code/trunk/src/orxonox/objects/WorldEntity.h
r1747 r1755 31 31 32 32 #include "OrxonoxPrereqs.h" 33 #include <OgrePrerequisites.h> 33 34 34 #include <OgreSceneManager.h>35 35 #include <OgreSceneNode.h> 36 37 36 #include "util/Math.h" 38 37 #include "util/XMLIncludes.h"
Note: See TracChangeset
for help on using the changeset viewer.