Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2009, 10:23:58 PM (14 years ago)
Author:
rgrieder
Message:

Merged presentation2 branch back to trunk.
Major new features:

  • Actual GUI with settings, etc.
  • Improved space ship steering (human interaction)
  • Rocket fire and more particle effects
  • Advanced sound framework
Location:
code/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/graphics/Billboard.cc

    r5781 r6417  
    4242        RegisterObject(Billboard);
    4343
    44         this->material_ = "";
    4544        this->colour_ = ColourValue::White;
    4645//        this->rotation_ = 0;
     
    7675    void Billboard::changedMaterial()
    7776    {
    78         if (this->material_ == "")
     77        if (this->material_.empty())
    7978            return;
    8079
     
    9998        {
    10099/*
    101             if (this->getScene() && GameMode::showsGraphics() && (this->material_ != ""))
     100            if (this->getScene() && GameMode::showsGraphics() && !this->material_.empty())
    102101            {
    103102                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
  • code/trunk/src/orxonox/graphics/BlinkingBillboard.cc

    r5781 r6417  
    8181                this->setScale(this->amplitude_ * static_cast<float>(square(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_))));
    8282            else
    83                 this->setScale(this->amplitude_ * static_cast<float>(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_)));
     83                this->setScale(this->amplitude_ * static_cast<float>(fabs(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_))));
    8484        }
    8585    }
  • code/trunk/src/orxonox/graphics/Camera.cc

    r5929 r6417  
    4242#include "Scene.h"
    4343#include "CameraManager.h"
     44#include "sound/SoundManager.h"
    4445
    4546namespace orxonox
     
    6162
    6263        this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
     64        this->camera_->setUserObject(this);
    6365        this->cameraNode_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
    6466        this->attachNode(this->cameraNode_);
     
    6870        this->bDrag_ = false;
    6971        this->nearClipDistance_ = 1;
     72        this->lastDtLagged_ = false;
    7073
    7174        this->setSyncMode(0x0);
     
    111114        {
    112115            // this stuff here may need some adjustments
    113             float coeff = std::min(1.0f, 15.0f * dt);
     116            float poscoeff = 15.0f * dt / this->getTimeFactor();
     117            float anglecoeff = 7.0f * dt / this->getTimeFactor();
     118            // Only clamp if fps rate is actually falling. Occasional high dts should
     119            // not be clamped to reducing lagging effects.
     120            if (poscoeff > 1.0f)
     121            {
     122                if (this->lastDtLagged_)
     123                    poscoeff = 1.0f;
     124                else
     125                    this->lastDtLagged_ = true;
     126            }
     127            else
     128                this->lastDtLagged_ = false;
     129
     130            if (anglecoeff > 1.0f)
     131            {
     132                if (this->lastDtLagged_)
     133                    anglecoeff = 1.0f;
     134                else
     135                    this->lastDtLagged_ = true;
     136            }
     137            else
     138                this->lastDtLagged_ = false;
    114139
    115140            Vector3 offset = this->getWorldPosition() - this->cameraNode_->_getDerivedPosition();
    116             this->cameraNode_->translate(coeff * offset);
     141            this->cameraNode_->translate(poscoeff * offset);
    117142
    118             this->cameraNode_->setOrientation(Quaternion::Slerp(coeff, this->cameraNode_->_getDerivedOrientation(), this->getWorldOrientation(), true));
    119             //this->cameraNode_->setOrientation(this->getWorldOrientation());
     143            this->cameraNode_->setOrientation(Quaternion::Slerp(anglecoeff, this->cameraNode_->_getDerivedOrientation(), this->getWorldOrientation(), true));
     144        }
     145
     146        // Update sound listener transformation
     147        if (GameMode::playsSound() && this->bHasFocus_)
     148        {
     149            SoundManager::getInstance().setListenerPosition(this->getWorldPosition());
     150            SoundManager::getInstance().setListenerOrientation(this->getWorldOrientation());
    120151        }
    121152    }
  • code/trunk/src/orxonox/graphics/Camera.h

    r5781 r6417  
    3434#include "util/OgreForwardRefs.h"
    3535#include "tools/interfaces/Tickable.h"
     36#include "tools/interfaces/TimeFactorListener.h"
    3637#include "worldentities/StaticEntity.h"
    3738
    3839namespace orxonox
    3940{
    40     class _OrxonoxExport Camera : public StaticEntity, public Tickable
     41    class _OrxonoxExport Camera : public StaticEntity, public Tickable, public TimeFactorListener
    4142    {
    4243        friend class CameraManager;
     
    5152            void requestFocus();
    5253            void releaseFocus();
     54
     55            inline Ogre::Camera* getOgreCamera()
     56               { return this->camera_; }
    5357
    5458            inline bool hasFocus()
     
    6973            bool             bHasFocus_;
    7074            bool             bDrag_;
     75            bool             lastDtLagged_;
    7176    };
    7277}
Note: See TracChangeset for help on using the changeset viewer.