Changeset 6372
- Timestamp:
- Dec 17, 2009, 4:52:45 PM (15 years ago)
- Location:
- code/branches/presentation2/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/Scene.cc
r6107 r6372 58 58 this->setScene(SmartPtr<Scene>(this, false), OBJECTID_UNKNOWN); 59 59 this->bShadows_ = true; 60 this->soundReferenceDistance_ = 20.0; 60 61 61 62 if (GameMode::showsGraphics()) … … 113 114 XMLPortParam(Scene, "ambientlight", setAmbientLight, getAmbientLight, xmlelement, mode).defaultValues(ColourValue(0.2f, 0.2f, 0.2f, 1.0f)); 114 115 XMLPortParam(Scene, "shadow", setShadow, getShadow, xmlelement, mode).defaultValues(true); 116 XMLPortParam(Scene, "soundReferenceDistance", setSoundReferenceDistance, getSoundReferenceDistance, xmlelement, mode).defaultValues(true); 115 117 116 118 XMLPortParam(Scene, "gravity", setGravity, getGravity, xmlelement, mode); -
code/branches/presentation2/src/orxonox/Scene.h
r5929 r6372 71 71 { return this->bShadows_; } 72 72 73 inline void setSoundReferenceDistance(float distance) 74 { this->soundReferenceDistance_ = distance; } 75 inline float getSoundReferenceDistance() const 76 { return this->soundReferenceDistance_; } 77 73 78 inline Radar* getRadar() 74 79 { return this->radar_; } … … 96 101 std::list<BaseObject*> objects_; 97 102 bool bShadows_; 103 float soundReferenceDistance_; 98 104 Radar* radar_; 99 105 -
code/branches/presentation2/src/orxonox/sound/BaseSound.cc
r6370 r6372 132 132 alSource3f(this->audioSource_, AL_VELOCITY, 0, 0, 0); 133 133 alSource3f(this->audioSource_, AL_DIRECTION, 0, 0, 0); 134 alSourcei(this->audioSource_, AL_REFERENCE_DISTANCE, 20);135 alSourcei(this->audioSource_, AL_MAX_DISTANCE, 10000);136 134 if (ALint error = alGetError()) 137 135 COUT(2) << "Sound Warning: Setting source parameters to 0 failed: " -
code/branches/presentation2/src/orxonox/sound/WorldSound.cc
r6370 r6372 35 35 #include "core/EventIncludes.h" 36 36 #include "core/XMLPort.h" 37 #include "Scene.h" 37 38 #include "SoundManager.h" 38 39 #include <core/ConsoleCommandCompilation.h> … … 79 80 { 80 81 BaseSound::initialiseSource(); 82 if (this->getScene()) 83 { 84 float refDist = this->getScene()->getSoundReferenceDistance(); 85 alSourcei(this->audioSource_, AL_REFERENCE_DISTANCE, refDist); 86 // TODO: 500 is very magical here. Derive something better 87 alSourcei(this->audioSource_, AL_MAX_DISTANCE, refDist * 500); 88 } 81 89 this->tick(0); // update position, orientation and velocity 82 90 }
Note: See TracChangeset
for help on using the changeset viewer.