- Timestamp:
- Jan 27, 2006, 5:16:44 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/hover.cc
r6800 r6801 135 135 // rotors 136 136 this->wingNodeLeft.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 137 this->wingNodeLeft.setParent(this); 138 this->wingNodeLeft.setRelCoor(-1.5, -.3, -1.0); 139 this->rotorNodeLeft.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 140 this->rotorNodeLeft.setParent(&this->wingNodeLeft); 141 this->rotorNodeLeft.setRelCoor(0, 1.0, -2.3); 142 137 143 this->wingNodeRight.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 138 139 this-> rotorNodeLeft.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);144 this->wingNodeRight.setParent(this); 145 this->wingNodeRight.setRelCoor(-1.5, -0.3, 1.0); 140 146 this->rotorNodeRight.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 141 142 this->wingNodeLeft.setParent(this);143 this->wingNodeRight.setParent(this);144 145 this->wingNodeLeft.setRelCoor(-1, .5, -.5);146 this->wingNodeRight.setRelCoor(-1, .5, .5);147 148 this->rotorNodeLeft.setParent(&this->wingNodeLeft);149 147 this->rotorNodeRight.setParent(&this->wingNodeRight); 148 this->rotorNodeRight.setRelCoor(0, 1.0, 2.3); 150 149 151 150 this->loadModel("models/ships/hoverglider_wing.obj", 1.0f, 3); … … 449 448 void Hover::draw() const 450 449 { 450 Vector tmpRot; 451 451 452 WorldEntity::draw(); 452 453 453 glMatrixMode(GL_MODELVIEW); 454 glPushMatrix(); 455 456 /* translate */ 457 glTranslatef (this->wingNodeLeft.getAbsCoor ().x, 458 this->wingNodeLeft.getAbsCoor ().y, 459 this->wingNodeLeft.getAbsCoor ().z); 460 Vector tmpRot = this->wingNodeLeft.getAbsDir().getSpacialAxis(); 461 glRotatef (this->wingNodeLeft.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 462 this->getModel(3)->draw(); 463 464 glPopMatrix (); 454 glPushMatrix(); 455 /// LEFT SIDE 456 glTranslatef (this->wingNodeLeft.getAbsCoor ().x, 457 this->wingNodeLeft.getAbsCoor ().y, 458 this->wingNodeLeft.getAbsCoor ().z); 459 tmpRot = this->wingNodeLeft.getAbsDir().getSpacialAxis(); 460 glRotatef (this->wingNodeLeft.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 461 this->getModel(3)->draw(); 462 glPopMatrix (); 463 464 glPushMatrix(); 465 glTranslatef (this->rotorNodeLeft.getAbsCoor ().x, 466 this->rotorNodeLeft.getAbsCoor ().y, 467 this->rotorNodeLeft.getAbsCoor ().z); 468 tmpRot = this->rotorNodeLeft.getAbsDir().getSpacialAxis(); 469 glRotatef (this->rotorNodeLeft.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 470 this->getModel(4)->draw(); 471 glPopMatrix (); 472 473 /// RIGHT SIDE 474 glPushMatrix(); 475 glTranslatef (this->wingNodeRight.getAbsCoor ().x, 476 this->wingNodeRight.getAbsCoor ().y, 477 this->wingNodeRight.getAbsCoor ().z); 478 tmpRot = this->wingNodeRight.getAbsDir().getSpacialAxis(); 479 glRotatef (this->wingNodeRight.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 480 glScalef(1,1,-1); 481 this->getModel(3)->draw(); 482 glPopMatrix (); 483 484 glPushMatrix(); 485 glTranslatef (this->rotorNodeRight.getAbsCoor ().x, 486 this->rotorNodeRight.getAbsCoor ().y, 487 this->rotorNodeRight.getAbsCoor ().z); 488 tmpRot = this->rotorNodeRight.getAbsDir().getSpacialAxis(); 489 glRotatef (this->rotorNodeRight.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 490 glScalef(1,1,-1); 491 this->getModel(4)->draw(); 492 glPopMatrix (); 465 493 466 494 this->getWeaponManager()->draw();
Note: See TracChangeset
for help on using the changeset viewer.