Changeset 6634 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 21, 2006, 1:18:19 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 6 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/Makefile.am
r6532 r6634 23 23 world_entities/character_attributes.cc \ 24 24 world_entities/test_entity.cc \ 25 world_entities/image_entity.cc \ 26 world_entities/planet.cc \ 25 27 \ 26 28 world_entities/weapons/weapon_manager.cc \ … … 72 74 world_entities/character_attributes.h \ 73 75 world_entities/test_entity.h \ 76 world_entities/image_entity.h \ 77 world_entities/planet.h \ 74 78 \ 75 79 world_entities/weapons/weapon_manager.h \ -
trunk/src/world_entities/skybox.cc
r6523 r6634 71 71 this->setClassID(CL_SKYBOX, "SkyBox"); 72 72 this->toList(OM_ENVIRON_NOTICK); 73 this->size = 100.0; 73 //this->size = 100.0; 74 this->textureSize = 1024.0f; 74 75 75 76 for (int i = 0; i < 6; i++) … … 215 216 } 216 217 218 219 220 void SkyBox::draw() 221 { 222 glPushAttrib(GL_ENABLE_BIT); 223 // glPushAttrib(GL_LIGHTING_BIT); 224 glDisable(GL_LIGHTING); 225 226 WorldEntity::draw(); 227 228 glPopAttrib(); 229 230 } 231 232 217 233 /** 218 234 * rebuilds the SkyBox … … 233 249 model->addVertex (0.5*size, -0.5*size, -0.5*size); 234 250 235 model->addVertexTexture (0.0, 1.0); 236 model->addVertexTexture (1.0, 1.0); 237 model->addVertexTexture (1.0, 0.0); 238 model->addVertexTexture (0.0, 0.0); 251 // model->addVertexTexture (0.0, 1.0); 252 // model->addVertexTexture (1.0, 1.0); 253 // model->addVertexTexture (1.0, 0.0); 254 // model->addVertexTexture (0.0, 0.0); 255 256 model->addVertexTexture (1.0/this->textureSize, (this->textureSize - 1.0)/this->textureSize); 257 model->addVertexTexture ((this->textureSize - 1.0)/this->textureSize, (this->textureSize - 1.0)/this->textureSize); 258 model->addVertexTexture ((this->textureSize - 1.0)/this->textureSize, 1.0/this->textureSize); 259 model->addVertexTexture (1.0/this->textureSize, 1.0/this->textureSize); 260 239 261 240 262 model->addVertexNormal (0.0, 0.0, 1.0); -
trunk/src/world_entities/skybox.h
r6519 r6634 33 33 void postInit(); 34 34 35 virtual void draw(); 35 36 36 37 void setSize(float size); … … 60 61 61 62 float size; //!< Size of the SkyBox. This should match the frustum maximum range. 63 float textureSize; //!< this is the length of a texture (assumes a square texture) 62 64 char* textureName; //!< Name of the Texture 63 65 -
trunk/src/world_entities/space_ships/space_ship.cc
r6617 r6634 40 40 41 41 #include "plane.h" 42 43 #include "state.h" 44 #include "player.h" 42 45 43 46 … … 272 275 void SpaceShip::tick (float time) 273 276 { 277 this->getWeaponManager()->tick(time); 278 // weapon system manipulation 279 this->weaponAction(); 280 281 // if( this != State::getPlayer()->getControllable()) 282 // return; 274 283 275 284 // spaceship controlled movement … … 293 302 294 303 //hoover effect 295 cycle += time;296 this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);304 //cycle += time; 305 //this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02); 297 306 298 307 //readjust … … 311 320 this->shiftCoor (move); 312 321 313 this->getWeaponManager()->tick(time); 314 // weapon system manipulation 315 this->weaponAction(); 322 316 323 } 317 324 … … 508 515 SYNCHELP_READ_BYTE( b ); 509 516 510 if ( b == DATA_state && this->getHostID()!=this->getOwner() ) 511 { 517 if ( b == DATA_state /*&& (this->getHostID()!=this->getOwner() || sender==0)*/ ) 518 { 519 PRINTF(0)("GOT STATE %d\n", this->getUniqueID()); 512 520 setRequestedSync( false ); 513 521 setIsOutOfSync( false ); 514 522 SYNCHELP_READ_FKT( WorldEntity::writeState ); 515 SYNCHELP_READ_FLOAT( cycle ); 516 } 517 518 if ( b == DATA_flags && this->getHostID()!=this->getOwner() ) 519 { 520 int flags; 523 //SYNCHELP_READ_FLOAT( cycle ); 524 525 return SYNCHELP_READ_N; 526 } 527 528 529 if ( b == DATA_flags /*&& this->getHostID()!=this->getOwner()*/ ) 530 { 531 int flags = 0; 521 532 SYNCHELP_READ_INT( flags ); 522 533 523 bUp = flags & MASK_bUp != 0; 524 bDown = flags & MASK_bDown != 0; 525 bLeft = flags & MASK_bLeft != 0; 526 bRight = flags & MASK_bRight != 0; 527 bAscend = flags & MASK_bAscend != 0; 528 bDescend = flags & MASK_bDescend != 0; 529 bFire = flags & MASK_bFire != 0; 530 bRollL = flags & MASK_bRollL != 0; 531 bRollR = flags & MASK_bRollR != 0; 532 } 533 534 if ( b == DATA_mouse && this->getHostID()!=this->getOwner() ) 534 bUp = (flags & MASK_bUp) != 0; 535 bDown = (flags & MASK_bDown) != 0; 536 bLeft = (flags & MASK_bLeft) != 0; 537 bRight = (flags & MASK_bRight) != 0; 538 bAscend = (flags & MASK_bAscend) != 0; 539 bDescend = (flags & MASK_bDescend) != 0; 540 bFire = (flags & MASK_bFire) != 0; 541 bRollL = (flags & MASK_bRollL) != 0; 542 bRollR = (flags & MASK_bRollR) != 0; 543 544 } 545 546 /*if ( b == DATA_mouse && this->getHostID()!=this->getOwner() ) 535 547 { 536 548 SYNCHELP_READ_FLOAT( xMouse ); … … 538 550 SYNCHELP_READ_FLOAT( mouseSensitivity ); 539 551 SYNCHELP_READ_FLOAT( cycle ); 540 } 552 }*/ 553 554 if ( this->getOwner() != this->getHostID() ) 555 SYNCHELP_READ_FKT( PNode::writeSync ); 541 556 542 557 return SYNCHELP_READ_N; … … 549 564 SYNCHELP_WRITE_BEGIN(); 550 565 551 if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner())566 if ( isOutOfSync() && !requestedSync() /*&& this->getHostID()!=this->getOwner()*/ ) 552 567 { 553 568 (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() ); 554 569 setRequestedSync( true ); 570 PRINTF(0)("REQUESTED STATE %d\n", this->getUniqueID()); 555 571 } 556 572 … … 560 576 *reciever = rec; 561 577 578 PRINTF(0)("SEND STATE %d %d\n", this->getUniqueID(), rec); 579 562 580 SYNCHELP_WRITE_BYTE( (byte)DATA_state ); 563 581 564 582 SYNCHELP_WRITE_FKT( WorldEntity::readState ); 565 SYNCHELP_WRITE_FLOAT( cycle );583 //SYNCHELP_WRITE_FLOAT( cycle ); 566 584 567 585 return SYNCHELP_WRITE_N; 568 586 } 569 570 587 571 588 *reciever = 0; … … 592 609 mask |= MASK_bRollR; 593 610 594 static int oldMask = mask+1; //so it is different the first time! 595 static float oldxMouse = xMouse + 1.0;596 static float oldyMouse = yMouse + 1.0;611 612 //static float oldxMouse = xMouse + 1.0; 613 //static float oldyMouse = yMouse + 1.0; 597 614 598 615 if ( mask != oldMask ) … … 602 619 SYNCHELP_WRITE_INT( mask ); 603 620 } 604 605 if ( oldxMouse != xMouse || oldyMouse != yMouse ) 621 else 622 { 623 SYNCHELP_WRITE_BYTE( 0 ); 624 } 625 626 /*if ( oldxMouse != xMouse || oldyMouse != yMouse ) 606 627 { 607 628 oldxMouse = xMouse; … … 612 633 SYNCHELP_WRITE_FLOAT( mouseSensitivity ); 613 634 SYNCHELP_WRITE_FLOAT( cycle ); 614 } 615 } 635 }*/ 636 } 637 else 638 { 639 SYNCHELP_WRITE_BYTE( 0 ); 640 } 641 642 if ( this->getOwner() == this->getHostID() ) 643 SYNCHELP_WRITE_FKT( PNode::readSync ); 616 644 617 645 return SYNCHELP_WRITE_N; -
trunk/src/world_entities/space_ships/space_ship.h
r6547 r6634 75 75 float airViscosity; 76 76 77 int oldMask; 78 77 79 }; 78 80 -
trunk/src/world_entities/world_entity.cc
r6512 r6634 517 517 if ( strcmp(modelFileName, "") ) 518 518 { 519 520 if ( strstr(modelFileName, ResourceManager::getInstance()->getDataDir()) ) 521 { 522 loadModel( modelFileName+strlen(ResourceManager::getInstance()->getDataDir()), scaling ); 523 } 524 else 525 { 526 loadModel( modelFileName, scaling ); 527 } 519 loadModel( modelFileName, scaling ); 528 520 } 529 521 delete[] modelFileName; 530 522 531 SYNCHELP_READ_STRINGM( modelFileName );523 /*SYNCHELP_READ_STRINGM( modelFileName ); 532 524 533 525 if ( strcmp(modelFileName, "") ) … … 541 533 this->md2TextureFileName = modelFileName; 542 534 } 535 */ 543 536 544 537 return SYNCHELP_READ_N; … … 558 551 SYNCHELP_WRITE_FKT( PNode::readState ); 559 552 560 SYNCHELP_WRITE_STRING( getModel( 0 )->getName() ); 553 if ( getModel(0) && getModel(0)->getName() ) 554 { 555 char* name = (char*)(getModel( 0 )->getName()); 556 557 if ( strstr(name, ResourceManager::getInstance()->getDataDir()) ) 558 { 559 name += strlen(ResourceManager::getInstance()->getDataDir()); 560 } 561 562 SYNCHELP_WRITE_STRING( name ); 563 } 564 else 565 { 566 SYNCHELP_WRITE_STRING(""); 567 } 568 561 569 SYNCHELP_WRITE_FLOAT( scaling ); 562 if ( this->md2TextureFileName!=NULL && strcmp(this->md2TextureFileName, "") )570 /*if ( this->md2TextureFileName!=NULL && strcmp(this->md2TextureFileName, "") ) 563 571 { 564 572 SYNCHELP_WRITE_STRING(this->md2TextureFileName); … … 567 575 { 568 576 SYNCHELP_WRITE_STRING(""); 569 } 577 }*/ 570 578 571 579 return SYNCHELP_WRITE_N;
Note: See TracChangeset
for help on using the changeset viewer.