mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
Expose HMD worn to scripting
This commit is contained in:
parent
87c9961aa8
commit
75c3fd18c9
2 changed files with 7 additions and 0 deletions
|
@ -92,3 +92,8 @@ glm::quat HMDScriptingInterface::getOrientation() const {
|
|||
}
|
||||
return glm::quat();
|
||||
}
|
||||
|
||||
bool HMDScriptingInterface::isMounted() const{
|
||||
auto displayPlugin = qApp->getActiveDisplayPlugin();
|
||||
return (displayPlugin->isHmd() && displayPlugin->isDisplayVisible());
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ class HMDScriptingInterface : public AbstractHMDScriptingInterface, public Depen
|
|||
Q_OBJECT
|
||||
Q_PROPERTY(glm::vec3 position READ getPosition)
|
||||
Q_PROPERTY(glm::quat orientation READ getOrientation)
|
||||
Q_PROPERTY(bool mounted READ isMounted)
|
||||
|
||||
public:
|
||||
Q_INVOKABLE glm::vec3 calculateRayUICollisionPoint(const glm::vec3& position, const glm::vec3& direction) const;
|
||||
|
@ -39,6 +40,7 @@ public:
|
|||
static QScriptValue getHUDLookAtPosition2D(QScriptContext* context, QScriptEngine* engine);
|
||||
static QScriptValue getHUDLookAtPosition3D(QScriptContext* context, QScriptEngine* engine);
|
||||
|
||||
bool isMounted() const;
|
||||
|
||||
private:
|
||||
// Get the position of the HMD
|
||||
|
|
Loading…
Reference in a new issue