Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
VAUnity
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
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
VAUnity
Commits
b0a1c5b6
Commit
b0a1c5b6
authored
Dec 06, 2018
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding sound receiver tracking (aka real world pose in VA)
parent
db7e14a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
VAUSoundReceiverTracking.cs
VAUSoundReceiverTracking.cs
+43
-0
No files found.
VAUSoundReceiverTracking.cs
0 → 100644
View file @
b0a1c5b6
using
UnityEngine
;
using
System.Linq
;
using
System.Collections
;
using
VA
;
public
class
VAUSoundReceiverTracking
:
MonoBehaviour
{
[
Tooltip
(
"Set the corresponding receiver that should be updated"
)]
public
VAUSoundReceiver
Receiver
=
null
;
void
Start
()
{
if
(
Receiver
&&
Receiver
.
ID
>
0
)
SetSoundReceiverRealWorldHeadPose
();
}
void
OnEnable
()
{
}
void
Update
()
{
if
(
Receiver
&&
Receiver
.
ID
>
0
)
SetSoundReceiverRealWorldHeadPose
();
}
protected
void
SetSoundReceiverRealWorldHeadPose
()
{
Vector3
p
=
GetComponent
<
Transform
>().
transform
.
position
;
// Unity coordinate system
VAVec3
v3PosOpenGL
=
new
VAVec3
(
p
.
x
,
p
.
y
,
-
p
.
z
);
// OpenGL coordinate system
Quaternion
q
=
GetComponent
<
Transform
>().
transform
.
rotation
;
// Unity coordinate system
VAQuat
qOrientOpenGL
=
new
VAQuat
(
q
.
x
,
q
.
y
,
-
q
.
z
,
q
.
w
);
// OpenGL coordinate system
VAUAdapter
.
VA
.
SetSoundReceiverRealWorldHeadPose
(
Receiver
.
ID
,
v3PosOpenGL
,
qOrientOpenGL
);
Debug
.
Log
(
"performed update, new q:"
+
p
+
q
);
}
private
void
OnDestroy
()
{
}
}
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