Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2977 for code


Ignore:
Timestamp:
May 14, 2009, 2:35:54 PM (16 years ago)
Author:
Naaduun
Message:

=movable plane

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

Legend:

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

    r2956 r2977  
    117117//Vector3 v = this->getRVWorldPosition();
    118118            //this->line_->setPoint(1, Vector3(0,v.y,0) );
    119             this->line_->setPoint(1, Vector3(0, -this->getRVWorldPosition().y ,0) );
     119            this->line_->setPoint(1, Vector3( 0, (int) -Map::getSingletonPtr()->movablePlane_->getDistance( this->getRVWorldPosition() ) ,0 ));
    120120            this->line_->update();
    121             this->LineNode_->setDirection(Vector3::UNIT_Y,Ogre::Node::TS_WORLD,Vector3::UNIT_Y);
     121            if( Map::getSingletonPtr()->playerShipNode_ )
     122                this->LineNode_->setDirection( Map::getSingletonPtr()->playerShipNode_->getLocalAxes().GetColumn(1) ,Ogre::Node::TS_WORLD,Vector3::UNIT_Y);
    122123        }
    123124    }
  • code/branches/map/src/orxonox/overlays/map/Map.cc

    r2956 r2977  
    4747
    4848#include <OgreOverlay.h>
     49#include <OgreMovablePlane.h>
    4950#include <OgreOverlayElement.h>
    5051#include <OgreOverlayManager.h>
     
    169170        overlay_->hide();
    170171
    171         //Create plane in map
     172        //Create plane to show grid
    172173        Ogre::Entity* plane_ent = Map::getMapSceneManager()->createEntity( "MapPlane", "plane.mesh");
    173174        planeNode_ = Map::getMapSceneManager()->getRootSceneNode()->createChildSceneNode();
    174        
     175        //Create plane for calculations
     176        movablePlane_ = new Ogre::MovablePlane( Vector3::UNIT_Y, 0 );
     177        movablePlane_->normalise();
     178
    175179        //Ogre::MaterialPtr plane_mat = Ogre::MaterialManager::getSingleton().create("mapgrid", "General");
    176180        //plane_mat->getTechnique(0)->getPass(0)->createTextureUnitState("mapgrid.tga");
     
    178182        plane_ent->setMaterialName("Map/Grid");
    179183        planeNode_->attachObject(plane_ent);
     184       
    180185        planeNode_->scale(10,1,10);
     186        planeNode_->attachObject(movablePlane_);
    181187        //Ogre::Material plane_mat = Ogre::MaterialManager::getSingletonPtr()->getByName("rock");
    182188       
     
    272278                this->Cam_->setPosition(0, 0, DISTANCE);
    273279                this->Cam_->pitch( (Degree)PITCH );
    274                 //this->CamNodeHelper_->lookAt(Vector3(0,0,0), Ogre::Node::TS_PARENT);
    275                 this->Cam_->setAutoTracking(true, this->playerShipNode_);
     280                this->Cam_->lookAt(Vector3(0,0,0));
     281                //this->Cam_->setAutoTracking(true, this->playerShipNode_);
    276282            }
    277283           
     
    364370        Map::singletonMap_s->CamNodeHelper_->lookAt(Vector3(0,0,0), Ogre::Node::TS_PARENT);
    365371*/
    366         singletonMap_s->CamNode_->pitch( (Degree)(value.y * singletonMap_s->mouseLookSpeed_), Ogre::Node::TS_PARENT);
     372        singletonMap_s->CamNode_->pitch( (Degree)(value.y * singletonMap_s->mouseLookSpeed_), Ogre::Node::TS_LOCAL);
    367373       
    368374    }
  • code/branches/map/src/orxonox/overlays/map/Map.h

    r2956 r2977  
    3838#include <OgreOverlayManager.h>
    3939#include <OgreOverlayContainer.h>
     40#include <OgreMovablePlane.h>
    4041
    4142#include <OgreBorderPanelOverlayElement.h>
     
    114115        Ogre::SceneNode* playerShipNode_;
    115116        Ogre::SceneNode* planeNode_;
    116        
     117        Ogre::MovablePlane* movablePlane_;
    117118        int mouseLookSpeed_;
    118119        bool isVisible_;
     120     
     121    friend class RadarViewable;
    119122    };
    120123}
  • code/branches/map/src/util/SubString.cc

    r2171 r2977  
    3939
    4040#include "SubString.h"
     41#include <stdio.h>
    4142
    4243namespace orxonox
Note: See TracChangeset for help on using the changeset viewer.