mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 02:37:12 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into fix-include-race
This commit is contained in:
commit
28d1b5430d
42 changed files with 123 additions and 123 deletions
|
@ -16,6 +16,7 @@ if (HIFI_MEMORY_DEBUGGING)
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -U_FORTIFY_SOURCE -fno-stack-protector -fno-omit-frame-pointer")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -U_FORTIFY_SOURCE -fno-stack-protector -fno-omit-frame-pointer")
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libasan -static-libstdc++ -fsanitize=address")
|
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libasan -static-libstdc++ -fsanitize=address")
|
||||||
|
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libasan -static-libstdc++ -fsanitize=address")
|
||||||
endif (UNIX)
|
endif (UNIX)
|
||||||
endif ()
|
endif ()
|
||||||
endmacro(SETUP_MEMORY_DEBUGGER)
|
endmacro(SETUP_MEMORY_DEBUGGER)
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Basic2DWindowOpenGLDisplayPlugin : public OpenGLDisplayPlugin {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
using Parent = OpenGLDisplayPlugin;
|
using Parent = OpenGLDisplayPlugin;
|
||||||
public:
|
public:
|
||||||
virtual const QString& getName() const override { return NAME; }
|
virtual const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
virtual float getTargetFrameRate() const override { return _framerateTarget ? (float) _framerateTarget : TARGET_FRAMERATE_Basic2DWindowOpenGL; }
|
virtual float getTargetFrameRate() const override { return _framerateTarget ? (float) _framerateTarget : TARGET_FRAMERATE_Basic2DWindowOpenGL; }
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
class NullDisplayPlugin : public DisplayPlugin {
|
class NullDisplayPlugin : public DisplayPlugin {
|
||||||
public:
|
public:
|
||||||
~NullDisplayPlugin() final {}
|
~NullDisplayPlugin() final {}
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
grouping getGrouping() const override { return DEVELOPER; }
|
grouping getGrouping() const override { return DEVELOPER; }
|
||||||
|
|
||||||
glm::uvec2 getRecommendedRenderSize() const override;
|
glm::uvec2 getRecommendedRenderSize() const override;
|
||||||
|
|
|
@ -758,7 +758,6 @@ void OpenGLDisplayPlugin::render(std::function<void(gpu::Batch& batch)> f) {
|
||||||
|
|
||||||
|
|
||||||
OpenGLDisplayPlugin::~OpenGLDisplayPlugin() {
|
OpenGLDisplayPlugin::~OpenGLDisplayPlugin() {
|
||||||
qDebug() << "Destroying OpenGLDisplayPlugin";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLDisplayPlugin::updateCompositeFramebuffer() {
|
void OpenGLDisplayPlugin::updateCompositeFramebuffer() {
|
||||||
|
|
|
@ -13,7 +13,7 @@ class DebugHmdDisplayPlugin : public HmdDisplayPlugin {
|
||||||
using Parent = HmdDisplayPlugin;
|
using Parent = HmdDisplayPlugin;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
grouping getGrouping() const override { return DEVELOPER; }
|
grouping getGrouping() const override { return DEVELOPER; }
|
||||||
|
|
||||||
bool isSupported() const override;
|
bool isSupported() const override;
|
||||||
|
|
|
@ -13,7 +13,7 @@ class InterleavedStereoDisplayPlugin : public StereoDisplayPlugin {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
using Parent = StereoDisplayPlugin;
|
using Parent = StereoDisplayPlugin;
|
||||||
public:
|
public:
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
grouping getGrouping() const override { return ADVANCED; }
|
grouping getGrouping() const override { return ADVANCED; }
|
||||||
glm::uvec2 getRecommendedRenderSize() const override;
|
glm::uvec2 getRecommendedRenderSize() const override;
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ class SideBySideStereoDisplayPlugin : public StereoDisplayPlugin {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
using Parent = StereoDisplayPlugin;
|
using Parent = StereoDisplayPlugin;
|
||||||
public:
|
public:
|
||||||
virtual const QString& getName() const override { return NAME; }
|
virtual const QString getName() const override { return NAME; }
|
||||||
virtual grouping getGrouping() const override { return ADVANCED; }
|
virtual grouping getGrouping() const override { return ADVANCED; }
|
||||||
virtual glm::uvec2 getRecommendedRenderSize() const override;
|
virtual glm::uvec2 getRecommendedRenderSize() const override;
|
||||||
|
|
||||||
|
|
|
@ -285,10 +285,10 @@ GL45Texture::GL45Texture(const std::weak_ptr<GLBackend>& backend, const Texture&
|
||||||
}
|
}
|
||||||
|
|
||||||
GL45Texture::~GL45Texture() {
|
GL45Texture::~GL45Texture() {
|
||||||
// External textures cycle very quickly, so don't spam the log with messages about them.
|
// // External textures cycle very quickly, so don't spam the log with messages about them.
|
||||||
if (!_gpuObject.getUsage().isExternal()) {
|
// if (!_gpuObject.getUsage().isExternal()) {
|
||||||
qCDebug(gpugl45logging) << "Destroying texture " << _id << " from source " << _source.c_str();
|
// qCDebug(gpugl45logging) << "Destroying texture " << _id << " from source " << _source.c_str();
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Remove this texture from the candidate list of derezzable textures
|
// Remove this texture from the candidate list of derezzable textures
|
||||||
if (_transferrable) {
|
if (_transferrable) {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include <PathUtils.h>
|
#include <PathUtils.h>
|
||||||
#include <NumericalConstants.h>
|
#include <NumericalConstants.h>
|
||||||
|
|
||||||
const QString KeyboardMouseDevice::NAME = "Keyboard/Mouse";
|
const char* KeyboardMouseDevice::NAME = "Keyboard/Mouse";
|
||||||
bool KeyboardMouseDevice::_enableTouch = true;
|
bool KeyboardMouseDevice::_enableTouch = true;
|
||||||
|
|
||||||
void KeyboardMouseDevice::pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) {
|
void KeyboardMouseDevice::pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) {
|
||||||
|
|
|
@ -66,7 +66,7 @@ public:
|
||||||
|
|
||||||
// Plugin functions
|
// Plugin functions
|
||||||
bool isSupported() const override { return true; }
|
bool isSupported() const override { return true; }
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
bool isHandController() const override { return false; }
|
bool isHandController() const override { return false; }
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public:
|
||||||
|
|
||||||
static void enableTouch(bool enableTouch) { _enableTouch = enableTouch; }
|
static void enableTouch(bool enableTouch) { _enableTouch = enableTouch; }
|
||||||
|
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <PathUtils.h>
|
#include <PathUtils.h>
|
||||||
#include <NumericalConstants.h>
|
#include <NumericalConstants.h>
|
||||||
|
|
||||||
const QString TouchscreenDevice::NAME = "Touchscreen";
|
const char* TouchscreenDevice::NAME = "Touchscreen";
|
||||||
|
|
||||||
bool TouchscreenDevice::isSupported() const {
|
bool TouchscreenDevice::isSupported() const {
|
||||||
for (auto touchDevice : QTouchDevice::devices()) {
|
for (auto touchDevice : QTouchDevice::devices()) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
|
|
||||||
// Plugin functions
|
// Plugin functions
|
||||||
virtual bool isSupported() const override;
|
virtual bool isSupported() const override;
|
||||||
virtual const QString& getName() const override { return NAME; }
|
virtual const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
bool isHandController() const override { return false; }
|
bool isHandController() const override { return false; }
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public:
|
||||||
void touchUpdateEvent(const QTouchEvent* event);
|
void touchUpdateEvent(const QTouchEvent* event);
|
||||||
void touchGestureEvent(const QGestureEvent* event);
|
void touchGestureEvent(const QGestureEvent* event);
|
||||||
|
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
//
|
//
|
||||||
#include "Plugin.h"
|
#include "Plugin.h"
|
||||||
|
|
||||||
QString Plugin::UNKNOWN_PLUGIN_ID("unknown");
|
const char* Plugin::UNKNOWN_PLUGIN_ID { "unknown" };
|
||||||
|
|
||||||
void Plugin::setContainer(PluginContainer* container) {
|
void Plugin::setContainer(PluginContainer* container) {
|
||||||
_container = container;
|
_container = container;
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Plugin : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/// \return human-readable name
|
/// \return human-readable name
|
||||||
virtual const QString& getName() const = 0;
|
virtual const QString getName() const = 0;
|
||||||
|
|
||||||
typedef enum { STANDARD, ADVANCED, DEVELOPER } grouping;
|
typedef enum { STANDARD, ADVANCED, DEVELOPER } grouping;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ public:
|
||||||
virtual grouping getGrouping() const { return STANDARD; }
|
virtual grouping getGrouping() const { return STANDARD; }
|
||||||
|
|
||||||
/// \return string ID (not necessarily human-readable)
|
/// \return string ID (not necessarily human-readable)
|
||||||
virtual const QString& getID() const { assert(false); return UNKNOWN_PLUGIN_ID; }
|
virtual const QString getID() const { assert(false); return UNKNOWN_PLUGIN_ID; }
|
||||||
|
|
||||||
virtual bool isSupported() const;
|
virtual bool isSupported() const;
|
||||||
|
|
||||||
|
@ -74,6 +74,6 @@ signals:
|
||||||
protected:
|
protected:
|
||||||
bool _active { false };
|
bool _active { false };
|
||||||
PluginContainer* _container { nullptr };
|
PluginContainer* _container { nullptr };
|
||||||
static QString UNKNOWN_PLUGIN_ID;
|
static const char* UNKNOWN_PLUGIN_ID;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -162,9 +162,10 @@ static const uint32_t blue = toRGBA(0, 0, 255, 255);
|
||||||
|
|
||||||
const int NUM_CIRCLE_SLICES = 24;
|
const int NUM_CIRCLE_SLICES = 24;
|
||||||
|
|
||||||
static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius, AnimDebugDrawData::Vertex*& v) {
|
static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius, glm::vec4& vecColor, AnimDebugDrawData::Vertex*& v) {
|
||||||
|
|
||||||
const float XYZ_AXIS_LENGTH = radius * 4.0f;
|
const float XYZ_AXIS_LENGTH = radius * 4.0f;
|
||||||
|
const uint32_t color = toRGBA(vecColor);
|
||||||
|
|
||||||
AnimPose finalPose = rootPose * pose;
|
AnimPose finalPose = rootPose * pose;
|
||||||
glm::vec3 base = rootPose * pose.trans;
|
glm::vec3 base = rootPose * pose.trans;
|
||||||
|
@ -192,10 +193,10 @@ static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius
|
||||||
// x-ring
|
// x-ring
|
||||||
for (int i = 0; i < NUM_CIRCLE_SLICES; i++) {
|
for (int i = 0; i < NUM_CIRCLE_SLICES; i++) {
|
||||||
v->pos = xRing[i];
|
v->pos = xRing[i];
|
||||||
v->rgba = red;
|
v->rgba = color;
|
||||||
v++;
|
v++;
|
||||||
v->pos = xRing[i + 1];
|
v->pos = xRing[i + 1];
|
||||||
v->rgba = red;
|
v->rgba = color;
|
||||||
v++;
|
v++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,10 +211,10 @@ static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius
|
||||||
// y-ring
|
// y-ring
|
||||||
for (int i = 0; i < NUM_CIRCLE_SLICES; i++) {
|
for (int i = 0; i < NUM_CIRCLE_SLICES; i++) {
|
||||||
v->pos = yRing[i];
|
v->pos = yRing[i];
|
||||||
v->rgba = green;
|
v->rgba = color;
|
||||||
v++;
|
v++;
|
||||||
v->pos = yRing[i + 1];
|
v->pos = yRing[i + 1];
|
||||||
v->rgba = green;
|
v->rgba = color;
|
||||||
v++;
|
v++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,10 +229,10 @@ static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius
|
||||||
// z-ring
|
// z-ring
|
||||||
for (int i = 0; i < NUM_CIRCLE_SLICES; i++) {
|
for (int i = 0; i < NUM_CIRCLE_SLICES; i++) {
|
||||||
v->pos = zRing[i];
|
v->pos = zRing[i];
|
||||||
v->rgba = blue;
|
v->rgba = color;
|
||||||
v++;
|
v++;
|
||||||
v->pos = zRing[i + 1];
|
v->pos = zRing[i + 1];
|
||||||
v->rgba = blue;
|
v->rgba = color;
|
||||||
v++;
|
v++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -367,7 +368,7 @@ void AnimDebugDraw::update() {
|
||||||
const float radius = BONE_RADIUS / (absPoses[i].scale.x * rootPose.scale.x);
|
const float radius = BONE_RADIUS / (absPoses[i].scale.x * rootPose.scale.x);
|
||||||
|
|
||||||
// draw bone
|
// draw bone
|
||||||
addBone(rootPose, absPoses[i], radius, v);
|
addBone(rootPose, absPoses[i], radius, color, v);
|
||||||
|
|
||||||
// draw link to parent
|
// draw link to parent
|
||||||
auto parentIndex = skeleton->getParentIndex(i);
|
auto parentIndex = skeleton->getParentIndex(i);
|
||||||
|
@ -382,20 +383,18 @@ void AnimDebugDraw::update() {
|
||||||
for (auto& iter : markerMap) {
|
for (auto& iter : markerMap) {
|
||||||
glm::quat rot = std::get<0>(iter.second);
|
glm::quat rot = std::get<0>(iter.second);
|
||||||
glm::vec3 pos = std::get<1>(iter.second);
|
glm::vec3 pos = std::get<1>(iter.second);
|
||||||
glm::vec4 color = std::get<2>(iter.second); // TODO: currently ignored.
|
glm::vec4 color = std::get<2>(iter.second);
|
||||||
Q_UNUSED(color);
|
|
||||||
const float radius = POSE_RADIUS;
|
const float radius = POSE_RADIUS;
|
||||||
addBone(AnimPose::identity, AnimPose(glm::vec3(1), rot, pos), radius, v);
|
addBone(AnimPose::identity, AnimPose(glm::vec3(1), rot, pos), radius, color, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimPose myAvatarPose(glm::vec3(1), DebugDraw::getInstance().getMyAvatarRot(), DebugDraw::getInstance().getMyAvatarPos());
|
AnimPose myAvatarPose(glm::vec3(1), DebugDraw::getInstance().getMyAvatarRot(), DebugDraw::getInstance().getMyAvatarPos());
|
||||||
for (auto& iter : myAvatarMarkerMap) {
|
for (auto& iter : myAvatarMarkerMap) {
|
||||||
glm::quat rot = std::get<0>(iter.second);
|
glm::quat rot = std::get<0>(iter.second);
|
||||||
glm::vec3 pos = std::get<1>(iter.second);
|
glm::vec3 pos = std::get<1>(iter.second);
|
||||||
glm::vec4 color = std::get<2>(iter.second); // TODO: currently ignored.
|
glm::vec4 color = std::get<2>(iter.second);
|
||||||
Q_UNUSED(color);
|
|
||||||
const float radius = POSE_RADIUS;
|
const float radius = POSE_RADIUS;
|
||||||
addBone(myAvatarPose, AnimPose(glm::vec3(1), rot, pos), radius, v);
|
addBone(myAvatarPose, AnimPose(glm::vec3(1), rot, pos), radius, color, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw rays from shared DebugDraw singleton
|
// draw rays from shared DebugDraw singleton
|
||||||
|
|
|
@ -1172,7 +1172,8 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac
|
||||||
// Guard against meaningless query and fragment parts.
|
// Guard against meaningless query and fragment parts.
|
||||||
// Do NOT use PreferLocalFile as its behavior is unpredictable (e.g., on defaultScriptsLocation())
|
// Do NOT use PreferLocalFile as its behavior is unpredictable (e.g., on defaultScriptsLocation())
|
||||||
const auto strippingFlags = QUrl::RemoveFilename | QUrl::RemoveQuery | QUrl::RemoveFragment;
|
const auto strippingFlags = QUrl::RemoveFilename | QUrl::RemoveQuery | QUrl::RemoveFragment;
|
||||||
for (QString file : includeFiles) {
|
for (QString includeFile : includeFiles) {
|
||||||
|
QString file = ResourceManager::normalizeURL(includeFile);
|
||||||
QUrl thisURL;
|
QUrl thisURL;
|
||||||
bool isStandardLibrary = false;
|
bool isStandardLibrary = false;
|
||||||
if (file.startsWith("/~/")) {
|
if (file.startsWith("/~/")) {
|
||||||
|
|
|
@ -23,12 +23,12 @@ namespace hifi {
|
||||||
using Builder = std::function<Pointer()>;
|
using Builder = std::function<Pointer()>;
|
||||||
using BuilderMap = std::map<Key, Builder>;
|
using BuilderMap = std::map<Key, Builder>;
|
||||||
|
|
||||||
void registerBuilder(const Key& name, Builder builder) {
|
void registerBuilder(const Key name, Builder builder) {
|
||||||
// FIXME don't allow name collisions
|
// FIXME don't allow name collisions
|
||||||
_builders[name] = builder;
|
_builders[name] = builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
Pointer create(const Key& name) const {
|
Pointer create(const Key name) const {
|
||||||
const auto& entryIt = _builders.find(name);
|
const auto& entryIt = _builders.find(name);
|
||||||
if (entryIt != _builders.end()) {
|
if (entryIt != _builders.end()) {
|
||||||
return (*entryIt).second();
|
return (*entryIt).second();
|
||||||
|
@ -39,7 +39,7 @@ namespace hifi {
|
||||||
template <typename Impl>
|
template <typename Impl>
|
||||||
class Registrar {
|
class Registrar {
|
||||||
public:
|
public:
|
||||||
Registrar(const Key& name, SimpleFactory& factory) {
|
Registrar(const Key name, SimpleFactory& factory) {
|
||||||
factory.registerBuilder(name, [] { return std::make_shared<Impl>(); });
|
factory.registerBuilder(name, [] { return std::make_shared<Impl>(); });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#include "HiFiCodec.h"
|
#include "HiFiCodec.h"
|
||||||
|
|
||||||
const QString HiFiCodec::NAME = "hifiAC";
|
const char* HiFiCodec::NAME { "hifiAC" };
|
||||||
|
|
||||||
void HiFiCodec::init() {
|
void HiFiCodec::init() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ class HiFiCodec : public CodecPlugin {
|
||||||
public:
|
public:
|
||||||
// Plugin functions
|
// Plugin functions
|
||||||
bool isSupported() const override;
|
bool isSupported() const override;
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
void deinit() override;
|
void deinit() override;
|
||||||
|
@ -36,7 +36,7 @@ public:
|
||||||
virtual void releaseDecoder(Decoder* decoder) override;
|
virtual void releaseDecoder(Decoder* decoder) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_HiFiCodec_h
|
#endif // hifi_HiFiCodec_h
|
||||||
|
|
|
@ -27,8 +27,8 @@ Q_LOGGING_CATEGORY(inputplugins, "hifi.inputplugins")
|
||||||
|
|
||||||
#include <NeuronDataReader.h>
|
#include <NeuronDataReader.h>
|
||||||
|
|
||||||
const QString NeuronPlugin::NAME = "Neuron";
|
const char* NeuronPlugin::NAME = "Neuron";
|
||||||
const QString NeuronPlugin::NEURON_ID_STRING = "Perception Neuron";
|
const char* NeuronPlugin::NEURON_ID_STRING = "Perception Neuron";
|
||||||
|
|
||||||
// indices of joints of the Neuron standard skeleton.
|
// indices of joints of the Neuron standard skeleton.
|
||||||
// This is 'almost' the same as the High Fidelity standard skeleton.
|
// This is 'almost' the same as the High Fidelity standard skeleton.
|
||||||
|
|
|
@ -29,8 +29,8 @@ public:
|
||||||
|
|
||||||
// Plugin functions
|
// Plugin functions
|
||||||
virtual bool isSupported() const override;
|
virtual bool isSupported() const override;
|
||||||
virtual const QString& getName() const override { return NAME; }
|
virtual const QString getName() const override { return NAME; }
|
||||||
const QString& getID() const override { return NEURON_ID_STRING; }
|
const QString getID() const override { return NEURON_ID_STRING; }
|
||||||
|
|
||||||
virtual bool activate() override;
|
virtual bool activate() override;
|
||||||
virtual void deactivate() override;
|
virtual void deactivate() override;
|
||||||
|
@ -65,8 +65,8 @@ protected:
|
||||||
|
|
||||||
std::shared_ptr<InputDevice> _inputDevice { std::make_shared<InputDevice>() };
|
std::shared_ptr<InputDevice> _inputDevice { std::make_shared<InputDevice>() };
|
||||||
|
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
static const QString NEURON_ID_STRING;
|
static const char* NEURON_ID_STRING;
|
||||||
|
|
||||||
std::string _serverAddress;
|
std::string _serverAddress;
|
||||||
int _serverPort;
|
int _serverPort;
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Joystick : public QObject, public controller::InputDevice {
|
||||||
public:
|
public:
|
||||||
using Pointer = std::shared_ptr<Joystick>;
|
using Pointer = std::shared_ptr<Joystick>;
|
||||||
|
|
||||||
const QString& getName() const { return _name; }
|
const QString getName() const { return _name; }
|
||||||
|
|
||||||
SDL_GameController* getGameController() { return _sdlGameController; }
|
SDL_GameController* getGameController() { return _sdlGameController; }
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ static_assert(
|
||||||
"SDL2 equvalence: Enums and values from StandardControls.h are assumed to match enums from SDL_gamecontroller.h");
|
"SDL2 equvalence: Enums and values from StandardControls.h are assumed to match enums from SDL_gamecontroller.h");
|
||||||
|
|
||||||
|
|
||||||
const QString SDL2Manager::NAME = "SDL2";
|
const char* SDL2Manager::NAME = "SDL2";
|
||||||
|
|
||||||
SDL_JoystickID SDL2Manager::getInstanceId(SDL_GameController* controller) {
|
SDL_JoystickID SDL2Manager::getInstanceId(SDL_GameController* controller) {
|
||||||
SDL_Joystick* joystick = SDL_GameControllerGetJoystick(controller);
|
SDL_Joystick* joystick = SDL_GameControllerGetJoystick(controller);
|
||||||
|
|
|
@ -24,7 +24,7 @@ class SDL2Manager : public InputPlugin {
|
||||||
public:
|
public:
|
||||||
// Plugin functions
|
// Plugin functions
|
||||||
bool isSupported() const override;
|
bool isSupported() const override;
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
QStringList getSubdeviceNames() override;
|
QStringList getSubdeviceNames() override;
|
||||||
bool isHandController() const override { return false; }
|
bool isHandController() const override { return false; }
|
||||||
|
@ -79,7 +79,7 @@ private:
|
||||||
|
|
||||||
QMap<SDL_JoystickID, Joystick::Pointer> _openJoysticks;
|
QMap<SDL_JoystickID, Joystick::Pointer> _openJoysticks;
|
||||||
bool _isInitialized { false } ;
|
bool _isInitialized { false } ;
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
QStringList _subdeviceNames;
|
QStringList _subdeviceNames;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -55,15 +55,15 @@ bool SixenseManager::_sixenseLoaded = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const QString SixenseManager::NAME = "Sixense";
|
const char* SixenseManager::NAME { "Sixense" };
|
||||||
const QString SixenseManager::HYDRA_ID_STRING = "Razer Hydra";
|
const char* SixenseManager::HYDRA_ID_STRING { "Razer Hydra" };
|
||||||
|
|
||||||
const QString MENU_PARENT = "Developer";
|
const char* MENU_PARENT { "Developer" };
|
||||||
const QString MENU_NAME = "Sixense";
|
const char* MENU_NAME { "Sixense" };
|
||||||
const QString MENU_PATH = MENU_PARENT + ">" + MENU_NAME;
|
const char* MENU_PATH { "Developer" ">" "Sixense" };
|
||||||
const QString TOGGLE_SMOOTH = "Smooth Sixense Movement";
|
const char* TOGGLE_SMOOTH { "Smooth Sixense Movement" };
|
||||||
const QString SHOW_DEBUG_RAW = "Debug Draw Raw Data";
|
const char* SHOW_DEBUG_RAW { "Debug Draw Raw Data" };
|
||||||
const QString SHOW_DEBUG_CALIBRATED = "Debug Draw Calibrated Data";
|
const char* SHOW_DEBUG_CALIBRATED { "Debug Draw Calibrated Data" };
|
||||||
|
|
||||||
bool SixenseManager::isSupported() const {
|
bool SixenseManager::isSupported() const {
|
||||||
#if defined(HAVE_SIXENSE) && !defined(Q_OS_OSX)
|
#if defined(HAVE_SIXENSE) && !defined(Q_OS_OSX)
|
||||||
|
|
|
@ -28,8 +28,8 @@ class SixenseManager : public InputPlugin {
|
||||||
public:
|
public:
|
||||||
// Plugin functions
|
// Plugin functions
|
||||||
virtual bool isSupported() const override;
|
virtual bool isSupported() const override;
|
||||||
virtual const QString& getName() const override { return NAME; }
|
virtual const QString getName() const override { return NAME; }
|
||||||
virtual const QString& getID() const override { return HYDRA_ID_STRING; }
|
virtual const QString getID() const override { return HYDRA_ID_STRING; }
|
||||||
|
|
||||||
// Sixense always seems to initialize even if the hydras are not present. Is there
|
// Sixense always seems to initialize even if the hydras are not present. Is there
|
||||||
// a way we can properly detect whether the hydras are present?
|
// a way we can properly detect whether the hydras are present?
|
||||||
|
@ -92,8 +92,8 @@ private:
|
||||||
|
|
||||||
std::shared_ptr<InputDevice> _inputDevice { std::make_shared<InputDevice>() };
|
std::shared_ptr<InputDevice> _inputDevice { std::make_shared<InputDevice>() };
|
||||||
|
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
static const QString HYDRA_ID_STRING;
|
static const char* HYDRA_ID_STRING;
|
||||||
|
|
||||||
static bool _sixenseLoaded;
|
static bool _sixenseLoaded;
|
||||||
};
|
};
|
||||||
|
|
|
@ -76,8 +76,8 @@ class SpacemouseManager : public InputPlugin, public QAbstractNativeEventFilter
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
bool isSupported() const override;
|
bool isSupported() const override;
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
const QString& getID() const override { return NAME; }
|
const QString getID() const override { return NAME; }
|
||||||
|
|
||||||
bool activate() override;
|
bool activate() override;
|
||||||
void deactivate() override;
|
void deactivate() override;
|
||||||
|
@ -127,7 +127,7 @@ private:
|
||||||
// use to calculate distance traveled since last event
|
// use to calculate distance traveled since last event
|
||||||
DWORD fLast3dmouseInputTime;
|
DWORD fLast3dmouseInputTime;
|
||||||
|
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
friend class SpacemouseDevice;
|
friend class SpacemouseDevice;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,11 @@
|
||||||
Q_DECLARE_LOGGING_CATEGORY(oculus)
|
Q_DECLARE_LOGGING_CATEGORY(oculus)
|
||||||
|
|
||||||
|
|
||||||
static const QString MENU_PARENT = "Avatar";
|
static const char* MENU_PARENT = "Avatar";
|
||||||
static const QString MENU_NAME = "Oculus Touch Controllers";
|
static const char* MENU_NAME = "Oculus Touch Controllers";
|
||||||
static const QString MENU_PATH = MENU_PARENT + ">" + MENU_NAME;
|
static const char* MENU_PATH = "Avatar" ">" "Oculus Touch Controllers";
|
||||||
|
|
||||||
const QString OculusControllerManager::NAME = "Oculus";
|
const char* OculusControllerManager::NAME = "Oculus";
|
||||||
|
|
||||||
bool OculusControllerManager::isSupported() const {
|
bool OculusControllerManager::isSupported() const {
|
||||||
return oculusAvailable();
|
return oculusAvailable();
|
||||||
|
|
|
@ -24,7 +24,7 @@ class OculusControllerManager : public InputPlugin {
|
||||||
public:
|
public:
|
||||||
// Plugin functions
|
// Plugin functions
|
||||||
bool isSupported() const override;
|
bool isSupported() const override;
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
bool isHandController() const override { return _touch != nullptr; }
|
bool isHandController() const override { return _touch != nullptr; }
|
||||||
QStringList getSubdeviceNames() override;
|
QStringList getSubdeviceNames() override;
|
||||||
|
@ -95,7 +95,7 @@ private:
|
||||||
ovrInputState _inputState {};
|
ovrInputState _inputState {};
|
||||||
RemoteDevice::Pointer _remote;
|
RemoteDevice::Pointer _remote;
|
||||||
TouchDevice::Pointer _touch;
|
TouchDevice::Pointer _touch;
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi__OculusControllerManager
|
#endif // hifi__OculusControllerManager
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "OculusDebugDisplayPlugin.h"
|
#include "OculusDebugDisplayPlugin.h"
|
||||||
#include <QtCore/QProcessEnvironment>
|
#include <QtCore/QProcessEnvironment>
|
||||||
|
|
||||||
const QString OculusDebugDisplayPlugin::NAME("Oculus Rift (Simulator)");
|
const char* OculusDebugDisplayPlugin::NAME { "Oculus Rift (Simulator)" };
|
||||||
|
|
||||||
static const QString DEBUG_FLAG("HIFI_DEBUG_OCULUS");
|
static const QString DEBUG_FLAG("HIFI_DEBUG_OCULUS");
|
||||||
static bool enableDebugOculus = true || QProcessEnvironment::systemEnvironment().contains("HIFI_DEBUG_OCULUS");
|
static bool enableDebugOculus = true || QProcessEnvironment::systemEnvironment().contains("HIFI_DEBUG_OCULUS");
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
class OculusDebugDisplayPlugin : public OculusBaseDisplayPlugin {
|
class OculusDebugDisplayPlugin : public OculusBaseDisplayPlugin {
|
||||||
public:
|
public:
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
grouping getGrouping() const override { return DEVELOPER; }
|
grouping getGrouping() const override { return DEVELOPER; }
|
||||||
bool isSupported() const override;
|
bool isSupported() const override;
|
||||||
|
|
||||||
|
@ -20,6 +20,6 @@ protected:
|
||||||
bool isHmdMounted() const override { return true; }
|
bool isHmdMounted() const override { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include "OculusHelpers.h"
|
#include "OculusHelpers.h"
|
||||||
|
|
||||||
const QString OculusDisplayPlugin::NAME("Oculus Rift");
|
const char* OculusDisplayPlugin::NAME { "Oculus Rift" };
|
||||||
static ovrPerfHudMode currentDebugMode = ovrPerfHud_Off;
|
static ovrPerfHudMode currentDebugMode = ovrPerfHud_Off;
|
||||||
|
|
||||||
bool OculusDisplayPlugin::internalActivate() {
|
bool OculusDisplayPlugin::internalActivate() {
|
||||||
|
|
|
@ -13,7 +13,7 @@ class OculusDisplayPlugin : public OculusBaseDisplayPlugin {
|
||||||
using Parent = OculusBaseDisplayPlugin;
|
using Parent = OculusBaseDisplayPlugin;
|
||||||
public:
|
public:
|
||||||
~OculusDisplayPlugin();
|
~OculusDisplayPlugin();
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ protected:
|
||||||
void cycleDebugOutput() override;
|
void cycleDebugOutput() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
ovrTextureSwapChain _textureSwapChain;
|
ovrTextureSwapChain _textureSwapChain;
|
||||||
gpu::FramebufferPointer _outputFramebuffer;
|
gpu::FramebufferPointer _outputFramebuffer;
|
||||||
bool _customized { false };
|
bool _customized { false };
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#include "OculusHelpers.h"
|
#include "OculusHelpers.h"
|
||||||
|
|
||||||
const QString OculusLegacyDisplayPlugin::NAME("Oculus Rift");
|
const char* OculusLegacyDisplayPlugin::NAME { "Oculus Rift" };
|
||||||
|
|
||||||
OculusLegacyDisplayPlugin::OculusLegacyDisplayPlugin() {
|
OculusLegacyDisplayPlugin::OculusLegacyDisplayPlugin() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ class OculusLegacyDisplayPlugin : public HmdDisplayPlugin {
|
||||||
public:
|
public:
|
||||||
OculusLegacyDisplayPlugin();
|
OculusLegacyDisplayPlugin();
|
||||||
bool isSupported() const override;
|
bool isSupported() const override;
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ protected:
|
||||||
bool isHmdMounted() const override { return true; }
|
bool isHmdMounted() const override { return true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
|
|
||||||
GLWindow* _hmdWindow{ nullptr };
|
GLWindow* _hmdWindow{ nullptr };
|
||||||
ovrHmd _hmd;
|
ovrHmd _hmd;
|
||||||
|
|
|
@ -33,9 +33,9 @@
|
||||||
|
|
||||||
Q_DECLARE_LOGGING_CATEGORY(displayplugins)
|
Q_DECLARE_LOGGING_CATEGORY(displayplugins)
|
||||||
|
|
||||||
const QString OpenVrDisplayPlugin::NAME("OpenVR (Vive)");
|
const char* OpenVrDisplayPlugin::NAME { "OpenVR (Vive)" };
|
||||||
const QString StandingHMDSensorMode = "Standing HMD Sensor Mode"; // this probably shouldn't be hardcoded here
|
const char* StandingHMDSensorMode { "Standing HMD Sensor Mode" }; // this probably shouldn't be hardcoded here
|
||||||
const QString OpenVrThreadedSubmit = "OpenVR Threaded Submit"; // this probably shouldn't be hardcoded here
|
const char* OpenVrThreadedSubmit { "OpenVR Threaded Submit" }; // this probably shouldn't be hardcoded here
|
||||||
|
|
||||||
PoseData _nextRenderPoseData;
|
PoseData _nextRenderPoseData;
|
||||||
PoseData _nextSimPoseData;
|
PoseData _nextSimPoseData;
|
||||||
|
|
|
@ -36,7 +36,7 @@ class OpenVrDisplayPlugin : public HmdDisplayPlugin {
|
||||||
using Parent = HmdDisplayPlugin;
|
using Parent = HmdDisplayPlugin;
|
||||||
public:
|
public:
|
||||||
bool isSupported() const override;
|
bool isSupported() const override;
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ private:
|
||||||
vr::IVRSystem* _system { nullptr };
|
vr::IVRSystem* _system { nullptr };
|
||||||
std::atomic<vr::EDeviceActivityLevel> _hmdActivityLevel { vr::k_EDeviceActivityLevel_Unknown };
|
std::atomic<vr::EDeviceActivityLevel> _hmdActivityLevel { vr::k_EDeviceActivityLevel_Unknown };
|
||||||
std::atomic<uint32_t> _keyboardSupressionCount{ 0 };
|
std::atomic<uint32_t> _keyboardSupressionCount{ 0 };
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
|
|
||||||
vr::HmdMatrix34_t _lastGoodHMDPose;
|
vr::HmdMatrix34_t _lastGoodHMDPose;
|
||||||
mat4 _sensorResetMat;
|
mat4 _sensorResetMat;
|
||||||
|
|
|
@ -37,12 +37,12 @@ void releaseOpenVrSystem();
|
||||||
|
|
||||||
static const char* CONTROLLER_MODEL_STRING = "vr_controller_05_wireless_b";
|
static const char* CONTROLLER_MODEL_STRING = "vr_controller_05_wireless_b";
|
||||||
|
|
||||||
static const QString MENU_PARENT = "Avatar";
|
static const char* MENU_PARENT = "Avatar";
|
||||||
static const QString MENU_NAME = "Vive Controllers";
|
static const char* MENU_NAME = "Vive Controllers";
|
||||||
static const QString MENU_PATH = MENU_PARENT + ">" + MENU_NAME;
|
static const char* MENU_PATH = "Avatar" ">" "Vive Controllers";
|
||||||
static const QString RENDER_CONTROLLERS = "Render Hand Controllers";
|
static const char* RENDER_CONTROLLERS = "Render Hand Controllers";
|
||||||
|
|
||||||
const QString ViveControllerManager::NAME = "OpenVR";
|
const char* ViveControllerManager::NAME { "OpenVR" };
|
||||||
|
|
||||||
bool ViveControllerManager::isSupported() const {
|
bool ViveControllerManager::isSupported() const {
|
||||||
return openVrSupported();
|
return openVrSupported();
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ViveControllerManager : public InputPlugin {
|
||||||
public:
|
public:
|
||||||
// Plugin functions
|
// Plugin functions
|
||||||
bool isSupported() const override;
|
bool isSupported() const override;
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
bool isHandController() const override { return true; }
|
bool isHandController() const override { return true; }
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ private:
|
||||||
vr::IVRSystem* _system { nullptr };
|
vr::IVRSystem* _system { nullptr };
|
||||||
std::shared_ptr<InputDevice> _inputDevice { std::make_shared<InputDevice>(_system) };
|
std::shared_ptr<InputDevice> _inputDevice { std::make_shared<InputDevice>(_system) };
|
||||||
|
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi__ViveControllerManager
|
#endif // hifi__ViveControllerManager
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include "PCMCodecManager.h"
|
#include "PCMCodecManager.h"
|
||||||
|
|
||||||
const QString PCMCodec::NAME = "pcm";
|
const char* PCMCodec::NAME { "pcm" };
|
||||||
|
|
||||||
void PCMCodec::init() {
|
void PCMCodec::init() {
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ void PCMCodec::releaseDecoder(Decoder* decoder) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString zLibCodec::NAME = "zlib";
|
const char* zLibCodec::NAME { "zlib" };
|
||||||
|
|
||||||
void zLibCodec::init() {
|
void zLibCodec::init() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ class PCMCodec : public CodecPlugin, public Encoder, public Decoder {
|
||||||
public:
|
public:
|
||||||
// Plugin functions
|
// Plugin functions
|
||||||
bool isSupported() const override;
|
bool isSupported() const override;
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
void deinit() override;
|
void deinit() override;
|
||||||
|
@ -45,7 +45,7 @@ public:
|
||||||
virtual void trackLostFrames(int numFrames) override { }
|
virtual void trackLostFrames(int numFrames) override { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
};
|
};
|
||||||
|
|
||||||
class zLibCodec : public CodecPlugin, public Encoder, public Decoder {
|
class zLibCodec : public CodecPlugin, public Encoder, public Decoder {
|
||||||
|
@ -54,7 +54,7 @@ class zLibCodec : public CodecPlugin, public Encoder, public Decoder {
|
||||||
public:
|
public:
|
||||||
// Plugin functions
|
// Plugin functions
|
||||||
bool isSupported() const override;
|
bool isSupported() const override;
|
||||||
const QString& getName() const override { return NAME; }
|
const QString getName() const override { return NAME; }
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
void deinit() override;
|
void deinit() override;
|
||||||
|
@ -80,7 +80,7 @@ public:
|
||||||
virtual void trackLostFrames(int numFrames) override { }
|
virtual void trackLostFrames(int numFrames) override { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const QString NAME;
|
static const char* NAME;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi__PCMCodecManager_h
|
#endif // hifi__PCMCodecManager_h
|
||||||
|
|
|
@ -166,9 +166,9 @@ AvatarList.avatarRemovedEvent.connect(function(avatarID){
|
||||||
if (isShowingOverlays) {
|
if (isShowingOverlays) {
|
||||||
// we are currently showing overlays and an avatar just went away
|
// we are currently showing overlays and an avatar just went away
|
||||||
|
|
||||||
// first remove the rendered overlay
|
// first remove the rendered overlays
|
||||||
for (var overlay in modOverlays[avatarID]) {
|
for (var j = 0; j < modOverlays[avatarID].length; ++j) {
|
||||||
Overlays.deleteOverlay(overlay);
|
Overlays.deleteOverlay(modOverlays[avatarID][j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete the saved ID of the overlay from our mod overlays object
|
// delete the saved ID of the overlay from our mod overlays object
|
||||||
|
|
Loading…
Reference in a new issue