Changeset 643 for code/branches/FICN/src/orxonox/objects
- Timestamp:
- Dec 19, 2007, 2:41:01 AM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/objects
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/objects/CMakeLists.txt
r638 r643 20 20 BillboardSet.cc 21 21 Light.cc 22 Projectile.cc 22 23 weapon_system/ammunition_dump.cc 23 24 weapon_system/barrel_gun.cc -
code/branches/FICN/src/orxonox/objects/SpaceShip.cc
r633 r643 27 27 28 28 #include "SpaceShip.h" 29 #include "Projectile.h" 29 30 30 31 #include "../../tinyxml/tinyxml.h" … … 45 46 46 47 SetConfigValue(bInvertMouse_, true); 48 SetConfigValue(reloadTime_, 0.1); 47 49 48 50 this->setMouseEventCallback_ = false; 51 this->bMousePressed_ = false; 49 52 50 53 this->tt_ = 0; … … 52 55 this->greenNode_ = 0; 53 56 this->blinkTime_ = 0; 57 58 this->timeToReload_ = 0; 54 59 55 60 this->moveForward_ = 0; … … 201 206 } 202 207 208 bool SpaceShip::mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id) 209 { 210 this->bMousePressed_ = true; 211 212 return true; 213 } 214 215 bool SpaceShip::mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id) 216 { 217 this->bMousePressed_ = false; 218 } 219 203 220 void SpaceShip::tick(float dt) 204 221 { … … 221 238 this->redNode_->setScale(redScale, redScale, redScale); 222 239 this->greenNode_->setScale(greenScale, greenScale, greenScale); 240 } 241 242 if (this->timeToReload_ > 0) 243 this->timeToReload_ -= dt; 244 else 245 this->timeToReload_ = 0; 246 247 if (this->bMousePressed_ && this->timeToReload_ <= 0) 248 { 249 Projectile* proj = new Projectile(this); 250 this->timeToReload_ = this->reloadTime_; 223 251 } 224 252 -
code/branches/FICN/src/orxonox/objects/SpaceShip.h
r633 r643 36 36 void maxSpeedLoopRightLeft(float maxSpeedLoopRightLeft); 37 37 bool mouseMoved(const OIS::MouseEvent &e); 38 bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id) { return true; }39 bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id) { return true; }38 bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id); 39 bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id); 40 40 41 41 … … 43 43 bool bInvertMouse_; 44 44 bool setMouseEventCallback_; 45 bool bMousePressed_; 45 46 46 47 particle::ParticleInterface *tt_; … … 51 52 Ogre::SceneNode* greenNode_; 52 53 float blinkTime_; 54 55 float timeToReload_; 56 float reloadTime_; 53 57 54 58 float moveForward_; -
code/branches/FICN/src/orxonox/objects/WorldEntity.cc
r637 r643 75 75 { 76 76 this->velocity_ += (dt * this->acceleration_); 77 this->translate(dt * this->velocity_ );77 this->translate(dt * this->velocity_, Ogre::Node::TS_LOCAL); 78 78 79 79 this->rotationRate_ += (dt * this->momentum_); … … 151 151 152 152 create(); 153 153 154 154 } 155 155 … … 158 158 return true; 159 159 } 160 160 161 161 void WorldEntity::registerAllVariables() 162 162 { -
code/branches/FICN/src/orxonox/objects/WorldEntity.h
r637 r643 23 23 virtual void loadParams(TiXmlElement* xmlElem); 24 24 bool create(); 25 25 26 26 inline Ogre::SceneNode* getNode() 27 27 { return this->node_; } … … 53 53 { this->node_->roll(angle, relativeTo); } 54 54 55 inline const Ogre::Quaternion& getOrientation() 56 { return this->node_->getOrientation(); } 57 inline void setOrientation(const Ogre::Quaternion& quat) 58 { this->node_->setOrientation(quat); } 55 59 inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL) 56 60 { this->node_->rotate(axis, angle, relativeTo); } … … 59 63 inline void setDirection(const Vector3 &vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z) 60 64 { this->node_->setDirection(vec, relativeTo, localDirectionVector); } 61 inline void setOrientation(const Ogre::Quaternion quat)62 { this->node_->setOrientation(quat); }63 65 inline void lookAt(const Vector3 &targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z) 64 66 { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); } … … 122 124 inline const Radian& getMomentum() const 123 125 { return this->momentum_; } 124 inline const Ogre::Quaternion& getOrientation()125 { return this->node_->getOrientation(); }126 126 127 127 inline void setStatic(bool bStatic)
Note: See TracChangeset
for help on using the changeset viewer.