Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 7, 2009, 4:44:12 PM (16 years ago)
Author:
Naaduun
Message:

added rotate and zoom to map. using static mapscenemanager now

Location:
code/branches/map/src/orxonox/objects
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/map/src/orxonox/objects/RadarViewable.cc

    r2942 r2956  
    5252        , MapEntity_(NULL)
    5353        , line_(NULL)
     54        , isHumanShip_(false)
    5455    {
    5556        RegisterRootObject(RadarViewable);
     
    6970    {
    7071        delete MapNode_;
     72        MapNode_=0;
    7173        delete MapEntity_;
     74        MapEntity_=0;
     75        delete line_;
     76        line_=0;
     77        delete LineNode_;
     78        LineNode_=0;
    7279    }
    7380
     
    9198
    9299            this->MapNode_->attachObject( this->MapEntity_ );
    93             this->MapNode_->attachObject( this->line_ );
     100
     101            this->LineNode_ = this->MapNode_->createChildSceneNode();
     102            this->LineNode_->attachObject( this->line_ );
    94103        }
    95104        else
     
    106115            this->MapNode_->translate( this->getRVOrientedVelocity(), (Ogre::Node::TransformSpace)3 );
    107116            this->MapNode_->setOrientation( this->getWorldEntity()->getOrientation() );
    108 Vector3 v = this->getRVWorldPosition();
    109             this->line_->setPoint(1, Vector3(0,v.y,0) );
     117//Vector3 v = this->getRVWorldPosition();
     118            //this->line_->setPoint(1, Vector3(0,v.y,0) );
     119            this->line_->setPoint(1, Vector3(0, -this->getRVWorldPosition().y ,0) );
     120            this->line_->update();
     121            this->LineNode_->setDirection(Vector3::UNIT_Y,Ogre::Node::TS_WORLD,Vector3::UNIT_Y);
    110122        }
    111123    }
  • code/branches/map/src/orxonox/objects/RadarViewable.h

    r2942 r2956  
    101101        Ogre::Entity * MapEntity_;
    102102        DynamicLines* line_;
     103        Ogre::SceneNode * LineNode_;
    103104        void addMapEntity();
    104105        void updateMapPosition();
     106        bool isHumanShip_;
     107        inline std::string getUniqueId()
     108        {
     109            return this->uniqueId_;
     110        }
     111
    105112    private:
    106113        void validate(const WorldEntity* object) const
     
    113120        }
    114121
     122        //Map
     123        std::string uniqueId_;
    115124       
    116         std::string uniqueId_;
    117125
     126        //Radar
    118127        float radarObjectCamouflage_;
    119128        Shape radarObjectShape_;
  • code/branches/map/src/orxonox/objects/worldentities/pawns/Pawn.cc

    r2782 r2956  
    7575
    7676        this->registerVariables();
     77
     78        this->isHumanShip_ = this->hasLocalController();
    7779    }
    7880
     
    291293    }
    292294
     295    //Tell the Map (RadarViewable), if this is a playership
     296    void Pawn::startLocalHumanControl()
     297    {
     298//        SUPER(ControllableEntity, changedPlayer());
     299        ControllableEntity::startLocalHumanControl();
     300        this->isHumanShip_ = true;
     301    }
     302
    293303
    294304    ///////////////////
  • code/branches/map/src/orxonox/objects/worldentities/pawns/Pawn.h

    r2662 r2956  
    108108
    109109            virtual void dropItems();
     110           
     111            virtual void startLocalHumanControl();
    110112
    111113        protected:
Note: See TracChangeset for help on using the changeset viewer.