4#include "Mach1DecodePositional.h"
7# define DEG_TO_RAD (PI / 180.0)
10#ifndef __FLT_EPSILON__
11# define __FLT_EPSILON__ 1.19209290e-07F
14Mach1DecodePositional::Mach1DecodePositional() {
15 M1obj = Mach1DecodePositionalCAPI_create();
18Mach1DecodePositional::~Mach1DecodePositional() {
19 Mach1DecodePositionalCAPI_delete(M1obj);
23 Mach1DecodePositionalCAPI_setPlatformType(M1obj, type);
39 Mach1DecodePositionalCAPI_setDecodeMode(M1obj, mode);
49 Mach1DecodePositionalCAPI_setMuteWhenOutsideObject(M1obj, muteWhenOutsideObject);
55 Mach1DecodePositionalCAPI_setMuteWhenInsideObject(M1obj, muteWhenInsideObject);
61 Mach1DecodePositionalCAPI_setUseAttenuation(M1obj, useAttenuation);
68 Mach1DecodePositionalCAPI_setAttenuationCurve(M1obj, attenuationCurve);
76 Mach1DecodePositionalCAPI_setUsePlaneCalculation(M1obj, usePlaneCalculation);
86 Mach1DecodePositionalCAPI_setUseYawForRotation(M1obj, useYawForRotation);
93 Mach1DecodePositionalCAPI_setUsePitchForRotation(M1obj, usePitchForRotation);
100 Mach1DecodePositionalCAPI_setUseRollForRotation(M1obj, useRollForRotation);
107 Mach1DecodePositionalCAPI_setListenerPosition(M1obj, point);
115 Mach1DecodePositionalCAPI_setListenerRotation(M1obj, point);
123 Mach1DecodePositionalCAPI_setListenerRotationQuat(M1obj, quat);
131 Mach1DecodePositionalCAPI_setDecoderAlgoPosition(M1obj, point);
139 Mach1DecodePositionalCAPI_setDecoderAlgoRotation(M1obj, point);
147 Mach1DecodePositionalCAPI_setDecoderAlgoRotationQuat(M1obj, quat);
155 Mach1DecodePositionalCAPI_setDecoderAlgoScale(M1obj, point);
162void Mach1DecodePositional::evaluatePositionResults() {
163 Mach1DecodePositionalCAPI_evaluatePositionResults(M1obj);
166#ifndef __EMSCRIPTEN__
168 Mach1DecodePositionalCAPI_getCoefficients(M1obj, result);
176 Mach1DecodePositionalCAPI_getCoefficients(M1obj, result.data());
183 return Mach1DecodePositionalCAPI_getDist(M1obj);
188int Mach1DecodePositional::getFormatChannelCount() {
189 return Mach1DecodePositionalCAPI_getFormatChannelCount(M1obj);
192int Mach1DecodePositional::getFormatCoeffCount() {
193 return Mach1DecodePositionalCAPI_getFormatCoeffCount(M1obj);
197 return Mach1DecodePositionalCAPI_getCurrentAngle(M1obj);
202 return Mach1DecodePositionalCAPI_getCurrentAngleInternal(M1obj);
207Mach1Point3D Mach1DecodePositional::getPositionalRotation() {
208 return Mach1DecodePositionalCAPI_getPositionalRotation(M1obj);
212 Mach1DecodePositionalCAPI_setFilterSpeed(M1obj, filterSpeed);
221Mach1Point3D Mach1DecodePositional::getClosestPointOnPlane() {
222 return Mach1DecodePositionalCAPI_getClosestPointOnPlane(M1obj);
void setUsePlaneCalculation(bool usePlaneCalculation)
Definition Mach1DecodePositional.cpp:75
Mach1Point3D getCurrentAngleInternal()
Definition Mach1DecodePositional.cpp:201
void setDecoderAlgoScale(Mach1Point3D point)
Definition Mach1DecodePositional.cpp:154
void setDecodeMode(Mach1DecodeMode mode)
Definition Mach1DecodePositional.cpp:38
void setUsePitchForRotation(bool usePitchForRotation)
Definition Mach1DecodePositional.cpp:92
void getCoefficients(float *result)
Definition Mach1DecodePositional.cpp:167
void setUseAttenuation(bool useAttenuation)
Definition Mach1DecodePositional.cpp:60
void setListenerRotationQuat(Mach1Point4D quat)
Definition Mach1DecodePositional.cpp:122
void setUseRollForRotation(bool useRollForRotation)
Definition Mach1DecodePositional.cpp:99
void setFilterSpeed(float filterSpeed)
Definition Mach1DecodePositional.cpp:211
void setMuteWhenInsideObject(bool muteWhenInsideObject)
Definition Mach1DecodePositional.cpp:54
void setDecoderAlgoRotation(Mach1Point3D point)
Definition Mach1DecodePositional.cpp:138
void setListenerPosition(Mach1Point3D point)
Definition Mach1DecodePositional.cpp:106
void setListenerRotation(Mach1Point3D point)
Definition Mach1DecodePositional.cpp:114
void setMuteWhenOutsideObject(bool muteWhenOutsideObject)
Definition Mach1DecodePositional.cpp:48
void setUseYawForRotation(bool useYawForRotation)
Definition Mach1DecodePositional.cpp:85
void setDecoderAlgoPosition(Mach1Point3D point)
Definition Mach1DecodePositional.cpp:130
Mach1Point3D getCurrentAngle()
Definition Mach1DecodePositional.cpp:196
void setPlatformType(Mach1PlatformType platformType)
Definition Mach1DecodePositional.cpp:22
void setDecoderAlgoRotationQuat(Mach1Point4D quat)
Definition Mach1DecodePositional.cpp:146
float getDist()
Definition Mach1DecodePositional.cpp:182
void setAttenuationCurve(float attenuationCurve)
Definition Mach1DecodePositional.cpp:67
Definition Mach1Point3D.h:17
Definition Mach1Point4D.h:15