| 1 | /* |
|---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
|---|
| 3 | * > www.orxonox.net < |
|---|
| 4 | * |
|---|
| 5 | * |
|---|
| 6 | * License notice: |
|---|
| 7 | * |
|---|
| 8 | * This program is free software; you can redistribute it and/or |
|---|
| 9 | * modify it under the terms of the GNU General Public License |
|---|
| 10 | * as published by the Free Software Foundation; either version 2 |
|---|
| 11 | * of the License, or (at your option) any later version. |
|---|
| 12 | * |
|---|
| 13 | * This program is distributed in the hope that it will be useful, |
|---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 16 | * GNU General Public License for more details. |
|---|
| 17 | * |
|---|
| 18 | * You should have received a copy of the GNU General Public License |
|---|
| 19 | * along with this program; if not, write to the Free Software |
|---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|---|
| 21 | * |
|---|
| 22 | * Author: |
|---|
| 23 | * Fabian 'x3n' Landau |
|---|
| 24 | * Co-authors: |
|---|
| 25 | * ... |
|---|
| 26 | * |
|---|
| 27 | */ |
|---|
| 28 | |
|---|
| 29 | #include "OrxonoxStableHeaders.h" |
|---|
| 30 | #include "ControllableEntity.h" |
|---|
| 31 | |
|---|
| 32 | #include "core/CoreIncludes.h" |
|---|
| 33 | #include "core/Core.h" |
|---|
| 34 | #include "core/XMLPort.h" |
|---|
| 35 | #include "core/Template.h" |
|---|
| 36 | |
|---|
| 37 | #include "objects/infos/PlayerInfo.h" |
|---|
| 38 | #include "objects/worldentities/Camera.h" |
|---|
| 39 | #include "objects/worldentities/CameraPosition.h" |
|---|
| 40 | #include "overlays/OverlayGroup.h" |
|---|
| 41 | |
|---|
| 42 | namespace orxonox |
|---|
| 43 | { |
|---|
| 44 | CreateFactory(ControllableEntity); |
|---|
| 45 | |
|---|
| 46 | ControllableEntity::ControllableEntity(BaseObject* creator) : WorldEntity(creator) |
|---|
| 47 | { |
|---|
| 48 | RegisterObject(ControllableEntity); |
|---|
| 49 | |
|---|
| 50 | this->bControlled_ = false; |
|---|
| 51 | this->server_overwrite_ = 0; |
|---|
| 52 | this->client_overwrite_ = 0; |
|---|
| 53 | this->player_ = 0; |
|---|
| 54 | this->playerID_ = network::OBJECTID_UNKNOWN; |
|---|
| 55 | this->hud_ = 0; |
|---|
| 56 | this->camera_ = 0; |
|---|
| 57 | 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 | |
|---|
| 69 | this->registerVariables(); |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | ControllableEntity::~ControllableEntity() |
|---|
| 73 | { |
|---|
| 74 | if (this->isInitialized()) |
|---|
| 75 | { |
|---|
| 76 | if (this->bControlled_) |
|---|
| 77 | this->stopLocalControl(); |
|---|
| 78 | |
|---|
| 79 | if (this->hud_) |
|---|
| 80 | delete this->hud_; |
|---|
| 81 | |
|---|
| 82 | if (this->camera_) |
|---|
| 83 | delete this->camera_; |
|---|
| 84 | |
|---|
| 85 | if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this) |
|---|
| 86 | this->getPlayer()->stopControl(this, false); |
|---|
| 87 | } |
|---|
| 88 | } |
|---|
| 89 | |
|---|
| 90 | void ControllableEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode) |
|---|
| 91 | { |
|---|
| 92 | SUPER(ControllableEntity, XMLPort, xmlelement, mode); |
|---|
| 93 | |
|---|
| 94 | XMLPortParam(ControllableEntity, "hudtemplate", setHudTemplate, getHudTemplate, xmlelement, mode); |
|---|
| 95 | XMLPortParam(ControllableEntity, "camerapositiontemplate", setCameraPositionTemplate, getCameraPositionTemkplate, xmlelement, mode); |
|---|
| 96 | |
|---|
| 97 | XMLPortObject(ControllableEntity, WorldEntity, "camerapositions", addCameraPosition, getCameraPosition, xmlelement, mode); |
|---|
| 98 | } |
|---|
| 99 | |
|---|
| 100 | void ControllableEntity::addCameraPosition(CameraPosition* position) |
|---|
| 101 | { |
|---|
| 102 | this->attach(position); |
|---|
| 103 | this->cameraPositions_.push_back(position); |
|---|
| 104 | } |
|---|
| 105 | |
|---|
| 106 | CameraPosition* ControllableEntity::getCameraPosition(unsigned int index) const |
|---|
| 107 | { |
|---|
| 108 | unsigned int i = 0; |
|---|
| 109 | for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) |
|---|
| 110 | { |
|---|
| 111 | if (i == index) |
|---|
| 112 | return (*it); |
|---|
| 113 | ++i; |
|---|
| 114 | } |
|---|
| 115 | return 0; |
|---|
| 116 | } |
|---|
| 117 | |
|---|
| 118 | void ControllableEntity::switchCamera() |
|---|
| 119 | { |
|---|
| 120 | if (this->camera_) |
|---|
| 121 | { |
|---|
| 122 | if (this->camera_->getParent() == this && this->cameraPositions_.size() > 0) |
|---|
| 123 | { |
|---|
| 124 | this->cameraPositions_.front()->attachCamera(this->camera_); |
|---|
| 125 | } |
|---|
| 126 | else if (this->cameraPositions_.size() > 0) |
|---|
| 127 | { |
|---|
| 128 | for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) |
|---|
| 129 | { |
|---|
| 130 | if ((*it) == this->camera_->getParent()) |
|---|
| 131 | { |
|---|
| 132 | ++it; |
|---|
| 133 | if (it != this->cameraPositions_.end()) |
|---|
| 134 | (*it)->attachCamera(this->camera_); |
|---|
| 135 | else |
|---|
| 136 | (*this->cameraPositions_.begin())->attachCamera(this->camera_); |
|---|
| 137 | break; |
|---|
| 138 | } |
|---|
| 139 | } |
|---|
| 140 | } |
|---|
| 141 | else |
|---|
| 142 | { |
|---|
| 143 | this->attach(this->camera_); |
|---|
| 144 | } |
|---|
| 145 | } |
|---|
| 146 | } |
|---|
| 147 | |
|---|
| 148 | void ControllableEntity::setPlayer(PlayerInfo* player) |
|---|
| 149 | { |
|---|
| 150 | if (!player) |
|---|
| 151 | { |
|---|
| 152 | this->removePlayer(); |
|---|
| 153 | return; |
|---|
| 154 | } |
|---|
| 155 | |
|---|
| 156 | this->player_ = player; |
|---|
| 157 | this->playerID_ = player->getObjectID(); |
|---|
| 158 | this->bControlled_ = (player->isLocalPlayer() && player->isHumanPlayer()); |
|---|
| 159 | if (this->bControlled_) |
|---|
| 160 | { |
|---|
| 161 | this->startLocalControl(); |
|---|
| 162 | |
|---|
| 163 | if (!Core::isMaster()) |
|---|
| 164 | { |
|---|
| 165 | COUT(0) << "CE: bidirectional synchronization" << std::endl; |
|---|
| 166 | this->setObjectMode(network::direction::bidirectional); |
|---|
| 167 | } |
|---|
| 168 | } |
|---|
| 169 | } |
|---|
| 170 | |
|---|
| 171 | void ControllableEntity::removePlayer() |
|---|
| 172 | { |
|---|
| 173 | if (this->bControlled_) |
|---|
| 174 | this->stopLocalControl(); |
|---|
| 175 | |
|---|
| 176 | this->player_ = 0; |
|---|
| 177 | this->playerID_ = network::OBJECTID_UNKNOWN; |
|---|
| 178 | this->bControlled_ = false; |
|---|
| 179 | this->setObjectMode(network::direction::toclient); |
|---|
| 180 | |
|---|
| 181 | if (this->bDestroyWhenPlayerLeft_) |
|---|
| 182 | delete this; |
|---|
| 183 | } |
|---|
| 184 | |
|---|
| 185 | void ControllableEntity::networkcallback_changedplayerID() |
|---|
| 186 | { |
|---|
| 187 | // just do this in case the entity wasn't yet synchronized when the corresponding PlayerInfo got our objectID |
|---|
| 188 | if (this->playerID_ != network::OBJECTID_UNKNOWN) |
|---|
| 189 | { |
|---|
| 190 | this->player_ = dynamic_cast<PlayerInfo*>(network::Synchronisable::getSynchronisable(this->playerID_)); |
|---|
| 191 | if (this->player_ && (this->player_->getControllableEntity() != this)) |
|---|
| 192 | this->player_->startControl(this); |
|---|
| 193 | } |
|---|
| 194 | } |
|---|
| 195 | |
|---|
| 196 | void ControllableEntity::startLocalControl() |
|---|
| 197 | { |
|---|
| 198 | std::cout << this->getObjectID() << " ###### start local control" << std::endl; |
|---|
| 199 | this->camera_ = new Camera(this); |
|---|
| 200 | this->camera_->requestFocus(); |
|---|
| 201 | if (this->cameraPositionTemplate_ != "") |
|---|
| 202 | this->addTemplate(this->cameraPositionTemplate_); |
|---|
| 203 | if (this->cameraPositions_.size() > 0) |
|---|
| 204 | this->cameraPositions_.front()->attachCamera(this->camera_); |
|---|
| 205 | else |
|---|
| 206 | this->attach(this->camera_); |
|---|
| 207 | |
|---|
| 208 | if (this->hudtemplate_ != "") |
|---|
| 209 | { |
|---|
| 210 | this->hud_ = new OverlayGroup(this); |
|---|
| 211 | this->hud_->addTemplate(this->hudtemplate_); |
|---|
| 212 | } |
|---|
| 213 | } |
|---|
| 214 | |
|---|
| 215 | void ControllableEntity::stopLocalControl() |
|---|
| 216 | { |
|---|
| 217 | std::cout << "###### stop local control" << std::endl; |
|---|
| 218 | this->camera_->detachFromParent(); |
|---|
| 219 | delete this->camera_; |
|---|
| 220 | this->camera_ = 0; |
|---|
| 221 | |
|---|
| 222 | delete this->hud_; |
|---|
| 223 | this->hud_ = 0; |
|---|
| 224 | } |
|---|
| 225 | |
|---|
| 226 | void ControllableEntity::tick(float dt) |
|---|
| 227 | { |
|---|
| 228 | if (this->isActive()) |
|---|
| 229 | { |
|---|
| 230 | this->velocity_ += (dt * this->acceleration_); |
|---|
| 231 | this->node_->translate(dt * this->velocity_, Ogre::Node::TS_LOCAL); |
|---|
| 232 | |
|---|
| 233 | if (Core::isMaster()) |
|---|
| 234 | { |
|---|
| 235 | this->server_velocity_ = this->velocity_; |
|---|
| 236 | this->server_position_ = this->node_->getPosition(); |
|---|
| 237 | } |
|---|
| 238 | else if (this->bControlled_) |
|---|
| 239 | { |
|---|
| 240 | this->client_velocity_ = this->velocity_; |
|---|
| 241 | this->client_position_ = this->node_->getPosition(); |
|---|
| 242 | } |
|---|
| 243 | } |
|---|
| 244 | } |
|---|
| 245 | |
|---|
| 246 | void ControllableEntity::registerVariables() |
|---|
| 247 | { |
|---|
| 248 | REGISTERSTRING(this->cameraPositionTemplate_, network::direction::toclient); |
|---|
| 249 | |
|---|
| 250 | REGISTERDATA(this->server_position_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition)); |
|---|
| 251 | REGISTERDATA(this->server_velocity_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity)); |
|---|
| 252 | REGISTERDATA(this->server_orientation_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation)); |
|---|
| 253 | |
|---|
| 254 | REGISTERDATA(this->server_overwrite_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite)); |
|---|
| 255 | |
|---|
| 256 | REGISTERDATA(this->client_position_, network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition)); |
|---|
| 257 | REGISTERDATA(this->client_velocity_, network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity)); |
|---|
| 258 | REGISTERDATA(this->client_orientation_, network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation)); |
|---|
| 259 | |
|---|
| 260 | REGISTERDATA(this->client_overwrite_, network::direction::toserver); |
|---|
| 261 | |
|---|
| 262 | REGISTERDATA(this->playerID_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID)); |
|---|
| 263 | } |
|---|
| 264 | |
|---|
| 265 | void ControllableEntity::processServerPosition() |
|---|
| 266 | { |
|---|
| 267 | if (!this->bControlled_) |
|---|
| 268 | this->node_->setPosition(this->server_position_); |
|---|
| 269 | } |
|---|
| 270 | |
|---|
| 271 | void ControllableEntity::processServerVelocity() |
|---|
| 272 | { |
|---|
| 273 | if (!this->bControlled_) |
|---|
| 274 | this->velocity_ = this->server_velocity_; |
|---|
| 275 | } |
|---|
| 276 | |
|---|
| 277 | void ControllableEntity::processServerOrientation() |
|---|
| 278 | { |
|---|
| 279 | if (!this->bControlled_) |
|---|
| 280 | this->node_->setOrientation(this->server_orientation_); |
|---|
| 281 | } |
|---|
| 282 | |
|---|
| 283 | void ControllableEntity::processOverwrite() |
|---|
| 284 | { |
|---|
| 285 | if (this->bControlled_) |
|---|
| 286 | { |
|---|
| 287 | this->setPosition(this->server_position_); |
|---|
| 288 | this->setVelocity(this->server_velocity_); |
|---|
| 289 | this->setOrientation(this->server_orientation_); |
|---|
| 290 | |
|---|
| 291 | this->client_overwrite_ = this->server_overwrite_; |
|---|
| 292 | } |
|---|
| 293 | } |
|---|
| 294 | |
|---|
| 295 | void ControllableEntity::processClientPosition() |
|---|
| 296 | { |
|---|
| 297 | if (this->server_overwrite_ == this->client_overwrite_) |
|---|
| 298 | { |
|---|
| 299 | this->node_->setPosition(this->client_position_); |
|---|
| 300 | this->server_position_ = this->client_position_; |
|---|
| 301 | } |
|---|
| 302 | } |
|---|
| 303 | |
|---|
| 304 | void ControllableEntity::processClientVelocity() |
|---|
| 305 | { |
|---|
| 306 | if (this->server_overwrite_ == this->client_overwrite_) |
|---|
| 307 | { |
|---|
| 308 | this->velocity_ = this->client_velocity_; |
|---|
| 309 | this->server_velocity_ = this->client_velocity_; |
|---|
| 310 | } |
|---|
| 311 | } |
|---|
| 312 | |
|---|
| 313 | void ControllableEntity::processClientOrientation() |
|---|
| 314 | { |
|---|
| 315 | if (this->server_overwrite_ == this->client_overwrite_) |
|---|
| 316 | { |
|---|
| 317 | this->node_->setOrientation(this->client_orientation_); |
|---|
| 318 | this->server_orientation_ = this->client_orientation_; |
|---|
| 319 | } |
|---|
| 320 | } |
|---|
| 321 | |
|---|
| 322 | |
|---|
| 323 | void ControllableEntity::setPosition(const Vector3& position) |
|---|
| 324 | { |
|---|
| 325 | if (Core::isMaster()) |
|---|
| 326 | { |
|---|
| 327 | this->node_->setPosition(position); |
|---|
| 328 | this->server_position_ = position; |
|---|
| 329 | ++this->server_overwrite_; |
|---|
| 330 | } |
|---|
| 331 | else if (this->bControlled_) |
|---|
| 332 | { |
|---|
| 333 | this->node_->setPosition(position); |
|---|
| 334 | this->client_position_ = position; |
|---|
| 335 | } |
|---|
| 336 | } |
|---|
| 337 | |
|---|
| 338 | void ControllableEntity::setVelocity(const Vector3& velocity) |
|---|
| 339 | { |
|---|
| 340 | if (Core::isMaster()) |
|---|
| 341 | { |
|---|
| 342 | this->velocity_ = velocity; |
|---|
| 343 | this->server_velocity_ = velocity; |
|---|
| 344 | ++this->server_overwrite_; |
|---|
| 345 | } |
|---|
| 346 | else if (this->bControlled_) |
|---|
| 347 | { |
|---|
| 348 | this->velocity_ = velocity; |
|---|
| 349 | this->client_velocity_ = velocity; |
|---|
| 350 | } |
|---|
| 351 | } |
|---|
| 352 | |
|---|
| 353 | void ControllableEntity::translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo) |
|---|
| 354 | { |
|---|
| 355 | if (Core::isMaster()) |
|---|
| 356 | { |
|---|
| 357 | this->node_->translate(distance, relativeTo); |
|---|
| 358 | this->server_position_ = this->node_->getPosition(); |
|---|
| 359 | ++this->server_overwrite_; |
|---|
| 360 | } |
|---|
| 361 | else if (this->bControlled_) |
|---|
| 362 | { |
|---|
| 363 | this->node_->translate(distance, relativeTo); |
|---|
| 364 | this->client_position_ = this->node_->getPosition(); |
|---|
| 365 | } |
|---|
| 366 | } |
|---|
| 367 | |
|---|
| 368 | void ControllableEntity::setOrientation(const Quaternion& orientation) |
|---|
| 369 | { |
|---|
| 370 | if (Core::isMaster()) |
|---|
| 371 | { |
|---|
| 372 | this->node_->setOrientation(orientation); |
|---|
| 373 | this->server_orientation_ = orientation; |
|---|
| 374 | ++this->server_overwrite_; |
|---|
| 375 | } |
|---|
| 376 | else if (this->bControlled_) |
|---|
| 377 | { |
|---|
| 378 | this->node_->setOrientation(orientation); |
|---|
| 379 | this->client_orientation_ = orientation; |
|---|
| 380 | } |
|---|
| 381 | } |
|---|
| 382 | |
|---|
| 383 | void ControllableEntity::rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo) |
|---|
| 384 | { |
|---|
| 385 | if (Core::isMaster()) |
|---|
| 386 | { |
|---|
| 387 | this->node_->rotate(rotation, relativeTo); |
|---|
| 388 | this->server_orientation_ = this->node_->getOrientation(); |
|---|
| 389 | ++this->server_overwrite_; |
|---|
| 390 | } |
|---|
| 391 | else if (this->bControlled_) |
|---|
| 392 | { |
|---|
| 393 | this->node_->rotate(rotation, relativeTo); |
|---|
| 394 | this->client_orientation_ = this->node_->getOrientation(); |
|---|
| 395 | } |
|---|
| 396 | } |
|---|
| 397 | |
|---|
| 398 | void ControllableEntity::yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo) |
|---|
| 399 | { |
|---|
| 400 | if (Core::isMaster()) |
|---|
| 401 | { |
|---|
| 402 | this->node_->yaw(angle, relativeTo); |
|---|
| 403 | this->server_orientation_ = this->node_->getOrientation(); |
|---|
| 404 | ++this->server_overwrite_; |
|---|
| 405 | } |
|---|
| 406 | else if (this->bControlled_) |
|---|
| 407 | { |
|---|
| 408 | this->node_->yaw(angle, relativeTo); |
|---|
| 409 | this->client_orientation_ = this->node_->getOrientation(); |
|---|
| 410 | } |
|---|
| 411 | } |
|---|
| 412 | |
|---|
| 413 | void ControllableEntity::pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo) |
|---|
| 414 | { |
|---|
| 415 | if (Core::isMaster()) |
|---|
| 416 | { |
|---|
| 417 | this->node_->pitch(angle, relativeTo); |
|---|
| 418 | this->server_orientation_ = this->node_->getOrientation(); |
|---|
| 419 | ++this->server_overwrite_; |
|---|
| 420 | } |
|---|
| 421 | else if (this->bControlled_) |
|---|
| 422 | { |
|---|
| 423 | this->node_->pitch(angle, relativeTo); |
|---|
| 424 | this->client_orientation_ = this->node_->getOrientation(); |
|---|
| 425 | } |
|---|
| 426 | } |
|---|
| 427 | |
|---|
| 428 | void ControllableEntity::roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo) |
|---|
| 429 | { |
|---|
| 430 | if (Core::isMaster()) |
|---|
| 431 | { |
|---|
| 432 | this->node_->roll(angle, relativeTo); |
|---|
| 433 | this->server_orientation_ = this->node_->getOrientation(); |
|---|
| 434 | ++this->server_overwrite_; |
|---|
| 435 | } |
|---|
| 436 | else if (this->bControlled_) |
|---|
| 437 | { |
|---|
| 438 | this->node_->roll(angle, relativeTo); |
|---|
| 439 | this->client_orientation_ = this->node_->getOrientation(); |
|---|
| 440 | } |
|---|
| 441 | } |
|---|
| 442 | |
|---|
| 443 | void ControllableEntity::lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector) |
|---|
| 444 | { |
|---|
| 445 | if (Core::isMaster()) |
|---|
| 446 | { |
|---|
| 447 | this->node_->lookAt(target, relativeTo, localDirectionVector); |
|---|
| 448 | this->server_orientation_ = this->node_->getOrientation(); |
|---|
| 449 | ++this->server_overwrite_; |
|---|
| 450 | } |
|---|
| 451 | else if (this->bControlled_) |
|---|
| 452 | { |
|---|
| 453 | this->node_->lookAt(target, relativeTo, localDirectionVector); |
|---|
| 454 | this->client_orientation_ = this->node_->getOrientation(); |
|---|
| 455 | } |
|---|
| 456 | } |
|---|
| 457 | |
|---|
| 458 | void ControllableEntity::setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector) |
|---|
| 459 | { |
|---|
| 460 | if (Core::isMaster()) |
|---|
| 461 | { |
|---|
| 462 | this->node_->setDirection(direction, relativeTo, localDirectionVector); |
|---|
| 463 | this->server_orientation_ = this->node_->getOrientation(); |
|---|
| 464 | ++this->server_overwrite_; |
|---|
| 465 | } |
|---|
| 466 | else if (this->bControlled_) |
|---|
| 467 | { |
|---|
| 468 | this->node_->setDirection(direction, relativeTo, localDirectionVector); |
|---|
| 469 | this->client_orientation_ = this->node_->getOrientation(); |
|---|
| 470 | } |
|---|
| 471 | } |
|---|
| 472 | } |
|---|