Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6100 for code/branches


Ignore:
Timestamp:
Nov 19, 2009, 9:01:16 PM (15 years ago)
Author:
rgrieder
Message:

Added a sound for the engine (forward active mode) by overloading changedActivity in WorldSound.

Location:
code/branches/sound3
Files:
5 edited

Legend:

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

    r6093 r6100  
    1717    skybox       = "Orxonox/Starbox"
    1818  >
    19   <AmbientSound source="Mars.ogg" loop="true" playOnLoad="true" />
    20   <AmbientSound source="Asteroid_rocks.ogg" loop="true" playOnLoad="false">
     19
     20  <AmbientSound source="Mars.ogg" loop="true" play="true" />
     21  <AmbientSound source="Asteroid_rocks.ogg" loop="true" play="false">
    2122        <events>
    2223                <activity>
     
    2930        </events>
    3031  </AmbientSound>
    31     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
    32     <SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshippirate />
     32
     33  <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
     34  <SpawnPoint position="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
    3335  </Scene>
    3436</Level>
  • code/branches/sound3/data/levels/templates/spaceship_assff.oxt

    r5781 r6100  
    7676      <Light mainstate=visibility position="-8, 0, 8" diffuse="0.3, 0.6, 1.0" specular="0.3, 0.6, 1.0" attenuation="600, 1.0, 0.007, 0.0002" type=point />
    7777-->
     78      <!--WorldSound mainstate=activity source="sounds/Engine_low.ogg" oop=1 /-->
    7879    </active>
    7980    <forward>
    8081      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
    8182      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
     83      <WorldSound mainstate=activity source="sounds/Engine_low.ogg" oop=1 />
    8284    </forward>
    8385    <boost>
    8486      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 6" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
    8587      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
     88      <!--WorldSound mainstate=activity source="sounds/Engine_high.ogg" oop=1 /-->
    8689    </boost>
    8790    <brake>
  • code/branches/sound3/src/orxonox/sound/AmbientSound.cc

    r6071 r6100  
    125125    void AmbientSound::changedActivity()
    126126    {
    127         COUT(3) << "Sound: " << this->getSource() << ": ChangedActivity: " << this->isActive() << std::endl;
    128         this->BaseObject::changedActivity();
     127        SUPER(AmbientSound, changedActivity);
    129128        if (this->isActive())
    130         {
    131129            this->play();
    132         }
    133130        else
    134         {
    135131            this->stop();
    136         }
    137132    }
    138133}
  • code/branches/sound3/src/orxonox/sound/WorldSound.cc

    r6071 r6100  
    8989        }
    9090    }
     91
     92    void WorldSound::changedActivity()
     93    {
     94        SUPER(WorldSound, changedActivity);
     95        if (this->isActive())
     96            this->play();
     97        else
     98            this->stop();
     99    }
    91100}
  • code/branches/sound3/src/orxonox/sound/WorldSound.h

    r6069 r6100  
    5050        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5151        virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
     52        virtual void changedActivity();
    5253
    5354        virtual void tick(float dt);
Note: See TracChangeset for help on using the changeset viewer.