Changeset 8351 for code/trunk/src/orxonox
- Timestamp:
- Apr 28, 2011, 7:15:14 AM (14 years ago)
- Location:
- code/trunk/src/orxonox
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/CMakeLists.txt
r7648 r8351 68 68 OrxonoxPrecompiledHeaders.h 69 69 LINK_LIBRARIES 70 ${Boost_FILESYSTEM_LIBRARY}71 ${Boost_SYSTEM_LIBRARY} # Filesystem dependency72 ${Boost_THREAD_LIBRARY}73 ${Boost_DATE_TIME_LIBRARY} # Thread dependency74 70 ${OGRE_LIBRARY} 71 ${CEGUI} 72 ${LUA5.1_LIBRARY} 73 ${CEGUI_TOLUA_LIBRARY} 75 74 ${OPENAL_LIBRARY} 76 75 ${ALUT_LIBRARY} 76 ${OGG_LIBRARY} 77 ${VORBIS_LIBRARY} 77 78 ${VORBISFILE_LIBRARY} 78 ${VORBIS_LIBRARY}79 ${OGG_LIBRARY}80 79 tinyxml_orxonox 81 tolua_orxonox82 80 bullet_orxonox 83 81 util … … 85 83 network 86 84 tools 87 SOURCE_FILES ${ORXONOX_SRC_FILES} 85 SOURCE_FILES 86 ${ORXONOX_SRC_FILES} 88 87 ) -
code/trunk/src/orxonox/MoodManager.cc
r7284 r8351 56 56 COUT(2) << "Mood Warning: Folder for default mood (" << MoodManager::defaultMood_ << ") does not exist!" << std::endl; 57 57 } 58 59 // @TODO 60 // Creating a vector of the available moods to enable easy mood selection by Lua/CEGUI 58 61 } 59 62 -
code/trunk/src/orxonox/OrxonoxPrereqs.h
r8178 r8351 53 53 # endif 54 54 # endif 55 #elif defined ( ORXONOX_GCC_VISIBILITY ) 55 # define _OrxonoxPrivate 56 #elif defined (ORXONOX_GCC_VISIBILITY) 56 57 # define _OrxonoxExport __attribute__ ((visibility("default"))) 58 # define _OrxonoxPrivate __attribute__ ((visibility("hidden"))) 57 59 #else 58 60 # define _OrxonoxExport 61 # define _OrxonoxPrivate 59 62 #endif 60 63 -
code/trunk/src/orxonox/PawnManager.cc
r5929 r8351 29 29 #include "PawnManager.h" 30 30 31 #include "util/ScopedSingletonManager.h" 31 32 #include "core/CoreIncludes.h" 32 33 #include "worldentities/pawns/Pawn.h" … … 34 35 namespace orxonox 35 36 { 36 PawnManager* PawnManager::singletonPtr_s = 0;37 ManageScopedSingleton(PawnManager, ScopeID::Root, false); 37 38 38 39 PawnManager::PawnManager() … … 43 44 PawnManager::~PawnManager() 44 45 { 46 // Be sure to delete all the pawns 47 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ) 48 (it++)->destroy(); 45 49 } 46 50 47 void PawnManager:: touch()51 void PawnManager::preUpdate(const Clock& time) 48 52 { 49 if (!PawnManager::singletonPtr_s) 50 new PawnManager(); 51 } 52 53 void PawnManager::tick(float dt) 54 { 55 unsigned int count = 0; 56 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++count) 53 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ) 57 54 { 58 55 if (!it->isAlive()) … … 61 58 ++it; 62 59 } 63 64 if (count == 0)65 this->destroy();66 60 } 67 61 } -
code/trunk/src/orxonox/PawnManager.h
r5781 r8351 37 37 namespace orxonox 38 38 { 39 class _OrxonoxExport PawnManager : p rotectedSingleton<PawnManager>, public Tickable39 class _OrxonoxExport PawnManager : public Singleton<PawnManager>, public Tickable 40 40 { 41 41 friend class Singleton<PawnManager>; 42 42 public: 43 static void touch(); 43 PawnManager(); 44 virtual ~PawnManager(); 44 45 45 virtual void tick(float dt);46 virtual void preUpdate(const Clock& time); 46 47 47 48 private: 48 PawnManager();49 virtual ~PawnManager();50 49 51 50 static PawnManager* singletonPtr_s; -
code/trunk/src/orxonox/controllers/ArtificialController.cc
r7801 r8351 847 847 Vector3 distanceCurrent = this->targetPosition_ - this->getControllableEntity()->getPosition(); 848 848 Vector3 distanceNew = it->getPosition() - this->getControllableEntity()->getPosition(); 849 if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / (2 * math::pi))850 < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / (2 * math::pi)) + rnd(-250, 250))849 if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / math::twoPi) 850 < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / math::twoPi) + rnd(-250, 250)) 851 851 { 852 852 this->target_ = (*it); -
code/trunk/src/orxonox/controllers/NewHumanController.cc
r8316 r8351 544 544 if (distance > 0.04f && distance <= 0.59f * arrowsSize_ / 2.0f ) 545 545 { 546 this->arrowsOverlay1_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi)* 360.0f));546 this->arrowsOverlay1_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f)); 547 547 this->arrowsOverlay1_->show(); 548 548 } 549 549 else if (distance > 0.59f * arrowsSize_ / 2.0f && distance <= 0.77f * arrowsSize_ / 2.0f ) 550 550 { 551 this->arrowsOverlay2_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi)* 360.0f));551 this->arrowsOverlay2_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f)); 552 552 this->arrowsOverlay2_->show(); 553 553 } 554 554 else if (distance > 0.77f * arrowsSize_ / 2.0f && distance <= arrowsSize_ / 2.0f) 555 555 { 556 this->arrowsOverlay3_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi)* 360.0f));556 this->arrowsOverlay3_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f)); 557 557 this->arrowsOverlay3_->show(); 558 558 } 559 559 else if (distance > arrowsSize_ / 2.0f) 560 560 { 561 this->arrowsOverlay4_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi)* 360.0f));561 this->arrowsOverlay4_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f)); 562 562 this->arrowsOverlay4_->show(); 563 563 } -
code/trunk/src/orxonox/gametypes/LastTeamStanding.cc
- Property svn:eol-style set to native
-
code/trunk/src/orxonox/gametypes/LastTeamStanding.h
- Property svn:eol-style set to native
-
code/trunk/src/orxonox/graphics/BlinkingBillboard.cc
r7163 r8351 79 79 if (this->isActive()) 80 80 { 81 this->time_ += dt; 81 // Wrap around to avoid loosing floating point precision 82 this->time_ = std::fmod(this->time_ + dt, 1.0f / this->frequency_); 83 float value = sin((math::twoPi * this->time_ + this->phase_.valueRadians()) * this->frequency_); 82 84 if (this->bQuadratic_) 83 this->setScale(this->amplitude_ * s tatic_cast<float>(square(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_))));85 this->setScale(this->amplitude_ * square(value)); 84 86 else 85 this->setScale(this->amplitude_ * st atic_cast<float>(fabs(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_))));87 this->setScale(this->amplitude_ * std::abs(value)); 86 88 } 87 89 } -
code/trunk/src/orxonox/graphics/BlinkingBillboard.h
r7163 r8351 75 75 Degree phase_; 76 76 bool bQuadratic_; 77 long doubletime_;77 float time_; 78 78 }; 79 79 } -
code/trunk/src/orxonox/interfaces/PickupCarrier.cc
- Property svn:eol-style set to native
-
code/trunk/src/orxonox/interfaces/PickupListener.cc
- Property svn:eol-style set to native
-
code/trunk/src/orxonox/interfaces/PickupListener.h
- Property svn:eol-style set to native
-
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r8309 r8351 284 284 angle = -angle; 285 285 angle -= math::pi * static_cast<int>(angle / (math::pi)); 286 if (angle > math::pi * 0.5)286 if (angle > math::pi_2) 287 287 angle = math::pi - angle; 288 288 -
code/trunk/src/orxonox/sound/AmbientSound.cc
r8079 r8351 42 42 43 43 // Ambient sounds always fade in 44 this->setVolume(0 );44 this->setVolume(0.0f); 45 45 } 46 46 -
code/trunk/src/orxonox/sound/SoundBuffer.cc
r6502 r8351 30 30 #include "SoundBuffer.h" 31 31 32 #include < AL/alut.h>32 #include <alut.h> 33 33 #include <vorbis/vorbisfile.h> 34 34 -
code/trunk/src/orxonox/sound/SoundManager.cc
r7858 r8351 31 31 #include "SoundManager.h" 32 32 33 #include <AL/alut.h>34 33 #include <utility> 34 #include <alut.h> 35 35 #include <loki/ScopeGuard.h> 36 36 … … 73 73 this->bDestructorCalled_ = false; 74 74 75 // Clear error messages (might be problematic on some systems) 76 alGetError(); 77 alutGetError(); 78 75 79 // See whether we even want to load 76 80 bool bDisableSound_ = false; … … 78 82 if (bDisableSound_) 79 83 ThrowException(InitialisationAborted, "Sound: Not loading at all"); 80 81 84 if (!alutInitWithoutContext(NULL, NULL)) 82 85 ThrowException(InitialisationFailed, "Sound Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError())); … … 107 110 this->device_ = alcOpenDevice(NULL); 108 111 if (this->device_ == NULL) 109 {110 COUT(1) << "Sound: Could not open sound device. Have you installed OpenAL?" << std::endl;111 #ifdef ORXONOX_PLATFORM_WINDOWS112 COUT(1) << "Sound: Just getting the DLL with the dependencies is not enough for Windows (esp. Windows 7)!" << std::endl;113 #endif114 112 ThrowException(InitialisationFailed, "Sound Error: Could not open sound device."); 115 }116 113 Loki::ScopeGuard closeDeviceGuard = Loki::MakeGuard(&alcCloseDevice, this->device_); 117 114 … … 327 324 ALenum error = alGetError(); 328 325 if (error == AL_INVALID_VALUE) 326 // @TODO: Follow this constantly appearing, nerve-racking warning 329 327 COUT(2) << "Sound: OpenAL: Invalid listener position" << std::endl; 330 328 } -
code/trunk/src/orxonox/sound/SoundManager.h
r7858 r8351 72 72 // tolua_begin 73 73 static SoundManager& getInstance() { return Singleton<SoundManager>::getInstance(); } 74 static bool exists() { return Singleton<SoundManager>::exists(); } 74 75 75 76 std::string getDeviceName(unsigned int index) const -
code/trunk/src/orxonox/sound/WorldSound.cc
r7284 r8351 30 30 #include "WorldSound.h" 31 31 32 #include <AL/alut.h> 32 #include <alut.h> 33 33 34 #include "util/Math.h" 34 35 #include "core/CoreIncludes.h" -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r8329 r8351 36 36 #include "network/NetworkFunction.h" 37 37 38 #include "PawnManager.h"39 38 #include "infos/PlayerInfo.h" 40 39 #include "controllers/Controller.h" … … 59 58 RegisterObject(Pawn); 60 59 61 PawnManager::touch();62 60 this->bAlive_ = true; 63 61 this->bReload_ = false;
Note: See TracChangeset
for help on using the changeset viewer.