i6engine  1.0
i6e::api::SoundComponent Class Reference

Attaches a sound node to an object. The Sound will follow the object For creating a SoundComponent, these keys are possible:

Name Required Type Description Public
offset yes Vec3 offset to the position of the PhysicalStateComponent this Component is connected to yes
direction yes Vec3 direction of the sound yes
file yes std::string sound file for this sound, currently only wav is supported yes
looping yes bool is this sound looping or only played once yes
maxDist yes double maxmimum distance this sound should be hearable, volume is interpolated yes
cache yes bool if set to true, this sound is cached in memory and mustn't be loaded from harddisk every time it is played yes
category no std::string specifies the category this sound belongs to, e.g. music, effect, dialog, default value is empty string yes
More...

#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/api/components/SoundComponent.h>

Public Member Functions

 SoundComponent (const int64_t id, const attributeMap &params)
 Constructor with attribute map. More...
 
 ~SoundComponent ()
 Destructor. More...
 
attributeMap synchronize () const override
 synchronizes the Components state More...
 
std::string getTemplateName () const override
 returns the name this template was registered with More...
 
std::vector< componentOptionsgetComponentOptions () override
 returns a vector containing all options of the Component being readable and writeable in the editor More...
 
- Public Member Functions inherited from i6e::api::Component
 Component ()
 Constructor for Component. More...
 
 Component (const int64_t id, const attributeMap &params)
 Constructor for Component. More...
 
virtual ~Component ()
 Destructor of Component. Must be implemented in derived class. More...
 
void setOwnerGO (const WeakGOPtr &objGo)
 Sets the GameObject that owns this Component. More...
 
GOPtr getOwnerGO ()
 Get the GameObject that owns this Component. More...
 
uint32_t getComponentID () const
 Returns the component identification string. More...
 
uint32_t getFamilyID () const
 Returns the family identification string. More...
 
std::string getIdentifier () const
 Returns the family identification string. More...
 
void setDie () const
 component will be deleted soon More...
 
int64_t getID () const
 returns the id of the component More...
 
virtual void News (const GameMessage::Ptr &msg)
 Receives messages for this component override this function, if you expect messages. More...
 
void setSync (bool b)
 sets whether this object has to be synchronized or not More...
 
bool getSync () const
 
void enableTicking (bool allowTicking) const
 triggers doEnableTicking threadsafe More...
 
void setSelf (const WeakComPtr &self)
 sets weak_ptr on self for registration of ticker More...
 
std::vector< ComPtrgetSubComponents () const
 returns all SubComponents attached to this Component More...
 

Additional Inherited Members

- Static Public Member Functions inherited from i6e::api::Component
template<typename T >
static ComPtr createC (const int64_t id, const attributeMap &params)
 
- Protected Member Functions inherited from i6e::api::Component
void addTicker ()
 adds this component to ticklist More...
 
void removeTicker ()
 removes this component from ticklist More...
 
void doEnableTicking (bool allowTicking)
 sets ticking status for this Component per default all Components are allowed to tick and calling addTicker will start ticking, but in some cases, e.g. for level editor, ticking has to be disabled and just a few components are allowed to tick More...
 
- Protected Attributes inherited from i6e::api::Component
int64_t _objOwnerID
 ID of the GameObject that owns this Component. More...
 
WeakGOPtr _objOwnerGO
 Owning GameObject. More...
 
uint32_t _objComponentID
 Component ID of the Component. More...
 
uint32_t _objFamilyID
 Family ID of the Component. More...
 
std::vector< ComPtr_subComps
 vector containing the other componetns of the same type if this is the dispatcher component More...
 
std::string _identifier
 identifies the subcomponent More...
 
int64_t _id
 id of this component More...
 
bool _sync
 
WeakComPtr _self
 a weak_ptr on the own shared_ptr More...
 
bool _tickingAllowed
 status if this object is allowed to tick or not More...
 
bool _wantsToTick
 stores if a Component which isn't allowed to tick want to tick, so it can start ticking when ticking will be allowed More...
 
bool _isTicking
 stores whether this Component is actually ticking More...
 

Detailed Description

Attaches a sound node to an object. The Sound will follow the object For creating a SoundComponent, these keys are possible:

Name Required Type Description Public
offset yes Vec3 offset to the position of the PhysicalStateComponent this Component is connected to yes
direction yes Vec3 direction of the sound yes
file yes std::string sound file for this sound, currently only wav is supported yes
looping yes bool is this sound looping or only played once yes
maxDist yes double maxmimum distance this sound should be hearable, volume is interpolated yes
cache yes bool if set to true, this sound is cached in memory and mustn't be loaded from harddisk every time it is played yes
category no std::string specifies the category this sound belongs to, e.g. music, effect, dialog, default value is empty string yes

Definition at line 51 of file SoundComponent.h.

Constructor & Destructor Documentation

i6e::api::SoundComponent::SoundComponent ( const int64_t  id,
const attributeMap params 
)

Constructor with attribute map.

i6e::api::SoundComponent::~SoundComponent ( )

Destructor.

Member Function Documentation

std::vector<componentOptions> i6e::api::SoundComponent::getComponentOptions ( )
overridevirtual

returns a vector containing all options of the Component being readable and writeable in the editor

Implements i6e::api::Component.

std::string i6e::api::SoundComponent::getTemplateName ( ) const
inlineoverridevirtual

returns the name this template was registered with

Implements i6e::api::Component.

Definition at line 68 of file SoundComponent.h.

attributeMap i6e::api::SoundComponent::synchronize ( ) const
overridevirtual

synchronizes the Components state

Implements i6e::api::Component.


The documentation for this class was generated from the following file: