mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Added detection of Rift and Vive controllers.
This commit is contained in:
parent
4918f7d186
commit
65d975fe5b
4 changed files with 32 additions and 0 deletions
|
@ -8711,6 +8711,14 @@ void Application::updateLoginDialogOverlayPosition() {
|
|||
}
|
||||
}
|
||||
|
||||
bool Application::hasRiftControllers() {
|
||||
return PluginUtils::isOculusTouchControllerAvailable();
|
||||
}
|
||||
|
||||
bool Application::hasViveControllers() {
|
||||
return PluginUtils::isViveControllerAvailable();
|
||||
}
|
||||
|
||||
void Application::onDismissedLoginDialog() {
|
||||
_loginDialogPoppedUp = false;
|
||||
loginDialogPoppedUp.set(false);
|
||||
|
|
|
@ -326,6 +326,10 @@ public:
|
|||
void createLoginDialogOverlay();
|
||||
void updateLoginDialogOverlayPosition();
|
||||
|
||||
// Check if a headset is connected
|
||||
bool hasRiftControllers();
|
||||
bool hasViveControllers();
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
void beforeEnterBackground();
|
||||
void enterBackground();
|
||||
|
|
|
@ -125,3 +125,11 @@ QString PlatformInfoScriptingInterface::getGraphicsCardType() {
|
|||
return QString("NO IMPLEMENTED");
|
||||
#endif
|
||||
}
|
||||
|
||||
bool PlatformInfoScriptingInterface::hasRiftControllers() {
|
||||
return qApp->hasRiftControllers();
|
||||
}
|
||||
|
||||
bool PlatformInfoScriptingInterface::hasViveControllers() {
|
||||
return qApp->hasViveControllers();
|
||||
}
|
||||
|
|
|
@ -53,6 +53,18 @@ public slots:
|
|||
* @returns {string} graphics card type
|
||||
*/
|
||||
QString getGraphicsCardType();
|
||||
|
||||
/**jsdoc
|
||||
* Returns true if Oculus Rift is connected (looks for hand controllers)
|
||||
* @function Window.hasRift
|
||||
* @returns {boolean} <code>true</code> if running on Windows, otherwise <code>false</code>.*/
|
||||
bool hasRiftControllers();
|
||||
|
||||
/**jsdoc
|
||||
* Returns true if HTC Vive is connected (looks for hand controllers)
|
||||
* @function Window.hasRift
|
||||
* @returns {boolean} <code>true</code> if running on Windows, otherwise <code>false</code>.*/
|
||||
bool hasViveControllers();
|
||||
};
|
||||
|
||||
#endif // hifi_PlatformInfoScriptingInterface_h
|
||||
|
|
Loading…
Reference in a new issue