Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9939 for code


Ignore:
Timestamp:
Dec 21, 2013, 11:16:54 PM (11 years ago)
Author:
jo
Message:

presentationHS13 branch merged into trunk

Location:
code/trunk
Files:
74 edited
47 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/data/defaultConfig/keybindings.ini

    r9526 r9939  
    5858KeyLeftWindows=
    5959KeyLessThan=
    60 KeyM=
     60KeyM="WorldAmbientSound nextsong"
    6161KeyMail=
    6262KeyMediaSelect=
  • code/trunk/data/gui/scripts/MiscConfigMenu.lua

    r9016 r9939  
    3838    table.insert(P.commandList, "HUDNavigation MarkerLimit_")
    3939    table.insert(P.commandList, "HUDNavigation showDistance")
     40    table.insert(P.commandList, "HUDRadar RadarMode_")
    4041
    4142    P.nameList = {}
     
    6061    table.insert(P.nameList, "Marker Limit")
    6162    table.insert(P.nameList, "Show Distance next to cursor")
     63    table.insert(P.nameList, "Set Radar on 3D mode")
    6264
    6365    P.linesList = {}
  • code/trunk/data/levels/FPSTest.oxw

    r9348 r9939  
     1<!-- -->
    12<LevelInfo
    23 name = "FPS testlevel"
  • code/trunk/data/levels/Spacerace2.oxw

    r9348 r9939  
    1414
    1515?>
     16
    1617
    1718<?lua
     
    107108
    108109    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
    109 
     110       
     111        <!-- SOUNDS & MUSIC -->
     112    <WorldSound name="scoreSound" position="-200,0,0" source="sounds/ReadyGo.ogg" >
     113      <events>
     114        <play>
     115          <EventListener event="start" />
     116        </play>
     117      </events>
     118    </WorldSound>
     119    <DistanceTrigger name="start" position="-200,0,0"  target="Pawn" distance=100 stayActive="true" delay=0.5 />
     120   
     121    <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />
    110122
    111123    <!-- ------------------Planet----------------- -->
  • code/trunk/data/levels/asteroidField.oxw

    r9348 r9939  
    1111  include("templates/lodInformation.oxt")
    1212?>
     13<WorldAmbientSound source="Asteroid_rocks.ogg" looping="true" playOnLoad="true" />
    1314
    1415<?lua
  • code/trunk/data/levels/asteroids.oxw

    r9348 r9939  
    55 screenshot = "asteroids.png"
    66/>
     7<WorldAmbientSound source="Asteroid_rocks.ogg" looping="true" playOnLoad="true" />
    78
    89<?lua
  • code/trunk/data/levels/docking.oxw

    r9348 r9939  
     1<!-- -->
    12<LevelInfo
    23 name = "Transporter"
  • code/trunk/data/levels/dynamicMatch.oxw

    r9348 r9939  
    55 screenshot = "dynamicMatch.png"
    66/>
     7<WorldAmbientSound source="Mars.ogg" looping="true" playOnLoad="true" />
    78
    89<?lua
  • code/trunk/data/levels/gallery.oxw

    r9763 r9939  
    3636    all Objects are organized in columns
    3737---->
     38
     39<!--- Spacestation --->
     40      <!--Model position="0,0,-160" yaw="90" pitch="-90" roll="0" scale="1" mesh="ss_box_lowpoly.mesh" /-->
     41      <Model position="0, 20,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_box_lowpoly_ad1.mesh" />
     42      <Model position="0, 40,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_box_lowpoly_ad2.mesh" />
     43      <Model position="0, 60,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_box_lowpoly_ad3.mesh" />
     44      <Model position="0, 80,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_box_lowpoly_ad4.mesh" />
     45      <Model position="0,-20,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_tube.mesh" />
     46      <Model position="0,-40,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_tube_twd.mesh" />
     47      <Model position="0,-60,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_tube_x.mesh" />
     48      <Model position="0,-80,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_wall.mesh" />
     49      <Model position="0,-100,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_table_cracked.mesh" />
     50      <Model position="0,-120,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_table.mesh" />
     51      <Model position="0,-140,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_spind.mesh" />
     52      <Model position="0,-160,-160" yaw="90" pitch="-90" roll="0" scale="0.01" mesh="ss_machine.mesh" />
     53      <Model position="0,-180,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_flag_room.mesh" />
     54      <Model position="0,-200,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_flag_eu.mesh" />
     55      <Model position="0,-220,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_flag_csa.mesh" />
     56      <Model position="0,-240,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_flag_cau.mesh" />
     57      <Model position="0,-260,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_flag_aean.mesh" />
     58      <Model position="0,-280,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_door.mesh" />
     59      <Model position="0,-300,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_cylinder.mesh" />
     60      <Model position="0,-320,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_curve.mesh" />
     61      <Model position="0,-340,-160" yaw="90" pitch="-90" roll="0" scale="5" mesh="ss_chair.mesh" />
     62     
    3863
    3964<!--- Whole Objects --->
     
    152177      <!--Model position="0,80,200" yaw="90" pitch="-90" roll="0" scale="5" mesh="SmallPart1.mesh" /-->
    153178      <Model position="0,-20,200" yaw="90" pitch="-90" roll="0" scale="4" mesh="raceCheckPoint.mesh" />
    154       <Model position="0,-40,200" yaw="90" pitch="-90" roll="0" scale="0.5" mesh="Spacegate.mesh" />
     179      <Model position="0,-40,200" yaw="90" pitch="0" roll="0" scale="0.5" mesh="Spacegate.mesh" />
    155180
    156181      <Model position="0,-60,200" yaw="90" pitch="-90" roll="0" scale="0.5" mesh="BigSpacegate.mesh" />
  • code/trunk/data/levels/lastManStanding.oxw

    r9555 r9939  
    3232      include("includes/pickups.oxi")
    3333    ?>
     34   
     35    <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
    3436
    3537<!----- Spawnpoints
  • code/trunk/data/levels/lastTeamStanding.oxw

    r9348 r9939  
    3333      include("includes/pickups.oxi")
    3434    ?>
     35   
     36    <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
    3537
    3638<Bot />
  • code/trunk/data/levels/lastTeamStandingII.oxw

    r9348 r9939  
    2727    skybox       = "Orxonox/skyBoxBasic"
    2828  >
     29  <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
     30 
    2931<!-- TODO:
    30321. make collisionshapes bulletproof: -> attach movable entity with dynamic collisionshape within a static collisionshape
  • code/trunk/data/levels/maxim.oxw

    r9664 r9939  
     1<!-- -->
     2
    13<LevelInfo
    24 name = "Maxim's Test"
     
    2527  </templates>
    2628  <?lua include("includes/notifications.oxi") ?>
     29 
     30  <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
    2731
    2832  <NotificationQueueCEGUI
  • code/trunk/data/levels/missionOne.oxw

    r9798 r9939  
     1<!---->
    12<LevelInfo
    23 name = "Mission One"
  • code/trunk/data/levels/pickups.oxw

    r9348 r9939  
     1<!-- -->
    12<LevelInfo
    23 name = "Pickups showcase"
  • code/trunk/data/levels/pirateAttack.oxw

    r9348 r9939  
    2525    dofile("includes/CuboidSpaceStation.lua")
    2626?>
     27
     28<WorldAmbientSound source="Mars.ogg" looping="true" playOnLoad="true" />
    2729   
    2830<Level
  • code/trunk/data/levels/pong.oxw

    r9526 r9939  
    3434
    3535<Template name=pongball>
    36   <PongBall>
     36  <PongBall
     37   defScoreSound = "sounds/PlayerWinScore_cut.ogg"
     38   defBatSound = "sounds/Button.ogg"
     39   defBoundarySound = "sounds/Button.ogg">
    3740    <attached>
    3841      <Model mesh="sphere.mesh" scale=2 />
  • code/trunk/data/levels/portals.oxw

    r9348 r9939  
    1  
     1<!-- -->
    22<LevelInfo
    33 name = "Portals"
  • code/trunk/data/levels/presentation.oxw

    r9016 r9939  
     1<!-- -->
     2
    13<LevelInfo
    24 name = "Presentation"
  • code/trunk/data/levels/presentationFS11.oxw

    r9348 r9939  
     1<!---->
     2
    13<LevelInfo
    24 name = "Presentation FS11"
  • code/trunk/data/levels/quests.oxw

    r9016 r9939  
     1<!-- -->
    12<LevelInfo
    23 name = "Quests showcase"
  • code/trunk/data/levels/spaceRace.oxw

    r9016 r9939  
    2929    skybox       = "Orxonox/skyBoxMoreNebula"
    3030  >
     31 
     32  <!-- SOUNDS & MUSIC -->
     33    <WorldSound name="scoreSound" position="0,-2100,0" source="sounds/ReadyGo.ogg" >
     34      <events>
     35        <play>
     36          <EventListener event="start" />
     37        </play>
     38      </events>
     39    </WorldSound>
     40    <DistanceTrigger name="start" position="0,-2100,0"  target="Pawn" distance=100 stayActive="true" delay=0.5 />
     41 
     42    <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />
     43 
    3144
    3245    <?lua math.randomseed(98) ?>
     
    463476      </controller>
    464477    </SpaceShip>
     478   
     479   
    465480
    466481  </Scene>
  • code/trunk/data/levels/surfaceRace.oxw

    r9348 r9939  
    1010 tags = "gametype"
    1111/>
     12
    1213
    1314<?lua
     
    445446    ?>
    446447    <?lua end ?>
     448   
     449    <!-- SOUNDS & MUSIC -->
     450    <WorldSound name="scoreSound" position="0,8050,0" source="sounds/ReadyGo.ogg" >
     451      <events>
     452        <play>
     453          <EventListener event="start" />
     454        </play>
     455      </events>
     456    </WorldSound>
     457    <DistanceTrigger name="start" position="0,8050,0"  target="Pawn" distance=100 stayActive="true" delay=0.5 />
     458    <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />
    447459
    448460  </Scene>
  • code/trunk/data/levels/teamBaseMatch.oxw

    r9348 r9939  
    1919>
    2020
     21<WorldAmbientSound source="Jupiter.ogg" looping="true" playOnLoad="true" />
     22
    2123  <templates>
    2224    <Template link=lodtemplate_default />
  • code/trunk/data/levels/teamDeathMatch.oxw

    r9348 r9939  
    2222  </templates>
    2323  <?lua include("includes/notifications.oxi") ?>
     24 
     25  <WorldAmbientSound source="Jupiter.ogg" looping="true" playOnLoad="true" />
    2426
    2527  <Scene
  • code/trunk/data/levels/templates/lodInformation.oxt

    r9763 r9939  
    1717      <MeshLodInformation mesh=turretHead.mesh enabled=false />
    1818      <MeshLodInformation mesh=LaserBeam2.mesh enabled=false/>
     19      <MeshLodInformation mesh=asteroid_ice.mesh enabled=false/>
     20      <MeshLodInformation mesh=ast1.mesh  lodQuality=0.1/>
     21      <MeshLodInformation mesh=ast2.mesh  lodQuality=0.1/>
     22      <MeshLodInformation mesh=ast3.mesh  lodQuality=0.1/>
     23      <MeshLodInformation mesh=ast4.mesh  lodQuality=0.1/>
     24      <MeshLodInformation mesh=ast5.mesh  lodQuality=0.1/>
     25      <MeshLodInformation mesh=ast6.mesh  lodQuality=0.1/>
    1926
    2027      <!-- disable LOD for some debris meshes which caused a crash (fixed in Ogre 1.7.3) -->
    2128      <MeshLodInformation mesh=BodyDebris1.mesh enabled=false/>
    2229      <MeshLodInformation mesh=WingDebris2.mesh enabled=false/>
     30      <MeshLodInformation mesh=HeavyCruiser_body.mesh enabled=false/>
     31      <MeshLodInformation mesh=HeavyCruiser_frontL.mesh enabled=false/>
     32      <MeshLodInformation mesh=HeavyCruiser_frontR.mesh enabled=false/>
     33      <MeshLodInformation mesh=HeavyCruiser_partL.mesh enabled=false/>
     34      <MeshLodInformation mesh=HeavyCruiser_partR.mesh enabled=false/>
     35      <MeshLodInformation mesh=HeavyCruiser_sidearmL.mesh enabled=false/>
     36      <MeshLodInformation mesh=HeavyCruiser_sidearmLfront.mesh enabled=false/>
     37      <MeshLodInformation mesh=HeavyCruiser_sidearmR.mesh enabled=false/>
     38      <MeshLodInformation mesh=HeavyCruiser_sidearmRfront.mesh enabled=false/>
     39
     40          <MeshLodInformation mesh=ss_cylinder.mesh enabled=false/>
     41          <MeshLodInformation mesh=ss_chair.mesh enabled=false/>
     42          <MeshLodInformation mesh=ss_flag_room.mesh enabled=false/>
     43          <MeshLodInformation mesh=ss_wall.mesh enabled=false/>
     44          <MeshLodInformation mesh=ss_tube_twd.mesh enabled=false/>
     45          <MeshLodInformation mesh=ss_spind.mesh enabled=false/>
     46         
    2347    </lodinformation>
    2448  </Level>
  • code/trunk/data/levels/templates/spaceshipAssff.oxt

    r8860 r9939  
    3737   linearDamping     = 0.7
    3838   angularDamping    = 0.9999999
     39
     40   explosionSound = "sounds/Explosion2.ogg"
    3941  >
    4042    <engines>
     
    8284   defEngineSndNormal = "sounds/Engine_low.ogg"
    8385   defEngineSndBoost = "sounds/Engine_high.ogg"
    84 
     86   
    8587   accelerationfront     = 500
    8688   accelerationbrake     = 500
  • code/trunk/data/levels/turretTest.oxw

    r9664 r9939  
     1<!-- -->
     2
    13<LevelInfo
    24 name = "turret Test"
  • code/trunk/data/levels/underAttack.oxw

    r9348 r9939  
     1<!---->
     2
    13<LevelInfo
    24 name = "Under Attack"
     
    2022  </templates>
    2123  <?lua include("includes/notifications.oxi") ?>
     24  <WorldAmbientSound source="Jupiter.ogg" looping="true" playOnLoad="true" />
    2225
    2326  <Scene
  • code/trunk/data/overlays/HUD.oxo

    r9526 r9939  
    6868  <HUDRadar
    6969   name          = "Radar"
    70    background    = "Orxonox/Radar"
     70   background    = "Orxonox/radar"
    7171   correctAspect = true
    7272   size          = "0.17, 0.17"
  • code/trunk/data/overlays/HUDTemplates3.oxo

    r9526 r9939  
    108108    />
    109109
    110     <HUDRadar
    111      name          = "Radar"
    112      background    = "Orxonox/Radar"
    113      correctaspect = true
    114      size          = "0.17, 0.17"
    115      position      = "1.0, 1.0"
    116      pickpoint     = "1.0, 1.0"
    117      rotation      = 0
    118      sensitivity   = 1.0
    119      halfDotSizeDistance = 3000
    120      maximumDotSize      = 0.1
     110        <HUDRadar
     111     name                               = "Radar"
     112     background                         = "Orxonox/Radar3D"
     113     material2D                         = "Orxonox/Radar"
     114     material3DMiddle           = "Orxonox/Radar3D"
     115     material3DFront            = "Orxonox/Radar3DFront"
     116     material3DBack                     = "Orxonox/Radar3DBack"
     117     correctaspect                      = true
     118     size                               = "0.17, 0.17"
     119     position                           = "1.0, 1.0"
     120     pickpoint                          = "1.0, 1.0"
     121     rotation                           = 0
     122     sensitivity                        = 1.0
     123     halfDotSizeDistance        = 3000
     124     detectionLimit             = 10000.0
     125     maximumDotSize             = 0.1
     126     maximumDotSize3D           = 0.06
     127     mapAngle3D                         = 0.6435011
    121128    />
    122 
     129   
    123130    <HUDTimer
    124131     name     = "Timer"
  • code/trunk/data/overlays/debug.oxo

    r8858 r9939  
    3232   name     = "RTRText"
    3333   position = "0.3, 0.09"
     34   font     = "Monofur"
     35   textsize = 0.03
     36  />
     37 
     38  <OverlayText
     39   name     = "PositionTextCaption"
     40   position = "0.03, 0.13"
     41   font     = "Monofur"
     42   caption  = "Position: "
     43   textsize = 0.03
     44  />
     45 
     46  <DebugPositionText
     47   name     = "PositionText"
     48   position = "0.3, 0.13"
    3449   font     = "Monofur"
    3550   textsize = 0.03
  • code/trunk/src/libraries/util/Math.cc

    r8400 r9939  
    2323 *      Fabian 'x3n' Landau
    2424 *   Co-authors:
    25  *      ...
     25 *      Wolfgang Roenninger
    2626 *
    2727 */
     
    147147
    148148    /**
    149         @brief Gets the 2D viewing direction (up/down, left/right) to the position of the other object, multiplied with the viewing distance to the object (0° = 0, 180° = 1).
     149        @brief Gets the 2D viewing direction (up/down, left/right) to the position of the other object, multiplied with the viewing distance to the object (0� = 0, 180� = 1).
    150150        @param myposition My position
    151151        @param mydirection My viewing direction
     
    189189        else
    190190            return orxonox::Vector2( -sin_value * radius, cos_value * radius);
     191    }
     192
     193
     194    /**
     195            @brief Gets the 2D project vector for the 3D Radar .
     196            @param myposition My position
     197            @param mydirection My viewing direction
     198            @param myorthonormal My orthonormalvector (pointing upwards through my head)
     199            @param otherposition The position of the other object
     200            @param mapangle The angle between line of sight on screen and the 3Dmap-x/z-plain in radian
     201            @param detectionlimit The limit in which objects are shown on the map
     202            @return The viewing direction
     203    */
     204    orxonox::Vector2 get3DProjection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float mapangle, const float detectionlimit)
     205    {
     206        // Orxonox Vectors: x_direction you are looking, y_direction points up, z_direction points to the right
     207        orxonox::Vector3 distance = otherposition - myposition; // get vector from Ship to object
     208
     209        // new coordinate system:       x_axsis:        mydirection             (points front)
     210        //                                                      y_axsis:        myorthonormal   (points up)
     211        //                                                      z_axsis:        myside                  (points right)
     212
     213        orxonox::Vector3 myside = mydirection.crossProduct(myorthonormal); // get 3. base vector
     214
     215        distance = 4*distance / detectionlimit; // shrink vector on map
     216        if(distance.length() > 1.0f) // if object would wander outside of the map
     217                {
     218                distance = distance / distance.length();
     219                        }
     220
     221        // perform a coordinate transformation to get distance in relation of the position of the ship
     222        orxonox::Vector3 distanceShip = getTransformedVector(distance, mydirection, myorthonormal, myside);
     223
     224        // calculate 2D vector on the map (with angle between x/z - plain and line of sight)
     225        float xcoordinate = distanceShip.z; // z; cause x direction on screen is to the right side
     226        float ycoordinate = distanceShip.x*sin(mapangle)+distanceShip.y*cos(mapangle);
     227        return orxonox::Vector2(xcoordinate , ycoordinate);
     228    }
     229
     230    /**
     231               @brief Gets if a object is over the x/z - plain on map
     232               @param myposition My position
     233               @param mydirection My viewing direction
     234               @param myorthonormal My orthonormalvector (pointing upwards through my head)
     235               @param otherposition The position of the other object
     236               @param mapangle The angle you look on the 3Dmap in radian
     237               @return If distancevector to the other object has a positive y-coordinate
     238
     239               Examples:
     240                Returns true if object is over x/z - plain
     241                Returns false if object is below x/z -plain
     242    */
     243    bool isObjectHigherThanShipOnMap(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float mapangle)
     244    {
     245        // Orxonox Vectors: x_direction you are looking, y_direction points up, z_direction points to the right
     246        orxonox::Vector3 distance = otherposition - myposition;
     247
     248        // new coordinate system:       x_axsis:        mydirection             (points front)
     249        //                                                      y_axsis:        myorthonormal   (points up)
     250        //                                                      z_axsis:        myside                  (points right)
     251
     252        orxonox::Vector3 myside = mydirection.crossProduct(myorthonormal); // get vector from Ship to object
     253
     254
     255        // perform a coordinate transformation to get distance in relation of the position of the ship
     256        orxonox::Vector3 distanceShip = getTransformedVector(distance, mydirection, myorthonormal, myside);
     257
     258        if(distanceShip.y >= 0)
     259                return true;
     260        else
     261                return false;
     262    }
     263
     264    /**
     265                   @brief A value between 0 and 10, in order how other object is in front or in back
     266                   @param myposition My position
     267                   @param mydirection My viewing direction
     268                   @param myorthonormal My orthonormalvector (pointing upwards through my head)
     269                   @param otherposition The position of the other object
     270                   @param detectionlimit The limit in which objects are shown on the map
     271                   @return value between 0 and 100
     272    */
     273    int determineMap3DZOrder(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float detectionlimit)
     274    {
     275        orxonox::Vector3 distance = otherposition - myposition; // get vector from Ship to object
     276        orxonox::Vector3 myside = mydirection.crossProduct(myorthonormal);      // get vector to the side
     277
     278        distance = 4*distance / detectionlimit; // shrink vector on map
     279        if(distance.length() > 1.0f) // if object would wander outside of the map
     280        {
     281                distance = distance / distance.length();
     282        }
     283
     284        // perform a coordinate transformation to get distance in relation of the position of the ship
     285        orxonox::Vector3 distanceShip = getTransformedVector(distance, mydirection, myorthonormal, myside);
     286
     287        return (int) 50 - 100*distanceShip.x;
     288    }
     289
     290
     291    /**
     292                @brief Gets the new vector after a coordinate transformation
     293                @param distance Vector which will be transformed
     294                @param mydirection New x basevector
     295                @param myorthonormal New y basevector
     296                @param otherposition New z basevector
     297                @return direction in the new coordinates
     298
     299                x is vector in old coordinates
     300                y is vector in old coordinates
     301                T is transform matrix with:
     302                        T = (t1 , t2 , t3)
     303                        t1 = mydirection
     304                        t2 = myorthonormal
     305                        t3 = myside
     306
     307                y = T^(-1)*x
     308            */
     309    orxonox::Vector3 getTransformedVector(const orxonox::Vector3& distance, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& myside)
     310    {
     311        // inverse of the transform matrix
     312        float determinant = +mydirection.x * (myorthonormal.y*myside.z - myside.y*myorthonormal.z)
     313                                                -mydirection.y * (myorthonormal.x*myside.z - myorthonormal.z*myside.x)
     314                                                +mydirection.z * (myorthonormal.x*myside.y - myorthonormal.y*myside.x);
     315        float invdet = 1/determinant;
     316
     317        // transform matrix
     318        orxonox::Vector3 xinvtransform;
     319        orxonox::Vector3 yinvtransform;
     320        orxonox::Vector3 zinvtransform;
     321
     322        xinvtransform.x = (myorthonormal.y * myside.z        - myside.y        * myorthonormal.z)*invdet;
     323        xinvtransform.y = (mydirection.z   * myside.y        - mydirection.y   * myside.z       )*invdet;
     324        xinvtransform.z = (mydirection.y   * myorthonormal.z - mydirection.z   * myorthonormal.y)*invdet;
     325        yinvtransform.x = (myorthonormal.z * myside.x        - myorthonormal.x * myside.z       )*invdet;
     326        yinvtransform.y = (mydirection.x   * myside.z        - mydirection.z   * myside.x       )*invdet;
     327        yinvtransform.z = (myorthonormal.x * mydirection.z   - mydirection.x   * myorthonormal.z)*invdet;
     328        zinvtransform.x = (myorthonormal.x * myside.y        - myside.x        * myorthonormal.y)*invdet;
     329        zinvtransform.y = (myside.x        * mydirection.y   - mydirection.x   * myside.y       )*invdet;
     330        zinvtransform.z = (mydirection.x   * myorthonormal.y - myorthonormal.x * mydirection.y  )*invdet;
     331
     332        // coordinate transformation
     333        orxonox::Vector3 distanceShip;
     334        distanceShip.x = xinvtransform.x * distance.x + yinvtransform.x * distance.y + zinvtransform.x * distance.z;
     335        distanceShip.y = xinvtransform.y * distance.x + yinvtransform.y * distance.y + zinvtransform.y * distance.z;
     336        distanceShip.z = xinvtransform.z * distance.x + yinvtransform.z * distance.y + zinvtransform.z * distance.z;
     337
     338        return distanceShip;
    191339    }
    192340
  • code/trunk/src/libraries/util/Math.h

    r9550 r9939  
    2323 *      Fabian 'x3n' Landau
    2424 *   Co-authors:
    25  *      ...
     25 *      Wolfgang Roenninger
    2626 *
    2727 */
     
    9292    _UtilExport orxonox::Vector2 get2DViewdirection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
    9393    _UtilExport orxonox::Vector2 get2DViewcoordinates(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition);
     94    _UtilExport orxonox::Vector2 get3DProjection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float mapangle, const float detectionlimit);
     95    _UtilExport bool isObjectHigherThanShipOnMap(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float mapangle);
     96    _UtilExport int determineMap3DZOrder(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float detectionlimit);
     97    _UtilExport orxonox::Vector3 getTransformedVector(const orxonox::Vector3& distance, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& myside);
    9498    _UtilExport orxonox::Vector3 getPredictedPosition(const orxonox::Vector3& myposition, float projectilespeed, const orxonox::Vector3& targetposition, const orxonox::Vector3& targetvelocity);
    9599
  • code/trunk/src/modules/CMakeLists.txt

    r9348 r9939  
    3939ADD_SUBDIRECTORY(docking)
    4040ADD_SUBDIRECTORY(towerdefense)
     41ADD_SUBDIRECTORY(invader)
  • code/trunk/src/modules/docking/Dock.cc

    r9667 r9939  
    6969        XMLPortObject(Dock, DockingAnimation, "animations", addAnimation, getAnimation, xmlelement, mode);
    7070        XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
     71        XMLPortEventSink(Dock, BaseObject, "undocking", undocking, xmlelement, mode);
     72
    7173    }
    7274
     
    7678
    7779        XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
    78     }
     80
     81        XMLPortEventSink(Dock, BaseObject, "undocking", undocking, xmlelement, mode);
     82    }
     83
     84
     85    bool Dock::undocking(bool bTriggered, BaseObject* trigger)
     86    {
     87
     88        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
     89        PlayerInfo* player = NULL;
     90
     91        // Check whether it is a player trigger and extract pawn from it
     92        if(pTrigger != NULL)
     93        {
     94              if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
     95              orxout(verbose, context::docking) << "Docking:execute PlayerTrigger was not triggered by a player.." << endl;
     96              return false;
     97              }
     98              player = pTrigger->getTriggeringPlayer();
     99        }
     100        else
     101        {
     102              orxout(verbose, context::docking) << "Docking::execute Not a player trigger, can't extract pawn from it.." << endl;
     103              return false;
     104        }
     105        if(player == NULL)
     106        {
     107              orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl;
     108              return false;
     109        }
     110
     111            if(bTriggered)
     112        {
     113              // Add player to this Docks candidates
     114              candidates_.insert(player);
     115
     116              // Show docking dialog
     117              this->showUndockingDialogHelper(player);
     118        }
     119        else
     120        {
     121              // Remove player from candidates list
     122              candidates_.erase(player);
     123        }
     124
     125        return true;
     126    }
     127
     128
    79129
    80130    bool Dock::execute(bool bTriggered, BaseObject* trigger)
     
    119169        return true;
    120170    }
     171
     172
     173    void Dock::showUndockingDialogHelper(PlayerInfo* player)
     174        {
     175            assert(player);
     176
     177            if(!player->isHumanPlayer())
     178                return;
     179
     180            if(GameMode::isMaster())
     181            {
     182                if(GameMode::showsGraphics())
     183                    GUIManager::showGUI("UndockingDialog");
     184            }
     185            else
     186                callStaticNetworkFunction(Dock::showDockingDialog, player->getClientID());
     187
     188        }
    121189
    122190    void Dock::showDockingDialogHelper(PlayerInfo* player)
     
    177245        if (animations_.empty())
    178246            return dockingAnimationFinished(player);
     247
    179248        else
    180249            DockingAnimation::invokeAnimation(true, player, animations_);
  • code/trunk/src/modules/docking/Dock.h

    r9667 r9939  
    6262            // Trigger interface
    6363            bool execute(bool bTriggered, BaseObject* trigger);
     64            bool undocking(bool bTriggered, BaseObject* trigger);
    6465
    6566            // XML interface
     
    8586            void dock()
    8687                { this->dock(HumanController::getLocalControllerSingleton()->getPlayer()); }
     88            void undock()
     89                { this->undock(HumanController::getLocalControllerSingleton()->getPlayer()); }
    8790            static unsigned int getNumberOfActiveDocks();
    8891            static Dock* getActiveDockAtIndex(unsigned int index);
     
    9598            // Network functions
    9699            void showDockingDialogHelper(PlayerInfo* player);
     100            void showUndockingDialogHelper(PlayerInfo* player);
    97101            static void showDockingDialog();
    98102
  • code/trunk/src/modules/docking/MoveToDockingTarget.cc

    r9667 r9939  
    6666    {
    6767        //TODO: Investigate strange things...
    68         this->parent_->detach((WorldEntity*)player->getControllableEntity());
     68        //this->parent_->detach((WorldEntity*)player->getControllableEntity());
    6969
     70        //TODO: Check the issue with this detach call.
     71        //I have removed the line because the detach call only caused a warning and terminated. And because I didn't find a attach call either.
     72        //Didn't find the need for the line.
    7073        this->parent_->undockingAnimationFinished(player);
    7174        return true;
  • code/trunk/src/modules/objects/ForceField.cc

    r9667 r9939  
    4545    /*static*/ const std::string ForceField::modeSphere_s = "sphere";
    4646    /*static*/ const std::string ForceField::modeInvertedSphere_s = "invertedSphere";
     47
     48    /*static*/ const std::string ForceField::modeHomogen_s = "homogen";
     49
    4750    /*static*/ const std::string ForceField::modeNewtonianGravity_s = "newtonianGravity";
    4851    /*static*/ const float ForceField::gravConstant_ = 6.673e-11;
    4952    /*static*/ const float ForceField::attenFactor_ = 1;
     53
    5054
    5155    /**
     
    8993        XMLPortParam(ForceField, "length", setLength  , getLength  , xmlelement, mode).defaultValues(2000);
    9094        XMLPortParam(ForceField, "mode", setMode, getMode, xmlelement, mode);
     95        XMLPortParam(ForceField, "forcedirection", setForceDirection, getForceDirection, xmlelement, mode).defaultValues(Vector3(0,-400,0));
    9196    }
    9297   
     
    196201            }
    197202        }
     203        else if(this->mode_ == forceFieldMode::homogen)
     204        {
     205                // Iterate over all objects that could possibly be affected by the ForceField.
     206                for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
     207                {
     208                        Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
     209                    float distance = distanceVector.length();
     210                    if (distance < this->radius_ && distance > this->massRadius_)
     211                    {
     212                        // Add a Acceleration in forceDirection_.
     213                        // Vector3(0,0,0) is the direction, where the force should work.
     214                        it->addAcceleration(forceDirection_ , Vector3(0,0,0));
     215                    }
     216                }
     217        }
    198218    }
    199219
     
    214234        else if(mode == ForceField::modeNewtonianGravity_s)
    215235            this->mode_ = forceFieldMode::newtonianGravity;
     236
     237        else if(mode == ForceField::modeHomogen_s)
     238            this->mode_ = forceFieldMode::homogen;
     239
    216240        else
    217241        {
     
    239263            case forceFieldMode::newtonianGravity:
    240264                return ForceField::modeNewtonianGravity_s;
     265
     266            case forceFieldMode::homogen:
     267                return ForceField::modeHomogen_s;
     268
    241269            default:
    242270                return ForceField::modeTube_s;
  • code/trunk/src/modules/objects/ForceField.h

    r9667 r9939  
     1
    12/*
    23 *   ORXONOX - the hottest 3D action shooter ever to exist
     
    5758            sphere, //!< The ForceField has a spherical shape.
    5859            invertedSphere, //!< The ForceField has a spherical shape but "inverted" behavior.
    59             newtonianGravity //!< The ForceField imitates Newtonian gravitation for use in stellar bodies.
     60            newtonianGravity, //!< The ForceField imitates Newtonian gravitation for use in stellar bodies.
     61            homogen //!< Local homogenous Force field with changeable direction for the Space Station
    6062        };
    6163    }
     
    6668
    6769        The following parameters can be set to specify the behavior of the ForceField.
     70        - @b forcedirection The direction and the strength of the homogenous force field. Default is 0,-400,0.
    6871        - @b velocity The amount of force the ForceField excerts. Default is 100.
    6972        - @b diameter The diameter of the ForceField. Default is 500.
     
    147150                { return this->halfLength_*2; }
    148151
     152            inline void setForceDirection(Vector3 forcedir)
     153                { this->forceDirection_ = forcedir; }
     154
     155            inline Vector3 getForceDirection()
     156                { return this->forceDirection_; }
     157
     158
    149159            void setMode(const std::string& mode); //!< Set the mode of the ForceField.
    150160            const std::string& getMode(void); //!< Get the mode of the ForceField.
     
    156166            static const std::string modeInvertedSphere_s;
    157167            static const std::string modeNewtonianGravity_s;
     168
     169            static const std::string modeHomogen_s;
    158170
    159171            float velocity_; //!< The velocity of the ForceField.
     
    167179            //! Attenuation factor for Newtonian ForceFields
    168180            static const float attenFactor_;
     181            Vector3 forceDirection_;
    169182  };
    170183}
  • code/trunk/src/modules/overlays/OverlaysPrereqs.h

    r9526 r9939  
    8080    class BarColour;
    8181    class ChatOverlay;
     82    class CountDown;
    8283    class DeathMessage;
    8384    class GametypeFadingMessage;
  • code/trunk/src/modules/overlays/debugging/CMakeLists.txt

    r5781 r9939  
    22  DebugFPSText.cc
    33  DebugRTRText.cc
     4  DebugPositionText.cc
    45)
  • code/trunk/src/modules/overlays/hud/CMakeLists.txt

    r9348 r9939  
    1818  PauseNotice.cc
    1919  LastTeamStandingInfos.cc
     20  CountDown.cc
    2021)
  • code/trunk/src/modules/overlays/hud/HUDNavigation.cc

    r9667 r9939  
    7474        OrxonoxOverlay(context)
    7575    {
    76         RegisterObject(HUDNavigation)
    77 ;        this->setConfigValues();
     76        RegisterObject(HUDNavigation);
     77        this->setConfigValues();
    7878
    7979        // Set default values
  • code/trunk/src/modules/overlays/hud/HUDRadar.cc

    r9667 r9939  
    2525 *   Co-authors:
    2626 *      Reto Grieder
     27 *      Wolfgang Roenninger
    2728 *
    2829 */
     
    4142#include "Scene.h"
    4243#include "Radar.h"
     44#include "core/config/ConfigValueIncludes.h"
    4345
    4446namespace orxonox
     
    5052    {
    5153        RegisterObject(HUDRadar);
     54        this->setConfigValues();
    5255
    5356        this->marker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
     
    6063        this->setHalfDotSizeDistance(3000.0f);
    6164        this->setMaximumDotSize(0.1f);
     65        this->setMaximumDotSize3D(0.07f);
    6266
    6367        this->shapeMaterials_[RadarViewable::Dot]      = "RadarDot.png";
    6468        this->shapeMaterials_[RadarViewable::Triangle] = "RadarTriangle.png";
    6569        this->shapeMaterials_[RadarViewable::Square]   = "RadarSquare.png";
    66         this->setDetectionLimit( 10000.0f );
    6770        this->owner_ = 0;
     71
     72        this->map3DFront_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
     73                .createOverlayElement("Panel", "HUDRadar_mapDreiDFront_" + getUniqueNumberString()));
     74        this->map3DFront_->setMaterialName("Orxonox/Radar3DFront");
     75        this->overlay_->add2D(this->map3DFront_);
     76        this->map3DFront_->hide();
     77
     78        this->map3DBack_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
     79                .createOverlayElement("Panel", "HUDRadar_mapDreiDBack_" + getUniqueNumberString()));
     80        this->map3DBack_->setMaterialName("Orxonox/Radar3DBack");
     81        this->overlay_->add2D(this->map3DBack_);
     82        this->map3DBack_->hide();
     83
    6884    }
    6985
     
    7389        {
    7490            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->marker_);
     91            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DFront_);
     92            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DBack_);
     93
    7594            for (std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it = this->radarObjects_.begin();
    7695                it != this->radarObjects_.end(); ++it)
     
    8099        }
    81100    }
     101
     102
     103
     104    void HUDRadar::setConfigValues()
     105       {
     106           SetConfigValue(RadarMode_, true);
     107       }
    82108
    83109    void HUDRadar::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     
    88114        XMLPortParam(HUDRadar, "halfDotSizeDistance", setHalfDotSizeDistance, getHalfDotSizeDistance, xmlelement, mode);
    89115        XMLPortParam(HUDRadar, "maximumDotSize", setMaximumDotSize, getMaximumDotSize, xmlelement, mode);
     116        XMLPortParam(HUDRadar, "maximumDotSize3D", setMaximumDotSize3D, getMaximumDotSize3D, xmlelement, mode);
     117        XMLPortParam(HUDRadar, "material2D", set2DMaterial, get2DMaterial, xmlelement, mode);
     118        XMLPortParam(HUDRadar, "material3DMiddle", set3DMaterial, get3DMaterial, xmlelement, mode);
     119        XMLPortParam(HUDRadar, "material3DFront", set3DMaterialFront, get3DMaterialFront, xmlelement, mode);
     120        XMLPortParam(HUDRadar, "material3DBack", set3DMaterialBack, get3DMaterialBack, xmlelement, mode);
     121        XMLPortParam(HUDRadar, "mapAngle3D", setMapAngle, getMapAngle, xmlelement, mode);
     122        XMLPortParam(HUDRadar, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode);
    90123    }
    91124
     
    152185        // update the distances for all objects
    153186        std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it;
     187
     188
     189        if(RadarMode_)
     190        {
     191                this->setBackgroundMaterial(material3D_);
     192                this->map3DFront_->_notifyZOrder(this->overlay_->getZOrder() * 100 + 250); // it seems that the ZOrder of overlayelements is 100 times the ZOrder of the overlay
     193                this->map3DBack_->_notifyZOrder(this->overlay_->getZOrder() * 100 - 250); // 250 a little bit buffer so that the two shels are displayed all in the front / in the back
     194                this->map3DFront_->show();
     195                this->map3DBack_->show();
     196        }
     197        else
     198        {
     199                this->setBackgroundMaterial(material2D_);
     200                this->map3DFront_->hide();
     201                this->map3DBack_->hide();
     202        }
     203
    154204        for( it = this->radarObjects_.begin(); it != this->radarObjects_.end(); ++it )
    155205        {
     
    165215            float distance = (wePointer->getWorldPosition() - this->owner_->getPosition()).length();
    166216            // calculate the size with 1/distance dependency for simplicity (instead of exp(-distance * lambda)
    167             float size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
     217
     218            float size;
     219            if(RadarMode_)
     220                size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
     221            else
     222                size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
    168223            it->second->setDimensions(size, size);
    169224
    170225            // calc position on radar...
    171             Vector2 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
     226            Vector2 coord;
     227
     228            if(RadarMode_)
     229            {
     230                coord = get3DProjection(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), 0.6435011, detectionLimit_);
     231
     232                // set zOrder on screen
     233                bool overXZPlain = isObjectHigherThanShipOnMap(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), this->mapAngle_);
     234
     235                int zOrder = determineMap3DZOrder(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), detectionLimit_);
     236                if(overXZPlain == false /*&& (it->second->getZOrder() >  100 * this->overlay_->getZOrder())*/) // it appears that zOrder of attached Overlayelements is 100 times the zOrder of the Overlay
     237                        it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 70 + zOrder);
     238                if(overXZPlain == true /*&& (it->second->getZOrder() <= 100 * this->overlay_->getZOrder())*/)
     239                        it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder);
     240            }
     241            else
     242                coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
     243
    172244            coord *= math::pi / 3.5f; // small adjustment to make it fit the texture
    173245            it->second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);
     246
    174247            if( distance < detectionLimit_ || detectionLimit_ < 0 )
    175248                it->second->show();
     
    182255                this->marker_->setDimensions(size * 1.5f, size * 1.5f);
    183256                this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f);
     257                if(RadarMode_)
     258                        this->marker_->_notifyZOrder(it->second->getZOrder() -1);
    184259                this->marker_->show();
    185260            }
  • code/trunk/src/modules/overlays/hud/HUDRadar.h

    r9667 r9939  
    3535#include <map>
    3636#include <vector>
     37#include <string>
    3738
    3839#include "util/OgreForwardRefs.h"
     
    5152        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5253        virtual void changedOwner();
     54        void setConfigValues();
    5355
    5456    private:
     
    5759        void setHalfDotSizeDistance(float distance) { this->halfDotSizeDistance_ = distance; }
    5860
    59         void setDetectionLimit( float limit )
    60         { this->detectionLimit_ = limit; }
    61         float getDetectionLimit() const
    62         { return this->detectionLimit_; }
     61        void setDetectionLimit( float limit ) { this->detectionLimit_ = limit; }
     62        float getDetectionLimit() const { return this->detectionLimit_; }
    6363
    6464        float getMaximumDotSize() const { return this->maximumDotSize_; }
    6565        void setMaximumDotSize(float size) { this->maximumDotSize_ = size; }
    6666
     67        float getMaximumDotSize3D() const { return this->maximumDotSize3D_; }
     68        void setMaximumDotSize3D(float size) { this->maximumDotSize3D_ = size;}
     69
     70        std::string get2DMaterial() const {return this->material2D_; }
     71        void set2DMaterial(std::string material2D) { this->material2D_ = material2D; }
     72
     73        std::string get3DMaterial() const {return this->material3D_; }
     74        void set3DMaterial(std::string material3D) { this->material3D_ = material3D; }
     75
     76        std::string get3DMaterialFront() const {return this->material3DFront_; }
     77        void set3DMaterialFront(std::string material3DFront) { this->material3DFront_ = material3DFront; }
     78
     79        std::string get3DMaterialBack() const {return this->material3DBack_; }
     80        void set3DMaterialBack(std::string material3DBack) { this->material3DBack_ = material3DBack; }
     81
    6782        float getRadarSensitivity() const { return this->sensitivity_; }
    6883        // used also by RadarListener interface!
    6984        void setRadarSensitivity(float sensitivity) { this->sensitivity_ = sensitivity; }
     85
     86        // Determines angle between line of sight and x/z-plain on the 3D minimap
     87        float getMapAngle() const { return this->mapAngle_; }
     88        void setMapAngle(float mapAngle) { this->mapAngle_ = mapAngle; }
    7089
    7190        // RadarListener interface
     
    85104        Ogre::PanelOverlayElement* marker_;
    86105
     106        bool RadarMode_; // Determines, if Radar runs in 3D or 2D Mode
     107
    87108        float halfDotSizeDistance_;
    88109        float maximumDotSize_;
     110        float maximumDotSize3D_;
     111        float mapAngle_;
     112
     113        std::string material2D_;                //Material name for 2D map
     114        std::string material3D_;                //Material names For the 3D minimap
     115        std::string material3DFront_;
     116        std::string material3DBack_;
     117
     118        Ogre::PanelOverlayElement* map3DFront_; //Overlayelements for the 3D minimap to be able to draw the points in a semi 3D matter
     119        Ogre::PanelOverlayElement* map3DBack_;
    89120
    90121        float sensitivity_;
  • code/trunk/src/modules/pong/Pong.cc

    r9667 r9939  
    4747#include "PongBot.h"
    4848#include "PongAI.h"
     49
    4950namespace orxonox
    5051{
     
    117118            }
    118119        }
     120
    119121    }
    120122
  • code/trunk/src/modules/pong/PongBall.cc

    r9667 r9939  
    4040
    4141#include "PongBat.h"
     42
     43#include "sound/WorldSound.h"
     44#include "core/XMLPort.h"
    4245
    4346namespace orxonox
     
    6669
    6770        this->registerVariables();
     71
     72        //initialize sound
     73        if (GameMode::isMaster())
     74             {
     75                 this->defScoreSound_ = new WorldSound(this->getContext());
     76                 this->defScoreSound_->setVolume(1.0f);
     77                 this->defBatSound_ = new WorldSound(this->getContext());
     78                 this->defBatSound_->setVolume(0.4f);
     79                 this->defBoundarySound_ = new WorldSound(this->getContext());
     80                 this->defBoundarySound_->setVolume(0.5f);
     81             }
     82             else
     83             {
     84                 this->defScoreSound_ = 0;
     85                 this->defBatSound_ = 0;
     86                 this->defBoundarySound_ = 0;
     87             }
    6888    }
    6989
     
    81101            delete[] this->batID_;
    82102        }
     103    }
     104
     105    //xml port for loading sounds
     106    void PongBall::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     107    {
     108        SUPER(PongBall, XMLPort, xmlelement, mode);
     109        XMLPortParam(PongBall, "defScoreSound",  setDefScoreSound,  getDefScoreSound,  xmlelement, mode);
     110        XMLPortParam(PongBall, "defBatSound",  setDefBatSound,  getDefBatSound,  xmlelement, mode);
     111        XMLPortParam(PongBall, "defBoundarySound",  setDefBoundarySound,  getDefBoundarySound,  xmlelement, mode);
    83112    }
    84113
     
    117146        if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2)
    118147        {
    119             // Its velocity in z-direction is inverted (i.e. it bounces off).
     148            defBoundarySound_->play(); //play boundary sound
     149                // Its velocity in z-direction is inverted (i.e. it bounces off).
    120150            velocity.z = -velocity.z;
    121151            // And its position is set as to not overstep the boundary it has just crossed.
     
    142172                    if (fabs(distance) <= 1) // If the bat is there to parry.
    143173                    {
    144                         // Set the ball to be exactly at the boundary.
     174                        defBatSound_->play(); //play bat sound
     175                        // Set the ball to be exactly at the boundary.
    145176                        position.x = this->fieldWidth_ / 2;
    146177                        // Invert its velocity in x-direction (i.e. it bounces off).
     
    155186                    else if (GameMode::isMaster() && position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
    156187                    {
     188                        defScoreSound_->play();//play score sound
    157189                        if (this->getGametype() && this->bat_[0])
    158190                        {
     
    169201                    if (fabs(distance) <= 1) // If the bat is there to parry.
    170202                    {
    171                         // Set the ball to be exactly at the boundary.
     203                        defBatSound_->play(); //play bat sound
     204                        // Set the ball to be exactly at the boundary.
    172205                        position.x = -this->fieldWidth_ / 2;
    173206                        // Invert its velocity in x-direction (i.e. it bounces off).
     
    182215                    else if (GameMode::isMaster() && position.x < -this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
    183216                    {
     217                        defScoreSound_->play();//play score sound
    184218                        if (this->getGametype() && this->bat_[1])
    185219                        {
     
    262296            this->bat_[1] = orxonox_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[1]));
    263297    }
     298
     299    void PongBall::setDefScoreSound(const std::string &pongSound)
     300    {
     301        if( defScoreSound_ )
     302            defScoreSound_->setSource(pongSound);
     303        else
     304            assert(0); // This should never happen, because soundpointer is only available on master
     305    }
     306
     307    const std::string& PongBall::getDefScoreSound()
     308    {
     309        if( defScoreSound_ )
     310            return defScoreSound_->getSource();
     311        else
     312            assert(0);
     313        return BLANKSTRING;
     314    }
     315
     316    void PongBall::setDefBatSound(const std::string &pongSound)
     317    {
     318        if( defBatSound_ )
     319            defBatSound_->setSource(pongSound);
     320        else
     321            assert(0); // This should never happen, because soundpointer is only available on master
     322    }
     323
     324    const std::string& PongBall::getDefBatSound()
     325    {
     326        if( defBatSound_ )
     327            return defBatSound_->getSource();
     328        else
     329            assert(0);
     330        return BLANKSTRING;
     331    }
     332
     333    void PongBall::setDefBoundarySound(const std::string &pongSound)
     334    {
     335        if( defBoundarySound_ )
     336            defBoundarySound_->setSource(pongSound);
     337        else
     338            assert(0); // This should never happen, because soundpointer is only available on master
     339    }
     340
     341    const std::string& PongBall::getDefBoundarySound()
     342    {
     343        if( defBoundarySound_ )
     344            return defBoundarySound_->getSource();
     345        else
     346            assert(0);
     347        return BLANKSTRING;
     348    }
    264349}
  • code/trunk/src/modules/pong/PongBall.h

    r9667 r9939  
    4242#include "worldentities/MovableEntity.h"
    4343
     44
    4445namespace orxonox
    4546{
     
    6364
    6465            virtual void tick(float dt);
     66
     67            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    6568
    6669            /**
     
    123126            static const float MAX_REL_Z_VELOCITY;
    124127
     128            void setDefScoreSound(const std::string& engineSound);
     129            const std::string& getDefScoreSound();
     130            void setDefBatSound(const std::string& engineSound);
     131            const std::string& getDefBatSound();
     132            void setDefBoundarySound(const std::string& engineSound);
     133            const std::string& getDefBoundarySound();
     134
    125135        private:
    126136            void registerVariables();
     
    135145            unsigned int* batID_; //!< The object IDs of the bats, to be able to synchronize them over the network.
    136146            float relMercyOffset_; //!< Offset, that makes the player not loose, when, in all fairness, he would have.
     147            WorldSound* defScoreSound_;
     148            WorldSound* defBatSound_;
     149            WorldSound* defBoundarySound_;
    137150    };
    138151}
  • code/trunk/src/modules/pong/PongScore.cc

    r9667 r9939  
    4141
    4242#include "Pong.h"
     43#include "sound/WorldSound.h" /////////////////////////////
    4344
    4445namespace orxonox
  • code/trunk/src/modules/pong/PongScore.h

    r9667 r9939  
    124124            WeakPtr<PlayerInfo> player1_; //!< Store information about left player permanently.
    125125            WeakPtr<PlayerInfo> player2_; //!< Same for the right player. To end the game properly.
     126            WorldSound* scoreSound_;
     127
    126128    };
    127129}
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.h

    r9667 r9939  
    5959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    6060
    61         private:
     61        protected:
    6262            /**
    6363            @brief Set the mesh.
     
    109109                { return this->delay_; }
    110110
    111             void shot();
     111            virtual void shot();
    112112            void muzzleflash();
    113113
  • code/trunk/src/orxonox/MoodManager.h

    r9667 r9939  
    5151
    5252        private:
    53             virtual void moodChanged(const std::string& mood) = 0;
     53            virtual bool moodChanged(const std::string& mood) = 0;
    5454
    5555            static void changedMood(const std::string& mood);
  • code/trunk/src/orxonox/controllers/NewHumanController.cc

    r9667 r9939  
    443443
    444444        if (pawn)
    445             pawn->setAimPosition( mouseRay.getOrigin() + mouseRay.getDirection() * 1200 );
     445            pawn->setAimPosition( mouseRay.getOrigin() + mouseRay.getDirection() * 3000 );
    446446
    447447        if( this->getControllableEntity() && this->getControllableEntity()->getTarget() != 0 )
  • code/trunk/src/orxonox/gamestates/GSMainMenu.cc

    r9667 r9939  
    8585    {
    8686        if (GameMode::playsSound())
    87             this->ambient_->destroy();
     87            this->ambient_->destroy(); //CHECK Thilo destroy ?preDestroy()? !!!!!!!
    8888
    8989        InputManager::getInstance().destroyState("MainMenuHackery");
  • code/trunk/src/orxonox/gametypes/Gametype.cc

    r9667 r9939  
    171171                    entity->setOrientation(oldentity->getWorldOrientation());
    172172                }
    173 
    174173                it->first->startControl(entity);
    175174            }
  • code/trunk/src/orxonox/graphics/ParticleEmitter.cc

    r9667 r9939  
    4545    RegisterClass(ParticleEmitter);
    4646
    47     ParticleEmitter::ParticleEmitter(Context* context) : StaticEntity(context)
     47    ParticleEmitter::ParticleEmitter(Context* context) : MovableEntity(context)
    4848    {
    4949        RegisterObject(ParticleEmitter);
  • code/trunk/src/orxonox/graphics/ParticleEmitter.h

    r9667 r9939  
    3333
    3434#include <string>
    35 #include "worldentities/StaticEntity.h"
     35#include "worldentities/MovableEntity.h"
    3636
    3737namespace orxonox
    3838{
    39     class _OrxonoxExport ParticleEmitter : public StaticEntity
     39    class _OrxonoxExport ParticleEmitter : public MovableEntity
    4040    {
    4141        public:
  • code/trunk/src/orxonox/infos/PlayerInfo.cc

    r9667 r9939  
    229229            return;
    230230
    231         this->controllableEntity_->getController()->setActive(false);
     231        Controller* tmp =this->controllableEntity_->getController();
     232        if (tmp == NULL)
     233        {
     234                orxout(verbose) <<  "PlayerInfo: pauseControl, Controller is NULL " << endl;
     235                return;
     236        }
     237        tmp->setActive(false);
    232238        //this->controllableEntity_->getController()->setControllableEntity(NULL);
    233239        this->controllableEntity_->setController(0);
  • code/trunk/src/orxonox/interfaces/RadarViewable.h

    r9667 r9939  
    6363        virtual void setRadarName(const std::string& name)
    6464            {
     65            // The following if-clause hides objects with radarname "HIDDEN"
     66                if (name == "HIDDEN")
     67                {
     68                    this->bVisibility_ = 0;
     69                    this->settingsChanged();
     70                }
    6571                if (this->radarName_ != name)
    6672                {
  • code/trunk/src/orxonox/items/MultiStateEngine.cc

    r9667 r9939  
    6161            this->defEngineSndNormal_->setLooping(true);
    6262            this->defEngineSndBoost_->setLooping(true);
     63            this->defEngineSndNormal_->setVolume(0.8f);
     64            this->defEngineSndBoost_->setVolume(0.5f);
    6365            this->lua_ = new LuaState();
    6466        }
  • code/trunk/src/orxonox/sound/AmbientSound.cc

    r8861 r9939  
    7979    }
    8080
    81     void AmbientSound::setAmbientSource(const std::string& source)
     81    bool AmbientSound::setAmbientSource(const std::string& source)
    8282    {
    8383        this->ambientSource_ = source;
    84         this->moodChanged(MoodManager::getInstance().getMood());
     84        return(this->moodChanged(MoodManager::getInstance().getMood()));
    8585    }
    8686
    87     void AmbientSound::moodChanged(const std::string& mood)
     87    bool AmbientSound::moodChanged(const std::string& mood)
    8888    {
    8989        if (GameMode::playsSound())
     
    9595                orxout(user_info) << "Loading ambient sound " << path << "..." << endl; // TODO: make this output internal if we implement sound streaming
    9696                this->setSource(path);
     97
     98                // all went fine
     99                return true;
    97100            }
    98101            else
    99102            {
    100103                orxout(internal_warning, context::sound) << this->ambientSource_ << ": Not a valid name! Ambient sound will not change." << endl;
     104
     105                // everything went southways
     106                return false;
    101107            }
    102108        }
     109        return false;
    103110    }
    104111
  • code/trunk/src/orxonox/sound/AmbientSound.h

    r7856 r9939  
    5454        void pause();
    5555
    56         void setAmbientSource(const std::string& source);
     56        bool setAmbientSource(const std::string& source);
    5757        inline const std::string& getAmbientSource() const
    5858            { return this->ambientSource_; }
     
    6868        void preDestroy();
    6969        float getRealVolume();
    70         void moodChanged(const std::string& mood);
     70        bool moodChanged(const std::string& mood);
    7171        inline void ambientSourceChanged()
    7272            { this->setAmbientSource(this->ambientSource_); }
  • code/trunk/src/orxonox/sound/BaseSound.cc

    r9667 r9939  
    4747    BaseSound::BaseSound()
    4848        : bPooling_(false)
    49         , volume_(1.0)
     49        , volume_(0.7)
    5050        , bLooping_(false)
    5151        , state_(Stopped)
  • code/trunk/src/orxonox/sound/SoundManager.cc

    r9667 r9939  
    218218            .description("Defines the overall volume.")
    219219            .callback(this, &SoundManager::checkSoundVolumeValidity);
    220         SetConfigValueAlias(volume_[SoundType::Music], "ambientVolume_", 1.0f)
     220        SetConfigValueAlias(volume_[SoundType::Music], "ambientVolume_", 0.7f)
    221221            .description("Defines the ambient volume.")
    222222            .callback(this, &SoundManager::checkAmbientVolumeValidity);
  • code/trunk/src/orxonox/sound/WorldAmbientSound.cc

    r9667 r9939  
    3333#include "core/XMLPort.h"
    3434#include "AmbientSound.h"
     35#include "core/command/ConsoleCommand.h"
     36#include <exception>
     37
    3538
    3639namespace orxonox
    3740{
     41        SetConsoleCommand("WorldAmbientSound", "nextsong",      &WorldAmbientSound::nextSong);
     42
    3843    RegisterClass(WorldAmbientSound);
    3944
     
    4449        this->ambientSound_ = new AmbientSound();
    4550        this->registerVariables();
     51        soundList_.push_back("Earth.ogg");
     52        soundList_.push_back("Jupiter.ogg");
     53        soundList_.push_back("Mars.ogg");
     54        soundList_.push_back("allgorythm-lift_up.ogg");
     55        soundList_.push_back("allgorythm-resonance_blaster.ogg");
     56        soundList_.push_back("AlphaCentauri.ogg");
     57        soundList_.push_back("Asteroid_rocks.ogg");
     58        soundList_.push_back("Ganymede.ogg");
     59        soundList_.push_back("luke_grey_-_hypermode.ogg");
     60
    4661    }
    47 
    4862    WorldAmbientSound::~WorldAmbientSound()
    4963    {
     
    5165        {
    5266            this->ambientSound_->destroy();
     67            WorldAmbientSound::soundList_.clear();
    5368        }
    5469    }
     
    94109            this->ambientSound_->stop();
    95110    }
     111
     112    void WorldAmbientSound::nextSong()
     113    {
     114
     115        //HACK: Assuption - there is only one WorldAmbientSound in a level and only one level is used.
     116        for (ObjectList<WorldAmbientSound>::iterator it = ObjectList<WorldAmbientSound>::begin();
     117             it != ObjectList<WorldAmbientSound>::end(); ++it)
     118        {
     119                while(it->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){
     120                        WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size();
     121                }
     122                WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size();
     123        }
     124    }
    96125}
  • code/trunk/src/orxonox/sound/WorldAmbientSound.h

    r9667 r9939  
    3434#include "core/BaseObject.h"
    3535#include "network/synchronisable/Synchronisable.h"
     36#include <string>
     37#include <vector>
     38
    3639
    3740namespace orxonox
     
    5457            void play();
    5558
     59            //This function changes the current ambient song.
     60            //You can call nextSong() active in the level
     61            //by pressing the key 'M'.
     62            static void nextSong();
     63
    5664        private:
    5765            void registerVariables();
    5866
     67            //Vector with the diffrent available level sounds.
     68            //The sound names are pushed in the WorldAmbientSound-constructor.
     69            static std::vector<std::string> soundList_;
     70
     71            // This value will be initialized below, don't make this into
     72            // a const, since we want to change it in nextSong().
     73            static int soundNumber_;
     74
     75
    5976            AmbientSound* ambientSound_;
    6077    };
     78
     79    // This is an initialization for the soundnumber variable. Since it is
     80    // static, we have to initialize it this way.
     81    int WorldAmbientSound::soundNumber_ = 0;
     82    std::vector<std::string> WorldAmbientSound::soundList_;
     83
    6184}
    6285
  • code/trunk/src/orxonox/sound/WorldSound.cc

    r9667 r9939  
    8181            alSourcef(this->audioSource_, AL_REFERENCE_DISTANCE, refDist);
    8282            // TODO: 500 is very magical here. Derive something better
    83             alSourcef(this->audioSource_, AL_MAX_DISTANCE, refDist * 500);
     83            alSourcef(this->audioSource_, AL_MAX_DISTANCE, refDist * 20);
    8484        }
    8585        this->tick(0); // update position, orientation and velocity
  • code/trunk/src/orxonox/weaponsystem/WeaponMode.cc

    r9667 r9939  
    7979            this->defSndWpnFire_ = new WorldSound(this->getContext());
    8080            this->defSndWpnFire_->setLooping(false);
     81            this->defSndWpnFire_->setVolume(0.8f);
    8182            this->bSoundAttached_ = false;
    8283        }
  • code/trunk/src/orxonox/worldentities/BigExplosion.cc

    r9667 r9939  
    4343    RegisterClass(BigExplosion);
    4444
    45     BigExplosion::BigExplosion(Context* context) : StaticEntity(context)
     45    BigExplosion::BigExplosion(Context* context) : MobileEntity(context)
    4646    {
    4747        RegisterObject(BigExplosion);
     48
     49        if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
     50            ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given.");
     51
     52        this->bStop_ = false;
     53        this->LOD_ = LODParticle::Normal;
     54
     55        if ( GameMode::showsGraphics() )
     56        {
     57            try
     58            {
     59                this->init();
     60            }
     61            catch (const std::exception& ex)
     62            {
     63                orxout(internal_error) << "Couldn't load particle effect in BigExplosion: " << ex.what() << endl;
     64                this->initZero();
     65            }
     66        }
     67        else
     68        {
     69            this->initZero();
     70        }
     71
     72        if (GameMode::isMaster())
     73        {
     74            this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
     75        }
     76
     77        this->registerVariables();
     78    }
     79
     80    BigExplosion::BigExplosion(Context* context, Vector3 initVelocity) : MobileEntity(context)
     81    {
     82        RegisterObject(BigExplosion);
     83        this->setVelocity(initVelocity);
    4884
    4985        if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
     
    100136        this->debris4_->setSyncMode(0);
    101137
    102         this->explosion_ = new StaticEntity(this->getContext());
     138        this->explosion_ = new MobileEntity(this->getContext());
    103139        this->explosion_->setSyncMode(0);
    104140
     
    148184        this->debrisEntity4_->attach(debris4_);
    149185
     186        // ///////////////////////
     187        // TODO: particleSpawner is a static entity. It should probably be dynamic, for better explosions.
     188        //
    150189        ParticleSpawner* effect = new ParticleSpawner(this->getContext());
     190        orxout() << "vel " << this->getVelocity() << endl;
     191        // effect->setVelocity(this->getVelocity());
    151192        effect->setDestroyAfterLife(true);
    152193        effect->setSource("Orxonox/explosion2b");
     
    155196
    156197        ParticleSpawner* effect2 = new ParticleSpawner(this->getContext());
     198        // effect2->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10, 200));
    157199        effect2->setDestroyAfterLife(true);
    158200        effect2->setSource("Orxonox/smoke6");
  • code/trunk/src/orxonox/worldentities/BigExplosion.h

    r9667 r9939  
    2222 *   Author:
    2323 *      Benjamin de Capitani
    24  *   Co-authors:
     24 *   Co-authors:§
    2525 *      ...
    2626 *
     
    3333
    3434#include "tools/Timer.h"
    35 #include "StaticEntity.h"
     35#include "MobileEntity.h"
    3636
    3737namespace orxonox
    3838{
    39     class _OrxonoxExport BigExplosion : public StaticEntity
     39    class _OrxonoxExport BigExplosion : public MobileEntity
    4040    {
    4141        public:
    4242            BigExplosion(Context* context);
     43            BigExplosion(Context* context, Vector3 initVelocity);
    4344            virtual ~BigExplosion();
    4445
     
    6061            bool                  bStop_;
    6162
    62             StaticEntity*         explosion_;
     63            MobileEntity*         explosion_;
    6364
    6465            MovableEntity*        debrisEntity1_;
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r9667 r9939  
    4646#include "weaponsystem/WeaponPack.h"
    4747#include "weaponsystem/WeaponSet.h"
     48#include "sound/WorldSound.h"
    4849
    4950#include "controllers/FormationController.h"
     
    100101
    101102        this->setSyncMode(ObjectDirection::Bidirectional); // needed to synchronise e.g. aimposition
     103
     104        if (GameMode::isMaster())
     105        {
     106            this->explosionSound_ = new WorldSound(this->getContext());
     107            this->explosionSound_->setVolume(1.0f);
     108        }
     109        else
     110        {
     111            this->explosionSound_ = 0;
     112        }
    102113    }
    103114
     
    109120                this->weaponSystem_->destroy();
    110121        }
     122
    111123    }
    112124
     
    135147        XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f);
    136148
     149        XMLPortParam(Pawn, "explosionSound",  setExplosionSound,  getExplosionSound,  xmlelement, mode);
     150
    137151        XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
    138152    }
     153
    139154
    140155    void Pawn::registerVariables()
     
    290305    void Pawn::kill()
    291306    {
    292         this->damage(this->health_);
     307        this->damage(this->health_);
    293308        this->death();
    294309    }
     
    314329        if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
    315330        {
    316             // Set bAlive_ to false and wait for PawnManager to do the destruction
     331            explosionSound_->play();
     332                // Set bAlive_ to false and wait for PawnManager to do the destruction
    317333            this->bAlive_ = false;
    318334
     
    365381        this->setDestroyWhenPlayerLeft(false);
    366382
    367         BigExplosion* chunk = new BigExplosion(this->getContext());
     383        orxout() << "big explosion: " << this->getVelocity() << endl;
     384        BigExplosion* chunk = new BigExplosion(this->getContext(), this->getVelocity());
    368385        chunk->setPosition(this->getPosition());
     386        // chunk->setVelocity(this->getVelocity());
    369387
    370388    }
     
    376394            effect->setPosition(this->getPosition());
    377395            effect->setOrientation(this->getOrientation());
     396            effect->setVelocity(this->getVelocity());
    378397            effect->setDestroyAfterLife(true);
    379398            effect->setSource("Orxonox/explosion2b");
     
    384403            effect->setPosition(this->getPosition());
    385404            effect->setOrientation(this->getOrientation());
     405            effect->setVelocity(this->getVelocity());
    386406            effect->setDestroyAfterLife(true);
    387407            effect->setSource("Orxonox/smoke6");
     
    392412            effect->setPosition(this->getPosition());
    393413            effect->setOrientation(this->getOrientation());
     414            effect->setVelocity(this->getVelocity());
    394415            effect->setDestroyAfterLife(true);
    395416            effect->setSource("Orxonox/sparks");
     
    527548
    528549
     550    void Pawn::setExplosionSound(const std::string &explosionSound)
     551    {
     552        if(explosionSound_ )
     553            explosionSound_->setSource(explosionSound);
     554        else
     555            assert(0); // This should never happen, because soundpointer is only available on master
     556    }
     557
     558    const std::string& Pawn::getExplosionSound()
     559    {
     560        if( explosionSound_ )
     561            return explosionSound_->getSource();
     562        else
     563            assert(0);
     564        return BLANKSTRING;
     565    }
     566
    529567
    530568}
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.h

    r9667 r9939  
    3636#include "interfaces/RadarViewable.h"
    3737#include "worldentities/ControllableEntity.h"
     38
    3839
    3940namespace orxonox // tolua_export
     
    178179            virtual void changedVisibility();
    179180
     181            void setExplosionSound(const std::string& engineSound);
     182            const std::string& getExplosionSound();
     183
    180184        protected:
    181185            virtual void preDestroy();
     
    231235
    232236            Vector3 aimPosition_;
     237
     238            WorldSound* explosionSound_;
     239
    233240    }; // tolua_export
    234241} // tolua_export
Note: See TracChangeset for help on using the changeset viewer.