Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 9, 2009, 4:52:36 PM (15 years ago)
Author:
Naaduun
Message:

Added own scenemanager to map, added 2 pointer to contain mapentity and mapscenenod to radarviewable

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

Legend:

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

    r2662 r2913  
    4545        , radarObjectShape_(Dot)
    4646        , radarObjectDescription_("staticObject")
     47        , MapNode_(NULL)
     48        , MapEntity_(NULL)
    4749    {
    4850        RegisterRootObject(RadarViewable);
  • code/branches/map/src/orxonox/objects/RadarViewable.h

    r2662 r2913  
    3636#include "util/Debug.h"
    3737#include "core/OrxonoxClass.h"
     38
     39#include <OgreSceneNode.h>
     40#include <OgreEntity.h>
    3841
    3942namespace orxonox
     
    8083            { return this->radarObjectShape_; }
    8184
     85/*
     86        inline void setMapNode(Ogre::SceneNode * node)
     87            { this->MapNode_ = node; }
     88        inline Ogre::SceneNode * getMapNode() const
     89            { return this->MapNode_; }
     90        inline void setMapEntity(Ogre::Entity * ent)
     91            { this->MapEntity_ = ent; }
     92        inline Ogre::Entity * getMapEntity() const
     93            { return this->MapEntity_; }
     94*/
     95        //Used for Map
     96        Ogre::SceneNode * MapNode_;
     97        Ogre::Entity * MapEntity_;
     98
    8299    private:
    83100        void validate(const WorldEntity* object) const
     
    94111        std::string radarObjectDescription_;
    95112        ColourValue radarObjectColour_;
     113       
    96114    };
    97115}
  • code/branches/map/src/orxonox/objects/worldentities/CameraPosition.cc

    r2662 r2913  
    3030#include "CameraPosition.h"
    3131
     32#include <OgreCamera.h>
     33
    3234#include "core/CoreIncludes.h"
    3335#include "core/XMLPort.h"
     
    4446        this->bDrag_ = false;
    4547        this->bAllowMouseLook_ = false;
     48        this->bRenderCamera_ = false;
    4649
    4750        this->setObjectMode(0x0);
     
    5861        XMLPortParam(CameraPosition, "drag", setDrag, getDrag, xmlelement, mode).defaultValues(false);
    5962        XMLPortParam(CameraPosition, "mouselook", setAllowMouseLook, getAllowMouseLook, xmlelement, mode).defaultValues(false);
     63        XMLPortParam(CameraPosition, "rendercamera", setRenderCamera, getRenderCamera, xmlelement, mode).defaultValues(false);
    6064    }
    6165
     
    7074            camera->setDrag(true);
    7175    }
     76
     77    void CameraPosition::attachCamera(Ogre::Camera* camera)
     78    {
     79        this->attachOgreObject(camera);
     80    }
    7281}
  • code/branches/map/src/orxonox/objects/worldentities/CameraPosition.h

    r2662 r2913  
    5454                { return this->bAllowMouseLook_; }
    5555
     56            inline void setRenderCamera(bool bRenderCamera)
     57                { this->bRenderCamera_ = bRenderCamera; }
     58            inline bool getRenderCamera() const
     59                { return this->bRenderCamera_; }
     60
    5661            void attachCamera(Camera* camera);
     62            void attachCamera(Ogre::Camera* camera);
    5763
    5864        private:
    5965            bool bDrag_;
    6066            bool bAllowMouseLook_;
     67            bool bRenderCamera_;
    6168    };
    6269}
  • code/branches/map/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2662 r2913  
    6262        this->hud_ = 0;
    6363        this->camera_ = 0;
     64        this->reverseCamera_ = 0;
    6465        this->bDestroyWhenPlayerLeft_ = false;
    6566        this->cameraPositionRootNode_ = this->node_->createChildSceneNode();
     
    148149        else
    149150            this->attach(position);
    150         this->cameraPositions_.push_back(position);
     151
     152        if (!position->getRenderCamera())
     153            this->cameraPositions_.push_back(position);
     154        else
     155            this->setReverseCamera(position);
    151156    }
    152157
  • code/branches/map/src/orxonox/objects/worldentities/ControllableEntity.h

    r2662 r2913  
    109109            inline const std::string& getCameraPositionTemkplate() const
    110110                { return this->cameraPositionTemplate_; }
     111
     112            inline void setReverseCamera(CameraPosition* camera)
     113                { this->reverseCamera_ = camera; }
     114            inline CameraPosition* getReverseCamera() const
     115                { return this->reverseCamera_; }
    111116
    112117            using WorldEntity::setPosition;
     
    188193            std::list<CameraPosition*> cameraPositions_;
    189194            std::string cameraPositionTemplate_;
     195            CameraPosition* reverseCamera_;
    190196
    191197            const GametypeInfo* gtinfo_;
Note: See TracChangeset for help on using the changeset viewer.