This commit is contained in:
ksuprynowicz 2023-01-29 18:43:01 +01:00
parent 3a5b927979
commit 3e692a60b4
22 changed files with 58 additions and 41 deletions

View file

@ -117,7 +117,7 @@ private:
mutable int _activeRefreshRate { 20 };
RefreshRateProfile _refreshRateProfile { RefreshRateProfile::INTERACTIVE};
RefreshRateRegime _refreshRateRegime { RefreshRateRegime::STARTUP };
UXMode _uxMode;
UXMode _uxMode { UXMode::UX_NUM };
mutable ReadWriteLockable _refreshRateProfileSettingLock;
Setting::Handle<int> _refreshRateProfileSetting { "refreshRateProfile", RefreshRateProfile::INTERACTIVE };

View file

@ -861,6 +861,7 @@ RayToAvatarIntersectionResult AvatarManager::findRayIntersectionVector(const Pic
result.avatarID = rayAvatarResult._intersectWithAvatar;
result.distance = rayAvatarResult._distance;
result.face = face;
Q_ASSERT(face < 7);
result.intersection = ray.origin + rayAvatarResult._distance * rayDirection;
result.surfaceNormal = rayAvatarResult._intersectionNormal;
result.jointIndex = rayAvatarResult._intersectWithJoint;
@ -954,6 +955,7 @@ ParabolaToAvatarIntersectionResult AvatarManager::findParabolaIntersectionVector
result.avatarID = sortedAvatar.second->getID();
result.parabolicDistance = parabolicDistance;
result.face = face;
Q_ASSERT(face < 7);
result.surfaceNormal = surfaceNormal;
result.extraInfo = extraInfo;
}

View file

@ -1008,7 +1008,7 @@ QUuid Overlays::getOverlayAtPoint(const glm::vec2& point) {
}
QVariant Overlays::getProperty(const QUuid& id, const QString& property) {
Overlay::Pointer overlay = get2DOverlay(id);
/*Overlay::Pointer overlay = get2DOverlay(id);
if (overlay) {
// We don't support getting properties from QML Overlays right now
return QVariant();
@ -1018,12 +1018,13 @@ QVariant Overlays::getProperty(const QUuid& id, const QString& property) {
auto propIter = overlayProperties.find(property);
if (propIter != overlayProperties.end()) {
return propIter.value();
}
}*/
qDebug() << "Overlays::getProperty is not supported anymore";
return QVariant();
}
QVariantMap Overlays::getProperties(const QUuid& id, const QStringList& properties) {
Overlay::Pointer overlay = get2DOverlay(id);
/*Overlay::Pointer overlay = get2DOverlay(id);
QVariantMap result;
if (overlay) {
// We don't support getting properties from QML Overlays right now
@ -1036,7 +1037,9 @@ QVariantMap Overlays::getProperties(const QUuid& id, const QStringList& properti
if (propIter != overlayProperties.end()) {
result.insert(property, propIter.value());
}
}
}*/
qDebug() << "Overlays::getProperties is not supported anymore";
QVariantMap result;
return result;
}

View file

@ -3175,6 +3175,7 @@ ScriptValue RayToAvatarIntersectionResultToScriptValue(ScriptEngine* engine, con
ScriptValue avatarIDValue = quuidToScriptValue(engine, value.avatarID);
obj.setProperty("avatarID", avatarIDValue);
obj.setProperty("distance", value.distance);
Q_ASSERT(value.face < 7);
obj.setProperty("face", boxFaceToString(value.face));
ScriptValue intersection = vec3ToScriptValue(engine, value.intersection);
@ -3192,6 +3193,7 @@ bool RayToAvatarIntersectionResultFromScriptValue(const ScriptValue& object, Ray
quuidFromScriptValue(avatarIDValue, value.avatarID);
value.distance = object.property("distance").toVariant().toFloat();
value.face = boxFaceFromString(object.property("face").toVariant().toString());
Q_ASSERT(value.face < 7);
ScriptValue intersection = object.property("intersection");
if (intersection.isValid()) {

View file

@ -1965,9 +1965,9 @@ public:
bool intersects { false };
QUuid avatarID;
float distance { FLT_MAX };
BoxFace face;
glm::vec3 intersection;
glm::vec3 surfaceNormal;
BoxFace face { UNKNOWN_FACE };
glm::vec3 intersection { glm::vec3(0.0f, 0.0f, 0.0f) };
glm::vec3 surfaceNormal { glm::vec3(0.0f, 1.0f, 0.0f) };
int jointIndex { -1 };
QVariantMap extraInfo;
};

View file

@ -37,9 +37,9 @@ private:
float _alpha { NAN };
PulsePropertyGroup _pulseProperties;
bool _followCamera;
bool _followCamera { false };
uint32_t _majorGridEvery;
float _minorGridEvery;
float _minorGridEvery { false };
glm::vec3 _dimensions;

View file

@ -42,8 +42,8 @@ private:
NetworkTexturePointer _texture;
bool _textureIsLoaded { false };
bool _emissive;
bool _keepAspectRatio;
bool _emissive { false };
bool _keepAspectRatio { false };
QRect _subImage;
std::shared_ptr<graphics::ProceduralMaterial> _material { std::make_shared<graphics::ProceduralMaterial>() };

View file

@ -57,7 +57,7 @@ private:
float _lineHeight;
glm::vec3 _textColor;
float _textAlpha;
bool _unlit;
bool _unlit { false };
std::shared_ptr<graphics::ProceduralMaterial> _material { std::make_shared<graphics::ProceduralMaterial>() };
glm::vec3 _backgroundColor { NAN };

View file

@ -98,9 +98,9 @@ private:
uint16_t _dpi;
QString _scriptURL;
uint8_t _maxFPS;
bool _useBackground;
bool _useBackground { false };
QString _userAgent;
WebInputMode _inputMode;
WebInputMode _inputMode { WebInputMode::TOUCH };
glm::vec3 _contextPosition;

View file

@ -1687,6 +1687,7 @@ ScriptValue RayToEntityIntersectionResultToScriptValue(ScriptEngine* engine, con
obj.setProperty("entityID", entityItemValue);
obj.setProperty("distance", value.distance);
obj.setProperty("face", boxFaceToString(value.face));
Q_ASSERT(value.face < 7);
ScriptValue intersection = vec3ToScriptValue(engine, value.intersection);
obj.setProperty("intersection", intersection);
@ -1703,6 +1704,7 @@ bool RayToEntityIntersectionResultFromScriptValue(const ScriptValue& object, Ray
quuidFromScriptValue(entityIDValue, value.entityID);
value.distance = object.property("distance").toVariant().toFloat();
value.face = boxFaceFromString(object.property("face").toVariant().toString());
Q_ASSERT(value.face < 7);
ScriptValue intersection = object.property("intersection");
if (intersection.isValid()) {

View file

@ -86,8 +86,8 @@ public:
QUuid entityID;
float distance { 0.0f };
BoxFace face { UNKNOWN_FACE };
glm::vec3 intersection;
glm::vec3 surfaceNormal;
glm::vec3 intersection { glm::vec3(0.0f, 0.0f, 0.0f) };
glm::vec3 surfaceNormal { glm::vec3(0.0f, 1.0f, 0.0f) };
QVariantMap extraInfo;
};
Q_DECLARE_METATYPE(RayToEntityIntersectionResult)

View file

@ -21,6 +21,7 @@ EntityItemPointer GizmoEntityItem::factory(const EntityItemID& entityID, const E
// our non-pure virtual subclass for now...
GizmoEntityItem::GizmoEntityItem(const EntityItemID& entityItemID) : EntityItem(entityItemID) {
_type = EntityTypes::Gizmo;
_gizmoType = GizmoType::UNSET_GIZMO_TYPE;
}
void GizmoEntityItem::setUnscaledDimensions(const glm::vec3& value) {

View file

@ -103,9 +103,9 @@ private:
QVector<glm::vec3> _colors;
QVector<float> _widths;
QString _textures;
bool _isUVModeStretch;
bool _glow;
bool _faceCamera;
bool _isUVModeStretch { false };
bool _glow { false };
bool _faceCamera { false };
bool _pointsChanged { false };
bool _normalsChanged { false };

View file

@ -116,7 +116,7 @@ private:
float _rightMargin;
float _topMargin;
float _bottomMargin;
bool _unlit;
bool _unlit { false };
QString _font;
TextAlignment _alignment;

View file

@ -92,8 +92,8 @@ protected:
QString _scriptURL;
uint8_t _maxFPS;
WebInputMode _inputMode;
bool _showKeyboardFocusHighlight;
bool _useBackground;
bool _showKeyboardFocusHighlight { false };
bool _useBackground { false };
QString _userAgent;
bool _localSafeContext { false };
};

View file

@ -422,9 +422,9 @@ struct GLTFMaterial {
int emissiveTexture;
int normalTexture;
int occlusionTexture;
graphics::MaterialKey::OpacityMapMode alphaMode;
graphics::MaterialKey::OpacityMapMode alphaMode { graphics::MaterialKey::OPACITY_MAP_OPAQUE };
double alphaCutoff;
bool doubleSided;
bool doubleSided { false };
GLTFpbrMetallicRoughness pbrMetallicRoughness;
QMap<QString, bool> defined;
void dump() {

View file

@ -57,9 +57,9 @@ namespace render {
const gpu::TexturePointer getStatusIconMap() const;
protected:
bool _showDisplay; // initialized by Config
bool _showNetwork; // initialized by Config
bool _showFade; // initialized by Config
bool _showDisplay { false }; // initialized by Config
bool _showNetwork { false }; // initialized by Config
bool _showFade { false }; // initialized by Config
gpu::Stream::FormatPointer _drawItemFormat;
gpu::PipelinePointer _drawItemBoundsPipeline;

View file

@ -1533,7 +1533,7 @@ ScriptValue ScriptManager::require(const QString& moduleId) {
qCDebug(scriptengine_module) << "//ScriptManager::require(" << moduleId << ")";
_engine->maybeEmitUncaughtException(__FUNCTION__);
qCDebug(scriptengine_module) << "Exports: " << _engine->scriptValueDebugDetails(module.property("exports"));
//qCDebug(scriptengine_module) << "Exports: " << _engine->scriptValueDebugDetails(module.property("exports"));
return module.property("exports");
}

View file

@ -928,8 +928,8 @@ ScriptValue ScriptEngineV8::evaluateInClosure(const ScriptValue& _closure,
}
}
// List members of closure global object
QString membersString("");
if (closureContext->Global()->IsObject()) {
//QString membersString("");
/*if (closureContext->Global()->IsObject()) {
v8::Local<v8::String> membersStringV8;
v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(closureContext->Global());
auto names = object->GetPropertyNames(closureContext).ToLocalChecked();
@ -939,8 +939,8 @@ ScriptValue ScriptEngineV8::evaluateInClosure(const ScriptValue& _closure,
membersString = QString(*v8::String::Utf8Value(_v8Isolate, membersStringV8));
} else {
membersString = QString(" Is not an object");
}
qDebug(scriptengine) << "Closure global before run:" << membersString;
}*/
//qDebug(scriptengine) << "Closure global before run:" << membersString;
auto maybeResult = program.constGet()->GetUnboundScript()->BindToCurrentContext()->Run(closureContext);
//qDebug(scriptengine) << "Closure after run:" << scriptValueDebugDetailsV8(closure);
v8::Local<v8::Value> v8Result;

View file

@ -1095,19 +1095,19 @@ int ScriptSignalV8Proxy::qt_metacall(QMetaObject::Call call, int id, void** argu
{
v8::Local<v8::Function> callback = v8::Local<v8::Function>::Cast(conn.callback.get());
//auto functionContext = callback->CreationContext();
//_engine->pushContext(functionContext);
_engine->pushContext(_v8Context.Get(_engine->getIsolate()));
//v8::Context::Scope functionContextScope(functionContext);
v8::Context::Scope functionContextScope(_v8Context.Get(_engine->getIsolate()));
auto functionContext = _v8Context.Get(_engine->getIsolate());
_engine->pushContext(functionContext);
v8::Context::Scope functionContextScope(functionContext);
v8::Local<v8::Value> v8This;
if (conn.thisValue.get()->IsObject()) {
v8This = conn.thisValue.get();
} else {
v8This = _engine->getContext()->Global();
v8This = functionContext->Global();
}
v8::TryCatch tryCatch(isolate);
callback->Call(_engine->getContext(), v8This, numArgs, args);
callback->Call(functionContext, v8This, numArgs, args);
if (tryCatch.HasCaught()) {
qCDebug(scriptengine) << "Signal proxy " << fullName() << " connection call failed: \""
<< _engine->formatErrorMessageFromTryCatch(tryCatch)

View file

@ -238,6 +238,7 @@ bool ScriptValueV8Wrapper::hasProperty(const QString& name) const {
v8::Isolate::Scope isolateScope(_engine->getIsolate());
v8::HandleScope handleScope(isolate);
v8::Context::Scope contextScope(_engine->getContext());
//V8TODO: does function return true on IsObject too?
if (_value.constGet()->IsObject()) {
//V8TODO: what about flags?
v8::Local<v8::Value> resultLocal;

View file

@ -35,9 +35,15 @@
// # define WEBRTC_POSIX 1
// # define WEBRTC_LEGACY 1
#elif defined(Q_OS_LINUX) && defined(Q_PROCESSOR_X86_64)
# define WEBRTC_AUDIO 1
//V8TODO:
// WEBRTC_AUDIO causes:
// overte/libraries/audio-client/src/AudioClient.cpp:1258:36: runtime error: member call on address 0x61b000006980 which does not point to an object of type 'AudioProcessing'
// 0x61b000006980: note: object has invalid vptr
// Should be investigated before doing a release with it uncommented
//# define WEBRTC_AUDIO 1
# define WEBRTC_POSIX 1
# define WEBRTC_DATA_CHANNELS 1
//V8TODO: temporarily disabled, because linker failed for memory debugging
//# define WEBRTC_DATA_CHANNELS 1
#elif defined(Q_OS_LINUX) && defined(Q_PROCESSOR_ARM)
// WebRTC is basically impossible to build on aarch64 Linux.
// I am looking at https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing for an alternative.