Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9945 for code/trunk/src


Ignore:
Timestamp:
Jan 3, 2014, 1:50:22 PM (11 years ago)
Author:
landauf
Message:

replaced tabs with spaces. no changes in code

Location:
code/trunk/src
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/util/Math.cc

    r9939 r9945  
    204204    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)
    205205    {
    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);
     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);
    228228    }
    229229
     
    243243    bool isObjectHigherThanShipOnMap(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float mapangle)
    244244    {
    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;
     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;
    262262    }
    263263
     
    265265                   @brief A value between 0 and 10, in order how other object is in front or in back
    266266                   @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
     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
    271271                   @return value between 0 and 100
    272272    */
    273273    int determineMap3DZOrder(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float detectionlimit)
    274274    {
    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;
     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;
    288288    }
    289289
     
    300300                y is vector in old coordinates
    301301                T is transform matrix with:
    302                         T = (t1 , t2 , t3)
    303                         t1 = mydirection
    304                         t2 = myorthonormal
    305                         t3 = myside
     302                    T = (t1 , t2 , t3)
     303                    t1 = mydirection
     304                    t2 = myorthonormal
     305                    t3 = myside
    306306
    307307                y = T^(-1)*x
     
    309309    orxonox::Vector3 getTransformedVector(const orxonox::Vector3& distance, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& myside)
    310310    {
    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;
     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;
    339339    }
    340340
  • code/trunk/src/modules/docking/Dock.cc

    r9939 r9945  
    8686    {
    8787
    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;
     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;
    126126    }
    127127
  • code/trunk/src/modules/docking/MoveToDockingTarget.cc

    r9939 r9945  
    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.
     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.
    7373        this->parent_->undockingAnimationFinished(player);
    7474        return true;
  • code/trunk/src/modules/gametypes/SpaceRaceController.cc

    r9667 r9945  
    464464                currentShape->getBoundingSphere(positionObject,radiusObject);
    465465                Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
    466                                 Vector3 norm_r_CP = cP1ToCP2.crossProduct(centerCP1-positionObjectNonBT);
    467 
    468                                 if(norm_r_CP.length() == 0){
    469                                         Vector3 zufall;
     466                Vector3 norm_r_CP = cP1ToCP2.crossProduct(centerCP1-positionObjectNonBT);
     467
     468                if(norm_r_CP.length() == 0){
     469                    Vector3 zufall;
    470470                    do{
    471471                        zufall=Vector3(rnd(),rnd(),rnd());//random
    472472                    }while((zufall.crossProduct(cP1ToCP2)).length() == 0);
    473                                         norm_r_CP=zufall.crossProduct(cP1ToCP2);
    474                                 }
    475                                 Vector3 VecToVCP = norm_r_CP.crossProduct(cP1ToCP2);
    476                                 float distanzToCP1 = sqrt(powf(radiusObject,4)/(powf((centerCP1-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));
    477                                 float distanzToCP2 = sqrt(powf(radiusObject,4)/(powf((racepoint2->getPosition()-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));
     473                    norm_r_CP=zufall.crossProduct(cP1ToCP2);
     474                }
     475                Vector3 VecToVCP = norm_r_CP.crossProduct(cP1ToCP2);
     476                float distanzToCP1 = sqrt(powf(radiusObject,4)/(powf((centerCP1-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));
     477                float distanzToCP2 = sqrt(powf(radiusObject,4)/(powf((racepoint2->getPosition()-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));
    478478                float distanz = std::max(distanzToCP1,distanzToCP2);
    479                                 //float distanz = 0.0f; //TEMPORARY
    480                                 Vector3 newCheckpointPositionPos = positionObjectNonBT+(distanz*VecToVCP)/VecToVCP.length();
    481                                 Vector3 newCheckpointPositionNeg = positionObjectNonBT-(distanz*VecToVCP)/VecToVCP.length();
    482                                 if((newCheckpointPositionPos - centerCP1).length() + (newCheckpointPositionPos - (centerCP1+cP1ToCP2)).length() < (newCheckpointPositionNeg - centerCP1).length() + (newCheckpointPositionNeg - (centerCP1+cP1ToCP2)).length() )
    483                                 {
    484                                         RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionPos);
    485                                 }
    486                                 else
    487                                 {
    488                                         RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionNeg);
    489                                 }
    490                                 return;
     479                //float distanz = 0.0f; //TEMPORARY
     480                Vector3 newCheckpointPositionPos = positionObjectNonBT+(distanz*VecToVCP)/VecToVCP.length();
     481                Vector3 newCheckpointPositionNeg = positionObjectNonBT-(distanz*VecToVCP)/VecToVCP.length();
     482                if((newCheckpointPositionPos - centerCP1).length() + (newCheckpointPositionPos - (centerCP1+cP1ToCP2)).length() < (newCheckpointPositionNeg - centerCP1).length() + (newCheckpointPositionNeg - (centerCP1+cP1ToCP2)).length() )
     483                {
     484                    RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionPos);
     485                }
     486                else
     487                {
     488                    RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionNeg);
     489                }
     490                return;
    491491            }
    492492        }
  • code/trunk/src/modules/invader/InvaderWeaponEnemy.cc

    r9943 r9945  
    4545    void InvaderWeaponEnemy::shot()
    4646    {
    47         InvaderWeapon::shot();
     47        InvaderWeapon::shot();
    4848        // SUPER(InvaderWeaponEnemy, shot);
    4949        // only shoot in foreward direction
  • code/trunk/src/modules/objects/ForceField.cc

    r9939 r9945  
    203203        else if(this->mode_ == forceFieldMode::homogen)
    204204        {
    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                 }
     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            }
    217217        }
    218218    }
  • code/trunk/src/modules/objects/Turret.cc

    r9667 r9945  
    5757    void Turret::rotatePitch(const Vector2& value)
    5858    {
    59         orxout()<< "Turret rotate Pitch"<< endl;
     59        orxout()<< "Turret rotate Pitch"<< endl;
    6060
    61         const Quaternion& orient = this->getOrientation();
    62         Radian pitch = orient.getPitch();
     61        const Quaternion& orient = this->getOrientation();
     62        Radian pitch = orient.getPitch();
    6363
    64         if((value.x > 0 && pitch < Radian(180)) || (value.x < 0 && pitch > Radian(0)))
    65                 SpaceShip::rotatePitch(value);
     64        if((value.x > 0 && pitch < Radian(180)) || (value.x < 0 && pitch > Radian(0)))
     65            SpaceShip::rotatePitch(value);
    6666    }
    6767
     
    6969    void Turret::setAlertnessRadius(float value)
    7070    {
    71         this->controller_->setAlertnessRadius(value);
     71        this->controller_->setAlertnessRadius(value);
    7272    }
    7373    float Turret::getAlertnessRadius()
    7474    {
    75         return this->controller_->getAlertnessRadius();
     75        return this->controller_->getAlertnessRadius();
    7676    }
    7777
  • code/trunk/src/modules/overlays/hud/HUDRadar.cc

    r9939 r9945  
    7171
    7272        this->map3DFront_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
    73                 .createOverlayElement("Panel", "HUDRadar_mapDreiDFront_" + getUniqueNumberString()));
     73            .createOverlayElement("Panel", "HUDRadar_mapDreiDFront_" + getUniqueNumberString()));
    7474        this->map3DFront_->setMaterialName("Orxonox/Radar3DFront");
    7575        this->overlay_->add2D(this->map3DFront_);
     
    7777
    7878        this->map3DBack_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
    79                 .createOverlayElement("Panel", "HUDRadar_mapDreiDBack_" + getUniqueNumberString()));
     79            .createOverlayElement("Panel", "HUDRadar_mapDreiDBack_" + getUniqueNumberString()));
    8080        this->map3DBack_->setMaterialName("Orxonox/Radar3DBack");
    8181        this->overlay_->add2D(this->map3DBack_);
     
    189189        if(RadarMode_)
    190190        {
    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();
     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();
    196196        }
    197197        else
    198198        {
    199                 this->setBackgroundMaterial(material2D_);
    200                 this->map3DFront_->hide();
    201                 this->map3DBack_->hide();
     199            this->setBackgroundMaterial(material2D_);
     200            this->map3DFront_->hide();
     201            this->map3DBack_->hide();
    202202        }
    203203
     
    218218            float size;
    219219            if(RadarMode_)
    220                 size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
     220                size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
    221221            else
    222                 size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
     222                size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
    223223            it->second->setDimensions(size, size);
    224224
     
    228228            if(RadarMode_)
    229229            {
    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);
     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);
    240240            }
    241241            else
    242                 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
     242                coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
    243243
    244244            coord *= math::pi / 3.5f; // small adjustment to make it fit the texture
     
    256256                this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f);
    257257                if(RadarMode_)
    258                         this->marker_->_notifyZOrder(it->second->getZOrder() -1);
     258                    this->marker_->_notifyZOrder(it->second->getZOrder() -1);
    259259                this->marker_->show();
    260260            }
  • code/trunk/src/modules/overlays/hud/HUDRadar.h

    r9939 r9945  
    111111        float mapAngle_;
    112112
    113         std::string material2D_;                //Material name for 2D map
    114         std::string material3D_;                //Material names For the 3D minimap
     113        std::string material2D_;        //Material name for 2D map
     114        std::string material3D_;        //Material names For the 3D minimap
    115115        std::string material3DFront_;
    116116        std::string material3DBack_;
  • code/trunk/src/modules/pong/PongBall.cc

    r9939 r9945  
    147147        {
    148148            defBoundarySound_->play(); //play boundary sound
    149                 // Its velocity in z-direction is inverted (i.e. it bounces off).
     149            // Its velocity in z-direction is inverted (i.e. it bounces off).
    150150            velocity.z = -velocity.z;
    151151            // And its position is set as to not overstep the boundary it has just crossed.
     
    173173                    {
    174174                        defBatSound_->play(); //play bat sound
    175                         // Set the ball to be exactly at the boundary.
     175                        // Set the ball to be exactly at the boundary.
    176176                        position.x = this->fieldWidth_ / 2;
    177177                        // Invert its velocity in x-direction (i.e. it bounces off).
     
    186186                    else if (GameMode::isMaster() && position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
    187187                    {
    188                         defScoreSound_->play();//play score sound
     188                        defScoreSound_->play();//play score sound
    189189                        if (this->getGametype() && this->bat_[0])
    190190                        {
     
    202202                    {
    203203                        defBatSound_->play(); //play bat sound
    204                         // Set the ball to be exactly at the boundary.
     204                        // Set the ball to be exactly at the boundary.
    205205                        position.x = -this->fieldWidth_ / 2;
    206206                        // Invert its velocity in x-direction (i.e. it bounces off).
     
    215215                    else if (GameMode::isMaster() && position.x < -this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
    216216                    {
    217                         defScoreSound_->play();//play score sound
     217                        defScoreSound_->play();//play score sound
    218218                        if (this->getGametype() && this->bat_[1])
    219219                        {
  • code/trunk/src/modules/tetris/TetrisBrick.cc

    r9803 r9945  
    8787                    stone->addTemplate(this->tetris_->getCenterpoint()->getStoneTemplate());
    8888                else
    89                         orxout()<< "tetris_->getCenterpoint == NULL in TetrisBrick.cc"<< endl;
     89                    orxout()<< "tetris_->getCenterpoint == NULL in TetrisBrick.cc"<< endl;
    9090            }
    9191            else
     
    116116            if(this->shapeIndex_ == 1 || this->shapeIndex_ == 6 || this->shapeIndex_ == 7)
    117117            {
    118                 stone->setPosition(0.0f, 2*size_, 0.0f);
     118                stone->setPosition(0.0f, 2*size_, 0.0f);
    119119            }
    120120            else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 4|| this->shapeIndex_ == 5)
    121121            {
    122                 stone->setPosition(size_, 0, 0.0f);
     122                stone->setPosition(size_, 0, 0.0f);
    123123            }
    124124            else if(this->shapeIndex_ == 2)
    125125            {
    126                 stone->setPosition(-size_, 0, 0.0f);
     126                stone->setPosition(-size_, 0, 0.0f);
    127127            }
    128128        }
     
    131131            if(this->shapeIndex_ == 2 || this->shapeIndex_ == 5)
    132132            {
    133                 stone->setPosition(size_, size_, 0.0f);
     133                stone->setPosition(size_, size_, 0.0f);
    134134            }
    135135            else if(this->shapeIndex_ == 1)
    136136            {
    137                 stone->setPosition(0, 3*size_, 0.0f);
     137                stone->setPosition(0, 3*size_, 0.0f);
    138138            }
    139139            else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 7)
    140140            {
    141                 stone->setPosition(-size_, 0, 0.0f);
     141                stone->setPosition(-size_, 0, 0.0f);
    142142            }
    143143            else if(this->shapeIndex_ == 4)
    144144            {
    145                 stone->setPosition(-size_, size_, 0.0f);
     145                stone->setPosition(-size_, size_, 0.0f);
    146146            }
    147147            else if(this->shapeIndex_ == 6)
    148148            {
    149                 stone->setPosition(size_, 0, 0.0f);
     149                stone->setPosition(size_, 0, 0.0f);
    150150            }
    151151        }
     
    154154    bool TetrisBrick::isValidMove(const Vector3& position, bool isRotation = false)
    155155    {
    156         return this->tetris_->isValidMove(this,position, isRotation);
     156        return this->tetris_->isValidMove(this,position, isRotation);
    157157    }
    158158
    159159    TetrisStone* TetrisBrick::getStone(unsigned int i)
    160160    {
    161         if(i < this->brickStones_.size())
     161        if(i < this->brickStones_.size())
    162162            return this->brickStones_[i];
    163         else return NULL;
     163        else return NULL;
    164164    }
    165165
     
    192192        else if(!this->lockRotation_) //rotate when key up is pressed
    193193        {
    194                 if(!isValidMove(this->getPosition(), true)) //catch illegal rotations
    195                     return;
     194            if(!isValidMove(this->getPosition(), true)) //catch illegal rotations
     195                return;
    196196            this->lockRotation_ = true; // multiple calls of this function have to be filtered out.
    197197            this->rotationTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&TetrisBrick::unlockRotation, this)));
  • code/trunk/src/modules/tetris/TetrisScore.cc

    r9667 r9945  
    9292        {
    9393            std::string score("0");
    94                 if(!this->owner_->hasEnded())
     94            if(!this->owner_->hasEnded())
    9595            {
    9696                //get the player
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.cc

    r9667 r9945  
    8282        XMLPortParam(HsW01, "material", setMaterial, getMaterial, xmlelement, mode);
    8383        XMLPortParam(HsW01, "projectileMesh", setMesh, getMesh, xmlelement, mode);
    84         XMLPortParam(HsW01, "sound", setSound, getSound, xmlelement, mode);
     84        XMLPortParam(HsW01, "sound", setSound, getSound, xmlelement, mode);
    8585    }
    8686
  • code/trunk/src/modules/weapons/weaponmodes/HsW01.h

    r9939 r9945  
    7474                { return this->mesh_; }
    7575
    76             /**
     76            /**
    7777            @brief Set the sound.
    7878            @param mesh The Sound name.
     
    8181                { this->sound_ = sound; }
    8282
    83             /**
     83            /**
    8484            @brief Get the sound.
    8585            @return Returns the sound name.
  • code/trunk/src/orxonox/gametypes/Dynamicmatch.cc

    r9667 r9945  
    276276            else if (friendlyfire && (source == target))
    277277            {
    278                     this->playerScored(originator->getPlayer(), -1);
     278                this->playerScored(originator->getPlayer(), -1);
    279279            }
    280280        }
     
    292292            if (playerParty_[originator->getPlayer()] == killer) //reward the killer
    293293            {
    294                     this->playerScored(originator->getPlayer(), 25);
     294                this->playerScored(originator->getPlayer(), 25);
    295295            }
    296296            return true;
     
    412412            if (it->second==piggy)//Spieler mit der Pig-party frags++
    413413            {
    414                 this->playerScored(it->first);
     414                this->playerScored(it->first);
    415415            }
    416416        }
  • code/trunk/src/orxonox/infos/PlayerInfo.cc

    r9939 r9945  
    232232        if (tmp == NULL)
    233233        {
    234                 orxout(verbose) <<  "PlayerInfo: pauseControl, Controller is NULL " << endl;
    235                 return;
     234            orxout(verbose) <<  "PlayerInfo: pauseControl, Controller is NULL " << endl;
     235            return;
    236236        }
    237237        tmp->setActive(false);
  • code/trunk/src/orxonox/sound/WorldAmbientSound.cc

    r9939 r9945  
    3939namespace orxonox
    4040{
    41         SetConsoleCommand("WorldAmbientSound", "nextsong",      &WorldAmbientSound::nextSong);
     41    SetConsoleCommand("WorldAmbientSound", "nextsong",      &WorldAmbientSound::nextSong);
    4242
    4343    RegisterClass(WorldAmbientSound);
     
    113113    {
    114114
    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         }
     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        }
    124124    }
    125125}
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r9939 r9945  
    305305    void Pawn::kill()
    306306    {
    307         this->damage(this->health_);
     307        this->damage(this->health_);
    308308        this->death();
    309309    }
     
    330330        {
    331331            explosionSound_->play();
    332                 // Set bAlive_ to false and wait for PawnManager to do the destruction
     332            // Set bAlive_ to false and wait for PawnManager to do the destruction
    333333            this->bAlive_ = false;
    334334
Note: See TracChangeset for help on using the changeset viewer.