Mach1 Spatial SDK
Loading...
Searching...
No Matches
Mach1DecodePositional.cpp
1// Mach1 Spatial SDK
2// Copyright © 2017 Mach1. All rights reserved.
3
4#include "Mach1DecodePositional.h"
5
6#ifndef DEG_TO_RAD
7# define DEG_TO_RAD (PI / 180.0)
8#endif
9
10#ifndef __FLT_EPSILON__
11# define __FLT_EPSILON__ 1.19209290e-07F
12#endif
13
14Mach1DecodePositional::Mach1DecodePositional() {
15 M1obj = Mach1DecodePositionalCAPI_create();
16}
17
18Mach1DecodePositional::~Mach1DecodePositional() {
19 Mach1DecodePositionalCAPI_delete(M1obj);
20}
21
22void Mach1DecodePositional::setPlatformType(Mach1PlatformType type) {
23 Mach1DecodePositionalCAPI_setPlatformType(M1obj, type);
36}
37
38void Mach1DecodePositional::setDecodeMode(Mach1DecodeMode mode) {
39 Mach1DecodePositionalCAPI_setDecodeMode(M1obj, mode);
46}
47
48void Mach1DecodePositional::setMuteWhenOutsideObject(bool muteWhenOutsideObject) {
49 Mach1DecodePositionalCAPI_setMuteWhenOutsideObject(M1obj, muteWhenOutsideObject);
52}
53
54void Mach1DecodePositional::setMuteWhenInsideObject(bool muteWhenInsideObject) {
55 Mach1DecodePositionalCAPI_setMuteWhenInsideObject(M1obj, muteWhenInsideObject);
58}
59
61 Mach1DecodePositionalCAPI_setUseAttenuation(M1obj, useAttenuation);
65}
66
67void Mach1DecodePositional::setAttenuationCurve(float attenuationCurve) {
68 Mach1DecodePositionalCAPI_setAttenuationCurve(M1obj, attenuationCurve);
73}
74
75void Mach1DecodePositional::setUsePlaneCalculation(bool usePlaneCalculation) {
76 Mach1DecodePositionalCAPI_setUsePlaneCalculation(M1obj, usePlaneCalculation);
83}
84
85void Mach1DecodePositional::setUseYawForRotation(bool useYawForRotation) {
86 Mach1DecodePositionalCAPI_setUseYawForRotation(M1obj, useYawForRotation);
90}
91
92void Mach1DecodePositional::setUsePitchForRotation(bool usePitchForRotation) {
93 Mach1DecodePositionalCAPI_setUsePitchForRotation(M1obj, usePitchForRotation);
97}
98
99void Mach1DecodePositional::setUseRollForRotation(bool useRollForRotation) {
100 Mach1DecodePositionalCAPI_setUseRollForRotation(M1obj, useRollForRotation);
104}
105
107 Mach1DecodePositionalCAPI_setListenerPosition(M1obj, point);
112}
113
115 Mach1DecodePositionalCAPI_setListenerRotation(M1obj, point);
120}
121
123 Mach1DecodePositionalCAPI_setListenerRotationQuat(M1obj, quat);
128}
129
131 Mach1DecodePositionalCAPI_setDecoderAlgoPosition(M1obj, point);
136}
137
139 Mach1DecodePositionalCAPI_setDecoderAlgoRotation(M1obj, point);
144}
145
147 Mach1DecodePositionalCAPI_setDecoderAlgoRotationQuat(M1obj, quat);
152}
153
155 Mach1DecodePositionalCAPI_setDecoderAlgoScale(M1obj, point);
160}
161
162void Mach1DecodePositional::evaluatePositionResults() {
163 Mach1DecodePositionalCAPI_evaluatePositionResults(M1obj);
164}
165
166#ifndef __EMSCRIPTEN__
168 Mach1DecodePositionalCAPI_getCoefficients(M1obj, result);
172}
173#endif
174
175void Mach1DecodePositional::getCoefficients(std::vector<float> &result) {
176 Mach1DecodePositionalCAPI_getCoefficients(M1obj, result.data());
180}
181
183 return Mach1DecodePositionalCAPI_getDist(M1obj);
186}
187
188int Mach1DecodePositional::getFormatChannelCount() {
189 return Mach1DecodePositionalCAPI_getFormatChannelCount(M1obj);
190}
191
192int Mach1DecodePositional::getFormatCoeffCount() {
193 return Mach1DecodePositionalCAPI_getFormatCoeffCount(M1obj);
194}
195
197 return Mach1DecodePositionalCAPI_getCurrentAngle(M1obj);
199}
200
202 return Mach1DecodePositionalCAPI_getCurrentAngleInternal(M1obj);
205}
206
207Mach1Point3D Mach1DecodePositional::getPositionalRotation() {
208 return Mach1DecodePositionalCAPI_getPositionalRotation(M1obj);
209}
210
212 Mach1DecodePositionalCAPI_setFilterSpeed(M1obj, filterSpeed);
219}
220
221Mach1Point3D Mach1DecodePositional::getClosestPointOnPlane() {
222 return Mach1DecodePositionalCAPI_getClosestPointOnPlane(M1obj);
223}
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