Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
VAMatlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
VAMatlab
Commits
4b1df35b
Commit
4b1df35b
authored
Oct 06, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Starting API adaption
parent
db13fabd
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
417 deletions
+139
-417
src/VAMatlabConnection.cpp
src/VAMatlabConnection.cpp
+2
-2
src/VAMatlabConnection.h
src/VAMatlabConnection.h
+2
-2
src/VAMatlabExecutable.cpp
src/VAMatlabExecutable.cpp
+74
-263
src/VAMatlabHelpers.cpp
src/VAMatlabHelpers.cpp
+46
-128
src/VAMatlabHelpers.h
src/VAMatlabHelpers.h
+0
-6
src/VAMatlabTracking.cpp
src/VAMatlabTracking.cpp
+13
-14
src/VAMatlabTracking.h
src/VAMatlabTracking.h
+2
-2
No files found.
src/VAMatlabConnection.cpp
View file @
4b1df35b
...
...
@@ -14,8 +14,8 @@
#include "VAMatlabConnection.h"
#include "VAMatlabTracking.h"
#include <VA
NetClient
.h>
#include <VA
Core
.h>
#include <VA.h>
#include <VA
Net
.h>
CVAMatlabConnection
::
CVAMatlabConnection
()
{
...
...
src/VAMatlabConnection.h
View file @
4b1df35b
...
...
@@ -18,7 +18,7 @@
#include <string>
#include <vector>
class
IVA
Cor
e
;
class
IVA
Interfac
e
;
class
CVAMatlabTracker
;
class
IVANetClient
;
...
...
@@ -27,7 +27,7 @@ class CVAMatlabConnection
{
public:
IVANetClient
*
pClient
;
IVA
Cor
e
*
pCoreInterface
;
IVA
Interfac
e
*
pCoreInterface
;
CVAMatlabTracker
*
pVAMatlabTracker
;
CVAMatlabConnection
();
...
...
src/VAMatlabExecutable.cpp
View file @
4b1df35b
This diff is collapsed.
Click to expand it.
src/VAMatlabHelpers.cpp
View file @
4b1df35b
...
...
@@ -89,7 +89,7 @@ bool matlabGetBoolScalar( const mxArray* arg, const char* argname )
return
(
*
p
==
true
);
}
if
(
mxIsNumeric
(
arg
)
&&
!
mxIsComplex
(
arg
)
&&
matlabIsScalar
(
arg
)
)
if
(
mxIsNumeric
(
arg
)
&&
!
mxIsComplex
(
arg
)
&&
matlabIsScalar
(
arg
)
)
{
void
*
p
=
mxGetData
(
arg
);
...
...
@@ -102,10 +102,9 @@ bool matlabGetBoolScalar( const mxArray* arg, const char* argname )
// Unsupported datatype
sprintf_s
(
buf
,
buflen
,
"Argument '%s' could not be interpreted as a logical scalar"
,
argname
);
VA_EXCEPT1
(
buf
);
return
false
;
}
if
(
mxIsChar
(
arg
)
&&
matlabIsRowVector
(
arg
)
)
if
(
mxIsChar
(
arg
)
&&
matlabIsRowVector
(
arg
)
)
{
mxGetString
(
arg
,
buf
,
buflen
);
std
::
string
s
(
buf
);
...
...
@@ -122,8 +121,6 @@ bool matlabGetBoolScalar( const mxArray* arg, const char* argname )
sprintf_s
(
buf
,
buflen
,
"Argument '%s' must be a logical scalar"
,
argname
);
VA_EXCEPT1
(
buf
);
return
false
;
}
int
matlabGetIntegerScalar
(
const
mxArray
*
arg
,
const
char
*
argname
)
...
...
@@ -155,13 +152,10 @@ int matlabGetIntegerScalar( const mxArray* arg, const char* argname )
// Unsupported datatype
sprintf_s
(
buf
,
1024
,
"Argument '%s' could not be interpreted as an integer scalar"
,
argname
);
VA_EXCEPT1
(
buf
);
return
-
1
;
}
sprintf_s
(
buf
,
1024
,
"Argument '%s' must be an integer scalar"
,
argname
);
VA_EXCEPT1
(
buf
);
return
-
1
;
}
double
matlabGetRealScalar
(
const
mxArray
*
arg
,
const
char
*
argname
)
...
...
@@ -185,13 +179,10 @@ double matlabGetRealScalar( const mxArray* arg, const char* argname )
// Unsupported datatype
sprintf_s
(
buf
,
1024
,
"Argument '%s' could not be interpreted as a real-valued scalar"
,
argname
);
VA_EXCEPT1
(
buf
);
return
-
1
;
}
sprintf_s
(
buf
,
1024
,
"Argument '%s' must be a real-valued scalar"
,
argname
);
VA_EXCEPT1
(
buf
);
return
-
1
;
}
void
matlabGetRealVector3
(
const
mxArray
*
arg
,
const
char
*
argname
,
double
&
x
,
double
&
y
,
double
&
z
)
...
...
@@ -202,45 +193,45 @@ void matlabGetRealVector3( const mxArray* arg, const char* argname, double& x, d
if
(
mxIsNumeric
(
arg
)
&&
!
mxIsComplex
(
arg
)
&&
matlabIsVector
(
arg
,
size
)
)
if
(
size
==
3
)
{
if
(
mxIsInt16
(
arg
)
)
{
int16_t
*
p
=
(
int16_t
*
)
mxGetData
(
arg
);
x
=
(
double
)
p
[
0
];
y
=
(
double
)
p
[
1
];
z
=
(
double
)
p
[
2
];
return
;
}
if
(
mxIsInt16
(
arg
)
)
{
int16_t
*
p
=
(
int16_t
*
)
mxGetData
(
arg
);
x
=
(
double
)
p
[
0
];
y
=
(
double
)
p
[
1
];
z
=
(
double
)
p
[
2
];
return
;
}
if
(
mxIsInt32
(
arg
)
)
{
int32_t
*
p
=
(
int32_t
*
)
mxGetData
(
arg
);
x
=
(
double
)
p
[
0
];
y
=
(
double
)
p
[
1
];
z
=
(
double
)
p
[
2
];
return
;
}
if
(
mxIsInt32
(
arg
)
)
{
int32_t
*
p
=
(
int32_t
*
)
mxGetData
(
arg
);
x
=
(
double
)
p
[
0
];
y
=
(
double
)
p
[
1
];
z
=
(
double
)
p
[
2
];
return
;
}
if
(
mxIsInt64
(
arg
)
)
{
int64_t
*
p
=
(
int64_t
*
)
mxGetData
(
arg
);
x
=
(
double
)
p
[
0
];
y
=
(
double
)
p
[
1
];
z
=
(
double
)
p
[
2
];
return
;
}
if
(
mxIsInt64
(
arg
)
)
{
int64_t
*
p
=
(
int64_t
*
)
mxGetData
(
arg
);
x
=
(
double
)
p
[
0
];
y
=
(
double
)
p
[
1
];
z
=
(
double
)
p
[
2
];
return
;
}
if
(
mxIsSingle
(
arg
)
)
{
float
*
p
=
(
float
*
)
mxGetData
(
arg
);
x
=
(
double
)
p
[
0
];
y
=
(
double
)
p
[
1
];
z
=
(
double
)
p
[
2
];
return
;
}
if
(
mxIsSingle
(
arg
)
)
{
float
*
p
=
(
float
*
)
mxGetData
(
arg
);
x
=
(
double
)
p
[
0
];
y
=
(
double
)
p
[
1
];
z
=
(
double
)
p
[
2
];
return
;
}
if
(
mxIsDouble
(
arg
)
)
{
double
*
p
=
(
double
*
)
mxGetData
(
arg
);
x
=
p
[
0
];
y
=
p
[
1
];
z
=
p
[
2
];
return
;
}
if
(
mxIsDouble
(
arg
)
)
{
double
*
p
=
(
double
*
)
mxGetData
(
arg
);
x
=
p
[
0
];
y
=
p
[
1
];
z
=
p
[
2
];
return
;
}
}
sprintf_s
(
buf
,
1024
,
"Argument '%s' must be a real-valued vector with exactly three elements"
,
argname
);
...
...
@@ -330,7 +321,6 @@ std::string matlabGetString( const mxArray* arg, const char* argname )
sprintf_s
(
buf
,
1024
,
"Argument '%s' must be a string"
,
argname
);
VA_EXCEPT1
(
buf
);
return
std
::
string
();
}
mxArray
*
matlabCreateRealVector3
(
double
x
,
double
y
,
double
z
)
...
...
@@ -343,7 +333,8 @@ mxArray* matlabCreateRealVector3( double x, double y, double z )
return
p
;
}
mxArray
*
matlabCreateID
(
int
iID
)
{
mxArray
*
matlabCreateID
(
int
iID
)
{
mwSize
d
[
2
]
=
{
1
,
1
};
mxArray
*
p
=
mxCreateNumericArray
(
2
,
d
,
mxINT32_CLASS
,
mxREAL
);
*
(
(
int
*
)
mxGetData
(
p
)
)
=
iID
;
...
...
@@ -367,93 +358,27 @@ mxArray* matlabCreateIDList( const std::vector<int>& viID )
mxArray
*
matlabCreateDirectivityInfo
(
const
CVADirectivityInfo
&
di
)
{
/*
int iID; // ID
std::string sName; // Name (optional)
std::string sFilename; // Filename
double dAlphaResDEG; // Alpha resolution []
double dBetaResDEG; // Beta resolution []
int iReferences; // Number of references
// TODO: Auflsung usw.
*/
const
mwSize
nFields
=
5
;
const
char
*
ppszFieldNames
[]
=
{
"id"
,
"name"
,
"
filename
"
,
"description"
,
"references"
};
const
char
*
ppszFieldNames
[]
=
{
"id"
,
"name"
,
"
class
"
,
"description"
,
"references"
};
mxArray
*
pStruct
=
mxCreateStructMatrix
(
1
,
1
,
nFields
,
ppszFieldNames
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
0
],
matlabCreateID
(
di
.
iID
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
1
],
mxCreateString
(
di
.
sName
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
2
],
m
xCreateString
(
di
.
sFilename
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
2
],
m
atlabCreateID
(
di
.
iClass
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
3
],
mxCreateString
(
di
.
sDesc
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
4
],
mxCreateDoubleScalar
(
di
.
iReferences
)
);
// no of references as double-value in matlab
return
pStruct
;
}
mxArray
*
matlabCreate
HRIRInfo
(
const
CVAHRIRInfo
&
hrir
i
)
mxArray
*
matlabCreate
SignalSourceInfo
(
const
CVASignalSourceInfo
&
ss
i
)
{
/*
int iID; // ID
std::string sName; // Name (optional)
std::string sFilename; // Filename
double dAlphaResDEG; // Alpha resolution []
double dBetaResDEG; // Beta resolution []
int iReferences; // Number of references
// TODO: More fields?
*/
const
mwSize
nFields
=
5
;
const
char
*
ppszFieldNames
[]
=
{
"id"
,
"name"
,
"filename"
,
"alphaResDeg"
,
"betaResDeg"
,
"references"
};
mxArray
*
pStruct
=
mxCreateStructMatrix
(
1
,
1
,
nFields
,
ppszFieldNames
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
0
],
matlabCreateID
(
hriri
.
iID
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
1
],
mxCreateString
(
hriri
.
sName
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
2
],
mxCreateString
(
hriri
.
sFilename
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
3
],
mxCreateString
(
hriri
.
sDesc
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
4
],
mxCreateDoubleScalar
(
hriri
.
iReferences
)
);
// no of references as double-value in matlab
return
pStruct
;
}
mxArray
*
matlabCreateSoundInfo
(
const
CVASoundInfo
&
si
)
{
/*
int iID; // ID
std::string sName; // Name (optional)
std::string sFilename; // Filename
int iLength; // Length [Samples]
double dDuration; // Duration [s]
*/
const
mwSize
nFields
=
5
;
const
char
*
ppszFieldNames
[]
=
{
"id"
,
"name"
,
"filename"
,
"nsamples"
,
"duration"
};
mxArray
*
pStruct
=
mxCreateStructMatrix
(
1
,
1
,
nFields
,
ppszFieldNames
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
0
],
matlabCreateID
(
si
.
iID
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
1
],
mxCreateString
(
si
.
sName
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
2
],
mxCreateString
(
si
.
sFilename
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
3
],
mxCreateDoubleScalar
(
si
.
iLength
)
);
// Anzahl Samples als Double in Matlab
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
4
],
mxCreateDoubleScalar
(
si
.
dDuration
)
);
return
pStruct
;
}
mxArray
*
matlabCreateSignalSourceInfo
(
const
CVASignalSourceInfo
&
ssi
)
{
/*
std::string sID; // ID (z.B. "af1")
std::string sType; // Typ (Datei|Sampler|Gerte-Eingang|Netzwerkstream)
std::string sName; // Name (z.B. "Trompete 1")
std::string sDesc; // Beschreibung
std::string sState; // Zustandsbeschreibung
int iReferences; // Anzahl Referenzen
*/
const
mwSize
nFields
=
6
;
const
char
*
ppszFieldNames
[]
=
{
"id"
,
"type"
,
"name"
,
"description"
,
"state"
,
"references"
};
mxArray
*
pStruct
=
mxCreateStructMatrix
(
1
,
1
,
nFields
,
ppszFieldNames
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
0
],
mxCreateString
(
ssi
.
sID
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
1
],
mxCreate
String
(
ssi
.
sType
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
1
],
mxCreate
DoubleScalar
(
ssi
.
iType
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
2
],
mxCreateString
(
ssi
.
sName
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
3
],
mxCreateString
(
ssi
.
sDesc
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
4
],
mxCreateString
(
ssi
.
sState
.
c_str
()
)
);
...
...
@@ -465,19 +390,12 @@ mxArray* matlabCreateSignalSourceInfo( const CVASignalSourceInfo& ssi ) {
mxArray
*
matlabCreateSceneInfo
(
const
CVASceneInfo
&
sci
)
{
// TODO: Implementieren
/*
//std::string sName; // Name (optional)
//std::string sFilename; // Scene filename (e.g. RAVEN project file)
// TODO: More fields, num polygons, num portals, num rooms, etc.
*/
const
mwSize
nFields
=
2
;
const
char
*
ppszFieldNames
[]
=
{
"
name"
,
"file
name"
};
const
char
*
ppszFieldNames
[]
=
{
"
id"
,
"
name"
};
mxArray
*
pStruct
=
mxCreateStructMatrix
(
1
,
1
,
nFields
,
ppszFieldNames
);
//mxSetField(pStruct, 0, ppszFieldNames[0], mxCreateString(sci.sName.c_str())
);
//mxSetField(pStruct, 0, ppszFieldNames[1], mxCreateString(sci.sFilename.c_str())
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
0
],
mxCreateString
(
sci
.
sID
.
c_str
()
)
);
mxSetField
(
pStruct
,
0
,
ppszFieldNames
[
0
],
mxCreateString
(
sci
.
sName
.
c_str
()
)
);
return
pStruct
;
}
...
...
src/VAMatlabHelpers.h
View file @
4b1df35b
...
...
@@ -72,12 +72,6 @@ mxArray* matlabCreateIDList(const std::vector<int>& viID);
// CVADirectivityInfo in Matlab struct konvertieren
mxArray
*
matlabCreateDirectivityInfo
(
const
CVADirectivityInfo
&
di
);
// CVAHRIRInfo in Matlab struct konvertieren
mxArray
*
matlabCreateHRIRInfo
(
const
CVAHRIRInfo
&
hriri
);
// CVASoundInfo in Matlab struct konvertieren
mxArray
*
matlabCreateSoundInfo
(
const
CVASoundInfo
&
si
);
// CVASignalSourceInfo in Matlab struct konvertieren
mxArray
*
matlabCreateSignalSourceInfo
(
const
CVASignalSourceInfo
&
ssi
);
...
...
src/VAMatlabTracking.cpp
View file @
4b1df35b
...
...
@@ -14,8 +14,7 @@
#include "VAMatlabTracking.h"
#include "VAMatlabConnection.h"
#include <VACore.h>
#include <VAException.h>
#include <VA.h>
// NatNet includes
#include <NatNetTypes.h>
...
...
@@ -29,22 +28,22 @@ void TrackerDataHandler( sFrameOfMocapData* sFrame, void* pUserData )
if
(
!
pVAMatlabTracker
)
return
;
IVA
Cor
e
*
pVACore
=
pVAMatlabTracker
->
pVACore
;
IVA
Interfac
e
*
pVACore
=
pVAMatlabTracker
->
pVACore
;
if
(
!
pVACore
)
return
;
// Listener
int
iTracked
Listen
erID
=
pVAMatlabTracker
->
iTrackedListenerID
;
int
iTracked
Listen
erRigidBodyIndex
=
pVAMatlabTracker
->
iTrackedListenerRigidBodyIndex
;
int
iTracked
Receiv
erID
=
pVAMatlabTracker
->
iTrackedListenerID
;
int
iTracked
Receiv
erRigidBodyIndex
=
pVAMatlabTracker
->
iTrackedListenerRigidBodyIndex
;
if
(
(
iTracked
ListenerID
!=
-
1
)
&&
(
iTrackedListenerRigidBodyIndex
<=
sFrame
->
nRigidBodies
)
&&
(
iTrackedListen
erRigidBodyIndex
>
0
)
)
if
(
(
iTracked
ReceiverID
!=
-
1
)
&&
(
iTrackedReceiverRigidBodyIndex
<=
sFrame
->
nRigidBodies
)
&&
(
iTrackedReceiv
erRigidBodyIndex
>
0
)
)
{
try
{
VistaVector3D
vPosOffsetLocalCoordinateSystem
=
pVAMatlabTracker
->
vTrackedListenerTranslation
;
VistaQuaternion
qOrientRotation
=
pVAMatlabTracker
->
qTrackedListenerRotation
;
const
sRigidBodyData
&
oBodyData
(
sFrame
->
RigidBodies
[
iTracked
Listen
erRigidBodyIndex
-
1
]
);
const
sRigidBodyData
&
oBodyData
(
sFrame
->
RigidBodies
[
iTracked
Receiv
erRigidBodyIndex
-
1
]
);
VistaVector3D
vPosPivotPoint
(
oBodyData
.
x
,
oBodyData
.
y
,
oBodyData
.
z
);
VistaQuaternion
qOrientRaw
(
oBodyData
.
qx
,
oBodyData
.
qy
,
oBodyData
.
qz
,
oBodyData
.
qw
);
...
...
@@ -55,8 +54,8 @@ void TrackerDataHandler( sFrameOfMocapData* sFrame, void* pUserData )
VistaVector3D
vPosOffsetGlobalCoordinateSystem
=
qOrientRigidBody
.
Rotate
(
vPosOffsetLocalCoordinateSystem
);
VistaVector3D
vPosRigidBody
=
vPosPivotPoint
+
vPosOffsetGlobalCoordinateSystem
;
pVACore
->
Set
ListenerPosition
(
iTrackedListenerID
,
vPosRigidBody
[
0
],
vPosRigidBody
[
1
],
vPosRigidBody
[
2
]
);
pVACore
->
Set
ListenerOrientationVU
(
iTrackedListenerID
,
vViewRigidBody
[
0
],
vViewRigidBody
[
1
],
vViewRigidBody
[
2
],
vUpRigidBody
[
0
],
vUpRigidBody
[
1
],
vUpRigidBody
[
2
]
);
pVACore
->
Set
SoundReceiverPosition
(
iTrackedReceiverID
,
VAVec3
(
vPosRigidBody
[
0
],
vPosRigidBody
[
1
],
vPosRigidBody
[
2
]
)
);
pVACore
->
Set
SoundReceiverOrientationVU
(
iTrackedReceiverID
,
VAVec3
(
vViewRigidBody
[
0
],
vViewRigidBody
[
1
],
vViewRigidBody
[
2
]
),
VAVec3
(
vUpRigidBody
[
0
],
vUpRigidBody
[
1
],
vUpRigidBody
[
2
]
)
);
}
catch
(
...
)
{
...
...
@@ -64,10 +63,10 @@ void TrackerDataHandler( sFrameOfMocapData* sFrame, void* pUserData )
}
// Real-world listener
int
iTrackedRealWorld
Listen
erID
=
pVAMatlabTracker
->
iTrackedRealWorldListenerID
;
int
iTrackedRealWorld
SoundReceiv
erID
=
pVAMatlabTracker
->
iTrackedRealWorldListenerID
;
int
iTrackedRealWorldListenerRigidBodyIndex
=
pVAMatlabTracker
->
iTrackedRealWorldListenerRigidBodyIndex
;
if
(
(
iTrackedRealWorld
Listen
erID
!=
-
1
)
&&
(
iTrackedRealWorldListenerRigidBodyIndex
<=
sFrame
->
nRigidBodies
)
&&
(
iTrackedRealWorldListenerRigidBodyIndex
>
0
)
)
if
(
(
iTrackedRealWorld
SoundReceiv
erID
!=
-
1
)
&&
(
iTrackedRealWorldListenerRigidBodyIndex
<=
sFrame
->
nRigidBodies
)
&&
(
iTrackedRealWorldListenerRigidBodyIndex
>
0
)
)
{
try
{
...
...
@@ -85,7 +84,7 @@ void TrackerDataHandler( sFrameOfMocapData* sFrame, void* pUserData )
VistaVector3D
vPosOffsetGlobalCoordinateSystem
=
qOrientRigidBody
.
Rotate
(
vPosOffsetLocalCoordinateSystem
);
VistaVector3D
vPosRigidBody
=
vPosPivotPoint
+
vPosOffsetGlobalCoordinateSystem
;
pVACore
->
Set
ListenerRealWorldHeadPositionOrientationVU
(
iTrackedRealWorldListenerID
,
vPosRigidBody
[
0
],
vPosRigidBody
[
1
],
vPosRigidBody
[
2
],
vViewRigidBody
[
0
],
vViewRigidBody
[
1
],
vViewRigidBody
[
2
],
vUpRigidBody
[
0
],
vUpRigidBody
[
1
],
vUpRigidBody
[
2
]
);
pVACore
->
Set
SoundReceiverRealWorldPositionOrientationVU
(
iTrackedRealWorldSoundReceiverID
,
VAVec3
(
vPosRigidBody
[
0
],
vPosRigidBody
[
1
],
vPosRigidBody
[
2
]
),
VAVec3
(
vViewRigidBody
[
0
],
vViewRigidBody
[
1
],
vViewRigidBody
[
2
]
),
VAVec3
(
vUpRigidBody
[
0
],
vUpRigidBody
[
1
],
vUpRigidBody
[
2
]
)
);
}
catch
(
...
)
{
...
...
@@ -114,8 +113,8 @@ void TrackerDataHandler( sFrameOfMocapData* sFrame, void* pUserData )
VistaVector3D
vPosOffsetGlobalCoordinateSystem
=
qOrientRigidBody
.
Rotate
(
vPosOffsetLocalCoordinateSystem
);
VistaVector3D
vPosRigidBody
=
vPosPivotPoint
+
vPosOffsetGlobalCoordinateSystem
;
pVACore
->
SetSoundSourcePosition
(
iTrackedSourceID
,
vPosRigidBody
[
0
],
vPosRigidBody
[
1
],
vPosRigidBody
[
2
]
);
pVACore
->
SetSoundSourceOrientationVU
(
iTrackedSourceID
,
vViewRigidBody
[
0
],
vViewRigidBody
[
1
],
vViewRigidBody
[
2
],
vUpRigidBody
[
0
],
vUpRigidBody
[
1
],
vUpRigidBody
[
2
]
);
pVACore
->
SetSoundSourcePosition
(
iTrackedSourceID
,
VAVec3
(
vPosRigidBody
[
0
],
vPosRigidBody
[
1
],
vPosRigidBody
[
2
]
)
);
pVACore
->
SetSoundSourceOrientationVU
(
iTrackedSourceID
,
VAVec3
(
vViewRigidBody
[
0
],
vViewRigidBody
[
1
],
vViewRigidBody
[
2
]
),
VAVec3
(
vUpRigidBody
[
0
],
vUpRigidBody
[
1
],
vUpRigidBody
[
2
]
)
);
}
catch
(
...
)
{
...
...
src/VAMatlabTracking.h
View file @
4b1df35b
...
...
@@ -23,7 +23,7 @@
#include <VistaBase/VistaQuaternion.h>
class
NatNetClient
;
class
IVA
Cor
e
;
class
IVA
Interfac
e
;
//! Wrapper class for NatNet tracking client
class
CVAMatlabTracker
...
...
@@ -35,7 +35,7 @@ public:
bool
Uninitialize
();
bool
IsConnected
()
const
;
IVA
Cor
e
*
pVACore
;
//!< Pointer to (networked) core instance
IVA
Interfac
e
*
pVACore
;
//!< Pointer to (networked) core instance
int
iTrackedListenerID
;
//!< -1 if deactivated, will be preferred over source
int
iTrackedListenerRigidBodyIndex
;
//!< Starts with 1 (default)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment