Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2009, 10:38:06 PM (15 years ago)
Author:
scheusso
Message:

first approach of having client-side pong physics
some optimisations in TrafficControl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/netp3/src/orxonox/objects/worldentities/PongBall.h

    r2885 r3043  
    3333
    3434#include "objects/worldentities/MovableEntity.h"
     35#include "objects/worldentities/PongBat.h"
    3536
    3637namespace orxonox
     
    4344
    4445            virtual void tick(float dt);
     46           
     47            void registerVariables();
    4548
    4649            void setFieldDimension(float width, float height)
     
    6164
    6265            void setBats(PongBat** bats)
    63                 { this->bat_ = bats; }
     66            { this->bat_ = bats; this->batID_[0] = this->bat_[0]->getObjectID(); this->batID_[1] = this->bat_[1]->getObjectID(); }
     67           
     68            void applyBats()
     69            { if(!this->bat_) this->bat_ = new PongBat*[2]; if(this->batID_[0] != OBJECTID_UNKNOWN) this->bat_[0] = dynamic_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[0])); if(this->batID_[1] != OBJECTID_UNKNOWN) this->bat_[1] = dynamic_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[1])); }
    6470
    6571            static const float MAX_REL_Z_VELOCITY;
     
    7177            float batlength_;
    7278            PongBat** bat_;
     79            unsigned int* batID_;
    7380            float relMercyOffset_;
    7481    };
Note: See TracChangeset for help on using the changeset viewer.