- Timestamp:
- Feb 14, 2009, 10:17:35 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc
r2171 r2662 23 23 * Fabian 'x3n' Landau 24 24 * Co-authors: 25 * ...25 * Reto Grieder 26 26 * 27 27 */ … … 30 30 #include "ControllableEntity.h" 31 31 32 #include <OgreSceneManager.h> 33 32 34 #include "core/CoreIncludes.h" 35 #include "core/ConfigValueIncludes.h" 33 36 #include "core/Core.h" 34 37 #include "core/XMLPort.h" 35 38 #include "core/Template.h" 36 39 40 #include "objects/Scene.h" 37 41 #include "objects/infos/PlayerInfo.h" 38 42 #include "objects/worldentities/Camera.h" 39 43 #include "objects/worldentities/CameraPosition.h" 44 #include "objects/gametypes/Gametype.h" 40 45 #include "overlays/OverlayGroup.h" 41 46 … … 44 49 CreateFactory(ControllableEntity); 45 50 46 ControllableEntity::ControllableEntity(BaseObject* creator) : WorldEntity(creator)51 ControllableEntity::ControllableEntity(BaseObject* creator) : MobileEntity(creator) 47 52 { 48 53 RegisterObject(ControllableEntity); 49 54 50 this->bControlled_ = false; 55 this->bHasLocalController_ = false; 56 this->bHasHumanController_ = false; 57 51 58 this->server_overwrite_ = 0; 52 59 this->client_overwrite_ = 0; … … 56 63 this->camera_ = 0; 57 64 this->bDestroyWhenPlayerLeft_ = false; 58 59 this->velocity_ = Vector3::ZERO; 60 this->acceleration_ = Vector3::ZERO; 61 62 this->server_position_ = Vector3::ZERO; 63 this->client_position_ = Vector3::ZERO; 64 this->server_velocity_ = Vector3::ZERO; 65 this->client_velocity_ = Vector3::ZERO; 66 this->server_orientation_ = Quaternion::IDENTITY; 67 this->client_orientation_ = Quaternion::IDENTITY; 68 65 this->cameraPositionRootNode_ = this->node_->createChildSceneNode(); 66 this->bMouseLook_ = false; 67 this->mouseLookSpeed_ = 200; 68 69 this->gtinfo_ = 0; 70 this->gtinfoID_ = OBJECTID_UNKNOWN; 71 this->changedGametype(); 72 73 this->server_position_ = Vector3::ZERO; 74 this->client_position_ = Vector3::ZERO; 75 this->server_linear_velocity_ = Vector3::ZERO; 76 this->client_linear_velocity_ = Vector3::ZERO; 77 this->server_orientation_ = Quaternion::IDENTITY; 78 this->client_orientation_ = Quaternion::IDENTITY; 79 this->server_angular_velocity_ = Vector3::ZERO; 80 this->client_angular_velocity_ = Vector3::ZERO; 81 82 83 this->setConfigValues(); 84 this->setPriority( priority::very_high ); 69 85 this->registerVariables(); 70 86 } … … 74 90 if (this->isInitialized()) 75 91 { 76 if (this->bControlled_) 77 this->stopLocalControl(); 92 this->bDestroyWhenPlayerLeft_ = false; 93 94 if (this->bHasLocalController_ && this->bHasHumanController_) 95 this->stopLocalHumanControl(); 96 97 if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this) 98 this->getPlayer()->stopControl(this, false); 78 99 79 100 if (this->hud_) … … 83 104 delete this->camera_; 84 105 85 if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this) 86 this->getPlayer()->stopControl(this, false); 106 for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 107 delete (*it); 108 109 if (this->getScene()->getSceneManager()) 110 this->getScene()->getSceneManager()->destroySceneNode(this->cameraPositionRootNode_->getName()); 87 111 } 88 112 } … … 98 122 } 99 123 124 void ControllableEntity::setConfigValues() 125 { 126 SetConfigValue(mouseLookSpeed_, 3.0f); 127 } 128 129 void ControllableEntity::changedGametype() 130 { 131 //SUPER(ControllableEntity, changedGametype); 132 WorldEntity::changedGametype(); 133 134 this->gtinfo_ = 0; 135 this->gtinfoID_ = OBJECTID_UNKNOWN; 136 137 if (this->getGametype() && this->getGametype()->getGametypeInfo()) 138 { 139 this->gtinfo_ = this->getGametype()->getGametypeInfo(); 140 this->gtinfoID_ = this->gtinfo_->getObjectID(); 141 } 142 } 143 100 144 void ControllableEntity::addCameraPosition(CameraPosition* position) 101 145 { 102 this->attach(position); 146 if (position->getAllowMouseLook()) 147 position->attachToNode(this->cameraPositionRootNode_); 148 else 149 this->attach(position); 103 150 this->cameraPositions_.push_back(position); 104 151 } … … 141 188 else 142 189 { 143 this-> attach(this->camera_);190 this->camera_->attachToNode(this->cameraPositionRootNode_); 144 191 } 145 192 } 193 } 194 195 void ControllableEntity::mouseLook() 196 { 197 this->bMouseLook_ = !this->bMouseLook_; 198 199 if (!this->bMouseLook_) 200 this->cameraPositionRootNode_->setOrientation(Quaternion::IDENTITY); 201 } 202 203 void ControllableEntity::rotateYaw(const Vector2& value) 204 { 205 if (this->bMouseLook_) 206 this->cameraPositionRootNode_->yaw(Radian(value.y * this->mouseLookSpeed_), Ogre::Node::TS_LOCAL); 207 } 208 209 void ControllableEntity::rotatePitch(const Vector2& value) 210 { 211 if (this->bMouseLook_) 212 this->cameraPositionRootNode_->pitch(Radian(value.y * this->mouseLookSpeed_), Ogre::Node::TS_LOCAL); 213 } 214 215 void ControllableEntity::rotateRoll(const Vector2& value) 216 { 217 if (this->bMouseLook_) 218 this->cameraPositionRootNode_->roll(Radian(value.y * this->mouseLookSpeed_), Ogre::Node::TS_LOCAL); 146 219 } 147 220 … … 156 229 this->player_ = player; 157 230 this->playerID_ = player->getObjectID(); 158 this->bControlled_ = (player->isLocalPlayer() && player->isHumanPlayer()); 159 if (this->bControlled_) 160 { 161 this->startLocalControl(); 231 this->bHasLocalController_ = player->isLocalPlayer(); 232 this->bHasHumanController_ = player->isHumanPlayer(); 233 234 if (this->bHasLocalController_ && this->bHasHumanController_) 235 { 236 this->startLocalHumanControl(); 162 237 163 238 if (!Core::isMaster()) 164 239 { 165 240 this->client_overwrite_ = this->server_overwrite_; 166 COUT(0) << "CE: bidirectional synchronization" << std::endl; 167 this->setObjectMode(direction::bidirectional); 241 this->setObjectMode(objectDirection::bidirectional); 168 242 } 169 243 } … … 172 246 void ControllableEntity::removePlayer() 173 247 { 174 if (this->b Controlled_)175 this->stopLocal Control();248 if (this->bHasLocalController_ && this->bHasHumanController_) 249 this->stopLocalHumanControl(); 176 250 177 251 this->player_ = 0; 178 252 this->playerID_ = OBJECTID_UNKNOWN; 179 this->bControlled_ = false; 180 this->setObjectMode(direction::toclient); 253 this->bHasLocalController_ = false; 254 this->bHasHumanController_ = false; 255 this->setObjectMode(objectDirection::toclient); 181 256 182 257 if (this->bDestroyWhenPlayerLeft_) … … 195 270 } 196 271 197 void ControllableEntity::startLocalControl() 198 { 199 // std::cout << this->getObjectID() << " ###### start local control" << std::endl; 200 this->camera_ = new Camera(this); 201 this->camera_->requestFocus(); 202 if (this->cameraPositionTemplate_ != "") 203 this->addTemplate(this->cameraPositionTemplate_); 204 if (this->cameraPositions_.size() > 0) 205 this->cameraPositions_.front()->attachCamera(this->camera_); 206 else 207 this->attach(this->camera_); 208 209 if (this->hudtemplate_ != "") 210 { 211 this->hud_ = new OverlayGroup(this); 212 this->hud_->addTemplate(this->hudtemplate_); 213 } 214 } 215 216 void ControllableEntity::stopLocalControl() 217 { 218 // std::cout << "###### stop local control" << std::endl; 219 this->camera_->detachFromParent(); 220 delete this->camera_; 221 this->camera_ = 0; 222 223 delete this->hud_; 224 this->hud_ = 0; 272 void ControllableEntity::networkcallback_changedgtinfoID() 273 { 274 if (this->gtinfoID_ != OBJECTID_UNKNOWN) 275 { 276 this->gtinfo_ = dynamic_cast<GametypeInfo*>(Synchronisable::getSynchronisable(this->gtinfoID_)); 277 278 if (!this->gtinfo_) 279 this->gtinfoID_ = OBJECTID_UNKNOWN; 280 } 281 } 282 283 void ControllableEntity::startLocalHumanControl() 284 { 285 if (!this->camera_) 286 { 287 this->camera_ = new Camera(this); 288 this->camera_->requestFocus(); 289 if (this->cameraPositionTemplate_ != "") 290 this->addTemplate(this->cameraPositionTemplate_); 291 if (this->cameraPositions_.size() > 0) 292 this->cameraPositions_.front()->attachCamera(this->camera_); 293 else 294 this->camera_->attachToNode(this->cameraPositionRootNode_); 295 } 296 297 if (!this->hud_) 298 { 299 if (this->hudtemplate_ != "") 300 { 301 this->hud_ = new OverlayGroup(this); 302 this->hud_->addTemplate(this->hudtemplate_); 303 this->hud_->setOwner(this); 304 } 305 } 306 } 307 308 void ControllableEntity::stopLocalHumanControl() 309 { 310 if (this->camera_) 311 { 312 this->camera_->detachFromParent(); 313 delete this->camera_; 314 this->camera_ = 0; 315 } 316 317 if (this->hud_) 318 { 319 delete this->hud_; 320 this->hud_ = 0; 321 } 225 322 } 226 323 227 324 void ControllableEntity::tick(float dt) 228 325 { 326 MobileEntity::tick(dt); 327 229 328 if (this->isActive()) 230 329 { 231 this->velocity_ += (dt * this->acceleration_); 232 this->node_->translate(dt * this->velocity_, Ogre::Node::TS_LOCAL); 233 234 if (Core::isMaster()) 330 // Check whether Bullet doesn't do the physics for us 331 if (!this->isDynamic()) 235 332 { 236 this->server_velocity_ = this->velocity_; 237 this->server_position_ = this->node_->getPosition(); 333 if (Core::isMaster()) 334 { 335 this->server_position_ = this->getPosition(); 336 this->server_orientation_ = this->getOrientation(); 337 this->server_linear_velocity_ = this->getVelocity(); 338 this->server_angular_velocity_ = this->getAngularVelocity(); 339 } 340 else if (this->bHasLocalController_) 341 { 342 this->client_position_ = this->getPosition(); 343 this->client_orientation_ = this->getOrientation(); 344 this->client_linear_velocity_ = this->getVelocity(); 345 this->client_angular_velocity_ = this->getAngularVelocity(); 346 } 238 347 } 239 else if (this->bControlled_)240 {241 // COUT(2) << "setting client position" << endl;242 this->client_velocity_ = this->velocity_;243 this->client_position_ = this->node_->getPosition();244 }245 348 } 246 349 } … … 248 351 void ControllableEntity::registerVariables() 249 352 { 250 REGISTERSTRING(this->cameraPositionTemplate_, direction::toclient); 251 252 REGISTERDATA(this->client_overwrite_, direction::toserver); 253 254 REGISTERDATA(this->server_position_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition)); 255 REGISTERDATA(this->server_velocity_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity)); 256 REGISTERDATA(this->server_orientation_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation)); 257 REGISTERDATA(this->server_overwrite_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite)); 258 259 REGISTERDATA(this->client_position_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition)); 260 REGISTERDATA(this->client_velocity_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity)); 261 REGISTERDATA(this->client_orientation_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation)); 262 263 264 REGISTERDATA(this->playerID_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID)); 353 registerVariable(this->cameraPositionTemplate_, variableDirection::toclient); 354 registerVariable(this->hudtemplate_, variableDirection::toclient); 355 356 registerVariable(this->server_position_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition)); 357 registerVariable(this->server_linear_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity)); 358 registerVariable(this->server_orientation_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation)); 359 registerVariable(this->server_angular_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity)); 360 361 registerVariable(this->server_overwrite_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite)); 362 registerVariable(this->client_overwrite_, variableDirection::toserver); 363 364 registerVariable(this->client_position_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition)); 365 registerVariable(this->client_linear_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity)); 366 registerVariable(this->client_orientation_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation)); 367 registerVariable(this->client_angular_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity)); 368 369 registerVariable(this->playerID_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID)); 370 registerVariable(this->gtinfoID_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedgtinfoID)); 265 371 } 266 372 267 373 void ControllableEntity::processServerPosition() 268 374 { 269 if (!this->b Controlled_)270 this->node_->setPosition(this->server_position_);271 } 272 273 void ControllableEntity::processServer Velocity()274 { 275 if (!this->b Controlled_)276 this->velocity_ = this->server_velocity_;375 if (!this->bHasLocalController_) 376 MobileEntity::setPosition(this->server_position_); 377 } 378 379 void ControllableEntity::processServerLinearVelocity() 380 { 381 if (!this->bHasLocalController_) 382 MobileEntity::setVelocity(this->server_linear_velocity_); 277 383 } 278 384 279 385 void ControllableEntity::processServerOrientation() 280 386 { 281 if (!this->bControlled_) 282 this->node_->setOrientation(this->server_orientation_); 387 if (!this->bHasLocalController_) 388 MobileEntity::setOrientation(this->server_orientation_); 389 } 390 391 void ControllableEntity::processServerAngularVelocity() 392 { 393 if (!this->bHasLocalController_) 394 MobileEntity::setAngularVelocity(this->server_angular_velocity_); 283 395 } 284 396 285 397 void ControllableEntity::processOverwrite() 286 398 { 287 if (this->b Controlled_)399 if (this->bHasLocalController_) 288 400 { 289 401 this->setPosition(this->server_position_); 290 this->setVelocity(this->server_velocity_);291 402 this->setOrientation(this->server_orientation_); 403 this->setVelocity(this->server_linear_velocity_); 404 this->setAngularVelocity(this->server_angular_velocity_); 292 405 293 406 this->client_overwrite_ = this->server_overwrite_; … … 299 412 if (this->server_overwrite_ == this->client_overwrite_) 300 413 { 301 // COUT(2) << "callback: setting client position" << endl; 302 this->node_->setPosition(this->client_position_); 303 this->server_position_ = this->client_position_; 304 } 305 // else 306 // COUT(2) << "callback: not setting client position" << endl; 307 } 308 309 void ControllableEntity::processClientVelocity() 414 MobileEntity::setPosition(this->client_position_); 415 this->server_position_ = this->getPosition(); 416 } 417 } 418 419 void ControllableEntity::processClientLinearVelocity() 310 420 { 311 421 if (this->server_overwrite_ == this->client_overwrite_) 312 422 { 313 this->velocity_ = this->client_velocity_;314 this->server_ velocity_ = this->client_velocity_;423 MobileEntity::setVelocity(this->client_linear_velocity_); 424 this->server_linear_velocity_ = this->getVelocity(); 315 425 } 316 426 } … … 320 430 if (this->server_overwrite_ == this->client_overwrite_) 321 431 { 322 this->node_->setOrientation(this->client_orientation_); 323 this->server_orientation_ = this->client_orientation_; 324 } 325 } 326 432 MobileEntity::setOrientation(this->client_orientation_); 433 this->server_orientation_ = this->getOrientation(); 434 } 435 } 436 437 void ControllableEntity::processClientAngularVelocity() 438 { 439 if (this->server_overwrite_ == this->client_overwrite_) 440 { 441 MobileEntity::setAngularVelocity(this->client_angular_velocity_); 442 this->server_angular_velocity_ = this->getAngularVelocity(); 443 } 444 } 327 445 328 446 void ControllableEntity::setPosition(const Vector3& position) … … 330 448 if (Core::isMaster()) 331 449 { 332 this->node_->setPosition(position);333 this->server_position_ = position;450 MobileEntity::setPosition(position); 451 this->server_position_ = this->getPosition(); 334 452 ++this->server_overwrite_; 335 453 } 336 else if (this->bControlled_) 337 { 338 this->node_->setPosition(position); 339 this->client_position_ = position; 454 else if (this->bHasLocalController_) 455 { 456 MobileEntity::setPosition(position); 457 this->client_position_ = this->getPosition(); 458 } 459 } 460 461 void ControllableEntity::setOrientation(const Quaternion& orientation) 462 { 463 if (Core::isMaster()) 464 { 465 MobileEntity::setOrientation(orientation); 466 this->server_orientation_ = this->getOrientation(); 467 ++this->server_overwrite_; 468 } 469 else if (this->bHasLocalController_) 470 { 471 MobileEntity::setOrientation(orientation); 472 this->client_orientation_ = this->getOrientation(); 340 473 } 341 474 } … … 345 478 if (Core::isMaster()) 346 479 { 347 this->velocity_ = velocity;348 this->server_ velocity_ = velocity;480 MobileEntity::setVelocity(velocity); 481 this->server_linear_velocity_ = this->getVelocity(); 349 482 ++this->server_overwrite_; 350 483 } 351 else if (this->b Controlled_)352 { 353 this->velocity_ = velocity;354 this->client_ velocity_ = velocity;355 } 356 } 357 358 void ControllableEntity:: translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo)484 else if (this->bHasLocalController_) 485 { 486 MobileEntity::setVelocity(velocity); 487 this->client_linear_velocity_ = this->getVelocity(); 488 } 489 } 490 491 void ControllableEntity::setAngularVelocity(const Vector3& velocity) 359 492 { 360 493 if (Core::isMaster()) 361 494 { 362 this->node_->translate(distance, relativeTo);363 this->server_ position_ = this->node_->getPosition();495 MobileEntity::setAngularVelocity(velocity); 496 this->server_angular_velocity_ = this->getAngularVelocity(); 364 497 ++this->server_overwrite_; 365 498 } 366 else if (this->bControlled_) 367 { 368 this->node_->translate(distance, relativeTo); 369 this->client_position_ = this->node_->getPosition(); 370 } 371 } 372 373 void ControllableEntity::setOrientation(const Quaternion& orientation) 374 { 499 else if (this->bHasLocalController_) 500 { 501 MobileEntity::setAngularVelocity(velocity); 502 this->client_angular_velocity_ = this->getAngularVelocity(); 503 } 504 } 505 506 void ControllableEntity::setWorldTransform(const btTransform& worldTrans) 507 { 508 MobileEntity::setWorldTransform(worldTrans); 375 509 if (Core::isMaster()) 376 510 { 377 this->node_->setOrientation(orientation); 378 this->server_orientation_ = orientation; 379 ++this->server_overwrite_; 380 } 381 else if (this->bControlled_) 382 { 383 this->node_->setOrientation(orientation); 384 this->client_orientation_ = orientation; 385 } 386 } 387 388 void ControllableEntity::rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo) 389 { 390 if (Core::isMaster()) 391 { 392 this->node_->rotate(rotation, relativeTo); 393 this->server_orientation_ = this->node_->getOrientation(); 394 ++this->server_overwrite_; 395 } 396 else if (this->bControlled_) 397 { 398 this->node_->rotate(rotation, relativeTo); 399 this->client_orientation_ = this->node_->getOrientation(); 400 } 401 } 402 403 void ControllableEntity::yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo) 404 { 405 if (Core::isMaster()) 406 { 407 this->node_->yaw(angle, relativeTo); 408 this->server_orientation_ = this->node_->getOrientation(); 409 ++this->server_overwrite_; 410 } 411 else if (this->bControlled_) 412 { 413 this->node_->yaw(angle, relativeTo); 414 this->client_orientation_ = this->node_->getOrientation(); 415 } 416 } 417 418 void ControllableEntity::pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo) 419 { 420 if (Core::isMaster()) 421 { 422 this->node_->pitch(angle, relativeTo); 423 this->server_orientation_ = this->node_->getOrientation(); 424 ++this->server_overwrite_; 425 } 426 else if (this->bControlled_) 427 { 428 this->node_->pitch(angle, relativeTo); 429 this->client_orientation_ = this->node_->getOrientation(); 430 } 431 } 432 433 void ControllableEntity::roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo) 434 { 435 if (Core::isMaster()) 436 { 437 this->node_->roll(angle, relativeTo); 438 this->server_orientation_ = this->node_->getOrientation(); 439 ++this->server_overwrite_; 440 } 441 else if (this->bControlled_) 442 { 443 this->node_->roll(angle, relativeTo); 444 this->client_orientation_ = this->node_->getOrientation(); 445 } 446 } 447 448 void ControllableEntity::lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector) 449 { 450 if (Core::isMaster()) 451 { 452 this->node_->lookAt(target, relativeTo, localDirectionVector); 453 this->server_orientation_ = this->node_->getOrientation(); 454 ++this->server_overwrite_; 455 } 456 else if (this->bControlled_) 457 { 458 this->node_->lookAt(target, relativeTo, localDirectionVector); 459 this->client_orientation_ = this->node_->getOrientation(); 460 } 461 } 462 463 void ControllableEntity::setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector) 464 { 465 if (Core::isMaster()) 466 { 467 this->node_->setDirection(direction, relativeTo, localDirectionVector); 468 this->server_orientation_ = this->node_->getOrientation(); 469 ++this->server_overwrite_; 470 } 471 else if (this->bControlled_) 472 { 473 this->node_->setDirection(direction, relativeTo, localDirectionVector); 474 this->client_orientation_ = this->node_->getOrientation(); 511 this->server_position_ = this->getPosition(); 512 this->server_orientation_ = this->getOrientation(); 513 this->server_linear_velocity_ = this->getVelocity(); 514 this->server_angular_velocity_ = this->getAngularVelocity(); 515 } 516 else if (this->bHasLocalController_) 517 { 518 this->client_position_ = this->getPosition(); 519 this->client_orientation_ = this->getOrientation(); 520 this->client_linear_velocity_ = this->getVelocity(); 521 this->client_angular_velocity_ = this->getAngularVelocity(); 475 522 } 476 523 }
Note: See TracChangeset
for help on using the changeset viewer.