Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dalai Felinto
virtual_reality_viewport
Commits
7e7d2765
Commit
7e7d2765
authored
Oct 14, 2015
by
Dalai Felinto
Browse files
selective tracking system (ALL, ROTATION, NONE)
parent
30720f33
Changes
1
Hide whitespace changes
Inline
Side-by-side
space_view3d_virtual_reality/hmd/__init__.py
View file @
7e7d2765
...
...
@@ -200,19 +200,30 @@ class HMD_Base:
"""
Update OpenGL drawing matrices
"""
tracking_mode
=
context
.
window_manager
.
virtual_reality
.
tracking_mode
view_matrix
=
self
.
_getViewMatrix
(
context
)
for
i
in
range
(
2
):
if
tracking_mode
==
'NONE'
:
self
.
_modelview_matrix
[
i
]
=
view_matrix
continue
rotation_raw
=
self
.
_eye_orientation_raw
[
i
]
position_raw
=
self
.
_eye_position_raw
[
i
]
rotation
=
Quaternion
(
rotation_raw
).
to_matrix
().
to_4x4
()
# take scene units into consideration
position_raw
=
self
.
_
scaleMovement
(
position_raw
)
if
tracking_mode
==
'ALL'
:
position_raw
=
self
.
_
eye_
position_raw
[
i
]
rotation
=
Quaternion
(
rotation_raw
).
to_matrix
().
to_4x4
()
position
=
Matrix
.
Translation
(
position_raw
)
# take scene units into consideration
position_raw
=
self
.
_scaleMovement
(
position_raw
)
position
=
Matrix
.
Translation
(
position_raw
)
transformation
=
position
*
rotation
transformation
=
position
*
rotation
else
:
# 'ROTATION'
# rotation only, ignore the positional data
transformation
=
rotation
self
.
_modelview_matrix
[
i
]
=
transformation
.
inverted
()
*
view_matrix
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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