Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8381


Ignore:
Timestamp:
May 2, 2011, 3:58:10 PM (13 years ago)
Author:
ssgier
Message:

started creating a more efficient code structure

Location:
code/branches/pickup/src/modules/pickup/items
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup/src/modules/pickup/items/ShrinkPickup.cc

    r8375 r8381  
    77#include "pickup/PickupIdentifier.h"
    88#include "worldentities/pawns/Pawn.h"
     9
     10#include "weaponsystem/WeaponSlot.h"
     11#include "weaponsystem/Weapon.h"
    912
    1013namespace orxonox
     
    4043       
    4144                        COUT(0) << "shrinking..." << endl;
     45                        //this->pawn->setScale3D(this->pawn->getScale3D() / 2.0);
    4246                        std::set<WorldEntity*> set = this->pawn->getAttachedObjects();
    4347                        for(std::set<WorldEntity*>::iterator it = set.begin(); it != set.end(); it++)
    4448                        {
    4549                                (*it)->setScale((*it)->getScale() / 5.0);
     50                                (*it)->setPosition((*it)->getPosition() / 5.0);
    4651                        }
     52                       
    4753                        durationTimer.setTimer(10, false, createExecutor(createFunctor(&ShrinkPickup::terminate, this)));
    4854        }
     
    5561        void ShrinkPickup::terminate(void)
    5662        {
     63                //this->pawn->setScale3D(this->pawn->getScale3D() * 5.0);
     64
    5765                std::set<WorldEntity*> set = this->pawn->getAttachedObjects();
    5866                for(std::set<WorldEntity*>::iterator it = set.begin(); it != set.end(); it++)
  • code/branches/pickup/src/modules/pickup/items/ShrinkPickup.h

    r8375 r8381  
    55
    66#include <string>
     7#include <vector>
    78
    89#include "pickup/Pickup.h"
     
    2728        private:
    2829            void initialize(void);
    29                 Pawn* carrierToPawnHelper(void);
     30                        const float duration;                   //determines how long the pickup will be active
     31                const float shrinkFactor;               //shrink factor of the space ship
     32                        const float shrinkDelay;                //how long it takes to shrink to the final size
     33                        double factorPerCall;
     34                        bool isTerminating;
     35                        vector<float> defaultScales;
     36                        vector<float> smallScales;
     37                        vector<float> actualScales;
     38                        vector<float> defaultPositions;
     39                        vector<float> smallPositions;
     40                        vector<float> actualPositions;
     41                        Pawn* carrierToPawnHelper(void);
    3042                        Pawn* pawn;
    3143                        Timer durationTimer;
Note: See TracChangeset for help on using the changeset viewer.