Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 15, 2011, 9:47:11 PM (13 years ago)
Author:
landauf
Message:

merged usability branch back to trunk

incomplete summary of the changes in this branch:

  • enhanced keyboard navigation in GUIs
  • implemented new graphics menu and changeable window size at runtime
  • added developer mode
  • HUD shows if game is paused, game pauses if ingame menu is opened
  • removed a few obsolete commands and hid some that are more for internal use
  • numpad works in console and gui
  • faster loading of level info
  • enhanced usage of compositors (Shader class)
  • improved camera handling, configurable FOV and aspect ratio
Location:
code/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/items/Engine.cc

    r7547 r8079  
    102102    void Engine::setConfigValues()
    103103    {
    104         SetConfigValue(blurStrength_, 3.0f);
     104        SetConfigValueExternal(bEnableMotionBlur_, "GraphicsSettings", "enableMotionBlur", true)
     105            .description("Enable or disable the motion blur effect when moving very fast")
     106            .callback(this, &Engine::changedEnableMotionBlur);
     107        SetConfigValueExternal(blurStrength_, "GraphicsSettings", "blurStrength", 3.0f)
     108            .description("Defines the strength of the motion blur effect");
    105109    }
    106110
     
    204208        this->ship_->setSteeringDirection(Vector3::ZERO);
    205209
    206         if (!this->boostBlur_ && this->ship_->hasLocalController() && this->ship_->hasHumanController())
     210        if (this->bEnableMotionBlur_ && !this->boostBlur_ && this->ship_->hasLocalController() && this->ship_->hasHumanController())
    207211        {
    208212            this->boostBlur_ = new Shader(this->ship_->getScene()->getSceneManager());
    209             this->boostBlur_->setCompositor("Radial Blur");
     213            this->boostBlur_->setCompositorName("Radial Blur");
    210214        }
    211215
    212216        if (this->boostBlur_ && this->maxSpeedFront_ != 0 && this->boostFactor_ != 1)
    213             this->boostBlur_->setParameter("Ogre/Compositor/Radial_Blur", 0, 0, "sampleStrength", this->blurStrength_ * clamp((-velocity.z - this->maxSpeedFront_) / ((this->boostFactor_ - 1) * this->maxSpeedFront_), 0.0f, 1.0f));
     217        {
     218            float blur = this->blurStrength_ * clamp((-velocity.z - this->maxSpeedFront_) / ((this->boostFactor_ - 1) * this->maxSpeedFront_), 0.0f, 1.0f);
     219
     220            this->boostBlur_->setVisible(blur > 0);
     221            this->boostBlur_->setParameter(0, 0, "sampleStrength", blur);
     222        }
    214223    }
    215224
     
    257266        return this->ship_->getWorldPosition();
    258267    }
     268
     269    void Engine::changedEnableMotionBlur()
     270    {
     271        if (!this->bEnableMotionBlur_)
     272        {
     273            this->boostBlur_->destroy();
     274            this->boostBlur_ = 0;
     275        }
     276    }
    259277}
  • code/trunk/src/orxonox/items/Engine.h

    r7552 r8079  
    127127            void registerVariables();
    128128            void networkcallback_shipID();
     129            void changedEnableMotionBlur();
    129130
    130131            SpaceShip* ship_;
     
    150151            Shader* boostBlur_;
    151152            float blurStrength_;
     153            bool bEnableMotionBlur_;
    152154    };
    153155}
Note: See TracChangeset for help on using the changeset viewer.