Changeset 6325
- Timestamp:
- Dec 11, 2009, 5:52:59 PM (15 years ago)
- Location:
- code/branches/presentation2/src/orxonox/worldentities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc
r6112 r6325 70 70 this->bDestroyWhenPlayerLeft_ = false; 71 71 this->cameraPositionRootNode_ = this->node_->createChildSceneNode(); 72 this->currentCameraPosition_ = 0; 72 73 this->bMouseLook_ = false; 73 74 this->mouseLookSpeed_ = 200; … … 174 175 { 175 176 this->cameraPositions_.front()->attachCamera(this->camera_); 177 this->currentCameraPosition_ = this->cameraPositions_.front().get(); 176 178 } 177 179 else if (this->cameraPositions_.size() > 0) … … 183 185 ++it; 184 186 if (it != this->cameraPositions_.end()) 187 { 185 188 (*it)->attachCamera(this->camera_); 189 this->currentCameraPosition_ = *it; 190 } 186 191 else 192 { 187 193 (*this->cameraPositions_.begin())->attachCamera(this->camera_); 194 this->currentCameraPosition_ = *this->cameraPositions_.begin(); 195 } 188 196 break; 189 197 } … … 193 201 { 194 202 this->camera_->attachToNode(this->cameraPositionRootNode_); 203 this->currentCameraPosition_ = 0; 195 204 } 196 205 } … … 203 212 if (!this->bMouseLook_) 204 213 this->cameraPositionRootNode_->setOrientation(Quaternion::IDENTITY); 214 if (this->getCamera()) 215 { 216 if (!this->bMouseLook_&& this->currentCameraPosition_->getDrag()) 217 this->getCamera()->setDrag(true); 218 else 219 this->getCamera()->setDrag(false); 220 } 205 221 } 206 222 … … 320 336 this->addTemplate(this->cameraPositionTemplate_); 321 337 if (this->cameraPositions_.size() > 0) 338 { 322 339 this->cameraPositions_.front()->attachCamera(this->camera_); 340 this->currentCameraPosition_ = this->cameraPositions_.front(); 341 } 323 342 else 343 { 324 344 this->camera_->attachToNode(this->cameraPositionRootNode_); 345 this->currentCameraPosition_ = 0; 346 } 325 347 } 326 348 -
code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h
r6112 r6325 210 210 Ogre::SceneNode* cameraPositionRootNode_; 211 211 std::list<SmartPtr<CameraPosition> > cameraPositions_; 212 CameraPosition* currentCameraPosition_; 212 213 std::string cameraPositionTemplate_; 213 214 Controller* xmlcontroller_;
Note: See TracChangeset
for help on using the changeset viewer.