Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
acgl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACGL
acgl
Commits
5c1f035e
Commit
5c1f035e
authored
11 years ago
by
Robert Menzel
Browse files
Options
Downloads
Patches
Plain Diff
exposed access to the Rifts quaternions
parent
2a50f6ac
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ACGL/HardwareSupport/SimpleRiftController.hh
+14
-2
14 additions, 2 deletions
include/ACGL/HardwareSupport/SimpleRiftController.hh
src/ACGL/HardwareSupport/SimpleRiftController.cc
+22
-0
22 additions, 0 deletions
src/ACGL/HardwareSupport/SimpleRiftController.cc
with
36 additions
and
2 deletions
include/ACGL/HardwareSupport/SimpleRiftController.hh
+
14
−
2
View file @
5c1f035e
...
...
@@ -12,10 +12,10 @@
*/
#include
<ACGL/ACGL.hh>
//#define ACGL_USE_OCULUS_RIFT
#ifdef ACGL_USE_OCULUS_RIFT
#include
<ACGL/Math/Math.hh>
#include
<glm/gtc/quaternion.hpp>
#include
<ACGL/Scene/HMDCamera.hh>
#include
<ACGL/OpenGL/Objects/Texture.hh>
...
...
@@ -43,7 +43,7 @@ class SimpleRiftController
{
public:
/**
* _riftnumber: which device to use in case multiple are attached
* _riftnumber: which device to use in case multiple are attached
- NOTE: the Rift SDK has problems supporting this yet!
* _performAutomaticMagneticCalibration: try to calibrate the magetometer to reduce drift
* the user has to look into at least four very different directions
* for this to work.
...
...
@@ -80,6 +80,18 @@ public:
void
setFoVMultiplier
(
float
_factor
)
{
mFoVMultiplier
=
_factor
;
updateCameraFoV
();
}
float
getFoVMultiplier
()
{
return
mFoVMultiplier
;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Access to direct sensor data as an alternative to the use of the ACGL camera
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//! get the rotation as a quaternion, the native format of the Rift (with sensor fusion):
glm
::
quat
getFusedRotationQuaternion
();
//! get the rotation as a quaternion, the native format of the Rift (without sensor fusion):
glm
::
quat
getRotationQuaternion
();
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// RAW parameters for distortion rendering:
...
...
This diff is collapsed.
Click to expand it.
src/ACGL/HardwareSupport/SimpleRiftController.cc
+
22
−
0
View file @
5c1f035e
...
...
@@ -161,6 +161,28 @@ void SimpleRiftController::setPrediction( float _seconds )
}
}
glm
::
quat
riftQuatToGLM
(
const
Quatf
&
_q
)
{
glm
::
quat
glmQuat
;
glmQuat
.
x
=
_q
.
x
;
glmQuat
.
y
=
_q
.
y
;
glmQuat
.
z
=
_q
.
z
;
glmQuat
.
w
=
_q
.
w
;
return
glmQuat
;
}
glm
::
quat
SimpleRiftController
::
getFusedRotationQuaternion
()
{
return
riftQuatToGLM
(
mORSensorFusion
->
GetPredictedOrientation
()
);
}
glm
::
quat
SimpleRiftController
::
getRotationQuaternion
()
{
return
riftQuatToGLM
(
mORSensorFusion
->
GetOrientation
()
);
}
glm
::
mat4
SimpleRiftController
::
getProjectionMatrixFromCamera
()
{
if
(
!
mCamera
)
return
glm
::
mat4
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment