Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 13, 2005, 7:38:52 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: SkyBox even better,

world-entity implements a draw function of its own

some other minor stuff

File:
1 edited

Legend:

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

    r3755 r3803  
    1919
    2020#include "world_entity.h"
    21 #include "objModel.h"
     21#include "model.h"
    2222#include "list.h"
     23#include "vector.h"
    2324
    2425//#include "stdincl.h"
     
    4142  this->setClassName ("WorldEntity");
    4243  this->bDraw = true;
    43   //this->model = NULL;
     44  this->model = NULL;
    4445  //  collisioncluster = NULL;
    4546}
     
    171172   Handle all stuff that should update with time inside this method (movement, animation, etc.)
    172173*/
    173 inline void WorldEntity::tick(float time)
     174void WorldEntity::tick(float time)
    174175{
    175176}
     
    181182   This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn.
    182183*/
    183 inline void WorldEntity::draw()
    184 {}
     184void WorldEntity::draw()
     185{
     186  glMatrixMode(GL_MODELVIEW);
     187  glPushMatrix();
     188  float matrix[4][4];
     189 
     190  /* translate */
     191  glTranslatef (this->getAbsCoor ().x,
     192                this->getAbsCoor ().y,
     193                this->getAbsCoor ().z);
     194  /* rotate */
     195  this->getAbsDir ().matrix (matrix);
     196  glMultMatrixf((float*)matrix);
     197
     198  if (this->model)
     199    this->model->draw();
     200  glPopMatrix();
     201}
    185202
    186203
Note: See TracChangeset for help on using the changeset viewer.