mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 08:14:48 +02:00
display plugins are never head controllers
This commit is contained in:
parent
b83620f7c5
commit
ac6135387c
14 changed files with 14 additions and 30 deletions
|
@ -4865,11 +4865,6 @@ bool Application::isHeadControllerEnabled() const {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
foreach(DisplayPluginPointer displayPlugin, PluginManager::getInstance()->getDisplayPlugins()) {
|
||||
if (displayPlugin->isActive() && displayPlugin->isHeadController()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
|||
} else {
|
||||
if (qApp->isHMDMode()) {
|
||||
// get HMD position from sensor space into world space, and back into rig space
|
||||
glm::mat4 worldHMDMat = myAvatar->getHeadControllerPoseInWorldFrame();
|
||||
glm::mat4 worldHMDMat = myAvatar->getHeadControllerPoseInWorldFrame().getMatrix();
|
||||
glm::mat4 rigToWorld = createMatFromQuatAndPos(getRotation(), getTranslation());
|
||||
glm::mat4 worldToRig = glm::inverse(rigToWorld);
|
||||
glm::mat4 rigHMDMat = worldToRig * worldHMDMat;
|
||||
|
|
|
@ -26,8 +26,6 @@ public:
|
|||
|
||||
virtual bool isThrottled() const override;
|
||||
|
||||
virtual bool isHeadController() const override { return false; }
|
||||
|
||||
protected:
|
||||
mutable bool _isThrottled = false;
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@ public:
|
|||
bool beginFrameRender(uint32_t frameIndex) override;
|
||||
float getTargetFrameRate() const override { return 90; }
|
||||
|
||||
virtual bool isHeadController() const override { return false; }
|
||||
|
||||
protected:
|
||||
void updatePresentPose() override;
|
||||
void hmdPresent() override {}
|
||||
|
|
|
@ -25,7 +25,6 @@ class HmdDisplayPlugin : public OpenGLDisplayPlugin {
|
|||
public:
|
||||
~HmdDisplayPlugin();
|
||||
bool isHmd() const override final { return true; }
|
||||
bool isHeadController() const override = 0;
|
||||
float getIPD() const override final { return _ipd; }
|
||||
glm::mat4 getEyeToHeadTransform(Eye eye) const override final { return _eyeOffsets[eye]; }
|
||||
glm::mat4 getEyeProjection(Eye eye, const glm::mat4& baseProjection) const override final { return _eyeProjections[eye]; }
|
||||
|
|
|
@ -17,8 +17,6 @@ public:
|
|||
grouping getGrouping() const override { return ADVANCED; }
|
||||
glm::uvec2 getRecommendedRenderSize() const override;
|
||||
|
||||
virtual bool isHeadController() const override { return false; }
|
||||
|
||||
protected:
|
||||
// initialize OpenGL context settings needed by the plugin
|
||||
void customizeContext() override;
|
||||
|
|
|
@ -19,8 +19,6 @@ public:
|
|||
virtual grouping getGrouping() const override { return ADVANCED; }
|
||||
virtual glm::uvec2 getRecommendedRenderSize() const override;
|
||||
|
||||
virtual bool isHeadController() const override { return false; }
|
||||
|
||||
private:
|
||||
static const QString NAME;
|
||||
};
|
||||
|
|
|
@ -135,7 +135,6 @@ public:
|
|||
|
||||
virtual int getRequiredThreadCount() const { return 0; }
|
||||
virtual bool isHmd() const { return false; }
|
||||
virtual bool isHeadController() const = 0;
|
||||
virtual int getHmdScreen() const { return -1; }
|
||||
/// By default, all HMDs are stereo
|
||||
virtual bool isStereo() const { return isHmd(); }
|
||||
|
|
|
@ -30,11 +30,6 @@ bool PluginUtils::isHeadControllerAvailable(const QString& pluginName) {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
for (auto& displayPlugin : PluginManager::getInstance()->getDisplayPlugins()) {
|
||||
if (displayPlugin->isHeadController() && (pluginName.isEmpty() || displayPlugin->getName() == pluginName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
|
|
@ -210,10 +210,20 @@ void OculusControllerManager::RemoteDevice::focusOutEvent() {
|
|||
_buttonPressedMap.clear();
|
||||
}
|
||||
|
||||
bool OculusControllerManager::isHeadController() const {
|
||||
// this plugin is a head controller if the HMD is mounted.
|
||||
ovrSessionStatus status;
|
||||
|
||||
bool success = OVR_SUCCESS(ovr_GetSessionStatus(_session, &status));
|
||||
if (!success) {
|
||||
return false;
|
||||
}
|
||||
return status.HmdMounted == ovrTrue;
|
||||
}
|
||||
|
||||
void OculusControllerManager::TouchDevice::update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) {
|
||||
_buttonPressedMap.clear();
|
||||
ovrSessionStatus status;
|
||||
if (!OVR_SUCCESS(ovr_GetSessionStatus(_parent._session, &status)) || (ovrFalse == status.HmdMounted)) {
|
||||
if (!_parent.isHeadController()) {
|
||||
// if the HMD isn't on someone's head, don't take input from the controllers
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
const QString getName() const override { return NAME; }
|
||||
|
||||
bool isHandController() const override { return _touch != nullptr; }
|
||||
bool isHeadController() const override { return true; }
|
||||
bool isHeadController() const override;
|
||||
QStringList getSubdeviceNames() override;
|
||||
|
||||
bool activate() override;
|
||||
|
|
|
@ -15,8 +15,6 @@ public:
|
|||
grouping getGrouping() const override { return DEVELOPER; }
|
||||
bool isSupported() const override;
|
||||
|
||||
bool isHeadController() const override { return false; }
|
||||
|
||||
protected:
|
||||
void hmdPresent() override {}
|
||||
bool isHmdMounted() const override { return true; }
|
||||
|
|
|
@ -24,8 +24,6 @@ public:
|
|||
|
||||
virtual QJsonObject getHardwareStats() const;
|
||||
|
||||
bool isHeadController() const override { return true; }
|
||||
|
||||
protected:
|
||||
QThread::Priority getPresentPriority() override { return QThread::TimeCriticalPriority; }
|
||||
|
||||
|
|
|
@ -58,8 +58,6 @@ public:
|
|||
// Possibly needs an additional thread for VR submission
|
||||
int getRequiredThreadCount() const override;
|
||||
|
||||
bool isHeadController() const override { return true; }
|
||||
|
||||
protected:
|
||||
bool internalActivate() override;
|
||||
void internalDeactivate() override;
|
||||
|
|
Loading…
Reference in a new issue