Tramway SDK
sound.h
Go to the documentation of this file.
1// Tramway Drifting and Dungeon Exploration Simulator SDK Runtime
2
3#ifndef TRAM_SDK_ENTITIES_AUDIO_H
4#define TRAM_SDK_ENTITIES_AUDIO_H
5
6#include <framework/entity.h>
9
10namespace tram {
11
12class AudioComponent;
13
14class Sound : public Entity {
15public:
17
18 // this should be a static method!!!
19 // and even better, the audiocomponent should have callbacks when the
20 // audio is finished playing, so that it can delete itself.. idk
21 // TODO: racenis fix pls
22 Sound(name_t sound, float volume, vec3 position);
23 void UpdateParameters();
24 void SetParameters();
25 void Load();
26 void Unload();
27 void Serialize();
28 void MessageHandler(Message& msg);
30 static void Register();
31protected:
33
35 float volume;
37};
38
39}
40
41#endif // TRAM_SDK_ENTITIES_AUDIO_H
Audio data resource.
Definition: sound.h:18
Sound(name_t name)
Definition: sound.h:35
Wrapper for an EntityComponent pointer.
Definition: entitycomponent.h:51
Entity base class.
Definition: entity.h:23
void Load()
Definition: resource.h:32
name_t sound
Definition: sound.h:34
float volume
Definition: sound.h:35
Sound(const SharedEntityData &, const ValueArray &)
int sound_flags
Definition: sound.h:36
void Serialize()
Definition: sound.cpp:123
void Unload()
Unloads an entity.
void UpdateParameters()
Called when Entity::UpdateTransform is called.
Definition: sound.cpp:89
Component< AudioComponent > audio
Definition: sound.h:32
name_t GetType()
Returns the type of the entity.
Definition: sound.cpp:55
void SetParameters()
Called when either Entity::SetLocation or Entity::SetRotation is called.
Definition: sound.cpp:94
void MessageHandler(Message &msg)
Allows entities to receive messages.
Definition: sound.cpp:127
Definition: value.h:314
void Register(name_t base_type, Entity *(*constr_func)(name_t new_type, const SharedEntityData &, const ValueArray &), void(*destr_func)(Entity *))
Definition: script.cpp:39
Serialization, i.e.
glm::vec3 vec3
Definition: math.h:11
Message data.
Definition: message.h:16
Basic Entity parameters.
Definition: entity.h:132
Interned string type.
Definition: uid.h:10