Changeset 2350 for code/branches/objecthierarchy2/src/orxonox/objects/items
- Timestamp:
- Dec 7, 2008, 4:18:11 AM (16 years ago)
- Location:
- code/branches/objecthierarchy2/src/orxonox/objects/items
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/objects/items/Engine.cc
r2256 r2350 32 32 #include "core/CoreIncludes.h" 33 33 #include "core/XMLPort.h" 34 #include "objects/Scene.h" 34 35 #include "objects/worldentities/pawns/SpaceShip.h" 36 #include "tools/Shader.h" 35 37 36 38 namespace orxonox … … 59 61 this->accelerationUpDown_ = 0.0; 60 62 63 this->boostBlur_ = 0; 64 61 65 this->registerVariables(); 62 66 } … … 65 69 { 66 70 if (this->isInitialized() && this->ship_) 71 { 67 72 this->ship_->setEngine(0); 73 74 if (this->boostBlur_) 75 delete this->boostBlur_; 76 } 68 77 } 69 78 … … 178 187 this->ship_->setBoost(false); 179 188 this->ship_->setSteeringDirection(Vector3::ZERO); 189 190 if (!this->boostBlur_ && this->ship_->hasLocalController() && this->ship_->hasHumanController()) 191 { 192 this->boostBlur_ = new Shader(this->ship_->getScene()->getSceneManager()); 193 this->boostBlur_->setCompositor("Radial Blur"); 194 } 195 196 if (this->boostBlur_ && this->maxSpeedFront_ != 0 && this->boostFactor_ != 1) 197 this->boostBlur_->setParameter("Ogre/Compositor/Radial_Blur", 0, 0, "sampleStrength", 5.0f * clamp((-velocity.z - this->maxSpeedFront_) / ((this->boostFactor_ - 1) * this->maxSpeedFront_), 0.0f, 1.0f)); 198 } 199 200 void Engine::changedActivity() 201 { 202 SUPER(Engine, changedActivity); 203 204 if (this->boostBlur_) 205 this->boostBlur_->setVisible(this->isVisible()); 180 206 } 181 207 … … 188 214 if (ship->getEngine() != this) 189 215 ship->setEngine(this); 216 217 if (this->boostBlur_) 218 { 219 delete this->boostBlur_; 220 this->boostBlur_ = 0; 221 } 190 222 } 191 223 } -
code/branches/objecthierarchy2/src/orxonox/objects/items/Engine.h
r2256 r2350 48 48 49 49 virtual void tick(float dt); 50 virtual void changedActivity(); 50 51 51 52 virtual void addToSpaceShip(SpaceShip* ship); … … 124 125 float accelerationLeftRight_; 125 126 float accelerationUpDown_; 127 128 Shader* boostBlur_; 126 129 }; 127 130 }
Note: See TracChangeset
for help on using the changeset viewer.