Changeset 3046 for code/branches/pickups2
- Timestamp:
- May 24, 2009, 11:53:09 PM (16 years ago)
- Location:
- code/branches/pickups2/src/orxonox/objects/pickup
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickups2/src/orxonox/objects/pickup/PickupSpawner.cc
r2917 r3046 44 44 namespace orxonox 45 45 { 46 const float PickupSpawner::bounceSpeed_s = 6.0f; 47 const float PickupSpawner::rotationSpeed_s = 1.0f; 48 const float PickupSpawner::bounceDistance_s = 4.0f; 49 46 50 CreateFactory(PickupSpawner); 47 51 … … 57 61 this->triggerDistance_ = 20; 58 62 this->respawnTime_ = 0.0f; 63 this->tickSum_ = 0.0f; 59 64 } 60 65 //! Deconstructor. … … 108 113 this->trigger(*it); 109 114 } 115 this->yaw(Radian(rotationSpeed_s*dt)); 116 this->tickSum_ += bounceSpeed_s*dt; 117 this->translate(Vector3(0,bounceDistance_s*dt*sin(this->tickSum_),0)); 118 if (this->tickSum_ > 2*Ogre::Math::PI) 119 this->tickSum_ -= 2*Ogre::Math::PI; 110 120 } 111 121 } -
code/branches/pickups2/src/orxonox/objects/pickup/PickupSpawner.h
r3042 r3046 109 109 float triggerDistance_; //!< Distance in which this gets triggered. 110 110 111 /* Pickup animation */ 112 float tickSum_; //!< Adds up tick to use in sine movement 113 static const float bounceSpeed_s; //!< Speed of pickup to bounce up and down 114 static const float bounceDistance_s; //!< Distance the pickup bounces up and down 115 static const float rotationSpeed_s; //!< Rotation speed of pickup 116 111 117 float respawnTime_; //!< Time after which this gets re-actived. 112 118 Timer<PickupSpawner> respawnTimer_; //!< Timer used for re-activating.
Note: See TracChangeset
for help on using the changeset viewer.