Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3408 in orxonox.OLD for orxonox/branches/dave/src/skybox.cc


Ignore:
Timestamp:
Feb 18, 2005, 4:56:49 PM (19 years ago)
Author:
dave
Message:

branches/dave/src: Die Skybox bewegt sich schon mal, dafuer neuer fehler beim Steuern

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/dave/src/skybox.cc

    r3407 r3408  
    1111#include "skybox.h"
    1212#include "stdincl.h"
     13#include "vector.h"
    1314#include "world_entity.h"
    14 #include "vector.h"
    1515
    1616
    1717using namespace std;
    1818
    19 Skybox::Skybox():WorldEntity()
     19Skybox::Skybox()
    2020
    2121    //GLUquadricObj *sphereObj=0;
     
    2727Skybox::~Skybox(){}
    2828
    29 void Skybox::tick(float time){
    30     this->move(time);
    31 }
    32 
    33 void Skybox::hit(WorldEntity* weapon,Vector loc){}
    34 
    35 void Skybox::destroy(){}
    36 
    37 void Skybox::collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitlags){}
    38 
    39 void Skybox::command(Command* cmd)
    40 {
    41     if(!strcmp(cmd->cmd, "up")) bUp=!cmd->bUp;
    42     else if(!strcmp(cmd->cmd,"down"))bDown=!cmd->bUp;
    43     else if(!strcmp(cmd->cmd,"left"))bLeft=!cmd->bUp;
    44     else if(!strcmp(cmd->cmd,"right"))bRight=!cmd->bUp;
    4529
    4630
    47 }
    4831
    49 
    50 void Skybox::draw()
     32void Skybox::draw(WorldEntity* myplayer)
    5133{
    5234
    5335    glPushMatrix();
    54     glTranslatef(this->getAbsCoor().x,this->getAbsCoor().y,this->getAbsCoor().z);
    55     glRotatef(180.0f,0.0f,0.0f,1.0f);
    56     glRotatef(45.0f,0.0,1.0f,0.0f);
     36    //Vector shift(myplayer->getRelCoor());
     37    //glTranslatef(shift.x,shift.y,shift.z);
     38    glTranslatef(myplayer->absCoordinate.x,myplayer->absCoordinate.y,myplayer->absCoordinate.z);
     39    glRotatef(-180.0f,0.0f,0.0f,1.0f);
     40    glRotatef(0.0f,0.0,1.0f,0.0f);
    5741    gluSphere(sphereObj,250.0f,20,20);
    5842    glPopMatrix();
    59 
    60 
    61 }
    62 
    63 void Skybox::leftWorld(){}
    64 
    65 void Skybox::move(float time)
    66 {
    67     Vector accel(0.0,0.0,0.0);
    68     Vector direction (1.0,0.0,0.0);
    69     Vector orthDirection (0.0,0.0,1.0);
    70    
    71     if(bUp){accel=accel+(direction*20.0f);}
    72     if(bDown){accel=accel-(direction*20.0f);}
    73     if(bLeft){accel=accel-(orthDirection*20.0f);}
    74     if(bRight){accel=accel+(orthDirection*20.0f);}
    75    
    76     Vector shift(15.0f*time,0,0);
    77     this->shiftCoor(&shift);
    78     Vector move=accel*time;
    79     this->shiftCoor(&move);
    80    
    81    
    82    
    83    
    8443
    8544
     
    9049
    9150
     51
     52
     53
Note: See TracChangeset for help on using the changeset viewer.