Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 25, 2008, 1:14:19 AM (16 years ago)
Author:
landauf
Message:

The SpaceShips HUD is working again (Speedbar and Radar)

Location:
code/branches/objecthierarchy2/src/orxonox/objects/worldentities
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy2/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2254 r2256  
    168168            {
    169169                this->client_overwrite_ = this->server_overwrite_;
    170 COUT(0) << "CE: bidirectional synchronization" << std::endl;
    171170                this->setObjectMode(direction::bidirectional);
    172171            }
     
    202201    void ControllableEntity::startLocalHumanControl()
    203202    {
    204 //        std::cout << this->getObjectID() << " ###### start local control" << std::endl;
    205203        this->camera_ = new Camera(this);
    206204        this->camera_->requestFocus();
     
    216214            this->hud_ = new OverlayGroup(this);
    217215            this->hud_->addTemplate(this->hudtemplate_);
     216            this->hud_->setOwner(this);
    218217        }
    219218    }
     
    221220    void ControllableEntity::stopLocalHumanControl()
    222221    {
    223 //        std::cout << "###### stop local control" << std::endl;
    224222        this->camera_->detachFromParent();
    225223        delete this->camera_;
     
    244242            else if (this->bHasLocalController_)
    245243            {
    246 //                COUT(2) << "setting client position" << endl;
    247244                this->client_velocity_ = this->velocity_;
    248245                this->client_position_ = this->node_->getPosition();
     
    254251    {
    255252        REGISTERSTRING(this->cameraPositionTemplate_, direction::toclient);
     253        REGISTERSTRING(this->hudtemplate_, direction::toclient);
    256254
    257255        REGISTERDATA(this->client_overwrite_,   direction::toserver);
     
    304302        if (this->server_overwrite_ == this->client_overwrite_)
    305303        {
    306 //            COUT(2) << "callback: setting client position" << endl;
    307304            this->node_->setPosition(this->client_position_);
    308305            this->server_position_ = this->client_position_;
    309306        }
    310 //        else
    311 //          COUT(2) << "callback: not setting client position" << endl;
    312307    }
    313308
  • code/branches/objecthierarchy2/src/orxonox/objects/worldentities/WorldEntity.h

    r2212 r2256  
    7272            inline void translate(float x, float y, float z, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
    7373                { this->translate(Vector3(x, y, z), relativeTo); }
     74
     75            virtual inline const Vector3& getVelocity() const
     76                { return Vector3::ZERO; }
    7477
    7578            virtual void setOrientation(const Quaternion& orientation) = 0;
  • code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2171 r2256  
    6161        this->weaponSystem_->getWeaponSetPointer(0)->getWeaponSlotPointer(0)->setAmmoType(true);
    6262        */
     63
     64        this->setRadarObjectColour(ColourValue::Red);
     65        this->setRadarObjectShape(RadarViewable::Dot);
    6366
    6467        this->registerVariables();
  • code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Pawn.h

    r2098 r2256  
    3333
    3434#include "objects/worldentities/ControllableEntity.h"
     35#include "objects/RadarViewable.h"
    3536
    3637namespace orxonox
    3738{
    38     class _OrxonoxExport Pawn : public ControllableEntity
     39    class _OrxonoxExport Pawn : public ControllableEntity, public RadarViewable
    3940    {
    4041        public:
     
    7879            virtual void postSpawn();
    7980
     81            inline const WorldEntity* getWorldEntity() const
     82                { return (WorldEntity*)this; }
     83
    8084        protected:
    8185            virtual void spawn();
  • code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/SpaceShip.cc

    r2254 r2256  
    229229        }
    230230    }
     231
     232    void SpaceShip::setEngine(Engine* engine)
     233    {
     234        this->engine_ = engine;
     235        if (engine && engine->getShip() != this)
     236            engine->addToSpaceShip(this);
     237    }
    231238}
  • code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/SpaceShip.h

    r2254 r2256  
    5858            virtual void boost();
    5959
     60            void setEngine(Engine* engine);
     61            inline Engine* getEngine() const
     62                { return this->engine_; }
     63
    6064            void setMaxRotation(const Degree& value)
    6165                { this->maxRotation_ = value; }
Note: See TracChangeset for help on using the changeset viewer.