mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 00:17:25 +02:00
Added display head mouse option (default off) and all camera modes follow head gyros the same way.
This commit is contained in:
parent
eb15aa602c
commit
32d2418b7a
2 changed files with 7 additions and 7 deletions
|
@ -57,8 +57,6 @@ const glm::vec3 START_LOCATION(0.f, 0.f, 0.f); // Where one's own agent begin
|
||||||
|
|
||||||
const int IDLE_SIMULATE_MSECS = 16; // How often should call simulate and other stuff
|
const int IDLE_SIMULATE_MSECS = 16; // How often should call simulate and other stuff
|
||||||
// in the idle loop? (60 FPS is default)
|
// in the idle loop? (60 FPS is default)
|
||||||
|
|
||||||
const bool DISPLAY_HEAD_MOUSE = true;
|
|
||||||
|
|
||||||
// customized canvas that simply forwards requests/events to the singleton application
|
// customized canvas that simply forwards requests/events to the singleton application
|
||||||
class GLCanvas : public QGLWidget {
|
class GLCanvas : public QGLWidget {
|
||||||
|
@ -319,12 +317,11 @@ void Application::paintGL() {
|
||||||
}
|
}
|
||||||
} else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
|
} else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
|
||||||
_myCamera.setTargetPosition(_myAvatar.getHeadPosition());
|
_myCamera.setTargetPosition(_myAvatar.getHeadPosition());
|
||||||
_myCamera.setTargetRotation(_myAvatar.getBodyYaw(),
|
_myCamera.setTargetRotation(_myAvatar.getAbsoluteHeadYaw(),
|
||||||
0.0f,
|
_myAvatar.getAbsoluteHeadPitch(),
|
||||||
//-_myAvatar.getAbsoluteHeadPitch(),
|
|
||||||
0.0f);
|
0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// important...
|
// important...
|
||||||
_myCamera.update( 1.f/_fps );
|
_myCamera.update( 1.f/_fps );
|
||||||
|
|
||||||
|
@ -1203,6 +1200,8 @@ void Application::initMenu() {
|
||||||
_gyroLook->setChecked(true);
|
_gyroLook->setChecked(true);
|
||||||
(_mouseLook = optionsMenu->addAction("Mouse Look"))->setCheckable(true);
|
(_mouseLook = optionsMenu->addAction("Mouse Look"))->setCheckable(true);
|
||||||
_mouseLook->setChecked(false);
|
_mouseLook->setChecked(false);
|
||||||
|
(_showHeadMouse = optionsMenu->addAction("Head Mouse"))->setCheckable(true);
|
||||||
|
_showHeadMouse->setChecked(false);
|
||||||
(_transmitterDrives = optionsMenu->addAction("Transmitter Drive"))->setCheckable(true);
|
(_transmitterDrives = optionsMenu->addAction("Transmitter Drive"))->setCheckable(true);
|
||||||
_transmitterDrives->setChecked(true);
|
_transmitterDrives->setChecked(true);
|
||||||
|
|
||||||
|
@ -1747,7 +1746,7 @@ void Application::displayOverlay() {
|
||||||
|
|
||||||
//noiseTest(_glWidget->width(), _glWidget->height());
|
//noiseTest(_glWidget->width(), _glWidget->height());
|
||||||
|
|
||||||
if (DISPLAY_HEAD_MOUSE && !_lookingInMirror->isChecked() && USING_INVENSENSE_MPU9150) {
|
if (_showHeadMouse->isChecked() && !_lookingInMirror->isChecked() && USING_INVENSENSE_MPU9150) {
|
||||||
// Display small target box at center or head mouse target that can also be used to measure LOD
|
// Display small target box at center or head mouse target that can also be used to measure LOD
|
||||||
glColor3f(1.0, 1.0, 1.0);
|
glColor3f(1.0, 1.0, 1.0);
|
||||||
glDisable(GL_LINE_SMOOTH);
|
glDisable(GL_LINE_SMOOTH);
|
||||||
|
|
|
@ -138,6 +138,7 @@ private:
|
||||||
QAction* _lookingInMirror; // Are we currently rendering one's own head as if in mirror?
|
QAction* _lookingInMirror; // Are we currently rendering one's own head as if in mirror?
|
||||||
QAction* _gyroLook; // Whether to allow the gyro data from head to move your view
|
QAction* _gyroLook; // Whether to allow the gyro data from head to move your view
|
||||||
QAction* _mouseLook; // Whether the have the mouse near edge of screen move your view
|
QAction* _mouseLook; // Whether the have the mouse near edge of screen move your view
|
||||||
|
QAction* _showHeadMouse; // Whether the have the mouse near edge of screen move your view
|
||||||
QAction* _transmitterDrives; // Whether to have Transmitter data move/steer the Avatar
|
QAction* _transmitterDrives; // Whether to have Transmitter data move/steer the Avatar
|
||||||
QAction* _renderVoxels; // Whether to render voxels
|
QAction* _renderVoxels; // Whether to render voxels
|
||||||
QAction* _renderVoxelTextures; // Whether to render noise textures on voxels
|
QAction* _renderVoxelTextures; // Whether to render noise textures on voxels
|
||||||
|
|
Loading…
Reference in a new issue