00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 #ifndef         SOUND_H_
00011 # define        SOUND_H_
00012 
00013 #include "pos.h"
00014 
00015 namespace lpzrobots {
00016 
00017   class OSGSphere;
00018   class OsgHandle;
00019   
00020 
00021   class Sound {
00022   public:
00023     Sound(double time, const Pos& pos, float intensity, float frequency, void* sender)
00024       : time(time), pos(pos), 
00025       intensity(intensity), frequency(frequency), sender(sender),
00026       visual(0) {}
00027 
00028     ~Sound();
00029     
00030 
00031     struct older_than : public std::unary_function<const Sound&, bool> {
00032       older_than(double time) : time(time) {}
00033       double time;
00034       bool operator()(const Sound& s) { return s.time < time; }
00035     };
00036 
00037     void render(const OsgHandle& osgHandle);
00038 
00039     double time;
00040     Pos pos;    
00041     float intensity; 
00042     float frequency; 
00043     void* sender;    
00044 
00045     
00046   private:
00047     OSGSphere* visual;    
00048   };
00049 
00050 } 
00051 
00052 #endif