mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-14 01:30:03 +02:00
keep a boolean for cursorHidden state, so we know when to hide the VR-mode-cursor while the normal cursor is hidden
This commit is contained in:
parent
9dbcefed2a
commit
de3afa0637
2 changed files with 16 additions and 5 deletions
|
@ -228,6 +228,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
_touchAvgX(0.0f),
|
||||
_touchAvgY(0.0f),
|
||||
_isTouchPressed(false),
|
||||
_cursorVisible(true),
|
||||
_mousePressed(false),
|
||||
_enableProcessOctreeThread(true),
|
||||
_octreeProcessor(),
|
||||
|
@ -1473,6 +1474,8 @@ void Application::setEnableVRMode(bool enableVRMode) {
|
|||
|
||||
auto glCanvas = DependencyManager::get<GLCanvas>();
|
||||
resizeGL(glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight());
|
||||
|
||||
updateCursorVisibility();
|
||||
}
|
||||
|
||||
void Application::setLowVelocityFilter(bool lowVelocityFilter) {
|
||||
|
@ -1943,14 +1946,19 @@ void Application::updateCursor(float deltaTime) {
|
|||
lastMousePos = QCursor::pos();
|
||||
}
|
||||
|
||||
void Application::setCursorVisible(bool visible) {
|
||||
if (visible) {
|
||||
DependencyManager::get<GLCanvas>()->unsetCursor();
|
||||
} else {
|
||||
void Application::updateCursorVisibility() {
|
||||
if (!_cursorVisible || Menu::getInstance()->isOptionChecked(MenuOption::EnableVRMode)) {
|
||||
DependencyManager::get<GLCanvas>()->setCursor(Qt::BlankCursor);
|
||||
} else {
|
||||
DependencyManager::get<GLCanvas>()->unsetCursor();
|
||||
}
|
||||
}
|
||||
|
||||
void Application::setCursorVisible(bool visible) {
|
||||
_cursorVisible = visible;
|
||||
updateCursorVisibility();
|
||||
}
|
||||
|
||||
void Application::update(float deltaTime) {
|
||||
bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
|
||||
PerformanceWarning warn(showWarnings, "Application::update()");
|
||||
|
|
|
@ -186,7 +186,7 @@ public:
|
|||
EntityTreeRenderer* getEntityClipboardRenderer() { return &_entityClipboardRenderer; }
|
||||
|
||||
bool isMousePressed() const { return _mousePressed; }
|
||||
bool isMouseHidden() const { return DependencyManager::get<GLCanvas>()->cursor().shape() == Qt::BlankCursor; }
|
||||
bool isMouseHidden() const { return !_cursorVisible; }
|
||||
const glm::vec3& getMouseRayOrigin() const { return _mouseRayOrigin; }
|
||||
const glm::vec3& getMouseRayDirection() const { return _mouseRayDirection; }
|
||||
bool mouseOnScreen() const;
|
||||
|
@ -404,6 +404,8 @@ private:
|
|||
void updateProjectionMatrix();
|
||||
void updateProjectionMatrix(Camera& camera, bool updateViewFrustum = true);
|
||||
|
||||
void updateCursorVisibility();
|
||||
|
||||
void sendPingPackets();
|
||||
|
||||
void initDisplay();
|
||||
|
@ -515,6 +517,7 @@ private:
|
|||
|
||||
Environment _environment;
|
||||
|
||||
bool _cursorVisible;
|
||||
int _mouseDragStartedX;
|
||||
int _mouseDragStartedY;
|
||||
quint64 _lastMouseMove;
|
||||
|
|
Loading…
Reference in a new issue