Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 17, 2005, 2:15:33 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: fixed movement bug (was in the lists), modified the player

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/primitive.cc

    r3578 r3586  
    2626
    2727
     28
     29/**
     30   \brief standard constructor
     31*/
    2832Primitive::Primitive (PRIMITIVE_FORM form) : WorldEntity()
    2933{
    30   this->model = new OBJModel("../data/models/fighter.obj");
     34  //this->model = new OBJModel("../data/models/fighter.obj");
    3135  //this->model = new OBJModel("");
     36  this->object = gluNewQuadric();
     37
     38  gluQuadricTexture(this->object, GL_TRUE);
     39
     40  this->material = new Material("Sky");
     41  this->material->setDiffuseMap("../data/pictures/sky-replace.jpg");
     42  this->material->setIllum(3);
     43  this->material->setAmbient(1.0, 1.0, 1.0);
    3244}
    3345
    3446
    35 
     47/**
     48   \brief standard deconstructor
     49*/
    3650Primitive::~Primitive ()
    3751{
    38 
     52  delete this->material;
     53  free(this->object);
    3954}
    4055
     56/**
     57   \brief called, when the object gets hit
     58   \param other object, that hits it
     59   \param location of impact
     60*/
     61void Primitive::hit (WorldEntity* weapon, Vector* loc) {}
     62
     63
     64/**
     65   \brief object collides
     66*/
     67void Primitive::collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags) {}
     68
     69
     70/**
     71   \brief tick singal put everything here, that is timedependent
     72   \param time in sec
     73*/
    4174void Primitive::tick (float time)
    4275{
    43   Vector v(0.0, 0.0, 1.0);
    44   Quaternion q(10.0, v);
     76  //Vector v(0.0, 0.0, 1.0);
     77  //Quaternion q(10.0, v);
    4578  //this->relDirection = this->relDirection * q;
    4679}
    4780
    48 void Primitive::hit (WorldEntity* weapon, Vector* loc) {}
    49 
    50 
    51 void Primitive::collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags) {}
    52 
     81/**
     82   \brief drawing function of the object
     83*/
    5384void Primitive::draw ()
    5485{
    5586  glMatrixMode(GL_MODELVIEW);
    5687  glPushMatrix();
     88
    5789  float matrix[4][4];
    58  
    5990  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
    6091  //rotate
    61   this->getAbsDir().matrix (matrix);
    62   glMultMatrixf((float*)matrix);
    63  
    64   this->model->draw();
     92  //this->getAbsDir().matrix (matrix);
     93  //glMultMatrixf((float*)matrix);
     94  gluSphere(this->object, 2, 20, 20);
     95
    6596  glPopMatrix();
    6697}
Note: See TracChangeset for help on using the changeset viewer.