Changeset 3311 in orxonox.OLD for orxonox/branches/parenting/src/world.cc
- Timestamp:
- Dec 31, 2004, 2:20:21 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/world.cc
r3309 r3311 25 25 #include "p_node.h" 26 26 #include "null_parent.h" 27 #include "helper_parent.h" 27 28 28 29 using namespace std; … … 84 85 } 85 86 87 GLfloat 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 86 91 87 92 ErrorMessage World::init() … … 92 97 cn->enable(true); 93 98 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 97 108 98 109 ErrorMessage World::start() … … 124 135 125 136 } 137 138 139 126 140 127 141 void World::load() … … 139 153 case DEBUG_WORLD_0: 140 154 { 141 this->nullParent = new NullParent();155 this->nullParent = NullParent::getInstance (); 142 156 this->nullParent->setName ("NullParent"); 143 157 … … 160 174 // !\todo old track-system has to be removed 161 175 176 //create helper for player 177 HelperParent* hp = new HelperParent (); 178 /* the player has to be added to this helper */ 179 162 180 // create a player 163 WorldEntity* myPlayer = new Player ();181 WorldEntity* myPlayer = new Player (); 164 182 myPlayer->setName ("player"); 165 this->spawn (myPlayer);183 this->spawn (myPlayer); 166 184 this->localPlayer = myPlayer; 167 185 168 186 // bind input 169 Orxonox *orx = Orxonox::getInstance ();187 Orxonox *orx = Orxonox::getInstance (); 170 188 orx->getLocalInput()->bind (myPlayer); 171 189 … … 188 206 case DEBUG_WORLD_1: 189 207 { 190 this->nullParent = new NullParent (); 208 this->nullParent = NullParent::getInstance (); 209 this->nullParent->setName ("NullParent"); 191 210 192 211 // create some path nodes … … 199 218 this->pathnodes[5] = Vector(30, 50, 0); 200 219 220 221 222 201 223 // create the tracks 202 224 this->tracklen = 6; … … 400 422 //draw track 401 423 glBegin(GL_LINES); 402 glColor3f(0 ,1,1);424 glColor3f(0.0, 1.0, 1.0); 403 425 for( int i = 0; i < tracklen; i++) 404 426 { … … 407 429 } 408 430 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 409 440 glEndList(); 410 441 } … … 470 501 // draw debug coord system 471 502 glCallList (objectList); 472 473 503 474 504 } … … 595 625 { 596 626 printf ("World::debug() - starting debug\n"); 597 PNode* p1 = new NullParent();627 PNode* p1 = NullParent::getInstance (); 598 628 PNode* p2 = new PNode (new Vector(2, 2, 2), p1); 599 629 PNode* p3 = new PNode (new Vector(4, 4, 4), p1);
Note: See TracChangeset
for help on using the changeset viewer.