Index: /trunk/src/lib/math/quaternion.cc
===================================================================
--- /trunk/src/lib/math/quaternion.cc	(revision 10694)
+++ /trunk/src/lib/math/quaternion.cc	(revision 10695)
@@ -79,6 +79,7 @@
  * @param yaw: the yaw in radians
  */
-Quaternion::Quaternion (float roll, float pitch, float yaw)
-{
+Quaternion::Quaternion (float attitude, float heading, float bank)
+{
+/*
   float cr, cp, cy, sr, sp, sy, cpcy, spsy;
 
@@ -99,5 +100,21 @@
   v.y = cr * sp * cy + sr * cp * sy;
   v.z = cr * cp * sy - sr * sp * cy;
-}
+*/
+  float c1, c2, c3, s1, s2, s3;
+
+  c1 = cos(heading / 2);
+  c2 = cos(attitude / 2);
+  c3 = cos(bank / 2);
+
+  s1 = sin(heading / 2);
+  s2 = sin(attitude / 2);
+  s3 = sin(bank / 2);
+
+  w = c1 * c2 * c3 - s1 * s2 * s3;
+  v.x = s1 * s2 * c3 +c1 * c2 * s3;
+  v.y = s1 * c2 * c3 + c1 * s2 * s3;
+  v.z = c1 * s2 * c3 - s1 * c2 * s3;
+}
+
 
 /**
@@ -271,4 +288,11 @@
 }
 
+/**
+ * @returns Bank, Attitude, Heading
+ */
+Vector Quaternion::getRotation() const
+{
+  return Vector(getAttitude(), getHeading(), getBank());
+}
 
 
Index: /trunk/src/lib/math/quaternion.h
===================================================================
--- /trunk/src/lib/math/quaternion.h	(revision 10694)
+++ /trunk/src/lib/math/quaternion.h	(revision 10695)
@@ -109,4 +109,7 @@
     float getBank() const;
     Quaternion getBankQuat() const;
+
+    Vector getRotation() const;
+
     /** @returns the rotational axis of this Quaternion */
     inline Vector getSpacialAxis() const { return this->v / sin(acos(w));/*sqrt(v.x*v.x + v.y*v.y + v.z+v.z);*/ };
Index: /trunk/src/lib/sound/sound_engine.cc
===================================================================
--- /trunk/src/lib/sound/sound_engine.cc	(revision 10694)
+++ /trunk/src/lib/sound/sound_engine.cc	(revision 10695)
@@ -317,4 +317,5 @@
       alSourcef (source, AL_PITCH,    1.0      );
       alSourcef (source, AL_GAIN,     this->getEffectsVolume() );
+      alSourcef (source, AL_ROLLOFF_FACTOR, 0.0 );
       alSourcei (source, AL_LOOPING,  AL_FALSE );
       this->ALSources.push(source);
Index: /trunk/src/lib/sound/sound_source.cc
===================================================================
--- /trunk/src/lib/sound/sound_source.cc	(revision 10694)
+++ /trunk/src/lib/sound/sound_source.cc	(revision 10695)
@@ -126,5 +126,6 @@
       alSourcei (this->sourceID, AL_BUFFER, this->buffer.getID());
       alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE);
-      alSourcef (this->sourceID, AL_GAIN, 1);
+//      alSourcef (this->sourceID, AL_ROLLOFF_FACTOR, 0.0);
+      alSourcef (this->sourceID, AL_GAIN, SoundEngine::getInstance()->getEffectsVolume());
       alSourcePlay(this->sourceID);
 
@@ -151,5 +152,6 @@
     alSourcei (this->sourceID, AL_BUFFER, buffer.getID());
     alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE);
-    alSourcef (this->sourceID, AL_GAIN, 1);
+//    alSourcef (this->sourceID, AL_ROLLOFF_FACTOR, 0.0);
+    alSourcef (this->sourceID, AL_GAIN, SoundEngine::getInstance()->getEffectsVolume());
 
     alSourcePlay(this->sourceID);
@@ -168,6 +170,7 @@
    * @param buffer the buffer to play back on this Source
    * @param gain the gain of the sound buffer
-  */
-  void SoundSource::play(const SoundBuffer& buffer, float gain)
+   * @param rolloff the rolloff of the sound buffer
+  */
+  void SoundSource::play(const SoundBuffer& buffer, float gain, float rolloff)
   {
     if (!this->retrieveSource())
@@ -180,4 +183,5 @@
     alSourcei (this->sourceID, AL_BUFFER, buffer.getID());
     alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE);
+    alSourcef (this->sourceID, AL_ROLLOFF_FACTOR, rolloff);
     alSourcef (this->sourceID, AL_GAIN, gain);
 
@@ -193,10 +197,11 @@
 
   /**
-   * @brief Plays back buffer on this Source with gain and looping possibility
+   * @brief Plays back buffer on this Source with gain, rolloff and looping possibility
    * @param buffer the buffer to play back on this Source
-   *  @param gain the gain of the sound buffer
+   * @param gain the gain of the sound buffer
+   * @param rolloff the rolloff of the sound buffer
    * @param loop if true, sound gets looped
    */
-  void SoundSource::play(const SoundBuffer& buffer, float gain, bool loop)
+  void SoundSource::play(const SoundBuffer& buffer, float gain, float rolloff, bool loop)
   {
     if (!this->retrieveSource())
@@ -215,4 +220,5 @@
 
     alSourcef (this->sourceID, AL_GAIN, gain);
+    alSourcef (this->sourceID, AL_ROLLOFF_FACTOR, rolloff);
 
     alSourcePlay(this->sourceID);
@@ -226,4 +232,37 @@
   }
 
+  /**
+   * @brief Plays back buffer on this Source with looping possibility
+   * @param buffer the buffer to play back on this Source
+   * @param loop if true, sound gets looped
+   */
+  void SoundSource::play(const SoundBuffer& buffer, bool loop)
+  {
+    if (!this->retrieveSource())
+    {
+      PRINTF(3)("No more Free sources (You might consider raising the Source-Count).\n");
+      return;
+    }
+
+    alSourceStop(this->sourceID);
+    alSourcei (this->sourceID, AL_BUFFER, buffer.getID());
+
+    if (loop)
+      alSourcei (this->sourceID, AL_LOOPING,  AL_TRUE);
+    else
+      alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE);
+
+    alSourcef (this->sourceID, AL_GAIN, SoundEngine::getInstance()->getEffectsVolume());
+
+    alSourcePlay(this->sourceID);
+
+    if (unlikely(this->buffer.getID() != 0))
+      alSourcei (this->sourceID, AL_BUFFER, this->buffer.getID());
+    this->bPlay = true;
+
+    if (DEBUG_LEVEL >= 3)
+      SoundEngine::checkError("Play Source", __LINE__);
+  }
+  
   /**
    * @brief Changes the volume of an (active) buffer
Index: /trunk/src/lib/sound/sound_source.h
===================================================================
--- /trunk/src/lib/sound/sound_source.h	(revision 10694)
+++ /trunk/src/lib/sound/sound_source.h	(revision 10695)
@@ -30,6 +30,7 @@
     void play();
     void play(const SoundBuffer& buffer);
-    void play(const SoundBuffer& buffer, float gain);
-    void play(const SoundBuffer& buffer, float gain, bool loop);
+    void play(const SoundBuffer& buffer, float gain, float rolloff);
+    void play(const SoundBuffer& buffer, float gain, float rolloff, bool loop);
+    void play(const SoundBuffer& buffer, bool loop);
 
     void gain(const SoundBuffer& buffer, float gain);
Index: /trunk/src/world_entities/WorldEntities.am
===================================================================
--- /trunk/src/world_entities/WorldEntities.am	(revision 10694)
+++ /trunk/src/world_entities/WorldEntities.am	(revision 10695)
@@ -12,5 +12,4 @@
                 world_entities/npcs/repair_station.cc \
                 world_entities/npcs/attractor_mine.cc \
-                world_entities/npcs/mover.cc \
                 \
                 \
@@ -79,4 +78,17 @@
                 world_entities/environments/planet.cc \
                 world_entities/environments/bsp_entity.cc \
+                world_entities/environments/mover.cc \
+                world_entities/environments/mover_station.cc \
+                world_entities/environments/mover_station_list.cc \
+                world_entities/environments/mover_trigger.cc \
+                world_entities/environments/mover_trigger_approach.cc \
+                world_entities/environments/mover_trigger_delay_list.cc \
+                world_entities/environments/mover_trigger_event.cc \
+                world_entities/environments/mover_trigger_event_list.cc \
+                world_entities/environments/mover_trigger_intervisibility.cc \
+                world_entities/environments/mover_trigger_key.cc \
+                world_entities/environments/mover_trigger_list.cc \
+                world_entities/environments/mover_trigger_pointer_list.cc \
+                world_entities/environments/mover_trigger_mapstart.cc \
 		\
 		\
@@ -146,5 +158,4 @@
                 npcs/repair_station.h \
                 npcs/attractor_mine.h \
-                npcs/mover.h \
                 \
                 environments/environment.h \
@@ -224,4 +235,17 @@
                 environments/mapped_water.h \
                 environments/rotor.h \
+                environments/mover.h \
+                environments/mover_station.h \
+                environments/mover_station_list.h \
+                environments/mover_trigger.h \
+                environments/mover_trigger_approach.h \
+                environments/mover_trigger_delay_list.h \
+                environments/mover_trigger_event.h \
+                environments/mover_trigger_event_list.h \
+                environments/mover_trigger_intervisibility.h \
+                environments/mover_trigger_key.h \
+                environments/mover_trigger_list.h \
+                environments/mover_trigger_pointer_list.h \
+                environments/mover_trigger_mapstart.h \
                 \
                 elements/image_entity.h \
Index: /trunk/src/world_entities/effects/explosion.cc
===================================================================
--- /trunk/src/world_entities/effects/explosion.cc	(revision 10694)
+++ /trunk/src/world_entities/effects/explosion.cc	(revision 10695)
@@ -25,4 +25,8 @@
 #include "particles/sprite_particles.h"
 
+#include "sound/resource_sound_buffer.h"
+#include "sound_engine.h"
+
+
 ObjectListDefinition(Explosion);
 CREATE_FAST_FACTORY_STATIC(Explosion);
@@ -38,4 +42,5 @@
                         //Explode !
                             ->addMethod("explode", Executor3<Explosion, lua_State*, float, float, float>(&Explosion::explode))
+                            ->addMethod("setExplosionSound", Executor1<Explosion, lua_State*, const std::string&>(&Explosion::setExplosionSound))
                        );
 
@@ -55,5 +60,7 @@
   this->lifeCycle = 0.0f;
   this->lifeTime = .5f;
-
+  
+  this->explosionSound.setSourceNode(this);
+  
 }
 
@@ -65,5 +72,6 @@
 {
   delete this->emitter;
-
+  if (this->explosionSound.isPlaying())
+    this->explosionSound.stop();
   /* this is normaly done by World.cc by deleting the ParticleEngine */
   if (Explosion::explosionParticles != NULL && Explosion::objectList().size() <= 1)
@@ -88,4 +96,6 @@
   explosion->emitter->setSize(Vector(x,y,z));
   explosion->activate();
+  
+  
 }
 
@@ -113,4 +123,6 @@
   this->toList(OM_DEAD_TICK);
   this->lifeCycle = 0.0;
+  
+  this->explosionSound.play(this->explosionSoundBuffer, OrxSound::SoundEngine::getInstance()->getEffectsVolume(), 0.01, true);
 }
 
Index: /trunk/src/world_entities/effects/explosion.h
===================================================================
--- /trunk/src/world_entities/effects/explosion.h	(revision 10694)
+++ /trunk/src/world_entities/effects/explosion.h	(revision 10695)
@@ -8,4 +8,7 @@
 
 #include "world_entity.h"
+#include "sound_source.h"
+#include "sound_buffer.h"
+#include "sound/resource_sound_buffer.h"
 
 class SpriteParticles;
@@ -19,4 +22,5 @@
     static void explode (PNode* position, const Vector& size);
     void explode (float x, float y, float z); /// Explode at the current position with size (x,y,z)
+    void setExplosionSound(const std::string& newExplosionSound){  this->explosionSoundBuffer = OrxSound::ResourceSoundBuffer(newExplosionSound);  }
     
     Explosion ();
@@ -36,4 +40,7 @@
     static SpriteParticles*    explosionParticles;
     BoxEmitter*                emitter;
+    
+    OrxSound::SoundSource      explosionSound;
+    OrxSound::SoundBuffer      explosionSoundBuffer;
 };
 
Index: unk/src/world_entities/npcs/mover.cc
===================================================================
--- /trunk/src/world_entities/npcs/mover.cc	(revision 10694)
+++ 	(revision )
@@ -1,254 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Fabian 'x3n' Landau
-   co-programmer:
-*/
-
-#include "sound/resource_sound_buffer.h"
-#include "util/loading/load_param.h"
-#include "util/loading/factory.h"
-#include "debug.h"
-
-#include "mover.h"
-#include "state.h"
-#include "tools/camera.h"
-
-
-ObjectListDefinition(Mover);
-CREATE_FACTORY(Mover);
-
-/**
- *  initializes the Mover from a XmlElement
-*/
-Mover::Mover(const TiXmlElement* root)
-{
-    this->registerObject(this, Mover::_objectList);
-    this->toList(OM_ENVIRON);
-
-    this->targetCoordinates = Vector(0, 0, 0);
-    this->originCoordinates = Vector(0, 87, -256);
-    this->actionRadius = 40.0;
-    this->actionTime = 1.0;
-
-    if (root != NULL)
-        this->loadParams(root);
-
-    this->updateNode(0.001);
-    this->originCoordinates = this->getAbsCoor();
-    this->state = Closed;
-
-    this->soundSource_starting.setSourceNode(this);
-    this->soundSource_moving.setSourceNode(this);
-    this->soundSource_ending.setSourceNode(this);
-
-//    this->soundSource_starting.setRolloffFactor(0.0);
-//    this->soundSource_moving.setRolloffFactor(0.0);
-//    this->soundSource_ending.setRolloffFactor(0.0);
-}
-
-Mover::~Mover()
-{
-    if (this->soundSource_starting.isPlaying())
-        this->soundSource_starting.stop();
-    if (this->soundSource_moving.isPlaying())
-        this->soundSource_moving.stop();
-    if (this->soundSource_ending.isPlaying())
-        this->soundSource_ending.stop();
-}
-
-/**
- * loads the Settings of the Mover from an XML-element.
- * @param root the XML-element to load the Movers's properties from
- */
-void Mover::loadParams(const TiXmlElement* root)
-{
-    WorldEntity::loadParams(root);
-
-    LoadParam(root, "rel-target-coor", this, Mover, setTargetCoordinates)
-        .describe("sets the relative target coordinates of the door");
-    LoadParam(root, "action-radius", this, Mover, setActionRadius)
-        .describe("sets the action radius of the door")
-        .defaultValues(40.0);
-    LoadParam(root, "action-time", this, Mover, setActionTime)
-        .describe("sets the action time of the door")
-        .defaultValues(1.0);
-    LoadParam(root, "stay-open-time", this, Mover, setStayOpenTime)
-        .describe("sets the time, the door must stay open")
-        .defaultValues(0.0);
-    LoadParam(root, "opening-sound", this, Mover, setOpeningSoundFile)
-        .describe("Sets the file of the opening sound source");
-    LoadParam(root, "opened-sound", this, Mover, setOpenedSoundFile)
-        .describe("Sets the file of the opened sound source");
-    LoadParam(root, "moving-sound", this, Mover, setMovingSoundFile)
-        .describe("Sets the file of the moving sound source");
-    LoadParam(root, "closing-sound", this, Mover, setClosingSoundFile)
-        .describe("Sets the file of the closing sound source");
-    LoadParam(root, "closed-sound", this, Mover, setClosedSoundFile)
-        .describe("Sets the file of the closed sound source");
-}
-
-void Mover::setOpeningSoundFile(const std::string& fileName)
-{
-    this->soundBuffer_opening = OrxSound::ResourceSoundBuffer(fileName);
-}
-
-void Mover::setOpenedSoundFile(const std::string& fileName)
-{
-    this->soundBuffer_opened = OrxSound::ResourceSoundBuffer(fileName);
-}
-
-void Mover::setMovingSoundFile(const std::string& fileName)
-{
-    this->soundBuffer_moving = OrxSound::ResourceSoundBuffer(fileName);
-}
-
-void Mover::setClosingSoundFile(const std::string& fileName)
-{
-    this->soundBuffer_closing = OrxSound::ResourceSoundBuffer(fileName);
-}
-
-void Mover::setClosedSoundFile(const std::string& fileName)
-{
-    this->soundBuffer_closed = OrxSound::ResourceSoundBuffer(fileName);
-}
-
-/**
- * tick function
- */
-void Mover::tick(float dt)
-{
-    if (this->state == Closed)
-    {
-        if (this->checkPlayerInActionRadius())
-        {
-            this->state = Opening;
-            if (this->soundBuffer_opening.loaded())
-                this->soundSource_starting.play(this->soundBuffer_opening);
-            if (this->soundBuffer_moving.loaded())
-                this->soundSource_moving.play(this->soundBuffer_moving, 1.0, true);
-        }
-    }
-    else if (this->state == Opening)
-    {
-        if (this->checkOpen(dt))
-        {
-            this->state = Open;
-            this->setAbsCoor(this->originCoordinates + this->targetCoordinates);
-            if (this->soundBuffer_opened.loaded())
-                this->soundSource_ending.play(this->soundBuffer_opened);
-            if (this->soundBuffer_moving.loaded())
-                this->soundSource_moving.stop();
-        }
-        this->openTime = 0;
-    }
-    else if (this->state == Open)
-    {
-        this->openTime += dt;
-        if (this->openTime >= this->stayOpenTime)
-        {
-            if (!this->checkPlayerInActionRadius())
-            {
-                this->state = Closing;
-                if (this->soundBuffer_closing.loaded())
-                    this->soundSource_starting.play(this->soundBuffer_closing);
-                if (this->soundBuffer_moving.loaded())
-                    this->soundSource_moving.play(this->soundBuffer_moving, 1.0, true);
-            }
-        }
-    }
-    else if (this->state == Closing)
-    {
-        if (this->checkClosed(dt))
-        {
-            this->state = Closed;
-            this->setAbsCoor(this->originCoordinates);
-            if (this->soundBuffer_closed.loaded())
-                this->soundSource_ending.play(this->soundBuffer_closed);
-            if (this->soundBuffer_moving.loaded())
-                this->soundSource_moving.stop();
-        }
-        if (this->checkPlayerInActionRadius())
-        {
-            this->state = Opening;
-        }
-    }
-
-    if (this->state == Opening)
-    {
-        this->shiftCoor(this->targetCoordinates / this->actionTime * dt);
-    }
-    else if (this->state == Closing)
-    {
-        this->shiftCoor(this->targetCoordinates * (-1) / this->actionTime * dt);
-    }
-}
-
-/**
- * checks if the door is open
- */
-bool Mover::checkOpen(float dt)
-{
-    if (fabs((this->originCoordinates - (this->getAbsCoor() - this->targetCoordinates)).len()) < fabs(2 * (this->targetCoordinates / this->actionTime * dt).len()))
-        return true;
-    
-    return false;
-}
-
-/**
- * checks if the door is closed
- */
-bool Mover::checkClosed(float dt)
-{
-    if (fabs((this->getAbsCoor() - this->originCoordinates).len()) < fabs(2 * (this->targetCoordinates / this->actionTime * dt).len()))
-        return true;
-
-    return false;
-}
-
-#include "playable.h"
-#include "generic_npc.h"
-/**
- * checks if the player is within the action radius
- */
-bool Mover::checkPlayerInActionRadius()
-{
-    WorldEntity* entity;
-    float distance;
-
-    for (ObjectList<Playable>::const_iterator it = Playable::objectList().begin();
-        it != Playable::objectList().end();
-        ++it)
-    // for all players
-    {
-        entity = (*it);
-        distance = (this->originCoordinates - entity->getAbsCoor()).len();
-        if (distance < this->actionRadius)
-        {
-            this->soundSource_starting.setSourceNode((PNode*)State::getCamera());   // bad hack!
-            this->soundSource_moving.setSourceNode((PNode*)State::getCamera());     // TODO: make the sound louder without
-            this->soundSource_ending.setSourceNode((PNode*)State::getCamera());     // attaching him to the player
-            return true;
-        }
-    }
-
-    for (ObjectList<GenericNPC>::const_iterator it = GenericNPC::objectList().begin();
-        it != GenericNPC::objectList().end();
-        ++it)
-    {
-        entity = (*it);
-        distance = (this->originCoordinates - entity->getAbsCoor()).len();
-        if (distance < this->actionRadius)
-            return true;
-    }
-
-    return false;
-}
Index: unk/src/world_entities/npcs/mover.h
===================================================================
--- /trunk/src/world_entities/npcs/mover.h	(revision 10694)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/*!
- * @file mover.h
- *  Mover is an object which moves from its origin to relatively given coordinates
- *  within a given action-time as soon as the player enters the action-radius.
- */
-
-#ifndef _MOVER_H
-#define _MOVER_H
-
-/* INCLUDES */
-#include "world_entity.h"
-
-#include "sound_buffer.h"
-#include "sound_source.h"
-
-//! A Class to handle a Mover
-class Mover : public WorldEntity
-{
-    ObjectListDeclaration(Mover);
-    public:
-        typedef enum MoverState {
-            Closed        = 0,
-            Opening       = 1,
-            Open          = 2,
-            Closing       = 3,
-            Locked        = 4
-        };
-
-        Mover(const TiXmlElement* root = NULL);
-        virtual ~Mover();
-
-        virtual void loadParams(const TiXmlElement* root);
-
-        void setTargetCoordinates(float x, float y, float z) { this->targetCoordinates = Vector(x,y,z); }
-        void setActionRadius(float radius) { this->actionRadius = radius; }
-        void setActionTime(float time) { this->actionTime = time; }
-        void setStayOpenTime(float time) { this->stayOpenTime = time; }
-        void setOpeningSoundFile(const std::string& fileName);
-        void setOpenedSoundFile(const std::string& fileName);
-        void setMovingSoundFile(const std::string& fileName);
-        void setClosingSoundFile(const std::string& fileName);
-        void setClosedSoundFile(const std::string& fileName);
-
-        virtual void tick(float dt);
-
-    private:
-        bool checkOpen(float dt);
-        bool checkClosed(float dt);
-        bool checkPlayerInActionRadius();
-    
-        OrxSound::SoundSource       soundSource_starting;
-        OrxSound::SoundSource       soundSource_moving;
-        OrxSound::SoundSource       soundSource_ending;
-        OrxSound::SoundBuffer       soundBuffer_opening;
-        OrxSound::SoundBuffer       soundBuffer_opened;
-        OrxSound::SoundBuffer       soundBuffer_moving;
-        OrxSound::SoundBuffer       soundBuffer_closing;
-        OrxSound::SoundBuffer       soundBuffer_closed;
-
-        Vector                      targetCoordinates;          //!< the target coordinates
-        Vector                      originCoordinates;          //!< the origin coordinates
-        float                       actionRadius;               //!< the action-radius
-        float                       actionTime;                 //!< the action-time
-        int                         state;                      //!< the state of the mover
-        float                       stayOpenTime;               //!< waiting time while opened
-        float                       openTime;                   //!< time since opened
-};
-
-#endif  /* _MOVER_H */
-
-
-
