Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 8, 2014, 4:14:31 PM (11 years ago)
Author:
fvultier
Message:

Added a whole bunch of code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickupsFS14/src/modules/jump/JumpPlatform.cc

    r10041 r10050  
    5959
    6060        this->figure_ = 0;
    61         this->bDeleteBats_ = false;
    62         this->batID_ = new unsigned int[1];
    63         this->batID_[0] = OBJECTID_UNKNOWN;
    64         this->relMercyOffset_ = 0.05f;
    65 
    66         this->registerVariables();
    6761
    6862        //initialize sound
     
    8680        this->setVelocity(Vector3(0,0,0));
    8781        this->setAcceleration(Vector3(0,0,0));
    88 
    89         model = NULL;
    9082    }
    9183
     
    116108    /**
    117109    @brief
    118         Register variables to synchronize over the network.
    119     */
    120     void JumpPlatform::registerVariables()
    121     {
    122         registerVariable( this->fieldWidth_ );
    123         registerVariable( this->fieldHeight_ );
    124         registerVariable( this->relMercyOffset_ );
    125         registerVariable( this->batID_[0] );
    126         //registerVariable( this->batID_[1], VariableDirection::ToClient, new NetworkCallback<JumpPlatform>( this, &JumpPlatform::applyBats) );
    127     }
    128 
    129     /**
    130     @brief
    131110        Is called every tick.
    132111        Handles the movement of the ball and its interaction with the boundaries and bats.
     
    147126            if(figureVelocity.z < 0 && figurePosition.x > platformPosition.x-10 && figurePosition.x < platformPosition.x+10 && figurePosition.z > platformPosition.z-4 && figurePosition.z < platformPosition.z+4)
    148127            {
    149                 figure_->JumpFromPlatform(200.0f);
     128                touchFigure();
    150129            }
    151130        }
     
    249228    void JumpPlatform::setFigure(WeakPtr<JumpFigure> newFigure)
    250229    {
    251         if (this->bDeleteBats_) // If there are already some bats, delete them.
    252         {
    253             delete this->figure_;
    254             this->bDeleteBats_ = false;
    255         }
    256 
    257         this->figure_ = newFigure;
    258         // Also store their object IDs, for synchronization.
    259         this->batID_[0] = this->figure_->getObjectID();
    260     }
    261 
    262     /**
    263     @brief
    264         Get the bats over the network.
    265     */
    266     void JumpPlatform::applyBats()
    267     {
    268         // Make space for the bats, if they don't exist, yet.
    269         if (this->figure_ == NULL)
    270         {
    271             this->figure_ = *(new WeakPtr<JumpFigure>);
    272             this->bDeleteBats_ = true;
    273         }
    274 
    275         if (this->batID_[0] != OBJECTID_UNKNOWN)
    276         {
    277                 // WAR IM PONG NICHT AUSKOMMENTIERT!!!
    278             //this->figure_ = orxonox_cast<JumpFigure>(Synchronisable::getSynchronisable(this->batID_[0]));
    279         }
     230        figure_ = newFigure;
     231    }
     232
     233    void JumpPlatform::accelerateFigure()
     234    {
     235        figure_->JumpFromPlatform(this);
     236    }
     237
     238    void JumpPlatform::touchFigure()
     239    {
     240
    280241    }
    281242
Note: See TracChangeset for help on using the changeset viewer.