Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6191 for code


Ignore:
Timestamp:
Dec 2, 2009, 9:06:19 AM (15 years ago)
Author:
rgrieder
Message:

Moved sound listener to the active camera and fixed the ambient distance trigger (now acts on cameras and we only have one in a Scene so far).

Location:
code/branches/presentation2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/data/levels/sound.oxw

    r6119 r6191  
    2222        <events>
    2323                <activity>
    24                         <DistanceTrigger position="300,100,0" distance=200 target="ControllableEntity">
     24                        <DistanceTrigger position="300,100,0" distance=200 target="Camera">
    2525                                <attached>
    2626                                        <ParticleSpawner position="0,0,0" source="Orxonox/fire3" lifetime=0 loop=0 autostart=1 />
  • code/branches/presentation2/src/orxonox/controllers/HumanController.cc

    r6159 r6191  
    3636#include "infos/PlayerInfo.h"
    3737#include "overlays/Map.h"
    38 #include "graphics/Camera.h"
    39 #include "sound/SoundManager.h"
    4038#include "Radar.h"
    4139#include "Scene.h"
     
    8381        if (GameMode::playsSound() && HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    8482        {
    85             // Update sound listener
    8683            Camera* camera = HumanController::localController_s->controllableEntity_->getCamera();
    87             if (camera)
    88             {
    89                 SoundManager::getInstance().setListenerPosition(camera->getWorldPosition());
    90                 SoundManager::getInstance().setListenerOrientation(camera->getWorldOrientation());
    91             }
    92             else
     84            if (!camera)
    9385                COUT(3) << "HumanController, Warning: Using a ControllableEntity without Camera" << std::endl;
    9486        }
  • code/branches/presentation2/src/orxonox/graphics/Camera.cc

    r6170 r6191  
    4242#include "Scene.h"
    4343#include "CameraManager.h"
     44#include "sound/SoundManager.h"
    4445
    4546namespace orxonox
     
    131132            this->cameraNode_->setOrientation(Quaternion::Slerp(coeff, this->cameraNode_->_getDerivedOrientation(), this->getWorldOrientation(), true));
    132133        }
     134
     135        // Update sound listener transformation
     136        if (GameMode::playsSound() && this->bHasFocus_)
     137        {
     138            SoundManager::getInstance().setListenerPosition(this->getWorldPosition());
     139            SoundManager::getInstance().setListenerOrientation(this->getWorldOrientation());
     140        }
    133141    }
    134142
Note: See TracChangeset for help on using the changeset viewer.