Changeset 3192 for code/branches/pch/src/orxonox/objects
- Timestamp:
- Jun 18, 2009, 10:00:15 AM (16 years ago)
- Location:
- code/branches/pch/src/orxonox/objects
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pch/src/orxonox/objects/Scene.cc
r3175 r3192 102 102 103 103 XMLPortParam(Scene, "skybox", setSkybox, getSkybox, xmlelement, mode); 104 XMLPortParam(Scene, "ambientlight", setAmbientLight, getAmbientLight, xmlelement, mode).defaultValues(ColourValue(0.2 , 0.2, 0.2, 1));104 XMLPortParam(Scene, "ambientlight", setAmbientLight, getAmbientLight, xmlelement, mode).defaultValues(ColourValue(0.2f, 0.2f, 0.2f, 1.0f)); 105 105 XMLPortParam(Scene, "shadow", setShadow, getShadow, xmlelement, mode).defaultValues(true); 106 106 -
code/branches/pch/src/orxonox/objects/Scene.h
r3177 r3192 36 36 #include <set> 37 37 #include <string> 38 #include <OgrePrerequisites.h>39 38 40 39 #include "util/Math.h" 40 #include "util/OgreForwardRefs.h" 41 41 #include "core/BaseObject.h" 42 42 #include "network/synchronisable/Synchronisable.h" -
code/branches/pch/src/orxonox/objects/collisionshapes/CollisionShape.cc
r3176 r3192 126 126 bool CollisionShape::hasTransform() const 127 127 { 128 return (!this->position_.positionEquals(Vector3(0, 0, 0), 0.001 ) ||129 !this->orientation_.equals(Quaternion(1,0,0,0), Degree(0.1 )));128 return (!this->position_.positionEquals(Vector3(0, 0, 0), 0.001f) || 129 !this->orientation_.equals(Quaternion(1,0,0,0), Degree(0.1f))); 130 130 } 131 131 -
code/branches/pch/src/orxonox/objects/controllers/AIController.cc
r3176 r3192 108 108 this->moveToTargetPosition(); 109 109 110 if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0 ))110 if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f)) 111 111 this->getControllableEntity()->fire(0); 112 112 -
code/branches/pch/src/orxonox/objects/controllers/PongAI.cc
r3176 r3192 39 39 CreateUnloadableFactory(PongAI); 40 40 41 const static float MAX_REACTION_TIME = 0.4 ;41 const static float MAX_REACTION_TIME = 0.4f; 42 42 43 43 PongAI::PongAI(BaseObject* creator) : Controller(creator) … … 49 49 this->ballEndPosition_ = 0; 50 50 this->randomOffset_ = 0; 51 this->relHysteresisOffset_ = 0.02 ;52 this->strength_ = 0.5 ;51 this->relHysteresisOffset_ = 0.02f; 52 this->strength_ = 0.5f; 53 53 this->movement_ = 0; 54 54 this->oldMove_ = 0; … … 171 171 172 172 // The position shouln't be larger than 0.5 (50% of the bat-length from the middle is the end) 173 position *= 0.48 ;173 position *= 0.48f; 174 174 175 175 // Both sides are equally probable … … 190 190 191 191 // Calculate bounces 192 for (float limit = 0.35 ; limit < this->strength_ || this->strength_ > 0.99; limit += 0.4)192 for (float limit = 0.35f; limit < this->strength_ || this->strength_ > 0.99f; limit += 0.4f) 193 193 { 194 194 // Calculate a random prediction error, based on the vertical speed of the ball and the strength of the AI -
code/branches/pch/src/orxonox/objects/gametypes/Gametype.cc
r3186 r3192 287 287 if (this->spawnpoints_.size() > 0) 288 288 { 289 unsigned int randomspawn = (unsigned int)rnd(this->spawnpoints_.size());289 unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(this->spawnpoints_.size()))); 290 290 unsigned int index = 0; 291 291 for (std::set<SpawnPoint*>::const_iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); ++it) -
code/branches/pch/src/orxonox/objects/gametypes/TeamDeathmatch.cc
r3186 r3192 54 54 static ColourValue colours[] = 55 55 { 56 ColourValue(1.0 , 0.3, 0.3),57 ColourValue(0.3 , 0.3, 1.0),58 ColourValue(0.3 , 1.0, 0.3),59 ColourValue(1.0 , 1.0, 0.0)56 ColourValue(1.0f, 0.3f, 0.3f), 57 ColourValue(0.3f, 0.3f, 1.0f), 58 ColourValue(0.3f, 1.0f, 0.3f), 59 ColourValue(1.0f, 1.0f, 0.0f) 60 60 }; 61 61 static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue)); … … 139 139 if (teamSpawnPoints.size() > 0) 140 140 { 141 unsigned int randomspawn = (unsigned int)rnd(teamSpawnPoints.size());141 unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size()))); 142 142 unsigned int index = 0; 143 143 for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it) -
code/branches/pch/src/orxonox/objects/infos/HumanPlayer.cc
r3179 r3192 143 143 float HumanPlayer::getPing() const 144 144 { 145 return ClientInformation::findClient(this->getClientID())->getRTT();145 return static_cast<float>(ClientInformation::findClient(this->getClientID())->getRTT()); 146 146 } 147 147 148 148 float HumanPlayer::getPacketLossRatio() const 149 149 { 150 return ClientInformation::findClient(this->getClientID())->getPacketLoss();150 return static_cast<float>(ClientInformation::findClient(this->getClientID())->getPacketLoss()); 151 151 } 152 152 -
code/branches/pch/src/orxonox/objects/weaponsystem/MuzzleFlash.cc
r3185 r3192 40 40 { 41 41 RegisterObject(MuzzleFlash); 42 this->setScale(0.1 );42 this->setScale(0.1f); 43 43 44 44 this->delayTimer_.setTimer(0.1f, false, this, createExecutor(createFunctor(&MuzzleFlash::destroy))); -
code/branches/pch/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.cc
r3188 r3192 44 44 { 45 45 assert(this->getScene()->getSceneManager()); // getScene() was already checked by WorldEntity 46 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(0.5 , 0.5, 0.7, 0.8), 1);46 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(0.5f, 0.5f, 0.7f, 0.8f), 1); 47 47 this->attachOgreObject(this->billboard_.getBillboardSet()); 48 48 } -
code/branches/pch/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.cc
r3185 r3192 42 42 this->textureIndex_ = 1; 43 43 this->maxTextureIndex_ = 8; 44 this->textureTimer_.setTimer(0.01 , true, this, createExecutor(createFunctor(&LightningGunProjectile::changeTexture)));44 this->textureTimer_.setTimer(0.01f, true, this, createExecutor(createFunctor(&LightningGunProjectile::changeTexture))); 45 45 46 46 registerVariables(); -
code/branches/pch/src/orxonox/objects/worldentities/BlinkingBillboard.cc
r3186 r3192 79 79 this->time_ += dt; 80 80 if (this->bQuadratic_) 81 this->setScale(this->amplitude_ * s quare(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_)));81 this->setScale(this->amplitude_ * static_cast<float>(square(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_)))); 82 82 else 83 this->setScale(this->amplitude_ * s in((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_));83 this->setScale(this->amplitude_ * static_cast<float>(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_))); 84 84 } 85 85 } -
code/branches/pch/src/orxonox/objects/worldentities/Camera.h
r3186 r3192 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include <OgrePrerequisites.h>34 #include "util/OgreForwardRefs.h" 35 35 #include "interfaces/Tickable.h" 36 36 #include "objects/worldentities/StaticEntity.h" -
code/branches/pch/src/orxonox/objects/worldentities/ExplosionChunk.cc
r3188 r3192 151 151 Vector3 change(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)); 152 152 change.normalise(); 153 change *= rnd(0.4 , 0.8);153 change *= rnd(0.4f, 0.8f); 154 154 Vector3 velocity = this->getVelocity(); 155 155 velocity.normalise(); 156 156 velocity += change; 157 157 velocity.normalise(); 158 velocity *= length * rnd(0.8 , 1.0);158 velocity *= length * rnd(0.8f, 1.0f); 159 159 160 160 this->setVelocity(velocity); -
code/branches/pch/src/orxonox/objects/worldentities/MobileEntity.cc
r3186 r3192 92 92 this->angularVelocity_.z += angularAcceleration_.z * dt; 93 93 // Calculate new orientation with quaternion derivative. This is about 30% faster than with angle/axis method. 94 float mult = dt * 0.5 ;94 float mult = dt * 0.5f; 95 95 // TODO: this could be optimized by writing it out. The calls currently create 4 new Quaternions! 96 96 Quaternion newOrientation(0.0f, this->angularVelocity_.x * mult, this->angularVelocity_.y * mult, this->angularVelocity_.z * mult); -
code/branches/pch/src/orxonox/objects/worldentities/Planet.cc
r3186 r3192 91 91 float scaleFactor = this->getScale(); 92 92 93 this->distList.push_back(10.0 *scaleFactor);94 this->distList.push_back(19.0 *scaleFactor);95 this->distList.push_back(27.0 *scaleFactor);96 this->distList.push_back(34.0 *scaleFactor);97 this->distList.push_back(40.0 *scaleFactor);98 this->distList.push_back(45.0 *scaleFactor);99 this->distList.push_back(49.0 *scaleFactor);100 this->distList.push_back(52.0 *scaleFactor);101 this->distList.push_back(54.0 *scaleFactor);102 this->distList.push_back(55.0 *scaleFactor);93 this->distList.push_back(10.0f*scaleFactor); 94 this->distList.push_back(19.0f*scaleFactor); 95 this->distList.push_back(27.0f*scaleFactor); 96 this->distList.push_back(34.0f*scaleFactor); 97 this->distList.push_back(40.0f*scaleFactor); 98 this->distList.push_back(45.0f*scaleFactor); 99 this->distList.push_back(49.0f*scaleFactor); 100 this->distList.push_back(52.0f*scaleFactor); 101 this->distList.push_back(54.0f*scaleFactor); 102 this->distList.push_back(55.0f*scaleFactor); 103 103 104 float reductionValue = 0.2 ;104 float reductionValue = 0.2f; 105 105 106 106 this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue); -
code/branches/pch/src/orxonox/objects/worldentities/PongBall.cc
r3186 r3192 50 50 this->batID_[0] = OBJECTID_UNKNOWN; 51 51 this->batID_[1] = OBJECTID_UNKNOWN; 52 this->relMercyOffset_ = 0.05 ;52 this->relMercyOffset_ = 0.05f; 53 53 54 54 this->registerVariables(); … … 103 103 if (position.x > this->fieldWidth_ / 2 && this->bat_[1]) 104 104 { 105 distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10 ) / 2);105 distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2); 106 106 if (fabs(distance) <= 1) 107 107 { … … 123 123 if (position.x < -this->fieldWidth_ / 2 && this->bat_[0]) 124 124 { 125 distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10 ) / 2);125 distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2); 126 126 if (fabs(distance) <= 1) 127 127 { … … 173 173 if (position.x > this->fieldWidth_ / 2 && this->bat_[1]) 174 174 { 175 distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10 ) / 2);175 distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2); 176 176 if (fabs(distance) <= 1) 177 177 { … … 184 184 if (position.x < -this->fieldWidth_ / 2 && this->bat_[0]) 185 185 { 186 distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10 ) / 2);186 distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2); 187 187 if (fabs(distance) <= 1) 188 188 { -
code/branches/pch/src/orxonox/objects/worldentities/WorldEntity.h
r3188 r3192 34 34 35 35 #ifdef ORXONOX_RELEASE 36 #include <OgreSceneNode.h> 37 #else 38 #include <OgrePrerequisites.h> 36 # include <OgreSceneNode.h> 39 37 #endif 40 38 #include <LinearMath/btMotionState.h> 41 39 42 40 #include "util/Math.h" 41 #include "util/OgreForwardRefs.h" 43 42 #include "core/BaseObject.h" 44 43 #include "network/synchronisable/Synchronisable.h" -
code/branches/pch/src/orxonox/objects/worldentities/pawns/Spectator.cc
r3188 r3192 59 59 { 60 60 this->greetingFlare_ = new BillboardSet(); 61 this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0 , 1.0, 0.8), Vector3(0, 20, 0), 1);61 this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0f, 1.0f, 0.8f), Vector3(0, 20, 0), 1); 62 62 if (this->greetingFlare_->getBillboardSet()) 63 63 this->attachOgreObject(this->greetingFlare_->getBillboardSet());
Note: See TracChangeset
for help on using the changeset viewer.