14 enum class DistanceModel
;
17 struct ALlistenerProps
{
18 std::array
<float,3> Position
;
19 std::array
<float,3> Velocity
;
20 std::array
<float,3> OrientAt
;
21 std::array
<float,3> OrientUp
;
25 std::atomic
<ALlistenerProps
*> next
;
27 DEF_NEWDEL(ALlistenerProps
)
31 std::array
<float,3> Position
{{0.0f
, 0.0f
, 0.0f
}};
32 std::array
<float,3> Velocity
{{0.0f
, 0.0f
, 0.0f
}};
33 std::array
<float,3> OrientAt
{{0.0f
, 0.0f
, -1.0f
}};
34 std::array
<float,3> OrientUp
{{0.0f
, 1.0f
, 0.0f
}};
36 float mMetersPerUnit
{AL_DEFAULT_METERS_PER_UNIT
};
38 std::atomic_flag PropsClean
;
41 /* Pointer to the most recent property values that are awaiting an
44 std::atomic
<ALlistenerProps
*> Update
{nullptr};
53 float SpeedOfSound
; /* in units per sec! */
55 bool SourceDistanceModel
;
56 DistanceModel mDistanceModel
;
59 ALlistener() { PropsClean
.test_and_set(std::memory_order_relaxed
); }
64 void UpdateListenerProps(ALCcontext
*context
);