Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2730 in orxonox.OLD


Ignore:
Timestamp:
Nov 5, 2004, 10:26:27 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: implemented a glList for player:

this is for testing purposes only, and will be set correctly, as soon as the Phyisics engine is up and running.
3 things have been done:


  1. added GLuint objectList to the player class.
  2. moved the mesh-definition of the player-object to the Player::Player, and packed into a list which resides to objectList.
  3. glCallList added into Player::Draw()

Patrick: i hope you don't mind this slight change in the trunk

Location:
orxonox/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/player.cc

    r2640 r2730  
    2525Player::Player(bool isFree) : WorldEntity(isFree)
    2626{
     27  objectList = glGenLists(1);
     28  glNewList (objectList, GL_COMPILE);
     29
     30  glBegin(GL_TRIANGLES);
     31  glColor3f(1,1,1);
     32  glVertex3f(0,0,0.5);
     33  glVertex3f(-0.5,0,-1);
     34  glVertex3f(0.5,0,-1);
     35
     36  glVertex3f(0,0,0.5);
     37  glVertex3f(0,0.5,-1);
     38  glVertex3f(0,-0.5,-1);
     39  glEnd();
     40   
     41  glBegin(GL_QUADS);
     42  glColor3f(0,0,1);
     43  glVertex3f(0.5,0.5,-1);
     44  glVertex3f(0.5,-0.5,-1);
     45  glVertex3f(-0.5,-0.5,-1);
     46  glVertex3f(-0.5,0.5,-1);
     47  glEnd();
     48 
     49  glEndList ();
     50
    2751}
    2852
     
    80104  glMultMatrixf ((float*)matrix);
    81105 
    82   glBegin(GL_TRIANGLES);
    83   glColor3f(1,1,1);
    84   glVertex3f(0,0,0.5);
    85   glVertex3f(-0.5,0,-1);
    86   glVertex3f(0.5,0,-1);
     106  glCallList (objectList);
    87107
    88   glVertex3f(0,0,0.5);
    89   glVertex3f(0,0.5,-1);
    90   glVertex3f(0,-0.5,-1);
    91   glEnd();
    92    
    93   glBegin(GL_QUADS);
    94   glColor3f(0,0,1);
    95   glVertex3f(0.5,0.5,-1);
    96   glVertex3f(0.5,-0.5,-1);
    97   glVertex3f(-0.5,-0.5,-1);
    98   glVertex3f(-0.5,0.5,-1);
    99   glEnd();
    100108 
    101109  //printf("Player@%f/%f/%f\n", get_placement()->r.x, get_placement()->r.y, get_placement()->r.z);
  • orxonox/trunk/src/player.h

    r2551 r2730  
    3636  float travel_speed;
    3737  float acceleration;
     38  GLuint objectList;
    3839 
    3940  void move (float time);
Note: See TracChangeset for help on using the changeset viewer.