Changeset 2990 for code/branches/netp3/src/orxonox/objects
- Timestamp:
- May 19, 2009, 9:35:10 PM (16 years ago)
- Location:
- code/branches/netp3
- Files:
-
- 60 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp3
- Property svn:mergeinfo changed
/code/branches/netp2 (added) merged: 2835-2836,2861,2937-2938,2940-2941,2943-2945,2947-2949,2951,2953,2964-2965,2974-2976
- Property svn:mergeinfo changed
-
code/branches/netp3/src/orxonox/objects/Level.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/Level.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/Test.cc
r2662 r2990 31 31 #include "core/ConfigValueIncludes.h" 32 32 #include "core/ConsoleCommand.h" 33 #include "network/NetworkFunction.h" 33 34 #include "Test.h" 35 #include "util/MultiType.h" 34 36 35 37 namespace orxonox … … 41 43 SetConsoleCommand(Test, printV3, true).accessLevel(AccessLevel::User); 42 44 SetConsoleCommand(Test, printV4, true).accessLevel(AccessLevel::User); 45 SetConsoleCommand(Test, call, true).accessLevel(AccessLevel::User); 46 SetConsoleCommand(Test, call2, true).accessLevel(AccessLevel::User); 47 48 49 //void=* aaaaa = copyPtr<sizeof(&Test::printV1)>( &NETWORK_FUNCTION_POINTER, &Test::printV1 ); 50 //void* NETWORK_FUNCTION_TEST_B = memcpy(&NETWORK_FUNCTION_POINTER, &a, sizeof(a)); 51 // NetworkFunctionBase* NETWORK_FUNCTION_TEST_C = new NetworkFunctionStatic( createFunctor(&Test::printV1), "bla", NETWORK_FUNCTION_POINTER ); 52 53 registerStaticNetworkFunction( &Test::printV1 ); 54 registerMemberNetworkFunction( Test, checkU1 ); 55 registerMemberNetworkFunction( Test, printBlaBla ); 43 56 44 57 Test* Test::instance_ = 0; … … 73 86 74 87 75 76 77 88 void Test::registerVariables() 89 { 90 registerVariable ( u1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkU1 )); 78 91 registerVariable ( u2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkU2 )); 79 92 registerVariable ( u3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true ); 80 93 registerVariable ( u4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkU4 ), true ); 81 94 … … 84 97 registerVariable ( s3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkS3 ), true ); 85 98 registerVariable ( s4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true ); 86 } 87 99 } 100 101 void Test::call(unsigned int clientID) 102 { 103 callStaticNetworkFunction( &Test::printV1, clientID ); 104 callStaticNetworkFunction( &Test::printV1, clientID ); 105 } 106 107 void Test::call2(unsigned int clientID, std::string s1, std::string s2, std::string s3, std::string s4) 108 { 109 callMemberNetworkFunction( Test, printBlaBla, this->getObjectID(), clientID, s1, s2, s3, s4, s4 ); 110 } 111 112 void Test::tick(float dt) 113 { 114 // std::string str1 = "blub"; 115 // //MultiType mt1(std::string("blub")); 116 // MultiType mt1(str1); 117 // uint8_t* mem = new uint8_t[mt1.getNetworkSize()]; 118 // uint8_t* temp = mem; 119 // mt1.exportData( temp ); 120 // assert( temp-mem == mt1.getNetworkSize() ); 121 // MultiType mt2; 122 // temp = mem; 123 // mt2.importData( temp ); 124 // assert( temp-mem == mt1.getNetworkSize() ); 125 // COUT(0) << mt2 << endl; 126 if(!Core::isMaster()) 127 call2(0, "bal", "a", "n", "ce"); 128 // callMemberNetworkFunction( Test, checkU1, this->getObjectID(), 0 ); 129 } 130 131 void Test::printBlaBla(std::string s1, std::string s2, std::string s3, std::string s4, std::string s5) 132 { 133 COUT(0) << s1 << s2 << s3 << s4 << s5 << endl; 134 } 135 88 136 void Test::checkU1(){ COUT(1) << "U1 changed: " << u1 << std::endl; } 89 137 void Test::checkU2(){ COUT(1) << "U2 changed: " << u2 << std::endl; } -
code/branches/netp3/src/orxonox/objects/Test.h
r2662 r2990 33 33 #include "core/BaseObject.h" 34 34 #include "network/synchronisable/Synchronisable.h" 35 #include "Tickable.h" 35 36 36 37 … … 41 42 namespace orxonox 42 43 { 43 class _OrxonoxExport Test: public BaseObject, public Synchronisable 44 class _OrxonoxExport Test: public BaseObject, public Synchronisable, public Tickable 44 45 { 45 46 public: … … 49 50 void setConfigValues(); 50 51 void registerVariables(); 52 53 static void call(unsigned int clientID); 54 void call2(unsigned int clientID, std::string s1, std::string s2, std::string s3, std::string s4); 55 virtual void tick(float dt); 51 56 52 57 … … 75 80 static void printV3(){ instance_->checkU3(); } 76 81 static void printV4(){ instance_->checkU4(); } 82 83 void printBlaBla(std::string s1, std::string s2, std::string s3, std::string s4, std::string s5); 77 84 78 85 private: -
code/branches/netp3/src/orxonox/objects/collisionshapes
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/controllers/AIController.cc
r2896 r2990 101 101 void AIController::tick(float dt) 102 102 { 103 if (!this->isActive()) 104 return; 105 106 if (this->target_) 107 this->aimAtTarget(); 108 109 if (this->bHasTargetPosition_) 110 this->moveToTargetPosition(dt); 111 112 if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(500) && this->isLookingAtTarget(Ogre::Math::PI / 20.0)) 113 this->getControllableEntity()->fire(WeaponMode::fire); 103 if(Core::isMaster()) 104 { 105 if (!this->isActive()) 106 return; 107 108 if (this->target_) 109 this->aimAtTarget(); 110 111 if (this->bHasTargetPosition_) 112 this->moveToTargetPosition(dt); 113 114 if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(500) && this->isLookingAtTarget(Ogre::Math::PI / 20.0)) 115 this->getControllableEntity()->fire(WeaponMode::fire); 116 } 114 117 115 118 SUPER(AIController, tick, dt); -
code/branches/netp3/src/orxonox/objects/gametypes/TeamDeathmatch.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/gametypes/TeamDeathmatch.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/pickup/Usable.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/AddQuest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/AddQuest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/AddQuestHint.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/AddQuestHint.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/AddReward.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/AddReward.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/ChangeQuestStatus.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/ChangeQuestStatus.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/CompleteQuest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/CompleteQuest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/FailQuest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/FailQuest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/GlobalQuest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/GlobalQuest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/LocalQuest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/LocalQuest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/Quest.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/Quest.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/QuestDescription.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/QuestDescription.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/QuestEffect.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/QuestEffect.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/QuestHint.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/QuestHint.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/QuestItem.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/QuestItem.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/QuestManager.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/QuestManager.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/Rewardable.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/quest/Rewardable.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/weaponSystem/WeaponSystem.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/weaponSystem/WeaponSystem.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/Backlight.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/Backlight.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/Camera.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/Camera.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/ControllableEntity.cc
r2973 r2990 66 66 this->mouseLookSpeed_ = 200; 67 67 68 this-> server_position_ = Vector3::ZERO;69 this->client_position_ = Vector3::ZERO;70 this-> server_linear_velocity_ = Vector3::ZERO;71 this->client_linear_velocity_ = Vector3::ZERO;72 this-> server_orientation_ = Quaternion::IDENTITY;73 this->client_orientation_ = Quaternion::IDENTITY;74 this-> server_angular_velocity_ = Vector3::ZERO;75 this->client_angular_velocity_ = Vector3::ZERO;68 this->common_position_ = Vector3::ZERO; 69 // this->client_position_ = Vector3::ZERO; 70 this->common_linear_velocity_ = Vector3::ZERO; 71 // this->client_linear_velocity_ = Vector3::ZERO; 72 this->common_orientation_ = Quaternion::IDENTITY; 73 // this->client_orientation_ = Quaternion::IDENTITY; 74 this->common_angular_velocity_ = Vector3::ZERO; 75 // this->client_angular_velocity_ = Vector3::ZERO; 76 76 77 77 … … 326 326 if (!this->isDynamic()) 327 327 { 328 if (GameMode::isMaster())329 {330 this-> server_position_ = this->getPosition();331 this-> server_orientation_ = this->getOrientation();332 this-> server_linear_velocity_ = this->getVelocity();333 this-> server_angular_velocity_ = this->getAngularVelocity();334 }335 else if (this->bHasLocalController_)336 {337 this->client_position_ = this->getPosition();338 this->client_orientation_ = this->getOrientation();339 this->client_linear_velocity_ = this->getVelocity();340 this->client_angular_velocity_ = this->getAngularVelocity();341 }328 // if (GameMode::isMaster()) 329 // { 330 this->common_position_ = this->getPosition(); 331 this->common_orientation_ = this->getOrientation(); 332 this->common_linear_velocity_ = this->getVelocity(); 333 this->common_angular_velocity_ = this->getAngularVelocity(); 334 // } 335 // else if (this->bHasLocalController_) 336 // { 337 // this->client_position_ = this->getPosition(); 338 // this->client_orientation_ = this->getOrientation(); 339 // this->client_linear_velocity_ = this->getVelocity(); 340 // this->client_angular_velocity_ = this->getAngularVelocity(); 341 // } 342 342 } 343 343 } … … 349 349 registerVariable(this->hudtemplate_, variableDirection::toclient); 350 350 351 registerVariable(this->server_position_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition)); 352 registerVariable(this->server_linear_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity)); 353 registerVariable(this->server_orientation_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation)); 354 registerVariable(this->server_angular_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity)); 355 356 registerVariable(this->server_overwrite_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite)); 357 registerVariable(this->client_overwrite_, variableDirection::toserver); 358 359 registerVariable(this->client_position_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition)); 360 registerVariable(this->client_linear_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity)); 361 registerVariable(this->client_orientation_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation)); 362 registerVariable(this->client_angular_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity)); 351 // registerVariable(this->server_position_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition)); 352 // registerVariable(this->server_linear_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity)); 353 // registerVariable(this->server_orientation_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation)); 354 // registerVariable(this->server_angular_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity)); 355 // 356 // registerVariable(this->server_overwrite_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite)); 357 // registerVariable(this->client_overwrite_, variableDirection::toserver); 358 // 359 // registerVariable(this->client_position_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition)); 360 // registerVariable(this->client_linear_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity)); 361 // registerVariable(this->client_orientation_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation)); 362 // registerVariable(this->client_angular_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity)); 363 364 registerVariable(this->common_position_, variableDirection::serverMaster, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition), true); 365 registerVariable(this->common_linear_velocity_, variableDirection::serverMaster, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity), true); 366 registerVariable(this->common_orientation_, variableDirection::serverMaster, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation), true); 367 registerVariable(this->common_angular_velocity_, variableDirection::serverMaster, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity), true); 363 368 364 369 registerVariable(this->playerID_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID)); … … 368 373 { 369 374 if (!this->bHasLocalController_) 370 MobileEntity::setPosition(this-> server_position_);375 MobileEntity::setPosition(this->common_position_); 371 376 } 372 377 … … 374 379 { 375 380 if (!this->bHasLocalController_) 376 MobileEntity::setVelocity(this-> server_linear_velocity_);381 MobileEntity::setVelocity(this->common_linear_velocity_); 377 382 } 378 383 … … 380 385 { 381 386 if (!this->bHasLocalController_) 382 MobileEntity::setOrientation(this-> server_orientation_);387 MobileEntity::setOrientation(this->common_orientation_); 383 388 } 384 389 … … 386 391 { 387 392 if (!this->bHasLocalController_) 388 MobileEntity::setAngularVelocity(this-> server_angular_velocity_);393 MobileEntity::setAngularVelocity(this->common_angular_velocity_); 389 394 } 390 395 … … 393 398 if (this->bHasLocalController_) 394 399 { 395 this->setPosition(this->server_position_);396 this->setOrientation(this->server_orientation_);397 this->setVelocity(this->server_linear_velocity_);398 this->setAngularVelocity(this->server_angular_velocity_);399 400 this->client_overwrite_ = this->server_overwrite_;400 // this->setPosition(this->server_position_); 401 // this->setOrientation(this->server_orientation_); 402 // this->setVelocity(this->server_linear_velocity_); 403 // this->setAngularVelocity(this->server_angular_velocity_); 404 405 // this->client_overwrite_ = this->server_overwrite_; 401 406 } 402 407 } … … 406 411 if (this->server_overwrite_ == this->client_overwrite_) 407 412 { 408 MobileEntity::setPosition(this->client_position_);409 this->server_position_ = this->getPosition();413 // MobileEntity::setPosition(this->client_position_); 414 // this->server_position_ = this->getPosition(); 410 415 } 411 416 } … … 415 420 if (this->server_overwrite_ == this->client_overwrite_) 416 421 { 417 MobileEntity::setVelocity(this->client_linear_velocity_);418 this->server_linear_velocity_ = this->getVelocity();422 // MobileEntity::setVelocity(this->client_linear_velocity_); 423 // this->server_linear_velocity_ = this->getVelocity(); 419 424 } 420 425 } … … 424 429 if (this->server_overwrite_ == this->client_overwrite_) 425 430 { 426 MobileEntity::setOrientation(this->client_orientation_);427 this->server_orientation_ = this->getOrientation();431 // MobileEntity::setOrientation(this->client_orientation_); 432 // this->server_orientation_ = this->getOrientation(); 428 433 } 429 434 } … … 433 438 if (this->server_overwrite_ == this->client_overwrite_) 434 439 { 435 MobileEntity::setAngularVelocity(this->client_angular_velocity_);436 this->server_angular_velocity_ = this->getAngularVelocity();440 // MobileEntity::setAngularVelocity(this->client_angular_velocity_); 441 // this->server_angular_velocity_ = this->getAngularVelocity(); 437 442 } 438 443 } … … 440 445 void ControllableEntity::setPosition(const Vector3& position) 441 446 { 442 if (GameMode::isMaster())443 {447 // if (GameMode::isMaster()) 448 // { 444 449 MobileEntity::setPosition(position); 445 this-> server_position_ = this->getPosition();446 ++this->server_overwrite_;447 }448 else if (this->bHasLocalController_)449 {450 MobileEntity::setPosition(position);451 this->client_position_ = this->getPosition();452 }450 this->common_position_ = this->getPosition(); 451 // ++this->server_overwrite_; 452 // } 453 // else if (this->bHasLocalController_) 454 // { 455 // MobileEntity::setPosition(position); 456 // this->client_position_ = this->getPosition(); 457 // } 453 458 } 454 459 455 460 void ControllableEntity::setOrientation(const Quaternion& orientation) 456 461 { 457 if (GameMode::isMaster())458 {462 // if (GameMode::isMaster()) 463 // { 459 464 MobileEntity::setOrientation(orientation); 460 this-> server_orientation_ = this->getOrientation();461 ++this->server_overwrite_;462 }463 else if (this->bHasLocalController_)464 {465 MobileEntity::setOrientation(orientation);466 this->client_orientation_ = this->getOrientation();467 }465 this->common_orientation_ = this->getOrientation(); 466 // ++this->server_overwrite_; 467 // } 468 // else if (this->bHasLocalController_) 469 // { 470 // MobileEntity::setOrientation(orientation); 471 // this->client_orientation_ = this->getOrientation(); 472 // } 468 473 } 469 474 470 475 void ControllableEntity::setVelocity(const Vector3& velocity) 471 476 { 472 if (GameMode::isMaster())473 {477 // if (GameMode::isMaster()) 478 // { 474 479 MobileEntity::setVelocity(velocity); 475 this-> server_linear_velocity_ = this->getVelocity();476 ++this->server_overwrite_;477 }478 else if (this->bHasLocalController_)479 {480 MobileEntity::setVelocity(velocity);481 this->client_linear_velocity_ = this->getVelocity();482 }480 this->common_linear_velocity_ = this->getVelocity(); 481 // ++this->server_overwrite_; 482 // } 483 // else if (this->bHasLocalController_) 484 // { 485 // MobileEntity::setVelocity(velocity); 486 // this->client_linear_velocity_ = this->getVelocity(); 487 // } 483 488 } 484 489 485 490 void ControllableEntity::setAngularVelocity(const Vector3& velocity) 486 491 { 487 if (GameMode::isMaster())488 {492 // if (GameMode::isMaster()) 493 // { 489 494 MobileEntity::setAngularVelocity(velocity); 490 this-> server_angular_velocity_ = this->getAngularVelocity();491 ++this->server_overwrite_;492 }493 else if (this->bHasLocalController_)494 {495 MobileEntity::setAngularVelocity(velocity);496 this->client_angular_velocity_ = this->getAngularVelocity();497 }495 this->common_angular_velocity_ = this->getAngularVelocity(); 496 // ++this->server_overwrite_; 497 // } 498 // else if (this->bHasLocalController_) 499 // { 500 // MobileEntity::setAngularVelocity(velocity); 501 // this->client_angular_velocity_ = this->getAngularVelocity(); 502 // } 498 503 } 499 504 … … 501 506 { 502 507 MobileEntity::setWorldTransform(worldTrans); 503 if (GameMode::isMaster())504 {505 this-> server_position_ = this->getPosition();506 this-> server_orientation_ = this->getOrientation();507 this-> server_linear_velocity_ = this->getVelocity();508 this-> server_angular_velocity_ = this->getAngularVelocity();509 }510 else if (this->bHasLocalController_)511 {512 this->client_position_ = this->getPosition();513 this->client_orientation_ = this->getOrientation();514 this->client_linear_velocity_ = this->getVelocity();515 this->client_angular_velocity_ = this->getAngularVelocity();516 }508 // if (GameMode::isMaster()) 509 // { 510 this->common_position_ = this->getPosition(); 511 this->common_orientation_ = this->getOrientation(); 512 this->common_linear_velocity_ = this->getVelocity(); 513 this->common_angular_velocity_ = this->getAngularVelocity(); 514 // } 515 // else if (this->bHasLocalController_) 516 // { 517 // this->client_position_ = this->getPosition(); 518 // this->client_orientation_ = this->getOrientation(); 519 // this->client_linear_velocity_ = this->getVelocity(); 520 // this->client_angular_velocity_ = this->getAngularVelocity(); 521 // } 517 522 } 518 523 } -
code/branches/netp3/src/orxonox/objects/worldentities/ControllableEntity.h
r2973 r2990 164 164 bool bDestroyWhenPlayerLeft_; 165 165 166 Vector3 server_position_; 167 Vector3 client_position_; 168 Vector3 server_linear_velocity_; 169 Vector3 client_linear_velocity_; 170 Quaternion server_orientation_; 171 Quaternion client_orientation_; 172 Vector3 server_angular_velocity_; 173 Vector3 client_angular_velocity_; 166 // Vector3 server_position_; 167 Vector3 common_position_; 168 // Vector3 client_position_; 169 // Vector3 server_linear_velocity_; 170 // Vector3 client_linear_velocity_; 171 Vector3 common_linear_velocity_; 172 // Quaternion server_orientation_; 173 // Quaternion client_orientation_; 174 Quaternion common_orientation_; 175 // Vector3 server_angular_velocity_; 176 // Vector3 client_angular_velocity_; 177 Vector3 common_angular_velocity_; 174 178 175 179 PlayerInfo* player_; -
code/branches/netp3/src/orxonox/objects/worldentities/MobileEntity.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/MobileEntity.h
- Property svn:mergeinfo changed
/code/branches/netp2/src/orxonox/objects/worldentities/MobileEntity.h (added) merged: 2975
r2911 r2990 61 61 { this->setAngularVelocity(Vector3(x, y, z)); } 62 62 inline const Vector3& getAngularVelocity() const 63 { return this-> linearAcceleration_; }63 { return this->angularVelocity_; } 64 64 65 65 void setAcceleration(const Vector3& acceleration); - Property svn:mergeinfo changed
-
code/branches/netp3/src/orxonox/objects/worldentities/ParticleSpawner.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/ParticleSpawner.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/StaticEntity.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/StaticEntity.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2904 r2990 39 39 #include "objects/worldentities/ParticleSpawner.h" 40 40 #include "objects/worldentities/ExplosionChunk.h" 41 #include "network/NetworkFunction.h" 41 42 42 43 namespace orxonox 43 44 { 44 45 CreateFactory(Pawn); 46 47 registerMemberNetworkFunction( Pawn, doFire ); 45 48 46 49 Pawn::Pawn(BaseObject* creator) : ControllableEntity(creator) … … 117 120 SUPER(Pawn, tick, dt); 118 121 119 if (this->weaponSystem_) 120 { 121 if (this->fire_ & WeaponMode::fire) 122 this->weaponSystem_->fire(WeaponMode::fire); 123 if (this->fire_ & WeaponMode::altFire) 124 this->weaponSystem_->fire(WeaponMode::altFire); 125 if (this->fire_ & WeaponMode::altFire2) 126 this->weaponSystem_->fire(WeaponMode::altFire2); 127 } 128 this->fire_ = this->firehack_; 129 this->firehack_ = 0x0; 130 131 if (this->health_ <= 0) 122 // if (this->weaponSystem_) 123 // { 124 // if (this->fire_ & WeaponMode::fire) 125 // this->weaponSystem_->fire(WeaponMode::fire); 126 // if (this->fire_ & WeaponMode::altFire) 127 // this->weaponSystem_->fire(WeaponMode::altFire); 128 // if (this->fire_ & WeaponMode::altFire2) 129 // this->weaponSystem_->fire(WeaponMode::altFire2); 130 // } 131 // this->fire_ = this->firehack_; 132 // this->firehack_ = 0x0; 133 134 if (Core::isMaster()) 135 if (this->health_ <= 0) 132 136 this->death(); 133 137 } … … 254 258 void Pawn::fire(WeaponMode::Enum fireMode) 255 259 { 256 this->firehack_ |= fireMode; 260 doFire(fireMode); 261 } 262 263 void Pawn::doFire(uint8_t fireMode) 264 { 265 if(Core::isMaster()) 266 { 267 if (this->weaponSystem_) 268 this->weaponSystem_->fire((WeaponMode::Enum)fireMode); 269 } 270 else 271 { 272 callMemberNetworkFunction( Pawn, doFire, this->getObjectID(), 0, ((uint8_t)fireMode)); 273 if (this->weaponSystem_) 274 this->weaponSystem_->fire((WeaponMode::Enum)fireMode); 275 } 257 276 } 258 277 -
code/branches/netp3/src/orxonox/objects/worldentities/pawns/Pawn.h
r2826 r2990 80 80 81 81 virtual void fire(WeaponMode::Enum fireMode); 82 virtual void doFire(uint8_t fireMode); 82 83 virtual void postSpawn(); 83 84 -
code/branches/netp3/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/triggers/Trigger.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/branches/netp3/src/orxonox/objects/worldentities/triggers/Trigger.h
- Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset
for help on using the changeset viewer.