Changeset 644 for code/branches/FICN/src/orxonox
- Timestamp:
- Dec 19, 2007, 3:03:30 AM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/objects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/objects/Projectile.cc
r643 r644 24 24 this->setOrientation(this->owner_->getOrientation()); 25 25 this->setPosition(this->owner_->getPosition()); 26 this->translate(Vector3(55, 0, 0), Ogre::Node::TS_LOCAL); 26 27 this->setVelocity(Vector3(1, 0, 0) * this->speed_); 27 28 } -
code/branches/FICN/src/orxonox/objects/SpaceShip.cc
r643 r644 49 49 50 50 this->setMouseEventCallback_ = false; 51 this->bMousePressed_ = false; 51 this->bLMousePressed_ = false; 52 this->bRMousePressed_ = false; 53 54 this->camNode_ = 0; 52 55 53 56 this->tt_ = 0; … … 140 143 this->greenBillboard_.setBillboardSet("Examples/Flare", ColourValue(0.0, 1.0, 0.0), 1); 141 144 142 this->redNode_ = this->getNode()->createChildSceneNode(this->getName() + "red", Vector3(0. 1, 4.6, -0.3));145 this->redNode_ = this->getNode()->createChildSceneNode(this->getName() + "red", Vector3(0.3, 4.7, -0.3)); 143 146 this->redNode_->setInheritScale(false); 144 this->greenNode_ = this->getNode()->createChildSceneNode(this->getName() + "green", Vector3(0. 1, -4.6, -0.3));147 this->greenNode_ = this->getNode()->createChildSceneNode(this->getName() + "green", Vector3(0.3, -4.7, -0.3)); 145 148 this->greenNode_->setInheritScale(false); 146 149 … … 171 174 { 172 175 Ogre::Camera *cam = Orxonox::getSingleton()->getSceneManager()->createCamera("ShipCam"); 173 Ogre::SceneNode *node= this->getNode()->createChildSceneNode("CamNode");176 this->camNode_ = this->getNode()->createChildSceneNode("CamNode"); 174 177 /* 175 178 // node->setInheritOrientation(false); … … 184 187 cam->roll(Degree(-90)); 185 188 186 node->attachObject(cam);189 this->camNode_->attachObject(cam); 187 190 Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam); 188 191 } … … 203 206 this->moved = true; 204 207 208 if (this->bRMousePressed_) 209 { 210 this->camNode_->roll(Degree(-e.state.X.rel * 0.10)); 211 this->camNode_->yaw(Degree(e.state.Y.rel * 0.10)); 212 } 213 205 214 return true; 206 215 } … … 208 217 bool SpaceShip::mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id) 209 218 { 210 this->bMousePressed_ = true; 219 if (id == OIS::MB_Left) 220 this->bLMousePressed_ = true; 221 else if (id == OIS::MB_Right) 222 this->bRMousePressed_ = true; 211 223 212 224 return true; … … 215 227 bool SpaceShip::mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id) 216 228 { 217 this->bMousePressed_ = false; 229 if (id == OIS::MB_Left) 230 this->bLMousePressed_ = false; 231 else if (id == OIS::MB_Right) 232 { 233 this->bRMousePressed_ = false; 234 this->camNode_->resetOrientation(); 235 } 236 237 return true; 218 238 } 219 239 … … 245 265 this->timeToReload_ = 0; 246 266 247 if (this->b MousePressed_ && this->timeToReload_ <= 0)267 if (this->bLMousePressed_ && this->timeToReload_ <= 0) 248 268 { 249 269 Projectile* proj = new Projectile(this); -
code/branches/FICN/src/orxonox/objects/SpaceShip.h
r643 r644 43 43 bool bInvertMouse_; 44 44 bool setMouseEventCallback_; 45 bool bMousePressed_; 45 bool bLMousePressed_; 46 bool bRMousePressed_; 47 48 Ogre::SceneNode* camNode_; 46 49 47 50 particle::ParticleInterface *tt_;
Note: See TracChangeset
for help on using the changeset viewer.