Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3311 in orxonox.OLD for orxonox/branches/parenting/src/world.cc


Ignore:
Timestamp:
Dec 31, 2004, 2:20:21 PM (19 years ago)
Author:
patrick
Message:

oroxnox/branches/parenting: implemented helperParent and made some tests with the opengl nurbs lib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/world.cc

    r3309 r3311  
    2525#include "p_node.h"
    2626#include "null_parent.h"
     27#include "helper_parent.h"
    2728
    2829using namespace std;
     
    8485}
    8586
     87GLfloat ctrlpoints[4][3] = {
     88  {20.0, 10.0, 5.0}, {40.0, -10.0, 0.0},
     89  {60.0, -10.0, 5.0}, {80.0, 10.0, 5.0}};
     90
    8691
    8792ErrorMessage World::init()
     
    9297  cn->enable(true);
    9398
    94   /* this is only for test purposes */
    95   this->debug ();
    96 }
     99  glMap1f (GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[0][0]);
     100  glEnable (GL_MAP1_VERTEX_3);
     101 
     102  //theNurb = gluNewNurbsRenderer ();
     103  //gluNurbsProperty (theNurb, GLU_NURBS_MODE, GLU_NURBS_TESSELLATOR);
     104  //gluNurbsProperty (theNurb, GLU_NURBS_VERTEX, vertexCallback );
     105}
     106
     107
    97108
    98109ErrorMessage World::start()
     
    124135
    125136}
     137
     138
     139
    126140
    127141void World::load()
     
    139153        case DEBUG_WORLD_0:
    140154          {
    141             this->nullParent = new NullParent ();
     155            this->nullParent = NullParent::getInstance ();
    142156            this->nullParent->setName ("NullParent");
    143157
     
    160174            // !\todo old track-system has to be removed
    161175
     176            //create helper for player
     177            HelperParent* hp = new HelperParent ();
     178            /* the player has to be added to this helper */
     179
    162180            // create a player
    163             WorldEntity* myPlayer = new Player();
     181            WorldEntity* myPlayer = new Player ();
    164182            myPlayer->setName ("player");
    165             this->spawn(myPlayer);
     183            this->spawn (myPlayer);
    166184            this->localPlayer = myPlayer;           
    167185
    168186            // bind input
    169             Orxonox *orx = Orxonox::getInstance();
     187            Orxonox *orx = Orxonox::getInstance ();
    170188            orx->getLocalInput()->bind (myPlayer);
    171189           
     
    188206        case DEBUG_WORLD_1:
    189207          {
    190             this->nullParent = new NullParent ();
     208            this->nullParent = NullParent::getInstance ();
     209            this->nullParent->setName ("NullParent");
    191210
    192211            // create some path nodes
     
    199218            this->pathnodes[5] = Vector(30, 50, 0);
    200219           
     220
     221
     222
    201223            // create the tracks
    202224            this->tracklen = 6;
     
    400422  //draw track
    401423  glBegin(GL_LINES);
    402   glColor3f(0,1,1);
     424  glColor3f(0.0, 1.0, 1.0);
    403425  for( int i = 0; i < tracklen; i++)
    404426    {
     
    407429    }
    408430  glEnd();
     431
     432  glBegin(GL_LINE_STRIP);
     433  glColor3f(1.0, 5.0, 1.0);
     434  for( int i = 0; i <= 30; i++)
     435    {
     436      glEvalCoord1f ((GLfloat) i/30.0);
     437    }
     438  glEnd();
     439
    409440  glEndList();
    410441}
     
    470501  // draw debug coord system
    471502  glCallList (objectList);
    472 
    473503
    474504}
     
    595625{
    596626  printf ("World::debug() - starting debug\n");
    597   PNode* p1 = new NullParent ();
     627  PNode* p1 = NullParent::getInstance ();
    598628  PNode* p2 = new PNode (new Vector(2, 2, 2), p1);
    599629  PNode* p3 = new PNode (new Vector(4, 4, 4), p1);
Note: See TracChangeset for help on using the changeset viewer.