Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6325


Ignore:
Timestamp:
Dec 11, 2009, 5:52:59 PM (14 years ago)
Author:
rgrieder
Message:

Disabled drag in mouse look.

Location:
code/branches/presentation2/src/orxonox/worldentities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc

    r6112 r6325  
    7070        this->bDestroyWhenPlayerLeft_ = false;
    7171        this->cameraPositionRootNode_ = this->node_->createChildSceneNode();
     72        this->currentCameraPosition_ = 0;
    7273        this->bMouseLook_ = false;
    7374        this->mouseLookSpeed_ = 200;
     
    174175            {
    175176                this->cameraPositions_.front()->attachCamera(this->camera_);
     177                this->currentCameraPosition_ = this->cameraPositions_.front().get();
    176178            }
    177179            else if (this->cameraPositions_.size() > 0)
     
    183185                        ++it;
    184186                        if (it != this->cameraPositions_.end())
     187                        {
    185188                            (*it)->attachCamera(this->camera_);
     189                            this->currentCameraPosition_ = *it;
     190                        }
    186191                        else
     192                        {
    187193                            (*this->cameraPositions_.begin())->attachCamera(this->camera_);
     194                            this->currentCameraPosition_ = *this->cameraPositions_.begin();
     195                        }
    188196                        break;
    189197                    }
     
    193201            {
    194202                this->camera_->attachToNode(this->cameraPositionRootNode_);
     203                this->currentCameraPosition_ = 0;
    195204            }
    196205        }
     
    203212        if (!this->bMouseLook_)
    204213            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        }
    205221    }
    206222
     
    320336                this->addTemplate(this->cameraPositionTemplate_);
    321337            if (this->cameraPositions_.size() > 0)
     338            {
    322339                this->cameraPositions_.front()->attachCamera(this->camera_);
     340                this->currentCameraPosition_ = this->cameraPositions_.front();
     341            }
    323342            else
     343            {
    324344                this->camera_->attachToNode(this->cameraPositionRootNode_);
     345                this->currentCameraPosition_ = 0;
     346            }
    325347        }
    326348
  • code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h

    r6112 r6325  
    210210            Ogre::SceneNode* cameraPositionRootNode_;
    211211            std::list<SmartPtr<CameraPosition> > cameraPositions_;
     212            CameraPosition* currentCameraPosition_;
    212213            std::string cameraPositionTemplate_;
    213214            Controller* xmlcontroller_;
Note: See TracChangeset for help on using the changeset viewer.