- Timestamp:
- Jul 27, 2005, 6:07:47 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/defs/alincl.h
r4504 r4959 2 2 \file alincl.h 3 3 \brief This file includes al Headers. 4 4 5 5 no Class is defined here, but the openAL Headers 6 6 */ … … 12 12 #include <AL/al.h> 13 13 #include <AL/alu.h> 14 #include <AL/alc.h> 14 15 #include <AL/alut.h> 15 16 #else 16 17 #include <OpenAL/al.h> 18 #include <OpenAL/alc.h> 17 19 #include <OpenAL/alu.h> 18 20 #include <OpenAL/alut.h> -
orxonox/trunk/src/lib/sound/sound_engine.cc
r4885 r4959 467 467 } 468 468 469 void SoundEngine::listDevices() 470 { 471 472 printf("%s\n",(const char*)alcGetString(NULL, ALC_DEVICE_SPECIFIER)); 473 } 474 469 475 /* 470 476 void SoundEngine::PrintALCErrorString(ALenum err) -
orxonox/trunk/src/lib/sound/sound_engine.h
r4885 r4959 1 1 /*! 2 \file sound_engine.h3 *Definition of the SoundEngine singleton Class4 */2 * @file sound_engine.h 3 * Definition of the SoundEngine singleton Class 4 */ 5 5 6 6 #ifndef _SOUND_ENGINE_H … … 22 22 class SoundBuffer : public BaseObject 23 23 { 24 public:25 SoundBuffer(const char* fileName);26 ~SoundBuffer();24 public: 25 SoundBuffer(const char* fileName); 26 ~SoundBuffer(); 27 27 28 /** @returns the ID of the buffer used in this SoundBuffer */29 inline ALuint getID() const { return this->bufferID; }28 /** @returns the ID of the buffer used in this SoundBuffer */ 29 inline ALuint getID() const { return this->bufferID; } 30 30 31 private:32 ALuint bufferID; //!< The address of the Buffer.31 private: 32 ALuint bufferID; //!< The address of the Buffer. 33 33 34 ALsizei size; //!< The size of the Buffer.35 ALboolean loop; //!< loop information.34 ALsizei size; //!< The size of the Buffer. 35 ALboolean loop; //!< loop information. 36 36 }; 37 37 … … 39 39 class SoundSource : public BaseObject 40 40 { 41 public:42 SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL);43 ~SoundSource();41 public: 42 SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL); 43 ~SoundSource(); 44 44 45 45 // user interaction 46 void play();47 void play(const SoundBuffer* buffer);48 void stop();49 void pause();50 void rewind();46 void play(); 47 void play(const SoundBuffer* buffer); 48 void stop(); 49 void pause(); 50 void rewind(); 51 51 52 52 // development functions 53 /** @returns The ID of this Source */54 inline ALuint getID() const { return this->sourceID; }55 /** @returns the SoundBuffer of this Source */56 inline const SoundBuffer* getBuffer() const { return this->buffer; }57 /** @returns the SourceNode of this Source */58 inline const PNode* getNode() const { return this->sourceNode;}53 /** @returns The ID of this Source */ 54 inline ALuint getID() const { return this->sourceID; } 55 /** @returns the SoundBuffer of this Source */ 56 inline const SoundBuffer* getBuffer() const { return this->buffer; } 57 /** @returns the SourceNode of this Source */ 58 inline const PNode* getNode() const { return this->sourceNode;} 59 59 60 void setRolloffFactor(ALfloat rolloffFactor);60 void setRolloffFactor(ALfloat rolloffFactor); 61 61 62 private:63 ALuint sourceID; //!< The ID of the Source64 const SoundBuffer* buffer; //!< The buffer to play in this source.65 const PNode* sourceNode; //!< The SourceNode represente the position/velocity... of this source.62 private: 63 ALuint sourceID; //!< The ID of the Source 64 const SoundBuffer* buffer; //!< The buffer to play in this source. 65 const PNode* sourceNode; //!< The SourceNode represente the position/velocity... of this source. 66 66 }; 67 67 … … 71 71 class SoundEngine : public BaseObject { 72 72 73 public:74 virtual ~SoundEngine();75 /** @returns a Pointer to the only object of this Class */76 inline static SoundEngine* getInstance() { if (!singletonRef) singletonRef = new SoundEngine(); return singletonRef; };73 public: 74 virtual ~SoundEngine(); 75 /** @returns a Pointer to the only object of this Class */ 76 inline static SoundEngine* getInstance() { if (!singletonRef) singletonRef = new SoundEngine(); return singletonRef; }; 77 77 78 SoundSource* createSource(const char* fileName, PNode* sourceNode = NULL);78 SoundSource* createSource(const char* fileName, PNode* sourceNode = NULL); 79 79 80 void setListener(PNode* listener);81 void setDopplerValues(ALfloat dopplerFactor, ALfloat dopplerVelocity);80 void setListener(PNode* listener); 81 void setDopplerValues(ALfloat dopplerFactor, ALfloat dopplerVelocity); 82 82 83 83 84 void addBuffer(SoundBuffer* buffer);85 void removeBuffer(SoundBuffer* buffer);86 void addSource(SoundSource* source);87 void removeSource(SoundSource* source);84 void addBuffer(SoundBuffer* buffer); 85 void removeBuffer(SoundBuffer* buffer); 86 void addSource(SoundSource* source); 87 void removeSource(SoundSource* source); 88 88 89 void update();89 void update(); 90 90 91 91 // administrative 92 void flushUnusedBuffers();93 void flushAllBuffers();94 void flushAllSources();95 bool initAudio();92 void flushUnusedBuffers(); 93 void flushAllBuffers(); 94 void flushAllSources(); 95 bool initAudio(); 96 96 97 97 // error handling: 98 static void PrintALErrorString(ALenum err);98 static void PrintALErrorString(ALenum err); 99 99 // static void PrintALCErrorString(ALenum err); 100 100 101 101 102 private: 103 SoundEngine(); 104 static SoundEngine* singletonRef; //!< Reference to this class 102 private: 103 SoundEngine(); 104 void listDevices(); 105 106 private: 107 static SoundEngine* singletonRef; //!< Reference to this class 105 108 106 109 107 PNode* listener; //!< The listener of the Scene108 tList<SoundBuffer>* bufferList; //!< A list of buffers109 tList<SoundSource>* sourceList; //!< A list for all the sources in the scene.110 PNode* listener; //!< The listener of the Scene 111 tList<SoundBuffer>* bufferList; //!< A list of buffers 112 tList<SoundSource>* sourceList; //!< A list for all the sources in the scene. 110 113 111 114 }; -
orxonox/trunk/src/story_entities/world.cc
r4955 r4959 917 917 918 918 /* update tick the rest */ 919 //TrackManager::getInstance()->tick(this->dtS);919 TrackManager::getInstance()->tick(this->dtS); 920 920 this->localCamera->tick(this->dtS); 921 921 // tick the engines -
orxonox/trunk/src/world_entities/weapons/test_gun.cc
r4955 r4959 164 164 if (target != NULL) 165 165 { 166 target->debugDraw(); 167 Vector test = ((target->getAbsCoor() - this->getAbsCoor())*5); 168 pj->setVelocity(test/20.0);//this->getVelocity()); 166 pj->setVelocity(this->getVelocity()+(target->getAbsCoor() - this->getAbsCoor())*.5);//this->getVelocity()); 169 167 } 170 168 else -
orxonox/trunk/src/world_entities/weapons/test_gun.h
r4955 r4959 26 26 #include "weapon.h" 27 27 28 29 //! a weapon can be left or right sided 30 /** 31 * @todo this will be reset with mirror X/Y/Z 32 */ 33 #define W_LEFT 0 34 #define W_RIGHT 1 35 36 28 37 class TestGun : public Weapon 29 38 { -
orxonox/trunk/src/world_entities/weapons/weapon.cc
r4955 r4959 56 56 if (this->soundBuffers[i]) 57 57 ResourceManager::getInstance()->unload(this->soundBuffers[i]); 58 59 if (ClassList::exists(this->soundSource, CL_SOUND_SOURCE)) 60 delete this->soundSource; 58 61 } 59 62 -
orxonox/trunk/src/world_entities/weapons/weapon.h
r4955 r4959 1 1 /*! 2 \file weapon.h 3 * a weapon that a can use 4 5 6 A weapon is characterized by: 7 o firing-rate: the initial firing rate of a weapon (1/s = Herz) 8 o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down! 9 o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile 10 11 Furthermore there are some other attributes, that will help to represent a firing 12 weapon in this world: 13 o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented 14 o animations 15 */ 2 * @file weapon.h 3 * 4 * Weapon is the mayor baseclass for all weapons. it is quite extensive, and expensive in use, 5 * because each weapon will know virutal functions for the WorldEntity's part, and also virtuals 6 * for Fireing/Reloading/..., 7 * quickly said: Weapon is a wrapper for weapons, that makes it easy to very quickly implement 8 * new Weapons, and with them make this game better, than any game before it, because still 9 * Weapons (GUNS) are the most important thing in life :?... no to be serious 10 * @see Weapon 11 */ 16 12 17 13 … … 56 52 } WeaponState; 57 53 58 59 //! a weapon can be left or right sided 60 /** 61 * @todo this will be reset with mirror X/Y/Z 62 */ 63 #define W_LEFT 0 64 #define W_RIGHT 1 54 //! an enumerator defining capabilities of a WeaponSlot 55 typedef enum 56 { 57 WTYPE_DIRECTIONAL = 0x00000001, //!< Weapon is directional/Slot is able to carry directional weapons 58 WTYPE_TURRET = 0x00000002, //!< Weapon is a turret/slot is able to carry turrets 59 WTYPE_ALLKINDS = 0x0000000f, //!< Weapon is all types/Slot is able to carry all kinds of weapons 60 61 WTYPE_FORWARD = 0x00000010, //!< Weapon fires forwards/Slot is able to carry weapons firing forwards 62 WTYPE_BACKWARD = 0x00000020, //!< Weapon fires backwards/Slot is able to carry weapons firing backwards 63 WTYPE_LEFT = 0x00000040, //!< Weapon fires to the left/Slot is able to carry weapons firing to the left 64 WTYPE_RIGHT = 0x00000080, //!< Weapon fires to the right/Slot is able to carry weapons firing to the right 65 WTYPE_ALLDIRS = 0x000000f0, //!< Weapon has no specific firing direction/Slot can fire into all directions 66 67 WTYPE_ALL = 0x000000ff, //!< Weapon has no limitations/Slot can handle all kinds of Weapon. 68 } W_Capability; 65 69 66 70 //! An abstract class, that describes weapons -
orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
r4954 r4959 73 73 for (int i = 0; i < WM_MAX_SLOTS; i++) 74 74 { 75 this->currentSlotConfig[i].capability = W M_SLOTC_ALL;75 this->currentSlotConfig[i].capability = WTYPE_ALL; 76 76 this->currentSlotConfig[i].currentWeapon = NULL; 77 77 this->currentSlotConfig[i].nextWeapon = NULL; -
orxonox/trunk/src/world_entities/weapons/weapon_manager.h
r4955 r4959 13 13 #include "base_object.h" 14 14 15 #include "p_node.h"16 15 #include "crosshair.h" 16 #include "weapon.h" 17 17 18 18 // FORWARD DECLARATION 19 class PNode;20 class Weapon;21 19 template <class T> class tAnimation; 22 20 … … 25 23 #define WM_MAX_CONFIGS 4 //!< The maximum number of predefined Configurations 26 24 #define WM_MAX_LOADED_WEAPONS 20 //!< The 27 28 //! an enumerator defining capabilities of a WeaponSlot29 typedef enum30 {31 WM_SLOTC_DIRECTIONAL = 0x00000001, //!< if the Slot is able to carry directional weapons32 WM_SLOTC_TURRET = 0x00000002, //!< if the Slot is able to carry turrets33 WM_SLOTC_ALLKINDS = 0x0000000f, //!< if the Slot is able to carry all kinds of weapons34 35 WM_SLOTC_FORWARD = 0x00000010, //!< if the Slot is able to carry weapons firing forward36 WM_SLOTC_BACKWARD = 0x00000020, //!< if the Slot is able to carry weapons firing backwards37 WM_SLOTC_LEFT = 0x00000040, //!< if the Slot is able to carry weapons firing to the left38 WM_SLOTC_RIGHT = 0x00000080, //!< if the Slot is able to carry weapons firing to the right39 WM_SLOTC_ALLDIRS = 0x000000f0, //!< this slot can fire into all directions40 41 WM_SLOTC_ALL = 0x000000ff, //!< everything allowed in this slot42 } WM_SlotCapability;43 25 44 26 //! an enumerator defining a Slot, where a Weapon can be stored inside.
Note: See TracChangeset
for help on using the changeset viewer.