mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:37:49 +02:00
Playing around with using the gyro acceleration to drive the eye offset.
This commit is contained in:
parent
97343edfca
commit
6f552b4a00
2 changed files with 8 additions and 0 deletions
|
@ -1294,6 +1294,10 @@ void Application::updateAvatar(float deltaTime) {
|
||||||
_headMouseY = max(_headMouseY, 0);
|
_headMouseY = max(_headMouseY, 0);
|
||||||
_headMouseY = min(_headMouseY, _glWidget->height());
|
_headMouseY = min(_headMouseY, _glWidget->height());
|
||||||
|
|
||||||
|
_eyeOffsetVelocity += _serialPort.getLastAcceleration() * deltaTime;
|
||||||
|
_myCamera.setEyeOffsetPosition(_myCamera.getEyeOffsetPosition() + _eyeOffsetVelocity * deltaTime);
|
||||||
|
resizeGL(_glWidget->width(), _glWidget->height());
|
||||||
|
|
||||||
if (OculusManager::isConnected()) {
|
if (OculusManager::isConnected()) {
|
||||||
float yaw, pitch, roll;
|
float yaw, pitch, roll;
|
||||||
OculusManager::getEulerAngles(yaw, pitch, roll);
|
OculusManager::getEulerAngles(yaw, pitch, roll);
|
||||||
|
@ -2086,6 +2090,9 @@ void Application::resetSensors() {
|
||||||
QCursor::setPos(_headMouseX, _headMouseY);
|
QCursor::setPos(_headMouseX, _headMouseY);
|
||||||
_myAvatar.reset();
|
_myAvatar.reset();
|
||||||
_myTransmitter.resetLevels();
|
_myTransmitter.resetLevels();
|
||||||
|
_myCamera.setEyeOffsetPosition(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||||
|
_eyeOffsetVelocity = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||||
|
resizeGL(_glWidget->width(), _glWidget->height());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setShortcutsEnabled(QWidget* widget, bool enabled) {
|
static void setShortcutsEnabled(QWidget* widget, bool enabled) {
|
||||||
|
|
|
@ -206,6 +206,7 @@ private:
|
||||||
|
|
||||||
Camera _myCamera; // My view onto the world
|
Camera _myCamera; // My view onto the world
|
||||||
Camera _viewFrustumOffsetCamera; // The camera we use to sometimes show the view frustum from an offset mode
|
Camera _viewFrustumOffsetCamera; // The camera we use to sometimes show the view frustum from an offset mode
|
||||||
|
glm::vec3 _eyeOffsetVelocity;
|
||||||
|
|
||||||
Environment _environment;
|
Environment _environment;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue