16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 12:29:18 +02:00

build 180215. sound velocity calculation, ai brake charging logic tweak, 3d shapes boundary calculation fixes

This commit is contained in:
tmj-fstate
2018-02-15 15:25:03 +01:00
parent 62327d5d08
commit 2dd82bf71b
8 changed files with 62 additions and 34 deletions

View File

@@ -63,7 +63,7 @@ struct openal_source {
play();
// updates state of the source
void
update( double const Deltatime );
update( double const Deltatime, glm::vec3 const &Listenervelocity );
// configures state of the source to match the provided set of properties
void
sync_with( sound_properties const &State );
@@ -90,6 +90,7 @@ private:
float pitch_variation { 1.f }; // emitter-specific variation of the base pitch
float sound_range { 50.f }; // cached audible range of the emitted samples
glm::vec3 sound_distance; // cached distance between sound and the listener
glm::vec3 sound_velocity; // sound movement vector
bool is_in_range { false }; // helper, indicates the source was recently within audible range
bool is_multipart { false }; // multi-part sounds are kept alive at longer ranges
};
@@ -142,6 +143,7 @@ private:
ALCcontext * m_context { nullptr };
bool m_ready { false }; // renderer is initialized and functional
glm::dvec3 m_listenerposition;
glm::vec3 m_listenervelocity;
buffer_manager m_buffers;
// TBD: list of sources as vector, sorted by distance, for openal implementations with limited number of active sources?