2007-11-13 18:02:18 -08:00
|
|
|
#ifndef _AL_LISTENER_H_
|
|
|
|
#define _AL_LISTENER_H_
|
|
|
|
|
2012-09-14 02:42:36 -07:00
|
|
|
#include "alMain.h"
|
2014-12-16 06:29:31 -08:00
|
|
|
#include "alu.h"
|
2007-11-13 18:02:18 -08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2017-09-27 08:55:42 -07:00
|
|
|
struct ALcontextProps {
|
|
|
|
ALfloat DopplerFactor;
|
|
|
|
ALfloat DopplerVelocity;
|
|
|
|
ALfloat SpeedOfSound;
|
|
|
|
ALboolean SourceDistanceModel;
|
|
|
|
enum DistanceModel DistanceModel;
|
|
|
|
ALfloat MetersPerUnit;
|
|
|
|
|
|
|
|
ATOMIC(struct ALcontextProps*) next;
|
|
|
|
};
|
|
|
|
|
2016-05-11 18:40:17 -07:00
|
|
|
struct ALlistenerProps {
|
2017-03-08 03:38:28 -08:00
|
|
|
ALfloat Position[3];
|
|
|
|
ALfloat Velocity[3];
|
|
|
|
ALfloat Forward[3];
|
|
|
|
ALfloat Up[3];
|
|
|
|
ALfloat Gain;
|
2016-05-11 18:40:17 -07:00
|
|
|
|
|
|
|
ATOMIC(struct ALlistenerProps*) next;
|
|
|
|
};
|
|
|
|
|
2012-10-09 04:48:12 -07:00
|
|
|
typedef struct ALlistener {
|
2017-07-13 21:30:05 -07:00
|
|
|
alignas(16) ALfloat Position[3];
|
2017-03-08 03:38:28 -08:00
|
|
|
ALfloat Velocity[3];
|
|
|
|
ALfloat Forward[3];
|
|
|
|
ALfloat Up[3];
|
|
|
|
ALfloat Gain;
|
2012-10-09 06:19:36 -07:00
|
|
|
|
2017-09-27 09:36:34 -07:00
|
|
|
ATOMIC_FLAG PropsClean;
|
|
|
|
|
2016-05-11 18:40:17 -07:00
|
|
|
/* Pointer to the most recent property values that are awaiting an update.
|
|
|
|
*/
|
|
|
|
ATOMIC(struct ALlistenerProps*) Update;
|
|
|
|
|
2012-10-09 06:19:36 -07:00
|
|
|
struct {
|
2016-05-16 18:28:46 -07:00
|
|
|
aluMatrixf Matrix;
|
2015-11-11 08:19:33 -08:00
|
|
|
aluVector Velocity;
|
2016-05-09 11:26:49 -07:00
|
|
|
|
|
|
|
ALfloat Gain;
|
|
|
|
ALfloat MetersPerUnit;
|
|
|
|
|
|
|
|
ALfloat DopplerFactor;
|
2017-09-22 05:42:04 -07:00
|
|
|
ALfloat SpeedOfSound; /* in units per sec! */
|
|
|
|
ALfloat ReverbSpeedOfSound; /* in meters per sec! */
|
2016-08-23 19:17:17 -07:00
|
|
|
|
|
|
|
ALboolean SourceDistanceModel;
|
|
|
|
enum DistanceModel DistanceModel;
|
2012-10-09 06:19:36 -07:00
|
|
|
} Params;
|
2007-11-13 18:02:18 -08:00
|
|
|
} ALlistener;
|
|
|
|
|
2016-05-11 18:40:17 -07:00
|
|
|
void UpdateListenerProps(ALCcontext *context);
|
|
|
|
|
2007-11-13 18:02:18 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|