Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
soundsource.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include <optional>
5#include <glm/glm.hpp>
9
11 SoundSource() = default;
12 SoundSource(ServerSFX sfx, glm::vec3 pos, float volume, float min_dist, float atten, bool loop = false);
13
15 glm::vec3 pos;
16 float volume;
17 float min_dist;
18 float atten;
19 bool loop;
20
21 std::optional<std::chrono::milliseconds> SERVER_time_remaining; // not serialized b/c not used by client
22
23 bool canBeHeardFrom(glm::vec3 pos) const;
24
25 DEF_SERIALIZE(Archive& ar, const unsigned int version) {
26 ar & sfx & pos & volume & min_dist & atten & loop;
27 }
28};
ServerSFX
Definition: soundtype.hpp:38
Definition: soundsource.hpp:10
glm::vec3 pos
Definition: soundsource.hpp:15
float min_dist
Definition: soundsource.hpp:17
bool canBeHeardFrom(glm::vec3 pos) const
Definition: soundsource.cpp:16
SoundSource()=default
float atten
Definition: soundsource.hpp:18
DEF_SERIALIZE(Archive &ar, const unsigned int version)
Definition: soundsource.hpp:25
bool loop
Definition: soundsource.hpp:19
float volume
Definition: soundsource.hpp:16
ServerSFX sfx
Definition: soundsource.hpp:14
std::optional< std::chrono::milliseconds > SERVER_time_remaining
Definition: soundsource.hpp:21